Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
10651 bpr 1
!! make the list of all classes and programms which are supervised
2
!! with the courses inside with incrementation.
10747 bpr 3
!! no test zone. No intercourses ?
10651 bpr 4
!! subclass1 is something as the variable $wims_participate (only courses ? )+ optional courses
5
!! eventually
6
!! subclass2 is the complement
7
 
8
!if $auth_method isitemof $auth_method_list and $wims_user!=supervisor
12821 bpr 9
  !set u_=$wims_external_auth
10651 bpr 10
!else
12821 bpr 11
  !set u_=$wims_realuser
12
  !default u_=$wims_user
10651 bpr 13
!endif
1429 bpr 14
!default CL_Name=$CL_Names
10762 bpr 15
!!!if $user_participate$user_supervise!=$empty
16
!!<p>
17
!!  !if $supervisable!=yes
10770 bpr 18
!!    $U_gotoclass
10762 bpr 19
!!  !else
10770 bpr 20
!!    $U_gotoclass3
10762 bpr 21
!!  !endif
22
!!</p>
23
!!!endif
5894 bpr 24
 
17506 guerimand 25
!if $supervisable=yes or ($wims_user=supervisor and ($wims_realuser=supervisor or $wims_realuser=SUPERVISOR))
10651 bpr 26
  !read subclasses_supervisor.phtml
27
  !if ($wims_user=supervisor or $wims_class=$wims_superclass)
12821 bpr 28
    !!FIXME desactivate the possibility for teachers to register without the administrator in a portal
10674 bpr 29
    !if $class_type iswordof 2 4
12821 bpr 30
      !!href module=adm/class/classes&type=supervisor&superclass=$wims_class $U_supervise
10674 bpr 31
    !!else
17506 guerimand 32
      !if $wims_user!=supervisor or ($wims_realuser!=supervisor and $wims_realuser!=SUPERVISOR)
13169 bpr 33
        <div class="wims_msg info">
10651 bpr 34
        $name_gotosupervise
13169 bpr 35
        </div>
10651 bpr 36
      !endif
37
    !endif
38
  !endif
13579 lemaire 39
  !read classlegend.phtml
5110 bpr 40
!else
12821 bpr 41
  !if $supervisable!=yes
42
    !read subclasses_user.phtml
43
    !read classlegend.phtml
44
  !endif
5110 bpr 45
!endif
10762 bpr 46
!!exit
47
!goto end1
10651 bpr 48
 
5110 bpr 49
  <ul class="wims_subclasses"><!--wims_subclasses-->
50
!reset alreadyseen
51
!if $wims_class!=$wims_superclass
12821 bpr 52
  !set subclass1=$wims_class,$subclass1
5110 bpr 53
!endif
54
!for c in $subclass1
12821 bpr 55
  !set name=!defof class_description in wimshome/log/classes/$c/.def
56
  !set type=!defof class_type in wimshome/log/classes/$c/.def
57
  !set type_name=!defof class_typename in wimshome/log/classes/$c/.def
58
  !read adm/class/initclass $c,auth
5110 bpr 59
 
12821 bpr 60
  !set t_=participant
61
  !set type_class=!defof class_type in wimshome/log/classes/$class/.def
62
  !if $c notitemof $alreadyseen
63
    <li>  <span class="wims_classes_direct_$type_name">
64
    !if $c!=$wims_class
5110 bpr 65
      !href module=adm/class/classes&type=authparticipant&class=$c&auth_user=$u_ $name
12821 bpr 66
    !else
67
      $name
68
    !endif
69
    ($(CL_Name[2]))</span>
70
    !set alreadyseen=!append item $c to $alreadyseen
71
    !set sub_=!record 0 of wimshome/log/classes/$c/courses
72
    !set sub_cnt=!linecnt $sub_
73
    !if $sub_cnt>0
5110 bpr 74
       <ul><!--2-->
1429 bpr 75
      !for k_ =1 to $sub_cnt
12821 bpr 76
        !set parent_c=!defof class_parent in wimshome/log/classes/$wims_superclass/$(sub_[$k_;1])/.def
77
        !set split=!replace internal / by , in $(sub_[$k_;1])
78
        !set progstyle=!defof class_progstyle in wimshome/log/classes/$wims_superclass/$(split[1])/$(split[3])/.def
79
        !set name_c=!defof class_description in wimshome/log/classes/$parent_c/.def
80
        !if  optional iswordof $progstyle
81
          !set inscrit=!defof user_class in wimshome/log/classes/$wims_superclass/$(sub_[$k_;1])/.users/$wims_user
82
        !endif
83
        !if $wims_superclass/$(sub_[$k_;1]) notitemof $alreadyseen and mandatory iswordof $progstyle or $(split[1])/$(split[2]) iswordof $inscrit or $wims_user=supervisor
84
          !set alreadyseen=!append item $wims_superclass/$(sub_[$k_;1]) to $alreadyseen
85
          <li>
86
          <span class="wims_classes_direct_course">
87
          !href module=adm/class/classes&type=auth$t_&class=$wims_superclass/$(sub_[$k_;1])&auth_user=$u_ $(sub_[$k_;3])
88
          ($(CL_Name[4]))
89
          </span>
90
           </li>
91
        !endif
3605 bpr 92
        </li>
1429 bpr 93
      !next k_
12821 bpr 94
      </ul><!end--2-->
95
    !endif sub_cnt>0
96
    !if $c=$wims_class
13169 bpr 97
      !goto end
12821 bpr 98
    !endif
99
  !endif $c notitemof $alreadyseen
5123 bpr 100
!next
101
 
5110 bpr 102
:end
5111 bpr 103
</ul>
10651 bpr 104
:end1
5110 bpr 105
!if $alreadyseen!=$empty
106
  !set subclass2=!listcomplement $alreadyseen in $subclass2
107
  !set subclasscnt2=!itemcnt $subclass2
108
!endif
4588 czzmrn 109
!if $class_mixed_external_auth!=2 and $subclasscnt2>0
10770 bpr 110
 
13063 bpr 111
   !if $insc!=yes
12821 bpr 112
    !!not a program
113
    !if $class_type!=3
114
      !href module=home&cmd=new&insc=yes $U_inscription2
115
    !endif
116
  !else
117
    <div>
118
      $U_inscription1
119
      <ul class="wims_subclasses">
120
    !for c in $subclass2
121
      !set name=!defof class_description in wimshome/log/classes/$c/.def
13064 bpr 122
      !set name_parent=!defof class_parent in wimshome/log/classes/$c/.def
123
      !set name_parent=!defof class_description in wimshome/log/classes/$name_parent/.def
12821 bpr 124
      !set type=!defof class_typename in wimshome/log/classes/$c/.def
125
      <li><span class="wims_classes_direct_$type">
126
      !! wrong variable?
127
      !!   !href module=adm/class/reguser&class=$c&auth_user=$u_ $name
128
      !href module=adm/class/reguser&class=$c&user_auth=$u_&subclass=yes $name
13064 bpr 129
      ($name_parent)
12821 bpr 130
      </span></li>
131
    !next c
132
    </ul>
133
    </div>
134
    !set wims_ref_class=wims_button wims_secondary_button
135
    !href module=home&cmd=new $wims_name_back2
10770 bpr 136
  !endif
33 reyssat 137
!endif
16250 guerimand 138
 
5843 bpr 139
!if $supervisable=yes and ($wims_user=supervisor or $wims_class=$wims_superclass) and $class_type notwordof 3 4
16250 guerimand 140
  !set regclass=!defof user_mkclass in $userdef
141
  !if $regclass!=no
142
    <p>
143
    !set wims_ref_class=wims_button
144
    !href module=adm/class/regclass $wims_name_classcreate
145
    !set wims_ref_class=wims_button
146
    !href module=adm/class/regclass&job=cloneexemple $wims_name_cloneclass
147
    </p>
148
  !endif
5020 bpr 149
!endif