Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
8368 bpr 1
max_votes=!defof MAX_VOTES in wimshome/public_html/bases/sys/define.conf
2
max_parms=!defof MAX_VOTES in wimshome/public_html/bases/sys/define.conf
3
 
10615 guerimand 4
!! NEED TO BE FIXED
5
!!wims_prefix=user class sharable sharing
10286 guerimand 6
!!wims_trustfile=primitives.phtml primitives/checkbox.phtml primitives/list.phtml primitives/list.phtml primitives/uservar.phtml
7
!!wims_readable=wims_read_parm noprint serial prim parmcnt
8
!!wims_writable=serial prim parms wims_read_parm
9
 
23 reyssat 10
!if $wims_class=$empty or $wims_user=$empty
11
 error=not_class
12
 !exit
13
!endif
1407 bpr 14
!if $seq!=
15
 !set wims_sequence=$seq
16
!endif
5369 bpr 17
!read adm/lang/date.phtml.$moduclass_lang
4951 bpr 18
limit_textarea=600
19
 
23 reyssat 20
wims_nw=votedir Votedir userdef vote Vote job empty
21
wims_nr=wims_sesrandom
22
Votedir=classes/$wims_class/vote
23
votedir=wimshome/log/$Votedir
24
!read adm/class/userdef classes,$wims_class,$wims_user
25
userfile=$userdef
2369 bpr 26
!read adm/class/classlang names.phtml
27
 
8256 bpr 28
!bound vote between integer 1 and $max_votes default 0
23 reyssat 29
 
5369 bpr 30
 
31
!default gstep=0
32
 
23 reyssat 33
vote_class=!defof sharing_vote in wimshome/log/classes/$wims_class/neighbors
34
!default vote_class=$wims_class
35
!default wims_superclass=$wims_class
36
!if $wims_superclass != $wims_class
37
 Votevar=!replace internal $wims_superclass/ by $ in $vote_class
38
 Votevar=!translate internal / to _ in $Votevar
39
 Vote=$(Votevar)_$vote
40
!else
41
 Vote=$vote
42
 Votevar=
43
!endif
44
 
45
!if $rEg!=$empty
46
 job=reg
47
 rEg=
48
!endif
49
!if $abandon!=$empty
5369 bpr 50
!!!FIXME edit or home
51
 job=edit
52
 !set gstep=$[max($gstep-2,0)]
23 reyssat 53
 abandon=
54
!endif
5369 bpr 55
 
4142 guerimand 56
readjobs=home,read,help,vote,showresult
7998 bpr 57
editjobs=creat,guided,edit,reg,erase,preview,csv,getsource
23 reyssat 58
!if $wims_user=supervisor
59
 !bound job within $readjobs,$editjobs default home
60
!else
61
 !bound job within $readjobs default home
62
!endif
63
!if $job=help or robot isin $session
64
 !exit
65
!endif
66
 
67
!read tabletheme
8256 bpr 68
!for i=1 to $max_votes
23 reyssat 69
 m_parm$i=$(parm$i)
70
!next i
71
 
72
votecnt=!recordcnt $votedir/.votes
217 bpr 73
!if $votecnt<1 and $job notwordof reg creat csv
23 reyssat 74
 job=home
75
 !changeto home.proc
76
!endif
77
!if $job=creat
5369 bpr 78
   !reset gstep
8256 bpr 79
 !if $votecnt>=$max_votes
23 reyssat 80
  error=too_many_votes
81
  !exit
82
 !else
83
  vote=$[$votecnt+1]
4142 guerimand 84
  !increase votecnt
23 reyssat 85
  job=edit
86
 !endif
87
!endif
88
 
5340 czzmrn 89
!default vote_model=$reg_model
23 reyssat 90
!if $vote>0 and $vote<=$votecnt
91
 vdata=!record $vote of $votedir/.votes
5340 czzmrn 92
 !distribute lines $vdata into vote_status,vote_title,vote_option,vote_show,vote_whovoteshow,vote_model
23 reyssat 93
 !default vote_option=anonymous
94
 !default vote_status=0
95
 !default vote_show=1
5340 czzmrn 96
!! !default vote_model=free
23 reyssat 97
 vote_src=!record 0 of $votedir/$vote.src
10736 guerimand 98
 !readproc adm/vfilter/msgchange.proc read\
99
$vote_src
100
 vote_src=$out_script
23 reyssat 101
!endif
5340 czzmrn 102
!default reg_model=$vote_model
5369 bpr 103
!! at some gstep these variables are not in the form but are required by reg.proc, so
104
!! we need to be sure to have found defaults
105
!default reg_status=$vote_status
106
!default reg_option=$vote_option
107
!default reg_show=$vote_show
5471 bpr 108
!default reg_whovoteshow=$vote_whovoteshow
23 reyssat 109
!if $vote<1
110
 job=home
111
!endif
112
 
10615 guerimand 113
!! don't allow to use model if vote is sharing or sharable (waiting sharin/sharable techvar)
114
test_share=!defof sharable_vote,sharing_vote in wimshome/log/classes/$wims_class/neighbors
115
test_share=!nonempty item $test_share
116
!if $test_share=$empty
117
 !set vmodellist=accessvar,group
118
 !set name_vmodellist=$(name_accessvar), $(name_group)
119
!else
120
 vmodellist=$empty
121
 name_vmodellist=$empty
122
!endif
23 reyssat 123
!read $job.proc
124