Subversion Repositories wimsdev

Rev

Rev 10736 | Rev 14335 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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