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