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