Rev 12981 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | # Delete a program and all its courses. |
2 | # Calling parameter: program address. |
||
3 | |||
4 | thisclass=!translate internal / to , in $wims_read_parm |
||
5 | thislevel=$(thisclass[1]) |
||
6 | |||
7 | !if $wims_superclass=$empty or $thislevel=$empty or $wims_user!=supervisor |
||
12981 | bpr | 8 | !exit |
20 | reyssat | 9 | !endif |
10 | |||
11 | cls_=$wims_read_parm |
||
12 | cls__=wimshome/log/classes/$wims_superclass/$cls_ |
||
13 | !if $cls_= or $wims_class/ notin $wims_superclass/$cls_ |
||
12981 | bpr | 14 | !exit |
20 | reyssat | 15 | !endif |
16 | test=!defof class_defined in $cls__/.def |
||
17 | !if $test!=yes |
||
12981 | bpr | 18 | error=del_not_exist |
19 | !exit |
||
20 | reyssat | 20 | !endif |
21 | |||
22 | courses=!record 0 of $cls__/courses |
||
23 | courses=!column 1 of $courses |
||
24 | courses=!nonempty items $courses |
||
25 | |||
26 | prog_=$wims_superclass/$cls_ |
||
27 | !for dp_c in $courses |
||
12981 | bpr | 28 | sharelist=!defof sharing_all in wimshome/log/classes/$wims_superclass/$dp_c/neighbors |
29 | !for dp_C in $sharelist |
||
30 | !if $dp_C != $prog_ |
||
31 | !read adm/class/stopshare $dp_C,$wims_superclass/$dp_c\ |
||
14336 | bpr | 32 | all |
12981 | bpr | 33 | !endif |
34 | !next dp_C |
||
35 | error= |
||
36 | !read adm/gateway/delsup $dp_c |
||
20 | reyssat | 37 | !next dp_c |
38 | |||
39 | !read adm/gateway/delsup $cls_ |
||
40 | courses=!items2words $courses |
||
41 | !sh cd $wims_home/log/classes/$wims_superclass\ |
||
42 | rm -Rf $cls_ $courses |