Subversion Repositories wimsdev

Rev

Rev 17306 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
17070 guerimand 1
!! verification de la classe
2
!if $wims_class=$empty
3
  !restart module=home
4
!endif
5
 
6
!! gestion des autorisations sur les variables (securisation)
17097 guerimand 7
wims_prefix=class user swork
17070 guerimand 8
 
17097 guerimand 9
!! max user in a class to activate this module (maybe can be change with test)
17070 guerimand 10
maxuser=50
11
 
12
!readproc tabletheme
13
 
14
!! --------- gestion des jobs du module
15
!if $wims_user=supervisor
17306 guerimand 16
  listjob=userlist,config,log
17070 guerimand 17
  defjob=userlist
17145 guerimand 18
  test=!fileexists wimshome/log/classes/$wims_class/swork
19
  !sh mkdir -p $wims_home/log/classes/$wims_class/swork
17070 guerimand 20
!else
17306 guerimand 21
  listjob=swork,log
17070 guerimand 22
  defjob=swork
23
!endif
24
!bound job within $listjob default $defjob
25
 
26
!! ------------- traitement commun à tous les jobs du module
27
nbuser=!recordcnt wimshome/log/classes/$wims_class/.userlist
28
!if $nbuser>$maxuser
29
  error=toomanyuser
30
  notallowed=1
31
  !exit
32
!endif
33
 
34
!if / isin $wims_class
35
  userclass=$wims_superclass
36
!else
37
  userclass=$wims_class
38
!endif
39
 
40
!! ------------ log du module
41
wims_module_log=$job
42
 
43
!! lecture du fichier de langue
44
!read adm/language lang/names.phtml
45
 
17097 guerimand 46
!! ---- read class configuration file for swork
47
!read wimshome/log/classes/$wims_class/swork/.def
48
!bound swork_refreshtiming between 1 and 1000 default 2
49
!bound swork_open within 1,0 default 0
50
!bound swork_allowrefresh within 1,0 default 0
51
!bound swork_nbexo between 1 and 10 default 5
17098 guerimand 52
!bound swork_minsore between 0 and 10 default 0
53
nbsheet=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets
54
listsh=!values v for v=1 to $nbsheet
55
swork_excludesh=!listintersection $swork_excludesh and $listsh
17070 guerimand 56
 
17384 guerimand 57
!if $wims_user=supervisor and $swork_open!=1
58
  job=config
59
!endif
60
 
17097 guerimand 61
!if $wims_user!=supervisor and $swork_open=0
62
  error=notopen
63
  notallowed=1
64
  !exit
65
!endif
66
 
67
severity=!record 0 of wimshome/log/classes/$wims_class/sheets/.severity
68
formulas=!record 0 of adm/class/sheetformula
69
 
17070 guerimand 70
!! lecture du fichier spécifique du job appelé
71
!changeto $job.proc