Subversion Repositories wimsdev

Rev

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