Subversion Repositories wimsdev

Rev

Rev 8256 | Rev 10286 | 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
 
23 reyssat 4
!if $wims_class=$empty or $wims_user=$empty
5
 error=not_class
6
 !exit
7
!endif
1407 bpr 8
!if $seq!=
9
 !set wims_sequence=$seq
10
!endif
5369 bpr 11
!read adm/lang/date.phtml.$moduclass_lang
4951 bpr 12
limit_textarea=600
13
 
23 reyssat 14
wims_nw=votedir Votedir userdef vote Vote job empty
15
wims_nr=wims_sesrandom
16
Votedir=classes/$wims_class/vote
17
votedir=wimshome/log/$Votedir
18
!read adm/class/userdef classes,$wims_class,$wims_user
19
userfile=$userdef
2369 bpr 20
!read adm/class/classlang names.phtml
21
 
8256 bpr 22
!bound vote between integer 1 and $max_votes default 0
23 reyssat 23
 
5369 bpr 24
 
25
!default gstep=0
26
 
23 reyssat 27
vote_class=!defof sharing_vote in wimshome/log/classes/$wims_class/neighbors
28
!default vote_class=$wims_class
29
!default wims_superclass=$wims_class
30
!if $wims_superclass != $wims_class
31
 Votevar=!replace internal $wims_superclass/ by $ in $vote_class
32
 Votevar=!translate internal / to _ in $Votevar
33
 Vote=$(Votevar)_$vote
34
!else
35
 Vote=$vote
36
 Votevar=
37
!endif
38
 
39
!if $rEg!=$empty
40
 job=reg
41
 rEg=
42
!endif
43
!if $abandon!=$empty
5369 bpr 44
!!!FIXME edit or home
45
 job=edit
46
 !set gstep=$[max($gstep-2,0)]
23 reyssat 47
 abandon=
48
!endif
5369 bpr 49
 
4142 guerimand 50
readjobs=home,read,help,vote,showresult
7998 bpr 51
editjobs=creat,guided,edit,reg,erase,preview,csv,getsource
23 reyssat 52
!if $wims_user=supervisor
53
 !bound job within $readjobs,$editjobs default home
54
!else
55
 !bound job within $readjobs default home
56
!endif
57
!if $job=help or robot isin $session
58
 !exit
59
!endif
60
 
61
!read tabletheme
8256 bpr 62
!for i=1 to $max_votes
23 reyssat 63
 m_parm$i=$(parm$i)
64
!next i
65
 
66
votecnt=!recordcnt $votedir/.votes
217 bpr 67
!if $votecnt<1 and $job notwordof reg creat csv
23 reyssat 68
 job=home
69
 !changeto home.proc
70
!endif
71
!if $job=creat
5369 bpr 72
   !reset gstep
8256 bpr 73
 !if $votecnt>=$max_votes
23 reyssat 74
  error=too_many_votes
75
  !exit
76
 !else
77
  vote=$[$votecnt+1]
4142 guerimand 78
  !increase votecnt
23 reyssat 79
  job=edit
80
 !endif
81
!endif
82
 
5340 czzmrn 83
!default vote_model=$reg_model
23 reyssat 84
!if $vote>0 and $vote<=$votecnt
85
 vdata=!record $vote of $votedir/.votes
5340 czzmrn 86
 !distribute lines $vdata into vote_status,vote_title,vote_option,vote_show,vote_whovoteshow,vote_model
23 reyssat 87
 !default vote_option=anonymous
88
 !default vote_status=0
89
 !default vote_show=1
5340 czzmrn 90
!! !default vote_model=free
23 reyssat 91
 vote_src=!record 0 of $votedir/$vote.src
92
!endif
5340 czzmrn 93
!default reg_model=$vote_model
5369 bpr 94
!! at some gstep these variables are not in the form but are required by reg.proc, so
95
!! we need to be sure to have found defaults
96
!default reg_status=$vote_status
97
!default reg_option=$vote_option
98
!default reg_show=$vote_show
5471 bpr 99
!default reg_whovoteshow=$vote_whovoteshow
23 reyssat 100
!if $vote<1
101
 job=home
102
!endif
103
 
5369 bpr 104
!set vmodellist=accessvar,group
105
!set name_vmodellist=$(name_accessvar), $(name_group)
5297 czzmrn 106
 
23 reyssat 107
!read $job.proc
108