Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
4142 guerimand 1
vcnt=!defof vcnt in wimshome/log/classes/$wims_class/vote/$vote.votes
4147 guerimand 2
!default vote_status=0
4950 bpr 3
!if $vote_status=0 or $vcnt=0 or $vcnt=$empty or $reg_src$vote_src=$empty
4142 guerimand 4
 !bound reg_status between integer 0 and 3 default 0
5
 !bound reg_option within anonymous,nominative,trace default anonymous
6
!else
7
 !bound reg_status between integer 1 and 3 default 1
8
 reg_option=$vote_option
9
!endif
23 reyssat 10
reg_title=!trim $reg_title
11
reg_title=!singlespace $reg_title
12
!bound reg_show within 0,1 default 1
2150 guerimand 13
!bound reg_whovoteshow within 0,1 default 0
23 reyssat 14
!if $reg_title=$empty
4950 bpr 15
  reg_status=0
5369 bpr 16
  gstep=$[max(0,$[$gstep-1])]
17
  error=no_title
23 reyssat 18
 :edit
19
 job=edit
20
 !changeto edit.proc
21
!endif
22
reg_src=!trim $reg_src
5297 czzmrn 23
!! FIXME: for models I need to bypass this error. Anyway there is
24
!!        no real syntax check, so is it really useful?
25
!!
26
!! !if $reg_src=$empty and $vote>$votecnt
27
!!    error=no_content
28
!!    reg_status=0
29
!!  !goto edit
30
!! !endif
23 reyssat 31
 
32
!for i=1 to $votecnt
33
 v_$i=!record $i of $votedir/.votes
34
!next i
5369 bpr 35
!if $reg_model isitemof $vmodellist
36
  reg_option=nominative
37
!endif
23 reyssat 38
v_$vote=$reg_status\
39
$reg_title\
40
$reg_option\
2150 guerimand 41
$reg_show\
5340 czzmrn 42
$reg_whovoteshow\
43
$reg_model
23 reyssat 44
 
45
!sh mkdir -p $wims_home/log/$Votedir
46
!writefile $votedir/.votes
47
 
48
!for i=1 to $[max($votecnt,$vote)]
49
 !appendfile $votedir/.votes :$(v_$i)
50
!next i
51
 
5297 czzmrn 52
!if $reg_src!=$empty and ($vote_status=0 or $mod_numsess>0)
23 reyssat 53
 !writefile $votedir/$vote.src $reg_src
54
 msg2wims_primitives=def define comment draw if for uservar\
55
	menu list radio mmenu mlist checkbox textarea
56
 !sh cd $wims_home; bin/msg2wims log/$Votedir/$vote.src log/$Votedir/$vote.def
57
!endif
58
 
4950 bpr 59
!if $reg_src=$empty and $vote_status=0
60
  !goto edit
61
!endif
5369 bpr 62
 
63
!if $vote_model!=free
64
    !goto edit
65
!endif
66
!! when all is done, need to reset gstep. Not sure this is the best way
67
 
68
!if $gstep=3
69
 !reset gstep
70
!endif
23 reyssat 71
job=read
72
!read var.proc
73