Subversion Repositories wimsdev

Rev

Rev 14043 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

desc_limit=4000

today=!char 1 to 8 of $wims_now
thisyear=!char 1 to 4 of $today
!if $class_expiration=$empty
  !defread wimshome/log/classes/$wims_class/.def
!endif
!if $class_expiration=$empty
  error=bad_class
  !exit
!endif

!bound nbredevoir between integer 0 and $max_todo default 1
!if $s_nbdevoir!=$nbredevoir
  !reset job2
!endif
s_nbdevoir=$nbredevoir

!if $jquery_defined!=yes
  jmonth=!char 2,3 of $[abs(floor($monthjdate))+100]
  jday=!char 2,3 of $[abs(floor($dayjdate))+100]
  jyear=!char -4 to -1 of $[abs(floor($yearjdate))+100000]
  jdate=$(jyear)$(jmonth)$(jday)
  !for i=1 to $s_nbdevoir
    jmonth=!char 2,3 of $[abs(floor($(monthddate$i)))+100]
    jday=!char 2,3 of $[abs(floor($(dayddate$i)))+100]
    jyear=!char -4 to -1 of $[abs(floor($(yearddate$i)))+100000]
    ddate$i=$(jyear)$(jmonth)$(jday)
  !next i
!endif

!if $job2!=save
  !if $filename!=$empty and $old_date=$empty
    !read wimshome/log/classes/$wims_class/cdt/def/$filename
    !if yes isin $date_exist
      jdesc=!record 0 of wimshome/log/classes/$wims_class/cdt/src/$filename.work
      jdate=!char 1 to 8 of $filename
      nbredevoir=!itemcnt $date_todo
      !if $nbredevoir>0
        !for i=1 to $nbredevoir
          ddesc$i=!record 0 of wimshome/log/classes/$wims_class/cdt/src/$filename.todo$i
          tmp=!item $i of $date_todo
          ddate$i=!char 1 to 8 of $tmp
        !next i
      !endif
      s_nbdevoir=$nbredevoir
       old_date=$filename
      !endif
      !reset filename
    !endif
    !exit
  !endif
  jyear=!char 1 to 4 of $jdate
  jmonth=!char 5 to 6 of $jdate
  jday=!char 7 to 8 of $jdate
  !if $jday>=1 and $jday<=31 and $jmonth>=1 and $jmonth<=12 \
      and N notin $jmonth$jday$jyear
    !! and $jyear$jmonth$jday<=$class_expiration
    !! and $jyear$jmonth$jday>=$class_creation

    jour=$jyear$jmonth$jday
  !else
   error=bad_day
  !exit
!endif

!reset date_exist
!read wimshome/log/classes/$wims_class/cdt/def/$jour
!if yes isin $date_exist and $jour!=$old_date
  error=day_exists
  !exit
!endif

ltjdevoir=$empty
!if $s_nbdevoir>0
  !for i=1 to $s_nbdevoir
    dyear=!char 1 to 4 of $(ddate$i)
    dmonth=!char 5 to 6 of $(ddate$i)
    dday=!char 7 to 8 of $(ddate$i)
    !if $dday>=1 and $dday<=31 and $dmonth>=1 and $dmonth<=12 \
       and $dyear$dmonth$dday>$jour \
       and N notin $dmonth$dday$dyear
      !! and $dyear$dmonth$dday<=$class_expiration
      !! and $dyear$dmonth$dday>=$class_creation
      jdevoir$i=$dyear$dmonth$dday
    !else
      error=bad_jday
      !exit
    !endif
    ltjdevoir=!append item $(jdevoir$i) to $ltjdevoir
  !next i
  tmp=!listuniq $ltjdevoir
  tmp1=!itemcnt $tmp
  tmp2=!itemcnt $ltjdevoir
  !if $tmp1!=$tmp2
    error=same_devoir
    !exit
  !endif
!endif

!if $old_date!=$empty
  !sh rm -f $wims_home/log/classes/$wims_class/cdt/src/$old_date.*;\
rm -f $wims_home/log/classes/$wims_class/cdt/def/$old_date;
!endif
ltjdevoir=$empty
!writefile wimshome/log/classes/$wims_class/cdt/src/$jour.work $jdesc
s2file=$wims_home/s2/$wims_session/$jour
!writefile wimshome/s2/$wims_session/$jour !set date_exist=yes\
!set date_todo=$empty\
\
!if $$wims_read_parm!=$$empty\
 !goto $$wims_read_parm\
!endif\
!exit\
\
:content

!sh $wims_home/bin/msg2wims $wims_home/log/classes/$wims_class/cdt/src/$jour.work $s2file.tmp;\
cat $s2file.tmp >> $s2file;\
echo "!exit" >> $s2file;

!if $s_nbdevoir>0
  nb=0
  !for i=1 to $s_nbdevoir
    !if $(ddesc$i)!=$empty
      nb=$[$nb+1]
      !writefile wimshome/log/classes/$wims_class/cdt/src/$jour.todo$nb $(ddesc$i)
      !sh $wims_home/bin/msg2wims $wims_home/log/classes/$wims_class/cdt/src/$jour.todo$nb $s2file.tmp;\
echo ":todo$nb" >> $s2file;\
cat $s2file.tmp >> $s2file;\
echo "!exit" >> $s2file;
      ltjdevoir=!append item $(jdevoir$i) to $ltjdevoir
    !endif
  !next i
!endif

!setdef !set date_todo=$ltjdevoir in wimshome/s2/$wims_session/$jour
!sh rm $s2file.tmp;\
mv $s2file $wims_home/log/classes/$wims_class/cdt/def/$jour;

!read proc/mkindex.proc

job=work
!read work.proc