Rev 11798 | Rev 14300 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | desc_limit=4000 |
2 | |||
3 | today=!char 1 to 8 of $wims_now |
||
4 | thisyear=!char 1 to 4 of $today |
||
8271 | guerimand | 5 | !if $class_expiration=$empty |
14043 | bpr | 6 | !defread wimshome/log/classes/$wims_class/.def |
23 | reyssat | 7 | !endif |
8 | !if $class_expiration=$empty |
||
14043 | bpr | 9 | error=bad_class |
10 | !exit |
||
23 | reyssat | 11 | !endif |
12 | |||
3912 | bpr | 13 | !bound nbredevoir between integer 0 and $max_todo default 1 |
23 | reyssat | 14 | !if $s_nbdevoir!=$nbredevoir |
14043 | bpr | 15 | !reset job2 |
23 | reyssat | 16 | !endif |
17 | s_nbdevoir=$nbredevoir |
||
18 | |||
19 | !if $job2!=save |
||
14043 | bpr | 20 | !if $filename!=$empty and $old_date=$empty |
21 | !read wimshome/log/classes/$wims_class/cdt/def/$filename |
||
22 | !if yes isin $date_exist |
||
23 | jdesc=!record 0 of wimshome/log/classes/$wims_class/cdt/src/$filename.work |
||
24 | jday=!char 7 to 8 of $filename |
||
25 | jmonth=!char 5 to 6 of $filename |
||
26 | jyear=!char 1 to 4 of $filename |
||
27 | jdate=!char 1 to 8 of $filename |
||
28 | nbredevoir=!itemcnt $date_todo |
||
29 | !if $nbredevoir>0 |
||
30 | !for i=1 to $nbredevoir |
||
31 | ddesc$i=!record 0 of wimshome/log/classes/$wims_class/cdt/src/$filename.todo$i |
||
32 | tmp=!item $i of $date_todo |
||
33 | dday$i=!char 7 to 8 of $tmp |
||
34 | dmonth$i=!char 5 to 6 of $tmp |
||
35 | dyear$i=!char 1 to 4 of $tmp |
||
36 | ddate$i=!char 1 to 8 of $tmp |
||
37 | !next i |
||
38 | !endif |
||
39 | s_nbdevoir=$nbredevoir |
||
40 | old_date=$filename |
||
41 | !endif |
||
42 | !reset filename |
||
43 | !endif |
||
44 | !exit |
||
10189 | bpr | 45 | !endif |
23 | reyssat | 46 | |
14043 | bpr | 47 | !if $jquery_defined=yes |
11798 | guerimand | 48 | jyear=!char 1 to 4 of $jdate |
49 | jmonth=!char 5 to 6 of $jdate |
||
50 | jday=!char 7 to 8 of $jdate |
||
14043 | bpr | 51 | !endif |
52 | jmonth=!char 2,3 of $[abs(floor($jmonth))+100] |
||
53 | jday=!char 2,3 of $[abs(floor($jday))+100] |
||
54 | jyear=!char -4 to -1 of $[abs(floor($jyear))+100000] |
||
55 | !if $jday>=1 and $jday<=31 and $jmonth>=1 and $jmonth<=12 \ |
||
56 | and N notin $jmonth$jday$jyear |
||
57 | !! and $jyear$jmonth$jday<=$class_expiration |
||
58 | !! and $jyear$jmonth$jday>=$class_creation |
||
23 | reyssat | 59 | |
14043 | bpr | 60 | jour=$jyear$jmonth$jday |
61 | !else |
||
62 | error=bad_day |
||
63 | !exit |
||
23 | reyssat | 64 | !endif |
65 | !reset date_exist |
||
66 | !read wimshome/log/classes/$wims_class/cdt/def/$jour |
||
67 | !if yes isin $date_exist and $jour!=$old_date |
||
14043 | bpr | 68 | error=day_exists |
69 | !exit |
||
23 | reyssat | 70 | !endif |
71 | |||
72 | ltjdevoir=$empty |
||
73 | !if $s_nbdevoir>0 |
||
14043 | bpr | 74 | !for i=1 to $s_nbdevoir |
75 | !if $jquery_defined=yes |
||
76 | dyear$i=!char 1 to 4 of $(ddate$i) |
||
77 | dmonth$i=!char 5 to 6 of $(ddate$i) |
||
78 | dday$i=!char 7 to 8 of $(ddate$i) |
||
79 | !endif |
||
80 | dmonth=!char 2,3 of $[abs(floor($(dmonth$i)))+100] |
||
81 | dday=!char 2,3 of $[abs(floor($(dday$i)))+100] |
||
82 | dyear=!char -4 to -1 of $[abs(floor($(dyear$i)))+100000] |
||
83 | !if $dday>=1 and $dday<=31 and $dmonth>=1 and $dmonth<=12 \ |
||
84 | and $dyear$dmonth$dday>$jour \ |
||
85 | and N notin $dmonth$dday$dyear |
||
86 | !! and $dyear$dmonth$dday<=$class_expiration |
||
87 | !! and $dyear$dmonth$dday>=$class_creation |
||
88 | jdevoir$i=$dyear$dmonth$dday |
||
89 | !else |
||
90 | error=bad_jday |
||
91 | !exit |
||
92 | !endif |
||
93 | ltjdevoir=!append item $(jdevoir$i) to $ltjdevoir |
||
94 | !next i |
||
95 | tmp=!listuniq $ltjdevoir |
||
96 | tmp1=!itemcnt $tmp |
||
97 | tmp2=!itemcnt $ltjdevoir |
||
98 | !if $tmp1!=$tmp2 |
||
99 | error=same_devoir |
||
100 | !exit |
||
101 | !endif |
||
23 | reyssat | 102 | !endif |
103 | |||
104 | !if $old_date!=$empty |
||
14043 | bpr | 105 | !sh rm -f $wims_home/log/classes/$wims_class/cdt/src/$old_date.*;\ |
23 | reyssat | 106 | rm -f $wims_home/log/classes/$wims_class/cdt/def/$old_date; |
107 | !endif |
||
108 | ltjdevoir=$empty |
||
109 | !writefile wimshome/log/classes/$wims_class/cdt/src/$jour.work $jdesc |
||
110 | s2file=$wims_home/s2/$wims_session/$jour |
||
111 | !writefile wimshome/s2/$wims_session/$jour !set date_exist=yes\ |
||
112 | !set date_todo=$empty\ |
||
113 | \ |
||
114 | !if $$wims_read_parm!=$$empty\ |
||
115 | !goto $$wims_read_parm\ |
||
116 | !endif\ |
||
117 | !exit\ |
||
118 | \ |
||
119 | :content |
||
120 | |||
121 | !sh $wims_home/bin/msg2wims $wims_home/log/classes/$wims_class/cdt/src/$jour.work $s2file.tmp;\ |
||
122 | cat $s2file.tmp >> $s2file;\ |
||
123 | echo "!exit" >> $s2file; |
||
124 | |||
125 | !if $s_nbdevoir>0 |
||
14043 | bpr | 126 | nb=0 |
127 | !for i=1 to $s_nbdevoir |
||
128 | !if $(ddesc$i)!=$empty |
||
129 | nb=$[$nb+1] |
||
130 | !writefile wimshome/log/classes/$wims_class/cdt/src/$jour.todo$nb $(ddesc$i) |
||
131 | !sh $wims_home/bin/msg2wims $wims_home/log/classes/$wims_class/cdt/src/$jour.todo$nb $s2file.tmp;\ |
||
23 | reyssat | 132 | echo ":todo$nb" >> $s2file;\ |
133 | cat $s2file.tmp >> $s2file;\ |
||
134 | echo "!exit" >> $s2file; |
||
14043 | bpr | 135 | ltjdevoir=!append item $(jdevoir$i) to $ltjdevoir |
136 | !endif |
||
137 | !next i |
||
23 | reyssat | 138 | !endif |
139 | |||
140 | !setdef !set date_todo=$ltjdevoir in wimshome/s2/$wims_session/$jour |
||
141 | !sh rm $s2file.tmp;\ |
||
142 | mv $s2file $wims_home/log/classes/$wims_class/cdt/def/$jour; |
||
143 | |||
144 | !read proc/mkindex.proc |
||
145 | |||
146 | job=work |
||
147 | !read work.proc |