Subversion Repositories wimsdev

Rev

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