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