Subversion Repositories wimsdev

Rev

Rev 16153 | Rev 16158 | 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
 
16154 guerimand 18
!if $save!=$empty
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
16154 guerimand 73
!!  !if $save!=$empty
16143 guerimand 74
    !if $sharers!=$empty and $allowshare=1
75
      setclass=!items2words $wims_class,$sharers
76
      setclass=!words2items $setclass
77
    !else
78
      setclass=$wims_class
79
    !endif
80
    !if $allow_parm=$empty
81
      !sh for c in $setclass; do rm -f $wims_home/log/classes/$$c/.S$seq; done
82
    !else
83
      !for c in $setclass
84
        !writefile wimshome/log/classes/$c/.S$seq $allow_parm
85
      !next c
86
    !endif
87
    wims_class_log=sequence $seq allow $allowtype $allowshare by $wims_realuser
16154 guerimand 88
!!  !endif
16143 guerimand 89
  !! ---- end of saving
90
!! -------- end manage of allow
14049 bpr 91
  !set listdoc=!makelist doc_ i for i=1 to $docpubliccnt
92
  !set listc=!filelist $wims_home/log/classes/$wims_class/doc
93
  !set listc=!lines2items $listc
94
  !set listc=!replace internal c by c_$ $ in $listc
95
  !set listexam=!makelist exam_ i for i=1 to $examcnt
96
  !set listsheet=!makelist sheet_ i for i=1 to $sheetcnt
97
  !set listvote=!makelist vote_ i for i=1 to $votecnt
98
  !set listtool=!makelist tool_ i for i=1 to $toolcnt
99
  !set listglossary=!makelist glossary_ i for i=1 to $glossarycnt
14769 guerimand 100
  !set listfreework=!makelist freework_ i for i=1 to $freeworkcnt
101
  list=!nospace $listc,$listdoc,$listsheet,$listexam,$listvote,$listtool,$listglossary,$listfreework
14049 bpr 102
  list=!nonempty items $list
103
  list1=debut
104
  !for x in $list
105
    list1=!append item $($x) to $list1
106
  !next
107
  list1=$(list1[2..-1])
108
  listcnt=!replace internal ,0, by , in ,$list1,
109
  listcnt=!nonempty items $listcnt
110
  listcnt=!itemcnt $listcnt
111
  !for j = 1 to $listcnt
112
    jj=!positionof item $j in $list1
113
    !if $jj!=
114
      listfinal=!append item $(list[$jj]) to $listfinal
115
    !endif
14769 guerimand 116
  !next j
14049 bpr 117
  list=!replace internal _ by $ $ in $(listfinal)
118
  new_data=!append line $list to $new_data
15989 guerimand 119
  !bound visible within 0,1 default 0
14049 bpr 120
  !writefile wimshome/log/classes/$wims_class/seq/.sequence$seq $new_data\
16143 guerimand 121
$visible
1406 bpr 122
 
16143 guerimand 123
!!$hidedate\
124
!!$showdate
125
 
14049 bpr 126
  s_ =!record 0 of .sequences
127
  s_=!line 2 to -1 of s_
128
  !if $seq= $[$seq_cnt+1]
129
    seq_cnt=$[$seq_cnt+1]
130
    !writefile wimshome/log/classes/$wims_class/seq/.sequences $seq_cnt\
131
    $s_
132
  !endif
1406 bpr 133
!endif
16143 guerimand 134
 
16154 guerimand 135
!! --- read saving configuration for allow parameters
136
  !readproc adm/vfilter/shexread.proc S$seq
137
  !! to distribute IPlist content into variable
138
  !read adm/scorerestriction put\
16143 guerimand 139
$IPlist
140
  old_allowtype=$allowtype
141
  old_allowtechvar=$allowtechvar
16153 guerimand 142
  !reset save
16143 guerimand 143
!! --- end of reading
144