Rev 14336 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4996 | czzmrn | 1 | ##create teacherlist and .teacherlist_external at all levels |
10981 | bpr | 2 | ## le parametre est la classe |
4692 | bpr | 3 | |
4 | uclass=$wims_read_parm |
||
10985 | bpr | 5 | !if $uclass!=$empty |
6 | superclass=!defof class_superclass in wimshome/log/classes/$uclass/.def |
||
7 | !endif |
||
20 | reyssat | 8 | !default superclass=$wims_superclass |
4692 | bpr | 9 | !default uclass=$wims_superclass |
5028 | bpr | 10 | !!! je ne comprends pas : l'indexation ne se fait pas sinon lorsqu'un enseignant s'inscrit |
11 | !default superclass=$uclass |
||
12 | !default wims_superclass=$class |
||
13 | !!! |
||
20 | reyssat | 14 | !if $superclass=$empty |
12981 | bpr | 15 | !exit |
20 | reyssat | 16 | !endif |
17 | !if $wims_superclass!=$empty and $superclass!=$wims_superclass and $wims_ismanager<2 |
||
12981 | bpr | 18 | !exit |
20 | reyssat | 19 | !endif |
20 | |||
21 | basedir=wimshome/log/classes/$superclass |
||
22 | basedir2=$wims_home/log/classes/$superclass |
||
4692 | bpr | 23 | basedirr=wimshome/log/classes/$uclass |
24 | basedirr2=$wims_home/log/classes/$uclass |
||
10980 | bpr | 25 | basedir0=wimshome/log/classes |
26 | basedir02=$wims_home/log/classes |
||
27 | |||
20 | reyssat | 28 | tlist=!sh cd $basedir2/.users\ |
14336 | bpr | 29 | grep -l user_supervisable=yes * |
20 | reyssat | 30 | tlist=!words2items $tlist |
10980 | bpr | 31 | !set tmp= |
4692 | bpr | 32 | !writefile $basedirr/.teacherlist.1 |
10985 | bpr | 33 | !writefile $basedirr/.teacherlist_external.1 |
20 | reyssat | 34 | !for t in $tlist |
4692 | bpr | 35 | US_=!defof user_supervise in $basedir/.users/$t |
10980 | bpr | 36 | EXT_=!defof user_external_auth in $basedir/.users/$t |
4692 | bpr | 37 | !if $superclass=$uclass or $uclass isitemof $US_ |
12981 | bpr | 38 | U_=!defof user_lastname,user_firstname in $basedir/.users/$t |
39 | !appendfile $basedirr/.teacherlist.1 $U_,$t |
||
40 | !if $EXT_!=$empty |
||
41 | !appendfile $basedirr/.teacherlist_external.1 $EXT_:$t |
||
42 | !endif |
||
43 | !for l in $US_ |
||
44 | !!teacherlist has not the same status in the superclass (every teacher) |
||
45 | !! and in the subclasses (supervise teachers ) |
||
46 | !if $l notwordof $superclass $uclass |
||
47 | !appendfile $basedir0/$l/.teacherlist.1 $U_,$t |
||
48 | !if $EXT_!=$empty |
||
49 | !appendfile $basedir0/$l/.teacherlist_external.1 $EXT_:$t |
||
50 | !endif |
||
51 | !set tmp=!append item $l to $tmp |
||
52 | !endif |
||
53 | !next |
||
54 | !endif |
||
10980 | bpr | 55 | !next t |
14994 | bpr | 56 | !set tmp=!listuniq $uclass,$tmp |
10981 | bpr | 57 | !set tmp=!nonempty items $tmp |
10980 | bpr | 58 | !for t in $tmp |
14336 | bpr | 59 | !sh sort -f $basedir02/$t/.teacherlist.1 | uniq | grep . >$basedir02/$t/.teacherlist\ |
60 | rm -f $basedir02/$t/.teacherlist.1 >/dev/null |
||
61 | !sh [ -f $basedir02/$t/.teacherlist_external.1 ] && sort -f $basedir02/$t/.teacherlist_external.1 | uniq | grep . >$basedir02/$t/.teacherlist_external\ |
||
62 | rm -f $basedir02/$t/.teacherlist_external.1 >/dev/null |
||
10980 | bpr | 63 | !next |
20 | reyssat | 64 | |
10980 | bpr | 65 | !reset tmp |