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