Subversion Repositories wimsdev

Rev

Rev 16512 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16479 guerimand 1
 
2
!if $wims_class=$empty
3
  error=noclass
4
  !exit
5
!endif
6
 
16512 guerimand 7
!if $wims_user=supervisor
16479 guerimand 8
  !! ---- build list of user/teacher of the class with mail defined
9
  !sh rm -f $wims_home/sessions/$wims_session/.userlist_mail $wims_home/sessions/$wims_session/.userlist_nomail $wims_home/sessions/$wims_session/.userteacher_nomail $wims_home/sessions/$wims_session/.teacherlist_mail;
10
  !read adm/class/userdef ,$wims_class,
11
  !distribute item 0,0,0,0 into nb_user,nb_teacher,nbw_user,nbw_teacher
12
  !! ----- not same process because of different format for file .userlist and .teacherlist
13
  !! -----  check of userlist
14
    type=user
15
    nbt_$type=!recordcnt wimshome/log/classes/$wims_class/.$(type)list
16
    !for k=1 to $(nbt_$type)
17
      data=!record $k of wimshome/log/classes/$wims_class/.$(type)list
18
      login=!item 3 of $data
19
      data=!defof user_firstname,user_lastname,user_email in $userfolder/$login
20
      !distribute item $data into f,l,m
21
      !if $m!=$empty
22
        !appendfile wimshome/sessions/$wims_session/.$(type)list_mail :$l,$f,$login,$m
23
        !increase nb_$type
24
      !else
25
        !appendfile wimshome/sessions/$wims_session/.$(type)list_nomail :$l,$f,$login
26
        !increase nbw_$type
27
      !endif
28
    !next k
29
  !! ---- check of teacherlist
30
    type=teacher
31
    globaldata=!record 0 of wimshome/log/classes/$wims_class/.$(type)list
32
    nbt_$type=!linecnt $globaldata
33
    !for k=1 to $(nbt_$type)
34
      data=!line $k of $globaldata
35
      login=!item 3 of $data
36
      data=!defof user_firstname,user_lastname,user_email in $userfolder/$login
37
      !distribute item $data into f,l,m
38
      !if $m!=$empty
39
        !appendfile wimshome/sessions/$wims_session/.$(type)list_mail :$l,$f,$login,$m
40
        !increase nb_$type
41
      !else
42
        !appendfile wimshome/sessions/$wims_session/.$(type)list_nomail :$l,$f,$login
43
        !increase nbw_$type
44
      !endif
45
    !next k
46
!endif
47
 
48
!read adm/class/classlang names.phtml
16512 guerimand 49
suplog=!defof class_Supervisor in wimshome/log/classes/$wims_class/.def
50
!if $suplog=$empty
51
  add=$wims_class/supervisor
16479 guerimand 52
!else
17272 guerimand 53
  !if $suplog=supervisor
54
    add=$wims_superclass/supervisor
55
  !else
56
    add=$wims_superclass/.users/$suplog
57
  !endif
16479 guerimand 58
!endif
59
 
60
tmp=!defof user_email,user_firstname,user_lastname in wimshome/log/classes/$add
61
supervisorname=$(tmp[2]) $(tmp[3])
62
supervisormail=$(tmp[1])
16512 guerimand 63
 
16479 guerimand 64
!if $supervisormail=$empty
16512 guerimand 65
  !if $wims_user!=supervisor
66
    error=sendmailteacherclose
67
  !else
68
    error=nosupervisoremail
69
  !endif
16479 guerimand 70
!endif
16482 guerimand 71