Rev 16921 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | !if ($wims_class notitemof $nei_sup,$nei_part or\ |
2 | $nei notitemof $n_sup,$n_part) and \ |
||
3 | all notitemof $nei_sup,$nei_part |
||
12776 | bpr | 4 | error=not_neighbor |
5 | job2=first |
||
6 | !exit |
||
23 | reyssat | 7 | !endif |
8 | |||
9 | !read scripts/reccnt.proc me log/classes/$wims_class |
||
10 | !read scripts/reccnt.proc it log/classes/$nei |
||
11 | import=!trim $import |
||
12 | !if $import=$empty |
||
12457 | bpr | 13 | :noimp |
14 | job2=import |
||
15 | !changeto neighbor/import.proc |
||
23 | reyssat | 16 | !endif |
17 | |||
18 | !bound impmethod within add,replace default add |
||
19 | !distribute items $import into itype,iname |
||
20 | imported=1 |
||
12907 | guerimand | 21 | !if $itype notitemof motd,exo,sheet,exam,doc,user,livret,glossary,pdoc,tool |
12457 | bpr | 22 | !goto noimp |
23 | reyssat | 23 | !endif |
24 | |||
25 | !if ($wims_class notitemof $nei_sup or $nei notitemof $n_sup) and \ |
||
12457 | bpr | 26 | all notitemof $nei_sup |
27 | !if $itype!=user |
||
28 | !goto noimp |
||
29 | !endif |
||
23 | reyssat | 30 | !endif |
31 | |||
2856 | guerimand | 32 | !if $itype=livret |
12903 | guerimand | 33 | !if $confirm!=yes and $impmethod=replace |
34 | test=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$replace |
||
35 | !if $test>0 |
||
36 | result=confirm |
||
37 | cfm=$cfm replace |
||
38 | !exit |
||
39 | !endif |
||
40 | !endif |
||
12457 | bpr | 41 | nbnei=!recordcnt wimshome/log/classes/$nei/livret/.comps |
42 | !if $impmethod=replace |
||
12903 | guerimand | 43 | !sh rm -f $wims_home/log/classes/$wims_class/livret/.comp[0-9]*;\ |
44 | rm -f $wims_home/log/classes/$wims_class/livret/.comps |
||
12457 | bpr | 45 | !endif |
12903 | guerimand | 46 | !sh cp $wims_home/log/classes/$nei/livret/.comps $wims_home/log/classes/$wims_class/livret/.comps |
47 | nb=!recordcnt wimshome/log/classes/$nei/livret/.comps |
||
48 | !for k=1 to $nb |
||
12457 | bpr | 49 | comp=$empty |
12903 | guerimand | 50 | nbp=!recordcnt wimshome/log/classes/$nei/livret/.comp$k |
51 | !for l=1 to $nbp |
||
12457 | bpr | 52 | d=!record $l of wimshome/log/classes/$nei/livret/.comp$k |
53 | d=!line 1 of $d |
||
54 | comp=!append line :$d\ |
||
55 | to $comp |
||
56 | !next l |
||
12903 | guerimand | 57 | !writefile wimshome/log/classes/$wims_class/livret/.comp$[$k] $comp |
12457 | bpr | 58 | !next k |
59 | verif=module=adm/class/livret |
||
60 | !exit |
||
2856 | guerimand | 61 | !endif |
62 | |||
12907 | guerimand | 63 | !distribute line doc/.docindex\ |
64 | tool/.toolindex into file_pdoc,file_tool |
||
65 | !if $itype=pdoc or $itype=tool |
||
66 | !if $confirm!=yes and $impmethod=replace |
||
67 | test=!recordcnt wimshome/log/classes/$wims_class/$(file_$itype) |
||
68 | !if $test>0 |
||
69 | result=confirm |
||
70 | cfm=$cfm replace |
||
71 | !exit |
||
72 | !endif |
||
73 | !endif |
||
74 | nbnei=!recordcnt wimshome/log/classes/$nei/$(file_$itype) |
||
75 | !if $impmethod=replace |
||
76 | !sh rm -f $wims_home/log/classes/$wims_class/$(file_$itype) |
||
77 | !endif |
||
78 | !sh cp $wims_home/log/classes/$nei/$(file_$itype) $wims_home/log/classes/$wims_class/$(file_$itype) |
||
79 | verif=module=home |
||
80 | !exit |
||
81 | !endif |
||
82 | |||
23 | reyssat | 83 | !if $itype=motd |
12457 | bpr | 84 | result=!mexec neighbor/import2.sh |
85 | verif=module=adm/class/motd |
||
86 | !exit |
||
23 | reyssat | 87 | !endif |
88 | |||
89 | !if $itype=exo |
||
12457 | bpr | 90 | result=!mexec neighbor/import2.sh |
91 | verif=module=classes/$lang |
||
92 | !exit |
||
23 | reyssat | 93 | !endif |
94 | |||
95 | !if $itype=sheet |
||
12457 | bpr | 96 | !if $confirm!=yes |
97 | !if $it_exocnt>0 |
||
98 | result=confirm |
||
99 | cfm=$cfm dep |
||
100 | !exit |
||
101 | !endif |
||
102 | !if $impmethod=replace |
||
103 | test=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$replace |
||
104 | !if $test>0 |
||
105 | result=confirm |
||
106 | cfm=$cfm replace |
||
107 | !exit |
||
108 | !endif |
||
109 | !endif |
||
23 | reyssat | 110 | !endif |
12457 | bpr | 111 | header=!record $iname of wimshome/log/classes/$nei/sheets/.sheets |
112 | header=!line 2 to -1 of $header |
||
17495 | bpr | 113 | header=!replace line number 1 by $class_expiration in $header |
16921 | guerimand | 114 | !! --- delete reference to a doc for sheet presentation |
17495 | bpr | 115 | tmp=!line 4 of $header |
16921 | guerimand | 116 | !if $tmp notitemof yes,no,$empty |
17495 | bpr | 117 | header=!replace line number 4 by $empty in $header |
16921 | guerimand | 118 | !endif |
119 | !! --- delete reference to a technical variable to hide sheet |
||
17495 | bpr | 120 | header=!replace line number 8 by $empty in $header |
12457 | bpr | 121 | !if $impmethod=add |
122 | !appendfile wimshome/log/classes/$wims_class/sheets/.sheets :0\ |
||
123 | $header |
||
124 | replace=$[$me_sheetcnt+1] |
||
23 | reyssat | 125 | !endif |
12457 | bpr | 126 | result=!mexec neighbor/import2.sh |
127 | verif=module=adm/class/sheet&sheet=$replace |
||
128 | !exit |
||
23 | reyssat | 129 | !endif |
130 | |||
131 | !if $itype=exam |
||
12457 | bpr | 132 | !if $confirm!=yes |
23 | reyssat | 133 | result=confirm |
12457 | bpr | 134 | cfm=$cfm dep |
135 | !if $impmethod=replace |
||
136 | test=!recordcnt wimshome/log/classes/$wims_class/exams/.exam$replace |
||
137 | !if $test>0 |
||
138 | result=confirm |
||
139 | cfm=$cfm replace |
||
140 | !exit |
||
141 | !endif |
||
142 | !endif |
||
23 | reyssat | 143 | !exit |
144 | !endif |
||
12457 | bpr | 145 | header=!record $iname of wimshome/log/classes/$nei/exams/.exams |
146 | header=!line 2 to -1 of $header |
||
147 | !if $impmethod=add |
||
148 | !appendfile wimshome/log/classes/$wims_class/exams/.exams :0\ |
||
149 | $header |
||
150 | replace=$[$me_examcnt+1] |
||
151 | !endif |
||
152 | result=!mexec neighbor/import2.sh |
||
153 | verif=module=adm/class/exam&exam=$replace |
||
23 | reyssat | 154 | !exit |
155 | !endif |
||
156 | |||
12899 | guerimand | 157 | !if $itype=glossary |
158 | !if $confirm!=yes |
||
159 | result=confirm |
||
160 | cfm=$cfm dep |
||
161 | !if $impmethod=replace |
||
162 | test=!recordcnt wimshome/log/classes/$wims_class/tool/.glossary$replace |
||
163 | !if $test>0 |
||
164 | result=confirm |
||
165 | cfm=$cfm replace |
||
166 | !exit |
||
167 | !endif |
||
168 | !endif |
||
169 | !exit |
||
170 | !endif |
||
171 | header=!record $iname of wimshome/log/classes/$nei/tool/.glossaryindex |
||
172 | header=!line 2 to -1 of $header |
||
173 | !if $impmethod=add |
||
174 | !appendfile wimshome/log/classes/$wims_class/tool/.glossaryindex :0\ |
||
175 | $header |
||
176 | replace=$[$me_examcnt+1] |
||
177 | !endif |
||
178 | result=!mexec neighbor/import2.sh |
||
179 | verif=module=adm/tool/glossary&gl=$replace |
||
180 | !exit |
||
181 | !endif |
||
182 | |||
23 | reyssat | 183 | !if $itype=doc |
12457 | bpr | 184 | !if $confirm!=yes |
185 | !if $impmethod=replace |
||
186 | result=confirm |
||
187 | cfm=$cfm replace |
||
188 | !exit |
||
189 | !endif |
||
23 | reyssat | 190 | !endif |
12457 | bpr | 191 | !if $impmethod=add |
192 | replace=$[$me_doccnt+1] |
||
193 | !endif |
||
194 | result=!mexec neighbor/import2.sh |
||
195 | Docdir=log/classes/$wims_class/doc |
||
196 | docdir=wimshome/$Docdir |
||
197 | !read adm/docindex.proc |
||
198 | verif=module=adm/doc&job=read&doc=c$replace |
||
199 | !exit |
||
23 | reyssat | 200 | !endif |
201 | |||
202 | !if $itype=user |
||
12457 | bpr | 203 | imported= |
204 | !read adm/class/userremain.proc |
||
205 | !for i=1 to $it_usercnt |
||
206 | t=!record $i of wimshome/log/classes/$nei/.userlist |
||
207 | u=!item 3 of $t |
||
208 | !if $u isitemof $iname or $iname=-all- |
||
209 | test1=!defof user_exists in wimshome/log/classes/$wims_class/.users/$u |
||
210 | !default test1=!defof user_exists in wimshome/log/classes/$wims_class/.users/.$u |
||
211 | !if $test1=$empty |
||
212 | !if $dispo>0 |
||
213 | ud=!record 0 of wimshome/log/classes/$nei/.users/$u |
||
214 | !writefile wimshome/log/classes/$wims_class/.users/$u $ud |
||
215 | !! userphoto copy |
||
216 | cls=!defof class_superclass in wimshome/log/classes/$nei/.def |
||
217 | !if $cls=$empty |
||
218 | photodir=$nei |
||
219 | !else |
||
220 | photodir=$cls |
||
221 | !endif |
||
222 | !sh mkdir -p $wims_home/log/classes/$wims_class/photoboard/; \ |
||
12117 | guerimand | 223 | cp $wims_home/log/classes/$photodir/photoboard/$u $wims_home/log/classes/$wims_class/photoboard/$u |
12457 | bpr | 224 | !! end userphoto copy |
225 | imported=!append item $u to $imported |
||
226 | !endif |
||
227 | !endif |
||
23 | reyssat | 228 | !endif |
12457 | bpr | 229 | !next i |
230 | !if $imported!=$empty |
||
231 | !read adm/class/mkuserlist |
||
232 | !read adm/class/stat |
||
233 | result=success |
||
234 | importedcnt=!itemcnt $imported |
||
235 | !else |
||
236 | result=none |
||
7684 | bpr | 237 | !endif |
12457 | bpr | 238 | verif=module=adm/class/usermanage |
239 | !exit |
||
23 | reyssat | 240 | !endif |