Subversion Repositories wimsdev

Rev

Rev 12479 | 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
12479 bpr 11
  error=not_class
12
  !exit
23 reyssat 13
!endif
1407 bpr 14
!if $seq!=
12479 bpr 15
  !set wims_sequence=$seq
1407 bpr 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
!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
12479 bpr 36
  Votevar=!replace internal $wims_superclass/ by $ in $vote_class
37
  Votevar=!translate internal / to _ in $Votevar
38
  Vote=$(Votevar)_$vote
23 reyssat 39
!else
12479 bpr 40
  Vote=$vote
41
  Votevar=
23 reyssat 42
!endif
43
 
44
!if $rEg!=$empty
12479 bpr 45
  job=reg
46
  rEg=
23 reyssat 47
!endif
48
!if $abandon!=$empty
12479 bpr 49
  !!!FIXME edit or home
50
  job=edit
51
  !set gstep=$[max($gstep-2,0)]
52
  abandon=
23 reyssat 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
12479 bpr 58
  !bound job within $readjobs,$editjobs default home
23 reyssat 59
!else
12479 bpr 60
  !bound job within $readjobs default home
23 reyssat 61
!endif
62
!if $job=help or robot isin $session
12479 bpr 63
  !exit
23 reyssat 64
!endif
65
 
66
!read tabletheme
8256 bpr 67
!for i=1 to $max_votes
12479 bpr 68
  m_parm$i=$(parm$i)
23 reyssat 69
!next i
70
 
71
votecnt=!recordcnt $votedir/.votes
217 bpr 72
!if $votecnt<1 and $job notwordof reg creat csv
12479 bpr 73
  job=home
74
  !changeto home.proc
23 reyssat 75
!endif
76
!if $job=creat
12479 bpr 77
  !reset gstep
78
  !if $votecnt>=$max_votes
79
    error=too_many_votes
80
    !exit
81
  !else
82
    vote=$[$votecnt+1]
83
    !increase votecnt
84
    job=edit
85
  !endif
23 reyssat 86
!endif
87
 
5340 czzmrn 88
!default vote_model=$reg_model
23 reyssat 89
!if $vote>0 and $vote<=$votecnt
12479 bpr 90
  vdata=!record $vote of $votedir/.votes
91
  !distribute lines $vdata into vote_status,vote_title,vote_option,vote_show,vote_whovoteshow,vote_model
92
  !default vote_option=anonymous
93
  !default vote_status=0
94
  !default vote_show=1
95
  !! !default vote_model=free
96
  vote_src=!record 0 of $votedir/$vote.src
97
  !readproc adm/vfilter/msgchange.proc read\
10736 guerimand 98
$vote_src
12479 bpr 99
  vote_src=$out_script
23 reyssat 100
!endif
5340 czzmrn 101
!default reg_model=$vote_model
5369 bpr 102
!! at some gstep these variables are not in the form but are required by reg.proc, so
103
!! we need to be sure to have found defaults
104
!default reg_status=$vote_status
105
!default reg_option=$vote_option
106
!default reg_show=$vote_show
5471 bpr 107
!default reg_whovoteshow=$vote_whovoteshow
23 reyssat 108
!if $vote<1
12479 bpr 109
  job=home
23 reyssat 110
!endif
111
 
10615 guerimand 112
!! don't allow to use model if vote is sharing or sharable (waiting sharin/sharable techvar)
113
test_share=!defof sharable_vote,sharing_vote in wimshome/log/classes/$wims_class/neighbors
114
test_share=!nonempty item $test_share
115
!if $test_share=$empty
12479 bpr 116
  !set vmodellist=accessvar,group
117
  !set name_vmodellist=$(name_accessvar), $(name_group)
10615 guerimand 118
!else
12479 bpr 119
  vmodellist=$empty
120
  name_vmodellist=$empty
10615 guerimand 121
!endif
23 reyssat 122
!read $job.proc