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