Rev 17327 | Rev 17527 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 17327 | Rev 17333 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | # Variable calculations should be done in this file. |
1 | # Variable calculations should be done in this file. |
2 | # It is read and interpreted by wims for all valid calls to the module. |
2 | # It is read and interpreted by wims for all valid calls to the module. |
3 | !read adm/class/classlang names.phtml |
3 | !read adm/class/classlang names.phtml |
4 | !! number of lines in a record of a sheet |
4 | !! number of lines in a record of a sheet |
5 | !set sheetrecordlimit=11 |
5 | !set sheetrecordlimit=11 |
- | 6 | ||
- | 7 | scnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets |
|
- | 8 | !if $job=cleantechvar |
|
- | 9 | !bound sheet between 1 and $scnt default $empty |
|
- | 10 | !if $sheet!=$empty |
|
- | 11 | !readproc proc/checktechvar.proc clean |
|
- | 12 | !endif |
|
- | 13 | job=$empty |
|
- | 14 | !endif |
|
6 | 15 | ||
7 | !if $job!=$empty and $job notwordof text modify |
16 | !if $job!=$empty and $job notwordof text modify |
8 | job1=$job |
17 | job1=$job |
9 | !!for the icon and the title |
18 | !!for the icon and the title |
10 | !if $job=getsource |
19 | !if $job=getsource |
Line 21... | Line 30... | ||
21 | !else |
30 | !else |
22 | !set wims_ariane=!append line sheetadmin,8 to $wims_ariane |
31 | !set wims_ariane=!append line sheetadmin,8 to $wims_ariane |
23 | !endif |
32 | !endif |
24 | !set wims_ariane_self=no |
33 | !set wims_ariane_self=no |
25 | 34 | ||
26 | scnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets |
- | |
27 | !if $sheet>$scnt |
35 | !if $sheet>$scnt |
28 | wims_infoshow=yes |
36 | wims_infoshow=yes |
29 | !setdef wims_infoshow=$wims_infoshow in wimshome/sessions/$wims_session/var.stat |
37 | !setdef wims_infoshow=$wims_infoshow in wimshome/sessions/$wims_session/var.stat |
30 | !endif |
38 | !endif |
31 | !if $cmd=resume |
39 | !if $cmd=resume |
Line 142... | Line 150... | ||
142 | don=!record $number of wimshome/log/classes/$classid/.techvar |
150 | don=!record $number of wimshome/log/classes/$classid/.techvar |
143 | listval=!line 2 of $don |
151 | listval=!line 2 of $don |
144 | nbtechvalue=!itemcnt $listval |
152 | nbtechvalue=!itemcnt $listval |
145 | !else |
153 | !else |
146 | !reset indivtechvar |
154 | !reset indivtechvar |
147 | !endif |
155 | !endif |
148 | !endif |
156 | !endif |
149 | !if $job=prep_activate |
157 | !if $job=prep_activate |
150 |
|
158 | nb=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
151 |
|
159 | !if $nb>$max_exos |
152 |
|
160 | error=toomanyexo |
153 |
|
161 | !reset job |
154 |
|
162 | !exit |
155 |
|
163 | !endif |
156 |
|
164 | !read adm/sheet/checkdepindiv |
157 |
|
165 | !if $sheet isitemof $sheet_dependancy and $sheet isitemof $sheet_indivtechvar |
158 |
|
166 | error=depindiv |
- | 167 | !reset job |
|
- | 168 | !exit |
|
- | 169 | !endif |
|
- | 170 | !readproc proc/checktechvar.proc |
|
- | 171 | !if $listvalues!=$empty |
|
- | 172 | error=techvardiscord $listvalues |
|
159 |
|
173 | !reset job |
160 |
|
174 | !endif |
161 | !endif |
175 | !endif |
162 | !exit |
176 | !exit |
163 | !endif |
177 | !endif |
164 | scnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets |
178 | scnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets |
165 | !if $job=erase and $sheet<=$scnt and $sheet>=1 |
179 | !if $job=erase and $sheet<=$scnt and $sheet>=1 |
166 | test= |
180 | test= |
167 | !for s=$sheet to $scnt |
181 | !for s=$sheet to $scnt |
Line 180... | Line 194... | ||
180 | !restart module=home |
194 | !restart module=home |
181 | !endif |
195 | !endif |
182 | 196 | ||
183 | !if $job=duplicate |
197 | !if $job=duplicate |
184 | !changeto $job.proc |
198 | !changeto $job.proc |
185 | !endif |
199 | !endif |
186 | 200 | ||
187 | !if $job=expire |
201 | !if $job=expire |
188 | !distribute item 1,2 into update_field,update_content |
202 | !distribute item 1,2 into update_field,update_content |
189 | !read update.sheet |
203 | !read update.sheet |
190 | job= |
204 | job= |
191 | !endif |
205 | !endif |
192 | 206 | ||
193 | !if $job=hide |
207 | !if $job=hide |
194 | !distribute item 1,3 into update_field,update_content |
208 | !distribute item 1,3 into update_field,update_content |
195 | !read update.sheet |
209 | !read update.sheet |
196 | job= |
210 | job= |
197 | !endif |
211 | !endif |
198 | 212 | ||
199 | !if $job=reactivate |
213 | !if $job=reactivate |
200 | !distribute item 1,1 into update_field,update_content |
214 | !distribute item 1,1 into update_field,update_content |
201 | !read update.sheet |
215 | !read update.sheet |
202 | job= |
216 | job= |
203 | !endif |
217 | !endif |
Line 205... | Line 219... | ||
205 | !if $job=deactivate |
219 | !if $job=deactivate |
206 | !read var.proc.deactivate |
220 | !read var.proc.deactivate |
207 | !else |
221 | !else |
208 | confirmed=!replace word share by $ in $confirmed |
222 | confirmed=!replace word share by $ in $confirmed |
209 | confirmed=!singlespace $confirmed |
223 | confirmed=!singlespace $confirmed |
210 | !endif |
224 | !endif |
211 | 225 | ||
212 | activetest=!record $sheet of wimshome/log/classes/$wims_class/sheets/.sheets |
226 | activetest=!record $sheet of wimshome/log/classes/$wims_class/sheets/.sheets |
213 | a_=!line 1 of $activetest |
227 | a_=!line 1 of $activetest |
214 | a_=!trim $a_ |
228 | a_=!trim $a_ |
215 | expp=!line 2 of $activetest |
229 | expp=!line 2 of $activetest |
216 | !default expiration=$expp |
230 | !default expiration=$expp |
217 | 231 | ||
218 | !if $expiration>$class_expiration or $test_expire!=$empty |
232 | !if $expiration>$class_expiration or $test_expire!=$empty |
219 | expiration=$class_expiration |
233 | expiration=$class_expiration |
220 | !endif |
234 | !endif |
221 | 235 | ||
222 | ecnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
236 | ecnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
223 | wims_listexo=!values v for v=1 to $ecnt |
237 | wims_listexo=!values v for v=1 to $ecnt |
224 | !setdef wims_listexo=$wims_listexo in wimshome/sessions/$wims_session/var.stat |
238 | !setdef wims_listexo=$wims_listexo in wimshome/sessions/$wims_session/var.stat |
225 | activetest=!replace line number 3 by $ecnt in $activetest |
239 | activetest=!replace line number 3 by $ecnt in $activetest |
226 | 240 | ||
Line 240... | Line 254... | ||
240 | !next k |
254 | !next k |
241 | !if NaN isin $[$re]$[$we] or $[$wre*$wwe*$wdi]!=1 or $wpa>1 or $ti=$empty or\ |
255 | !if NaN isin $[$re]$[$we] or $[$wre*$wwe*$wdi]!=1 or $wpa>1 or $ti=$empty or\ |
242 | .. isin $di or $re<0 or $we<0 or ($re>0 and $we=0) |
256 | .. isin $di or $re<0 or $we<0 or ($re>0 and $we=0) |
243 | error=bad_source |
257 | error=bad_source |
244 | ssource=$source |
258 | ssource=$source |
245 | !exit |
259 | !exit |
246 | !endif |
260 | !endif |
247 | ti=!char 1 to $etitle_limit of $ti |
261 | ti=!char 1 to $etitle_limit of $ti |
248 | de=!char 1 to $edesc_limit of $de |
262 | de=!char 1 to $edesc_limit of $de |
249 | source_$i=$s_ |
263 | source_$i=$s_ |
250 | last=$i |
264 | last=$i |
Line 252... | Line 266... | ||
252 | # last record may be empty |
266 | # last record may be empty |
253 | !if $i!=$putcnt |
267 | !if $i!=$putcnt |
254 | error=bad_source |
268 | error=bad_source |
255 | ssource=$source |
269 | ssource=$source |
256 | !exit |
270 | !exit |
257 | !endif |
271 | !endif |
258 | !endif |
272 | !endif |
259 | !next i |
273 | !next i |
260 | !for i=1 to $last |
274 | !for i=1 to $last |
261 | !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$sheet :$(source_$i) |
275 | !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$sheet :$(source_$i) |
262 | !next i |
276 | !next i |
263 | !reset ssource |
277 | !reset ssource |
264 | !endif |
278 | !endif |
265 | 279 | ||
266 | !if $activetest!=$empty |
280 | !if $activetest!=$empty |
267 | sheet_exist=yes |
281 | sheet_exist=yes |
268 | !default expiration=!line 2 of $activetest |
282 | !default expiration=!line 2 of $activetest |
269 | activetest=!line 1 of $activetest |
283 | activetest=!line 1 of $activetest |
270 | exocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
284 | exocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
271 | !else |
285 | !else |
272 | sheet_exist=no |
286 | sheet_exist=no |
273 | activetest=-1 |
287 | activetest=-1 |
274 | exocnt=0 |
288 | exocnt=0 |
275 | !default expiration=$class_expiration |
289 | !default expiration=$class_expiration |
276 | !endif |
290 | !endif |
277 | 291 | ||
278 | !if $job=getsource and $sheet_exist=yes |
292 | !if $job=getsource and $sheet_exist=yes |
279 | !writefile $srcname |
293 | !writefile $srcname |
280 | !for i=1 to $exocnt |
294 | !for i=1 to $exocnt |
281 | l=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
295 | l=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
282 | # replace eventual html entities so it will not insert \n in textarea |
296 | # replace eventual html entities so it will not insert \n in textarea |
Line 302... | Line 316... | ||
302 | !if $allowtype=select and $IPlist=$empty and $save!=$empty |
316 | !if $allowtype=select and $IPlist=$empty and $save!=$empty |
303 | allowtype=all |
317 | allowtype=all |
304 | !endif |
318 | !endif |
305 | !if $allowtype=all |
319 | !if $allowtype=all |
306 | allow_parm= |
320 | allow_parm= |
307 | !endif |
321 | !endif |
308 | !if $allowtype=none |
322 | !if $allowtype=none |
309 | allow_parm=none |
323 | allow_parm=none |
310 | !endif |
324 | !endif |
311 | !if $allowtype=select |
325 | !if $allowtype=select |
312 | allow_parm=$IPlist |
326 | allow_parm=$IPlist |
Line 397... | Line 411... | ||
397 | $ by $ $ in $mod_desc |
411 | $ by $ $ in $mod_desc |
398 | mod_comment=!replace internal $\ |
412 | mod_comment=!replace internal $\ |
399 | $ by $ $ in $mod_comment |
413 | $ by $ $ in $mod_comment |
400 | !if $title_save$desc_save=$empty |
414 | !if $title_save$desc_save=$empty |
401 | rec=!record $sheet of wimshome/log/classes/$wims_class/sheets/.sheets |
415 | rec=!record $sheet of wimshome/log/classes/$wims_class/sheets/.sheets |
402 | !distribute lines $rec into |
416 | !distribute lines $rec into a,bidon,title_save,desc_save,prpage_save,\ |
403 | comment_save,attribut_save,exodescshow_save,formal_hidden_condition_save,\ |
417 | comment_save,attribut_save,exodescshow_save,formal_hidden_condition_save,\ |
404 | indivtechvar_save |
418 | indivtechvar_save |
405 |
|
419 | !if $indivtechvar_save notitemof $tv_listlocalcode |
- | 420 | !if $a=0 |
|
- | 421 | !readproc proc/checktechvar.proc |
|
- | 422 | !if $listvalues!=$empty |
|
- | 423 | error=techvardiscord $listvalues |
|
- | 424 | display=1 |
|
- | 425 | !endif |
|
- | 426 | !endif |
|
- | 427 | !endif |
|
406 | !endif |
428 | !endif |
407 | title=$title_save |
429 | title=$title_save |
408 | desc=$desc_save |
430 | desc=$desc_save |
409 | prpage=$prpage_save |
431 | prpage=$prpage_save |
410 | comment=$comment_save |
432 | comment=$comment_save |