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