Rev 10820 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 10820 | Rev 12488 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | !if $version_class>=5 |
2 | !if $version_class>=5 |
3 | !exit |
3 | !exit |
4 | !endif |
4 | !endif |
5 | olddon=!record 0 of wimshome/s2/$wims_session/oldtechvar.don |
5 | olddon=!record 0 of wimshome/s2/$wims_session/oldtechvar.don |
6 | !if $olddon=$empty or $subjob=$empty |
6 | !if $olddon=$empty or $subjob=$empty |
7 |
|
7 | olddon=!sh cd $wims_home/log/classes/$tv_Sclass/.users/;\ |
8 | grep -r user__ * | awk -F= '$$2!=""{print $$0}' |
8 | grep -r user__ * | awk -F= '$$2!=""{print $$0}' |
9 |
|
9 | olddon=!replace internal :!set user__ by , in $olddon |
10 |
|
10 | olddon=!replace internal = by , in $olddon |
11 |
|
11 | !if $olddon=$empty |
12 |
|
12 | !writefile wimshome/s2/$wims_session/oldtechvar.don EMPTY |
13 |
|
13 | !else |
14 |
|
14 | !writefile wimshome/s2/$wims_session/oldtechvar.don $olddon |
15 |
|
15 | !endif |
16 | !endif |
16 | !endif |
17 | !if EMPTY=$olddon |
17 | !if EMPTY=$olddon |
18 |
|
18 | !reset olddon |
19 | !endif |
19 | !endif |
20 | nb=!linecnt $olddon |
20 | nb=!linecnt $olddon |
21 | !if $nb<=0 |
21 | !if $nb<=0 |
22 |
|
22 | error=nooldvar |
23 |
|
23 | job=listvar |
24 |
|
24 | !changeto $job.proc |
25 |
|
25 | !exit |
26 | !endif |
26 | !endif |
27 | 27 | ||
28 | listclsuser=$empty |
28 | listclsuser=$empty |
29 | nuser=!recordcnt wimshome/log/classes/$wims_class/.userlist |
29 | nuser=!recordcnt wimshome/log/classes/$wims_class/.userlist |
30 | !if $nuser>0 |
30 | !if $nuser>0 |
31 |
|
31 | !for k=1 to $nuser |
32 |
|
32 | u=!record $k of wimshome/log/classes/$wims_class/.userlist |
33 |
|
33 | listclsuser=!append item $(u[3]) to $listclsuser |
34 |
|
34 | !next k |
35 | !endif |
35 | !endif |
36 | listlocalname=!item $tv_listlocal of $tv_listname |
36 | listlocalname=!item $tv_listlocal of $tv_listname |
37 | 37 | ||
38 | !! ------ description of used variables : |
38 | !! ------ description of used variables : |
39 | !! listforbname1 : contient les noms de variables non chargeables car affectés également à des participants extérieurs à la classe |
39 | !! listforbname1 : contient les noms de variables non chargeables car affectés également à des participants extérieurs à la classe |
Line 43... | Line 43... | ||
43 | !! listmodify : variable locale modifiable |
43 | !! listmodify : variable locale modifiable |
44 | !! listlogin_$name : contient la liste des logins contenant une valeur pour la variable name |
44 | !! listlogin_$name : contient la liste des logins contenant une valeur pour la variable name |
45 | !! listval_$name : liste des différentes valeurs trouvées pour la variable name |
45 | !! listval_$name : liste des différentes valeurs trouvées pour la variable name |
46 | 46 | ||
47 | !for k=1 to $nb |
47 | !for k=1 to $nb |
48 |
|
48 | l=!line $k of $olddon |
49 |
|
49 | !distribute item $l into varuser,varname,varval |
50 |
|
50 | name2=!text select 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ in $varname |
51 |
|
51 | name2=!nospace $name2 |
52 |
|
52 | n=!charcnt $name2 |
53 |
|
53 | !if $n>$MAXcharname or $n<1 |
54 |
|
54 | listforbname3=!listunion $listforbname3 and $varname |
- | 55 | !else |
|
- | 56 | varname=$name2 |
|
- | 57 | !if $varname notitemof $tv_listallname |
|
- | 58 | # eventualy a new vartech |
|
- | 59 | listnew=!listunion $listnew and $varname |
|
- | 60 | # precheck condition of localisation (no participant use it outside class) |
|
- | 61 | !if $varuser notitemof $listclsuser |
|
- | 62 | listforbname1=!listunion $listforbname1 and $varname |
|
- | 63 | !endif |
|
55 | !else |
64 | !else |
56 | varname=$name2 |
- | |
57 | !if $varname |
65 | !if $varname isitemof $listlocalname |
58 | # eventualy a new vartech |
- | |
59 |
|
66 | listmodify=!listunion $listmodify and $varname |
60 | # precheck condition of localisation (no participant use it outside class) |
- | |
61 | !if $varuser notitemof $listclsuser |
- | |
62 | listforbname1=!listunion $listforbname1 and $varname |
- | |
63 | !endif |
- | |
64 | !else |
67 | !else |
65 | !if $varname isitemof $listlocalname |
- | |
66 | listmodify=!listunion $listmodify and $varname |
- | |
67 | !else |
- | |
68 |
|
68 | listforbname2=!listunion $listforbname2 and $varname |
69 | !endif |
- | |
70 | !endif |
69 | !endif |
71 | !endif |
70 | !endif |
- | 71 | !endif |
|
72 | !next k |
72 | !next k |
73 | listnew=!listcomplement $listforbname1 in $listnew |
73 | listnew=!listcomplement $listforbname1 in $listnew |
74 | !! check list of value for new techvar |
74 | !! check list of value for new techvar |
75 | !for k in $listnew |
75 | !for k in $listnew |
76 |
|
76 | newval=!sh grep $k $wims_home/s2/$wims_session/oldtechvar.don |
77 |
|
77 | newval=!column 3 of $newval |
78 |
|
78 | newval=!listuniq $newval |
79 |
|
79 | nb=!itemcnt $newval |
80 |
|
80 | !if $nb>$MAXnbvalue |
81 |
|
81 | listnew=!listcomplement $k in $listnew |
82 |
|
82 | listforbname3=!listunion $listforbname3 and $k |
83 |
|
83 | !endif |
84 | !next k |
84 | !next k |
85 | !! check list of value for modify techvar |
85 | !! check list of value for modify techvar |
86 | !for k in $listmodify |
86 | !for k in $listmodify |
87 |
|
87 | newval=!sh grep $k $wims_home/s2/$wims_session/oldtechvar.don |
88 |
|
88 | newval=!column 3 of $newval |
89 |
|
89 | num=!positionof item $techvar in $tv_listname |
90 |
|
90 | don=!record $num of wimshome/log/classes/$wims_class/.techvar |
91 |
|
91 | oldval=!line 2 of $don |
92 |
|
92 | val=!listuniq $newval,$oldval |
93 |
|
93 | nb=!itemcnt $val |
94 |
|
94 | !if $nb>$MAXnbvalue |
95 |
|
95 | listmodify=!listcomplement $k in $listmodify |
96 |
|
96 | listforbname3=!listunion $listforbname3 and $k |
97 |
|
97 | !endif |
98 | !next k |
98 | !next k |
99 | 99 | ||
100 | !!debug olddon : $olddon\ |
100 | !!debug olddon : $olddon\ |
101 | !!listforbname1 : $listforbname1\ |
101 | !!listforbname1 : $listforbname1\ |
102 | !!listforbname2 : $listforbname2\ |
102 | !!listforbname2 : $listforbname2\ |
103 | !!listforbname3 : $listforbname3\ |
103 | !!listforbname3 : $listforbname3\ |
104 | !!listnew : $listnew \ |
104 | !!listnew : $listnew \ |
105 | !!listmodify : $listmodify |
105 | !!listmodify : $listmodify |
106 | 106 | ||
107 | !if $listnew$listforbname1$listforbname2$listmodify=$empty |
107 | !if $listnew$listforbname1$listforbname2$listmodify=$empty |
108 |
|
108 | error=nooldvar |
109 |
|
109 | job=listvar |
110 |
|
110 | !changeto $job.proc |
111 |
|
111 | !exit |
112 | !endif |
112 | !endif |
113 | 113 | ||
114 | !! --------------------------- le processus make est à reprendre avec les nouvelles variables. |
114 | !! --------------------------- le processus make est à reprendre avec les nouvelles variables. |
115 | 115 | ||
116 | !if $subjob=make |
116 | !if $subjob=make |
117 |
|
117 | nb=!itemcnt $tv_listlocal |
118 |
|
118 | !if $nb>=$MAXtechvar |
119 |
|
119 | error=toomanytechvar |
120 |
|
120 | !reset subjob |
121 |
|
121 | !exit |
122 |
|
122 | !endif |
123 |
|
123 | !if $techvar notitemof $listnew |
124 |
|
124 | error=oldvar_badvar |
125 |
|
125 | !reset subjob |
126 |
|
126 | !exit |
127 |
|
127 | !endif |
128 |
|
128 | num=!replace internal / by _ in $wims_class |
129 |
|
129 | !increase nb |
130 |
|
130 | num=$(num)_$nb |
131 |
|
131 | liste=!sh grep $techvar $wims_home/s2/$wims_session/oldtechvar.don |
132 |
|
132 | !if $liste=$empty |
133 |
|
133 | error=oldvar_nouser |
134 |
|
134 | !reset subjob |
135 |
|
135 | !exit |
136 |
|
136 | !endif |
137 | !! make the new technical variable |
137 | !! make the new technical variable |
138 |
|
138 | listval=!column 3 of $liste |
139 |
|
139 | listval=!listuniq $listval |
140 |
|
140 | nbval=!itemcnt $listval |
141 |
|
141 | !if $nbval>$MAXnbvalue |
142 |
|
142 | error=badoldvaluesnb |
143 |
|
143 | !reset subjob |
144 |
|
144 | !exit |
145 |
|
145 | !endif |
146 |
|
146 | techvar=!lower $techvar |
147 |
|
147 | !fileappend wimshome/log/classes/$wims_class/.techvar :$techvar\ |
148 | $listval |
148 | $listval |
149 |
|
149 | !fileappend wimshome/log/classes/$tv_Sclass/.indextechvar :$techvar,$wims_class,$[$nb] |
150 | !! put value in participant file. |
150 | !! put value in participant file. |
151 |
|
151 | nb=!linecnt $liste |
152 |
|
152 | !for k=1 to $nb |
153 |
|
153 | udon=!line $k of $liste |
154 |
|
154 | !distribute item $udon into login,bb,val |
155 |
|
155 | !setdef !set user_techvar_$num=$val in wimshome/log/classes/$tv_Sclass/.users/$login |
156 |
|
156 | listlogin=!append item $login to $listlogin |
157 |
|
157 | !next k |
158 |
|
158 | !restart module=adm/class/techvar |
159 | !endif |
159 | !endif |
160 | 160 | ||
161 | !if $subjob=modify |
161 | !if $subjob=modify |
162 |
|
162 | !if $techvar notitemof $listmodify |
163 |
|
163 | error=oldvar_badvar |
164 |
|
164 | !reset subjob |
165 |
|
165 | !exit |
166 |
|
166 | !endif |
167 |
|
167 | liste=!sh grep $techvar $wims_home/s2/$wims_session/oldtechvar.don |
168 |
|
168 | !if $liste=$empty |
169 |
|
169 | error=oldvar_nouser |
170 |
|
170 | !reset subjob |
171 |
|
171 | !exit |
172 |
|
172 | !endif |
173 |
|
173 | nb=!linecnt $liste |
174 |
|
174 | num0=!positionof item $techvar in $tv_listname |
175 |
|
175 | num=$(tv_listtechvar[$num0;3]) |
176 |
|
176 | cls=!item $num0 of $tv_listcode |
- | 177 | !for k=1 to $nb |
|
- | 178 | udon=!line $k of $liste |
|
- | 179 | !distribute item $udon into login,bb,val |
|
- | 180 | !setdef !set user_techvar_$(cls)=$val in wimshome/log/classes/$tv_Sclass/.users/$login |
|
- | 181 | listlogin=!append item $login to $listlogin |
|
- | 182 | !next k |
|
- | 183 | !! modify list of values (if necessary) of technical variable |
|
- | 184 | listval=!column 3 of $liste |
|
- | 185 | listval=!listuniq $listval |
|
- | 186 | don=!record $num of wimshome/log/classes/$wims_class/.techvar |
|
- | 187 | oldval=!line 2 of $don |
|
- | 188 | new=!listcomplement $oldval in $listval |
|
- | 189 | !if $new!=$empty |
|
- | 190 | nb=!recordcnt wimshome/log/classes/$wims_class/.techvar |
|
- | 191 | output=$empty |
|
177 | !for k=1 to $nb |
192 | !for k=1 to $nb |
178 |
|
193 | tmp=!record $k of wimshome/log/classes/$wims_class/.techvar |
179 |
|
194 | !if $k=$num |
180 |
|
195 | tmp=!replace line number 2 by $oldval,$new in $tmp |
- | 196 | !endif |
|
181 |
|
197 | output=!append line :$tmp to $output |
182 | !next k |
198 | !next k |
183 | !! modify list of values (if necessary) of technical variable |
- | |
184 | listval=!column 3 of $liste |
- | |
185 | listval=!listuniq $listval |
- | |
186 | don=!record $num of wimshome/log/classes/$wims_class/.techvar |
- | |
187 | oldval=!line 2 of $don |
- | |
188 | new=!listcomplement $oldval in $listval |
- | |
189 | !if $new!=$empty |
- | |
190 | nb=!recordcnt wimshome/log/classes/$wims_class/.techvar |
- | |
191 | output=$empty |
- | |
192 | !for k=1 to $nb |
- | |
193 | tmp=!record $k of wimshome/log/classes/$wims_class/.techvar |
- | |
194 | !if $k=$num |
- | |
195 | tmp=!replace line number 2 by $oldval,$new in $tmp |
- | |
196 | !endif |
- | |
197 | output=!append line :$tmp to $output |
- | |
198 | !next k |
- | |
199 |
|
199 | !filewrite wimshome/log/classes/$wims_class/.techvar $output |
200 |
|
200 | !endif |
201 |
|
201 | !restart module=adm/class/techvar&job=userlist |
202 | !endif |
202 | !endif |