Subversion Repositories wimsdev

Rev

Rev 12411 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23 reyssat 1
!bound job2 within first,def,addshare,stopshare,sharelist,\
2
	import,import2 default first
3
 
956 guerimand 4
!if $keyword=*
12411 bpr 5
  !reset keyword
956 guerimand 6
!endif
2718 bpr 7
!reset clist1 clist2
23 reyssat 8
!if $wims_superclass=$empty
12411 bpr 9
  clfile=wimshome/log/classes/.index
10
  cllimit=60
23 reyssat 11
!else
12411 bpr 12
  cllimit=300
13
  supertype=!defof class_type in wimshome/log/classes/$wims_superclass/.def
14
  !if $supertype=4 and / isin $wims_class
15
    cterms=!translate / to , in $wims_class
16
    ctypename=!defof class_typename in wimshome/log/classes/$wims_class/.def
17
    clevel=!itemcnt $cterms
18
    !if yes isin $excls
19
      clfile=wimshome/log/classes/.index
4758 bpr 20
    !else
12411 bpr 21
      !if $clevel>=3
22
        cls=!record 0 of wimshome/log/classes/$class_parent/classes
23
        prog=!record 0 of wimshome/log/classes/$class_parent/programs
24
        !if $clevel=3
25
          crs=!record 0 of wimshome/log/classes/$wims_class/courses
26
          hastest=!defof class_defined in wimshome/log/classes/$wims_class/0/.def
27
          !if $hastest issametext yes
28
            testzone=$(cterms[2])/$(cterms[3])/0
29
          !endif
30
        !else
31
          crs=!record 0 of wimshome/log/classes/$class_parent/courses
32
        !endif
33
        clist1=!column 1 of $testzone\
23 reyssat 34
$cls\
35
$prog\
36
$crs
12411 bpr 37
        clist1=!nonempty items $clist1
38
        clist1=!makelist $wims_superclass/xx for xx in $clist1
39
        clist1=!listcomplement $wims_class in $clist1
40
        !if $clevel>3
41
          clist1=!append item $clist1 to $class_parent
42
        !endif
43
        clfile=nonexistent
44
      !endif
4758 bpr 45
    !endif
956 guerimand 46
  !else
12411 bpr 47
    scl=!item 1 of $wims_superclass
48
    !if yes isin $excls
49
      clfile=wimshome/log/classes/.index
50
    !else
51
      clfile=wimshome/log/classes/$scl/.subclasses
52
    !endif
956 guerimand 53
  !endif
23 reyssat 54
!endif
55
classcnt=!recordcnt $clfile
56
clgot=0
57
keyword=!trim $keyword
58
kw=!items2words $keyword
59
kw=!trim $kw
60
kw=!singlespace $kw
61
kw=!deaccent $kw
62
kw=!tolower $kw
956 guerimand 63
!if $keyword!=$empty
12411 bpr 64
  !reset excls
956 guerimand 65
!endif
66
!if $classcnt>1 and ($clist1$clist2=$empty or $keyword != $save_keyword or yes isin $excls)
12411 bpr 67
  !reset clist1 clist2
68
  save_keyword=$keyword
69
  !for c=1 to $classcnt
70
    l_=!record $c of $clfile
71
    n_=!item 1 of $l_
72
    !if yes isin $excls
73
      !if $n_<10000
74
        ln=!defof class_lang in wimshome/log/classes/$n_/.def
75
        !if $ln=$class_lang
76
          clist1=!append item $n_ to $clist1
77
        !else
78
          clist2=!append item $n_ to $clist2
79
        !endif
80
      !endif
956 guerimand 81
    !else
12411 bpr 82
      !if $kw != $empty
83
        L_=!singlespace $l_
84
        L_=!deaccent $L_
85
        L_=!tolower $L_
86
      !endif
87
      !if $kw isin $L_ or $kw=$empty
88
        ln=!defof class_lang in wimshome/log/classes/$n_/.def
89
        !if $ln=$class_lang
90
          !if $n_!=$wims_class
91
            clist1=!append item $n_ to $clist1
92
            !advance clgot
93
          !endif
94
        !else
95
          !if $ln!=$empty
96
            clist2=!append item $n_ to $clist2
97
            !advance clgot
98
          !endif
99
        !endif
100
        !if $clgot > $cllimit
101
          toomany=yes
102
          !break
103
        !endif
104
      !endif
23 reyssat 105
    !endif
12411 bpr 106
  !next c
23 reyssat 107
!endif
108
classcnt1=!itemcnt $clist1
109
classcnt2=!itemcnt $clist2
110
clist=!append item $clist2 to $clist1
111
!readdef wimshome/log/classes/$wims_class/neighbors
112
!reset sharable_all,sharing_all,sharable,sharing
113
!for rec in $sharelist
12411 bpr 114
  sharing_$rec=!listintersect $(sharing_$rec) and $clist
115
  sharable_$rec=!listintersect $(sharable_$rec) and $clist
116
  !if $(sharing_$rec)!=$empty
117
    sharing_all=!append item $(sharing_$rec) to $sharing_all
118
    sharing=!append item $rec to $sharing
119
    sharable_$rec=
120
  !else
121
    sharable_$rec=!listintersect $(sharable_$rec) and $n_sup
122
    !if $(sharable_$rec)!=$empty
123
      sharable_all=!append item $(sharable_$rec) to $sharable_all
124
      sharable=!append item $rec to $sharable
125
    !endif
23 reyssat 126
  !endif
127
!next rec
128
sharable_all=!listuniq $sharable_all
129
sharing_all=!listuniq $sharing_all
130
 
131
!if $job2 notwordof first sharelist
12411 bpr 132
  !if $nei=$empty or $nei notitemof $clist1,$clist2
133
    job2=first
134
    !exit
135
  !endif
136
  D_=!defof n_sup\
23 reyssat 137
n_part\
138
sharable_exo\
139
sharable_sheet\
140
sharable_exam\
141
sharable_doc\
142
sharable_user\
143
sharable_forum\
144
sharable_sup\
145
sharable_motd\
146
sharable_vote\
147
sharable_cdt\
1322 guerimand 148
sharable_livret\
1407 bpr 149
sharable_seq\
12115 guerimand 150
sharable_userphoto\
12895 guerimand 151
sharable_tool\
23 reyssat 152
sharing_exo\
153
sharing_sheet\
154
sharing_exam\
155
sharing_doc\
156
sharing_user\
157
sharing_forum\
158
sharing_sup\
159
sharing_motd\
160
sharing_vote\
161
sharing_cdt\
1322 guerimand 162
sharing_livret\
1407 bpr 163
sharing_seq\
12115 guerimand 164
sharing_userphoto\
12895 guerimand 165
sharing_tool\
23 reyssat 166
sharable_all\
167
sharing_all in wimshome/log/classes/$nei/neighbors
12411 bpr 168
  !distribute lines $D_ into nei_sup,nei_part,\
169
	  nsharable_exo,nsharable_sheet,nsharable_exam,nsharable_doc,\
170
	  nsharable_user,nsharable_forum,nsharable_sup,nsharable_motd,nsharable_vote,\
12895 guerimand 171
	  nsharable_cdt,nsharable_livret,nsharable_seq,nsharable_userphoto,nsharable_tool,\
12411 bpr 172
	  nsharing_exo,nsharing_sheet,nsharing_exam,nsharing_doc,\
173
	  nsharing_user,nsharing_forum,nsharing_sup,nsharing_motd,nsharing_vote,\
12895 guerimand 174
	  nsharing_cdt,nsharing_livret,nsharing_seq,nsharing_userphoto,nsharing_tool,\
12411 bpr 175
	  nsharable_all,nsharing_all
176
  !reset nsharable,nsharing
177
  !for rec in $sharelist
178
    !if $(nsharing_$rec)!=$empty
179
      !if $wims_class isitemof $(nsharing_$rec)
180
        nsharing=!append item $rec to $nsharing
181
      !endif
182
    !else
183
      nsharable_$rec=!listintersect $(nsharable_$rec) and $nei_sup
184
      !if $wims_class isitemof $(nsharable_$rec) and\
185
	        $wims_class isitemof $nei_sup
186
        nsharable=!append item $rec to $nsharable
187
      !endif
188
    !endif
189
  !next rec
190
  nsharable=!nospace $nsharable
191
  nsharing=!nospace $nsharing
192
  D_=!defof class_institution\
23 reyssat 193
class_description\
194
class_supervisor\
195
class_email\
196
class_lang in wimshome/log/classes/$nei/.def
197
 !distribute lines $D_ into nei_institution, nei_description,nei_supervisor,\
12411 bpr 198
	  nei_email,nei_lang
23 reyssat 199
 !read neighbor/$job2.proc
200
!endif