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