!goto $gstep
:1
$table_header
$table_tr
<td>$name_howmany ($name_atmost 10)</td>
<td>
!if $vote_status>0
$numsess
!else
!formselect mod_numsess from 1 to 10
!endif
</td>
</tr>
$table_tr
<td>$name_namevar <span class="field_required">*</span></td>
<td>
!if $vote_status>0
$namevar
!else
<input size=12 name="up_namevar" id="namevar" value="$namevar"> <small>$(name_$(reg_model)_help)</small>
!endif
</td>
</tr>
$table_tr
<td>$name_textconnip</td>
<td>
!if $vote_status>0
$defconnip
!else
<input size=12 name="up_defconnip" id="defconnip" value="$defconnip">
!endif
</td>
</tr>
$table_end
<input type="hidden" name="gstep" value="2">
:2
<p>$name_introtext</p>
<center>
<textarea class="iEdit" id="testointro" rows="10" cols="80" name="up_testointro">
!replace internal \( by \( in $testointro
</textarea>
</center>
<p>$name_session_select</p>
$table_header
$table_hdtr
!! needed by datemenu.phtml.$lang
!default creyear=!char 1 to 4 of $class_creation
!default expyear=!char 1 to 4 of $class_expiration
!if $jyear=$empty
!let jyear=!char 1 to 4 of $wims_now
!let jmonth=!char 5 to 6 of $wims_now
!let jday=!char 7 to 8 of $wims_now
!endif
<th>$name_numstud</th><th>$name_sessiondate</th><th>$name_begintime</th><th>$name_endtime</th><th>$name_connip</th><th>$name_extra</th>
</tr>
!for i=1 to $numsess
$table_tr
<td>
<input size=4 name="up_nstud$i" id="nstud$i" value="$(nstud$i)">
</td>
<td>
!default up_bday$i=$jday
!default up_byear$i=$jyear
!default up_bmonth$i=$jmonth
!distribute item $[$(up_bday$i)],$[$(up_bmonth$i)],$[$(up_byear$i)] into up_bday$i,up_bmonth$i,up_byear$i
!if $vote_status=0
!read adm/lang/datemenu.phtml.$moduclass_lang 1, up_bday$i,up_bmonth$i,up_byear$i
!else
$(bday$i) $(months[$(bmonth$i)]) $(byear$i)
!endif
</td>
<td>
!if $vote_status=0
!read adm/lang/datemenu.phtml.$moduclass_lang 6,up_bhour$i,up_bmin$i
!else
$(bhour$i):$(bmin$i)
!endif
</td>
<td>
!if $vote_status=0
!read adm/lang/datemenu.phtml.$moduclass_lang 6,up_ehour$i,up_emin$i
!else
$(ehour$i):$(emin$i)
!endif
<td>
!if $vote_status=0
!default up_exconnip$i=$defconnip
<input size=10 name="up_exconnip$i" id="exconnip$i" value="$(up_exconnip$i)">
!else
$(exconnip$i)
!endif
</td>
<td>
<input size=10 name="up_testoextra$i" id="testoextra$i" value="$(testoextra$i)">
</td>
</tr>
$table_end
<input type="hidden" name="gstep" value="3">
:3
!!## need to check $testointro contains no vote primitives
!for i in uservar
,menu
,list,radio
,checkbox
,textarea
!set testointro=!replace internal \$i by INVALID in $testointro
!writefile $votedir/$vote.data
!!## with writefile we are loosing these variables at gstep=3
!for dato in numsess,namevar,defconnip
!appendfile $votedir/$vote.data $dato=$($dato)
!!## NOTE: the above list should be setup at model level
!##! (e.g. defconnip is not needed for vote_model=groups)
!for i=1 to $numsess
!!## need to check no "," in exconnip/testoextra
!set exconnip$i=!replace internal , by . in $(exconnip$i)
!set testoextra$i=!replace internal , by . in $(testoextra$i)
!for dato in nstud$i,bday$i,mese$i,byear$i,bhour$i,bmin$i,testoextra$i,\
bmonth$i,ehour$i,emin$i,exconnip$i
!appendfile $votedir/$vote.data $dato=$($dato)
!appendfile $votedir/$vote.data \
:$testointro
!set reg_src=<div>\
$testointro\
</div>\
!set reg_src1=$reg_src
!set reg_src2=\uservar{$namevar,>20081105.17:30 <20081105.15:30,
!for i=1 to $numsess
!set mese$i=!item $(bmonth$i) of $months
!set bmonth
$i=!char
2,3 of $
[abs(floor($
(bmonth
$i)))+100]
!set byear
$i=!char
-4 to
-1 of $
[abs(floor($
(byear
$i)))+100000]
!set bmin
$i=!char
2,3 of $
[abs(floor($
(bmin
$i)))+100]
!set emin
$i=!char
2,3 of $
[abs(floor($
(emin
$i)))+100]
!set bday
$i=!char
2,3 of $
[abs(floor($
(bday
$i)))+100]
!set bhour
$i=!char
2,3 of $
[abs(floor($
(bhour
$i)))+100]
!set ehour
$i=!char
2,3 of $
[abs(floor($
(ehour
$i)))+100]
$
!set reg_src1=$reg_src1\
$(nstud$i): $(bday$i) $(mese$i) $(byear$i) - $(bhour$i).$(bmin$i) / $(ehour$i).$(emin$i)$ $(testoextra$i),
!set reg_src2=$reg_src2\
>$(byear$i)$(bmonth$i)$(bday$i).$(bhour$i):$(bmin$i) <$(byear$i)$(bmonth$i)$(bday$i).$(ehour$i):$(emin$i) $(exconnip$i),
!set reg_src=$reg_src1\
$name_cancellation\
}\
$reg_src2\
>20081105.17:30 <20081105.15:30\
}
$name_describesource
<p>$name_yourvariable.</p>
<pre>
$reg_src
</pre>
$(name_$(reg_model)_instr)
<input type="hidden" name="gstep" value="0">