Subversion Repositories wimsdev

Rev

Rev 10640 | Rev 10725 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !! make the list of all classes and programms which are supervised
  2. !! with the courses inside with incrementation.
  3. !! no test zone. No intecourses ?
  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
  9.       !set u_=$wims_external_auth
  10. !else
  11.       !set u_=$wims_user
  12. !endif
  13. !default CL_Name=$CL_Names
  14. !if $user_participate$user_supervise!=$empty
  15. <p>
  16.   !if $supervisable!=yes
  17.    !!$U_gotoclass
  18.   !else
  19.    !!$(U_gotoclass1)
  20.   !endif
  21. </p>
  22. !endif
  23.  
  24. !if $supervisable=yes or ($wims_user=supervisor and $wims_realuser=supervisor)
  25.   !read subclasses_supervisor.phtml
  26.   !if ($wims_user=supervisor or $wims_class=$wims_superclass)
  27. !!FIXME desactivate the possibility for teachers to register without the administrator in a portal
  28.     !if $class_type notwordof 2 4
  29.      !href module=adm/class/classes&type=supervisor&superclass=$wims_class $U_supervise
  30.     !else
  31.       !if $wims_user!=supervisor or $wims_realuser!=supervisor
  32.         $name_gotosupervise
  33.       !endif
  34.     !endif
  35.   !endif
  36. !else
  37.     !if $supervisable!=yes
  38.       !read subclasses_user.phtml
  39.     !endif
  40. !endif
  41.  
  42. !goto end1
  43.  
  44.   <ul class="wims_subclasses"><!--wims_subclasses-->
  45. !reset alreadyseen
  46. !if $wims_class!=$wims_superclass
  47.    !set subclass1=$wims_class,$subclass1
  48. !endif
  49. !for c in $subclass1
  50.      !set name=!defof class_description in wimshome/log/classes/$c/.def
  51.      !set type=!defof class_type in wimshome/log/classes/$c/.def
  52.      !set type_name=!defof class_typename in wimshome/log/classes/$c/.def
  53.      !read adm/class/initclass $c,auth
  54.  
  55.      !set t_=participant
  56.      !set type_class=!defof class_type in wimshome/log/classes/$class/.def
  57.      !if $c notitemof $alreadyseen
  58.       <li>  <span class="wims_classes_direct_$type_name">
  59.       !if $c!=$wims_class
  60.       !href module=adm/class/classes&type=authparticipant&class=$c&auth_user=$u_ $name
  61.       !else
  62.         $name
  63.       !endif
  64.       ($(CL_Name[2]))</span>
  65.      !set alreadyseen=!append item $c to $alreadyseen
  66.      !set sub_=!record 0 of wimshome/log/classes/$c/courses
  67.      !set sub_cnt=!linecnt $sub_
  68.      !if $sub_cnt>0
  69.        <ul><!--2-->
  70.       !for k_ =1 to $sub_cnt
  71.        !set parent_c=!defof class_parent in wimshome/log/classes/$wims_superclass/$(sub_[$k_;1])/.def
  72.        !set split=!replace internal / by , in $(sub_[$k_;1])
  73.        !set progstyle=!defof class_progstyle in wimshome/log/classes/$wims_superclass/$(split[1])/$(split[3])/.def
  74.        !set name_c=!defof class_description in wimshome/log/classes/$parent_c/.def
  75.        !if  optional iswordof $progstyle
  76.          !set inscrit=!defof user_class in wimshome/log/classes/$wims_superclass/$(sub_[$k_;1])/.users/$wims_user
  77.        !endif
  78.        !if $wims_superclass/$(sub_[$k_;1]) notitemof $alreadyseen and mandatory iswordof $progstyle or $(split[1])/$(split[2]) iswordof $inscrit or $wims_user=supervisor
  79.         !set alreadyseen=!append item $wims_superclass/$(sub_[$k_;1]) to $alreadyseen
  80.         <li>
  81.         <span class="wims_classes_direct_course">
  82.         !href module=adm/class/classes&type=auth$t_&class=$wims_superclass/$(sub_[$k_;1])&auth_user=$u_ $(sub_[$k_;3])
  83.        ($(CL_Name[4]))
  84.         </span>
  85.         </li>
  86.        !endif
  87.        </li>
  88.       !next k_
  89.        </ul><!end--2-->
  90.       !endif sub_cnt>0
  91.         !if $c=$wims_class
  92.          !goto end
  93.         !endif
  94.       !endif $c notitemof $alreadyseen
  95. !next
  96.  
  97. :end
  98. </ul>
  99. :end1
  100. !if $alreadyseen!=$empty
  101.   !set subclass2=!listcomplement $alreadyseen in $subclass2
  102.   !set subclasscnt2=!itemcnt $subclass2
  103. !endif
  104. !if $class_mixed_external_auth!=2 and $subclasscnt2>0
  105.  !if $insc!=yes
  106.   !href module=home&cmd=new&insc=yes $U_inscription2
  107.  !else
  108. <div>
  109.   $U_inscription1
  110.  <ul>
  111.   !for c in $subclass2
  112.    !set name=!defof class_description in wimshome/log/classes/$c/.def
  113.    !set type=!defof class_typename in wimshome/log/classes/$c/.def
  114.    <li> <span class="wims_classes_direct_$type">
  115. !! wrong variable?
  116. !!   !href module=adm/class/reguser&class=$c&auth_user=$u_ $name
  117.    !href module=adm/class/reguser&class=$c&user_auth=$u_ $name
  118.    </span></li>
  119.   !next c
  120.  </ul>
  121. </div>
  122.   !set wims_ref_class=wims_button
  123.   !href module=home&cmd=new $wims_name_back2
  124.  !endif
  125. !endif
  126. !if $supervisable=yes and ($wims_user=supervisor or $wims_class=$wims_superclass) and $class_type notwordof 3 4
  127. <p>
  128.    !set wims_ref_class=wims_button
  129.    !href module=adm/class/regclass $wims_name_classcreate
  130.    !set wims_ref_class=wims_button
  131.    !href module=adm/class/regclass&job=cloneexemple $wims_name_cloneclass
  132.  
  133. </p>
  134. !endif
  135.