Subversion Repositories wimsdev

Rev

Rev 16154 | Rev 16223 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1406 bpr 1
 
3912 bpr 2
!bound seq between integer 1 and $seq_cnt+1 default $empty
16143 guerimand 3
jquery_defined=!defof jquery_defined in themes/$wims_theme/header.phtml
1406 bpr 4
 
5
!if $cf_abandon!=$empty or $seq=$empty
12335 bpr 6
  !reset cf_abandon
7
  job=show
8
  !exit
1406 bpr 9
!endif
10
 
11
!if $seq>$maxseq
12335 bpr 12
  error=toomanyseq
13
  !exit
1406 bpr 14
!endif
15
 
16143 guerimand 16
!readproc adm/vfilter/listvarfilter.proc
17
 
16158 guerimand 18
!if $save!=$empty or ($old_allowtype!=$allowtype and ($allowtype=techvar and $old_allowtechvar!=$allowtechvar))
15987 guerimand 19
  seq_desc=!replace internal $\
20
$ by $ $ in $seq_desc
15988 guerimand 21
  seq_title=!char 1 to $title_limit of $seq_title
22
  seq_desc=!char 1 to $desc_limit of $seq_desc
14049 bpr 23
  new_data=:$seq_title\
15998 guerimand 24
$seq_desc
16143 guerimand 25
!!  !! ---- check hidedate and showdate
26
!!  today=!char 1 to 8 of $wims_now
27
!!  thisyear=!char 1 to 4 of $today
28
!!  !for k in hide,show
29
!!    $(k)date=!text select char 0123456789 in $($(k)date)
30
!!    expmon=!char 5 to 6 of $($(k)date)
31
!!    expday=!char 7 to 8 of $($(k)date)
32
!!    expyear=!char 1 to 4 of $($(k)date)
33
!!    !if $expday<1 or $expday>31 or $expmon<1 or $expmon>12 \
34
!!      or $expyear<$thisyear or $expyear>$thisyear+1 \
35
!!      or $($(k)date)<$class_creation \
36
!!      or $($(k)date)>$class_expiration \
37
!!      or N isin $expmon$expday$expyear \
38
!!      or $($(k)date)<=$today
39
!!      !reset $(k)date
40
!!    !endif
41
!!  !next k
16154 guerimand 42
!! ------ save
16143 guerimand 43
 
44
!! ------  manage of allow
16154 guerimand 45
  !if $tv_listname=$empty
46
    !bound allowtype within all,none,select default all
47
  !else
48
    !bound allowtype within all,none,select,techvar default all
49
  !endif
50
  !read adm/scorerestriction get
51
  IPlist=$_output
52
  IPlist=!translate ,;\
16143 guerimand 53
* to $    $ in $IPlist
16154 guerimand 54
  IPlist=!trim $IPlist
55
  !if $allowtype=select and $IPlist=$empty and $save!=$empty
16143 guerimand 56
      allowtype=all
16154 guerimand 57
  !endif
58
  !if $allowtype=all
16143 guerimand 59
      allow_parm=
16154 guerimand 60
  !endif
61
  !if $allowtype=none
16143 guerimand 62
      allow_parm=none
16154 guerimand 63
  !endif
64
  !if $allowtype=select
16143 guerimand 65
      allow_parm=$IPlist
16154 guerimand 66
  !endif
16143 guerimand 67
  old_allowtype=$allowtype
68
  old_allowtechvar=$allowtechvar
16153 guerimand 69
  !if $allowtype=techvar
70
    !readproc adm/vfilter/shexselect.proc .S$seq
71
  !endif
16143 guerimand 72
  !! ---- save modification of allow parameters for sequence
73
    !if $sharers!=$empty and $allowshare=1
74
      setclass=!items2words $wims_class,$sharers
75
      setclass=!words2items $setclass
76
    !else
77
      setclass=$wims_class
78
    !endif
79
    !if $allow_parm=$empty
80
      !sh for c in $setclass; do rm -f $wims_home/log/classes/$$c/.S$seq; done
81
    !else
82
      !for c in $setclass
83
        !writefile wimshome/log/classes/$c/.S$seq $allow_parm
84
      !next c
85
    !endif
86
    wims_class_log=sequence $seq allow $allowtype $allowshare by $wims_realuser
87
  !! ---- end of saving
88
!! -------- end manage of allow
14049 bpr 89
  !set listdoc=!makelist doc_ i for i=1 to $docpubliccnt
90
  !set listc=!filelist $wims_home/log/classes/$wims_class/doc
91
  !set listc=!lines2items $listc
92
  !set listc=!replace internal c by c_$ $ in $listc
93
  !set listexam=!makelist exam_ i for i=1 to $examcnt
94
  !set listsheet=!makelist sheet_ i for i=1 to $sheetcnt
95
  !set listvote=!makelist vote_ i for i=1 to $votecnt
96
  !set listtool=!makelist tool_ i for i=1 to $toolcnt
97
  !set listglossary=!makelist glossary_ i for i=1 to $glossarycnt
14769 guerimand 98
  !set listfreework=!makelist freework_ i for i=1 to $freeworkcnt
99
  list=!nospace $listc,$listdoc,$listsheet,$listexam,$listvote,$listtool,$listglossary,$listfreework
14049 bpr 100
  list=!nonempty items $list
101
  list1=debut
102
  !for x in $list
103
    list1=!append item $($x) to $list1
104
  !next
105
  list1=$(list1[2..-1])
106
  listcnt=!replace internal ,0, by , in ,$list1,
107
  listcnt=!nonempty items $listcnt
108
  listcnt=!itemcnt $listcnt
109
  !for j = 1 to $listcnt
110
    jj=!positionof item $j in $list1
111
    !if $jj!=
112
      listfinal=!append item $(list[$jj]) to $listfinal
113
    !endif
14769 guerimand 114
  !next j
14049 bpr 115
  list=!replace internal _ by $ $ in $(listfinal)
116
  new_data=!append line $list to $new_data
15989 guerimand 117
  !bound visible within 0,1 default 0
14049 bpr 118
  !writefile wimshome/log/classes/$wims_class/seq/.sequence$seq $new_data\
16143 guerimand 119
$visible
1406 bpr 120
 
16143 guerimand 121
!!$hidedate\
122
!!$showdate
123
 
14049 bpr 124
  s_ =!record 0 of .sequences
125
  s_=!line 2 to -1 of s_
126
  !if $seq= $[$seq_cnt+1]
127
    seq_cnt=$[$seq_cnt+1]
128
    !writefile wimshome/log/classes/$wims_class/seq/.sequences $seq_cnt\
129
    $s_
130
  !endif
1406 bpr 131
!endif
16143 guerimand 132
 
16154 guerimand 133
!! --- read saving configuration for allow parameters
134
  !readproc adm/vfilter/shexread.proc S$seq
135
  !! to distribute IPlist content into variable
136
  !read adm/scorerestriction put\
16143 guerimand 137
$IPlist
138
  old_allowtype=$allowtype
139
  old_allowtechvar=$allowtechvar
16153 guerimand 140
  !reset save
16143 guerimand 141
!! --- end of reading
142