Subversion Repositories wimsdev

Rev

Rev 14300 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23 reyssat 1
# Variable calculations should be done in this file.
2
# It is read and interpreted by wims for all valid calls to the module.
3
 
4
desc_limit=4000
5
 
6
today=!char 1 to 8 of $wims_now
7
thisyear=!char 1 to 4 of $today
10189 bpr 8
!if $class_expiration=$empty
13610 obado 9
  !defread wimshome/log/classes/$wims_class/.def
23 reyssat 10
!endif
11
!if $class_expiration=$empty
13610 obado 12
  error=bad_class
13
  !exit
23 reyssat 14
!endif
15
 
3912 bpr 16
!bound nbredevoir between integer 1 and $max_todo default 1
23 reyssat 17
!if $s_nbdevoir!=$nbredevoir
13610 obado 18
  !reset job2
23 reyssat 19
!endif
20
s_nbdevoir=$nbredevoir
21
 
22
!if $job2!=save
13610 obado 23
  !exit
23 reyssat 24
!endif
25
 
14300 guerimand 26
jyear=!char 1 to 4 of $jdate
17299 guerimand 27
jmonth=!char 6 to 7 of $jdate
28
jday=!char 9 to 10 of $jdate
29
!if $jday>=1 and $jday<=31 and $jmonth>=1 and $jmonth<=12 and N notin $jmonth$jday$jyear
13610 obado 30
  jour=$jyear$jmonth$jday
23 reyssat 31
!else
13610 obado 32
  error=bad_day
33
  !exit
23 reyssat 34
!endif
35
!reset date_todo,date_exist
36
!read wimshome/log/classes/$wims_class/cdt/def/$jour
37
tmp=!itemcnt $date_todo
38
!if yes isin $date_exist and $tmp+$s_nbdevoir>$max_todo
13610 obado 39
  error=toomany_todo
40
  !if $tmp<$max_todo
41
    s_nbdevoir=$[$max_todo-$tmp]
42
    nbredevoir=$s_nbdevoir
43
  !endif
44
  !exit
23 reyssat 45
!endif
46
 
47
ltjdevoir=$date_todo
48
!for i=1 to $s_nbdevoir
14300 guerimand 49
  dyear=!char 1 to 4 of $(ddate$i)
17299 guerimand 50
  dmonth=!char 6 to 7 of $(ddate$i)
51
  dday=!char 9 to 10 of $(ddate$i)
13610 obado 52
  !if $dday>=1 and $dday<=31 and $dmonth>=1 and $dmonth<=12 \
53
   and N notin $dmonth$dday$dyear \
54
   and $dyear$dmonth$dday>$jour
55
    jdevoir$i=$dyear$dmonth$dday
56
    ltjdevoir=!append item $(jdevoir$i) to $ltjdevoir
57
  !else
58
    error=bad_jday
59
    !exit
60
  !endif
23 reyssat 61
!next i
62
tmp=!listuniq $ltjdevoir
63
tmp1=!itemcnt $tmp
64
tmp2=!itemcnt $ltjdevoir
65
!if $tmp1!=$tmp2
13610 obado 66
  error=same_devoir2
67
  !exit
23 reyssat 68
!endif
69
 
70
s2file=$wims_home/s2/$wims_session/$jour
71
 
72
!if yes isin $date_exist
13610 obado 73
  !sh cp $wims_home/log/classes/$wims_class/cdt/def/$jour $s2file
23 reyssat 74
!else
13610 obado 75
  cdt_nbdate=$[$cdt_nbdate+1]
76
  !writefile wimshome/log/classes/$wims_class/cdt/src/$jour.work $empty
77
  !writefile wimshome/s2/$wims_session/$jour !set date_exist=yes\
23 reyssat 78
!set date_todo=$empty\
79
\
80
!if $$wims_read_parm!=$$empty\
81
 !goto $$wims_read_parm\
82
!endif\
83
!exit\
84
\
85
:content\
86
!exit
87
 
88
!endif
89
 
90
ltjdevoir=$date_todo
91
nb=!itemcnt $date_todo
92
!for i=1 to $s_nbdevoir
13610 obado 93
  !if $(ddesc$i)!=$empty
94
    nb=$[$nb+1]
95
    !writefile wimshome/log/classes/$wims_class/cdt/src/$jour.todo$nb $(ddesc$i)
96
    !sh $wims_home/bin/msg2wims $wims_home/log/classes/$wims_class/cdt/src/$jour.todo$nb $s2file.tmp;\
23 reyssat 97
echo ":todo$nb" >> $s2file;\
98
cat $s2file.tmp >> $s2file;\
99
echo "!exit" >> $s2file;
13610 obado 100
    ltjdevoir=!append item $(jdevoir$i) to $ltjdevoir
101
  !endif
23 reyssat 102
!next i
103
 
104
!setdef !set date_todo=$ltjdevoir in wimshome/s2/$wims_session/$jour
105
!sh rm $s2file.tmp;\
106
mv $s2file $wims_home/log/classes/$wims_class/cdt/def/$jour;
107
 
108
!read proc/mkindex.proc
109
 
14300 guerimand 110
!!jday2=$jday
111
!!jmonth2=$jmonth
112
!!jyear2=$jyear
23 reyssat 113
job=work
114
!read work.proc