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