Subversion Repositories wimsdev

Rev

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