Subversion Repositories wimsdev

Rev

Rev 14335 | 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
12479 bpr 4
  !bound reg_status between integer 0 and 3 default 0
5
  !bound reg_option within anonymous,nominative,trace default anonymous
4142 guerimand 6
!else
12479 bpr 7
  !bound reg_status between integer 1 and 3 default 1
8
  reg_option=$vote_option
4142 guerimand 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
12479 bpr 18
  :edit
19
  job=edit
20
  !changeto edit.proc
23 reyssat 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
12479 bpr 33
  v_$i=!record $i of $votedir/.votes
23 reyssat 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)]
12479 bpr 49
  !appendfile $votedir/.votes :$(v_$i)
23 reyssat 50
!next i
51
 
5297 czzmrn 52
!if $reg_src!=$empty and ($vote_status=0 or $mod_numsess>0)
12479 bpr 53
  !! convert username/code for technical variable
10736 guerimand 54
  !readproc adm/vfilter/msgchange.proc write\
55
$reg_src
56
  !writefile $votedir/$vote.src $out_script
12479 bpr 57
  !! -----------
58
  msg2wims_primitives=def define comment draw if for uservar\
15753 bpr 59
    menu list radio mmenu mlist checkbox textarea inputfield
12479 bpr 60
  !sh cd $wims_home; bin/msg2wims log/$Votedir/$vote.src log/$Votedir/$vote.def
23 reyssat 61
!endif
62
 
4950 bpr 63
!if $reg_src=$empty and $vote_status=0
64
  !goto edit
65
!endif
5369 bpr 66
 
67
!if $vote_model!=free
12479 bpr 68
  !goto edit
5369 bpr 69
!endif
70
!! when all is done, need to reset gstep. Not sure this is the best way
71
 
72
!if $gstep=3
12479 bpr 73
  !reset gstep
5369 bpr 74
!endif
23 reyssat 75
job=read
76
!read var.proc