Subversion Repositories wimsdev

Rev

Rev 11798 | Rev 14300 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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