Subversion Repositories wimsdev

Rev

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