File: addseq.proc

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (141 lines) | stat: -rw-r--r-- 4,156 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

!bound seq between integer 1 and $seq_cnt+1 default $empty
jquery_defined=!defof jquery_defined in themes/$wims_theme/header.phtml

!if $cf_abandon!=$empty or $seq=$empty
  !reset cf_abandon
  job=show
  !exit
!endif

!if $seq>$maxseq
  error=toomanyseq
  !exit
!endif

!readproc adm/vfilter/listvarfilter.proc

sharers=
sharing1=!defof sharable_sheet in wimshome/log/classes/$wims_class/neighbors
!for c in $sharing1
  d=!defof sharing_sheet in wimshome/log/classes/$c/neighbors
  !if $d issametext $wims_class
    sharers=!append item $c to $sharers
  !endif
!next c

!if $save!=$empty or ($old_allowtype!=$allowtype and ($allowtype=techvar and $old_allowtechvar!=$allowtechvar))
  seq_desc=!replace internal $\
$ by $ $ in $seq_desc
  seq_title=!char 1 to $title_limit of $seq_title
  seq_desc=!char 1 to $desc_limit of $seq_desc
  new_data=:$seq_title\
$seq_desc
  !! ------  manage of allow
  !if $tv_listname=$empty
    !bound allowtype within all,none,select default all
  !else
    !bound allowtype within all,none,select,techvar default all
  !endif
  !read adm/scorerestriction get
  IPlist=$_output
  IPlist=!translate ,;\
* to $    $ in $IPlist
  IPlist=!trim $IPlist
  !if $allowtype=select and $IPlist=$empty and $save!=$empty
    allowtype=all
  !endif
  !if $allowtype=all
    allow_parm=
  !endif
  !if $allowtype=none
    allow_parm=none
  !endif
  !if $allowtype=select
    allow_parm=$IPlist
  !endif
  old_allowtype=$allowtype
  old_allowtechvar=$allowtechvar
  !if $allowtype=techvar
    !readproc adm/vfilter/shexselect.proc .S$seq
  !endif
  !! ---- save modification of allow parameters for sequence
  !if $sharers!=$empty and $allowshare=1
    !if $allowtype=techvar
      !readproc adm/vfilter/validtechvar.proc $allowtechvar\
$sharers
      !if $output=1
        setclass=$wims_class,$sharers
      !else
        error=badallowshare
        allowshare=0
        setclass=$wims_class
      !endif
    !else
      setclass=$wims_class,$sharers
    !endif
  !else
    setclass=$wims_class
  !endif  
  !if $allow_parm=$empty
    !sh for c in $setclass; do rm -f $wims_home/log/classes/$$c/.S$seq; done
  !else
    setclass=!words2items $setclass
    !for c in $setclass
      !writefile wimshome/log/classes/$c/.S$seq $allow_parm
    !next c
  !endif
  wims_class_log=sequence $seq allow $allowtype $allowshare by $wims_realuser
  !! ---- end of saving
  !! -------- end manage of allow
  !set listdoc=!makelist doc_ i for i=1 to $docpubliccnt
  !set listc=!filelist $wims_home/log/classes/$wims_class/doc
  !set listc=!lines2items $listc
  !set listc=!replace internal c by c_$ $ in $listc
  !set listexam=!makelist exam_ i for i=1 to $examcnt
  !set listsheet=!makelist sheet_ i for i=1 to $sheetcnt
  !set listvote=!makelist vote_ i for i=1 to $votecnt
  !set listtool=!makelist tool_ i for i=1 to $toolcnt
  !set listglossary=!makelist glossary_ i for i=1 to $glossarycnt
  !set listfreework=!makelist freework_ i for i=1 to $freeworkcnt
  list=!nospace $listc,$listdoc,$listsheet,$listexam,$listvote,$listtool,$listglossary,$listfreework
  list=!nonempty items $list
  list1=debut
  !for x in $list
    list1=!append item $($x) to $list1
  !next
  list1=$(list1[2..-1])
  listcnt=!replace internal ,0, by , in ,$list1,
  listcnt=!nonempty items $listcnt
  listcnt=!itemcnt $listcnt
  !for j = 1 to $listcnt
    jj=!positionof item $j in $list1
    !if $jj!=
      listfinal=!append item $(list[$jj]) to $listfinal
    !endif
  !next j
  list=!replace internal _ by $ $ in $(listfinal)
  new_data=$new_data\
$list
  !bound visible within 0,1 default 0
  !writefile wimshome/log/classes/$wims_class/seq/.sequence$seq $new_data\
$visible

  s_ =!record 0 of .sequences
  s_=!line 2 to -1 of s_
  !if $seq= $[$seq_cnt+1]
    seq_cnt=$[$seq_cnt+1]
    !writefile wimshome/log/classes/$wims_class/seq/.sequences $seq_cnt\
    $s_
  !endif
!endif

!! --- read saving configuration for allow parameters
  !readproc adm/vfilter/shexread.proc S$seq
  !! to distribute IPlist content into variable
  !read adm/scorerestriction put\
$IPlist
  old_allowtype=$allowtype
  old_allowtechvar=$allowtechvar
  !reset save
!! --- end of reading