Subversion Repositories wimsdev

Rev

Rev 12907 | 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\
12457 bpr 3
	  $nei notitemof $n_sup,$n_part) and \
23 reyssat 4
    all notitemof $nei_sup,$nei_part
12457 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
 
13
!if ($wims_class notitemof $nei_sup or $nei notitemof $n_sup) and \
12457 bpr 14
    all notitemof $nei_sup
15
  newcnt1=0
16
  !goto user
23 reyssat 17
!endif
18
 
19
newrec=!mexec neighbor/newrec.sh
12906 guerimand 20
 
23 reyssat 21
newcnt1=!linecnt $newrec
22
 
12899 guerimand 23
!reset doctit,sheettit,examtit,glossarytit
23 reyssat 24
!for i=1 to $me_doccnt
12457 bpr 25
  l=!record $i of wimshome/log/classes/$wims_class/doc/.index
26
  l=!line 2 of $l
27
  doctit=!append line $l to $doctit
23 reyssat 28
!next i
29
!for i=1 to $me_sheetcnt
12457 bpr 30
  l=!record $i of wimshome/log/classes/$wims_class/sheets/.sheets
31
  l=!line 3 of $l
32
  sheettit=!append line $l to $sheettit
23 reyssat 33
!next i
34
!for i=1 to $me_examcnt
12457 bpr 35
  l=!record $i of wimshome/log/classes/$wims_class/exams/.exams
36
  l=!line 4 of $l
37
  examtit=!append line $l to $examtit
23 reyssat 38
!next i
12899 guerimand 39
!for i=1 to $me_glossarycnt
40
  l=!record $i of wimshome/log/classes/$wims_class/tool/.glossaryindex
41
  l=!line 2 of $l
42
  glossarytit=!append line $l to $glossarytit
43
!next i
23 reyssat 44
!for i=1 to $newcnt1
12457 bpr 45
  l=!line $i of $newrec
46
  !distribute words $l into t_,n_,c_
47
  rtype$i=$t_
48
  rcode$i=$c_
49
  rstat$i=1
50
  rcnt$i=1
51
  !if $t_=motd
52
    rName$i=---
53
    rname$i=---
23 reyssat 54
  !endif
12457 bpr 55
  !if $t_=exo
56
    N_=!char 1 to -5 of $n_
57
    rName$i=$N_
58
    rname$i=!defof title in wimshome/log/classes/$nei/def/$N_.def
23 reyssat 59
  !endif
12457 bpr 60
  !if $t_=doc
61
    rName$i=c$n_
62
    rname$i=!defof tit in wimshome/log/classes/$nei/doc/c$n_/.def
63
    rcnt$i=!recordcnt wimshome/log/classes/$nei/doc/c$n_/.index
64
    test=!positionof line $(rname$i) in $doctit
65
    !if $test!=$empty
66
      test=!item 1 of $test
67
      rmine$i=$test
68
      rcode$i=2
69
    !else
70
      rcode$i=1
71
    !endif
72
  !endif
73
  !if $t_=sheet
74
    l=!record $n_ of wimshome/log/classes/$nei/sheets/.sheets
75
    rName$i=$n_
76
    rname$i=!line 3 of $l
77
    rstat$i=!word 1 of $l
78
    rcnt$i=!recordcnt wimshome/log/classes/$nei/sheets/.sheet$n_
79
    test=!positionof line $(rname$i) in $sheettit
80
    !if $test!=$empty
81
      test=!item 1 of $test
82
      rmine$i=$test
83
      rcode$i=2
84
      l=!record $test of wimshome/log/classes/$wims_class/sheets/.sheets
85
      test=!word 1 of $l
86
      !if $test>0
87
        rcode$i=3
88
      !endif
89
    !else
90
      rcode$i=1
91
    !endif
92
  !endif
12899 guerimand 93
  !if $t_=glossary
94
    rName$i=$n_
95
    l=!record $n_ of wimshome/log/classes/$nei/tool/.glossaryindex
96
    rname$i=!line 2 of $l
97
    rstat$i=!word 1 of $l
98
    rcnt$i=!recordcnt wimshome/log/classes/$nei/tool/.glossary$n_
99
    test=!positionof line $(rname$i) in $glossarytit
100
    !if $test!=$empty
101
      test=!item 1 of $test
102
      rmine$i=$test
103
      rcode$i=2
104
      l=!record $test of wimshome/log/classes/$wims_class/glossary/.glossaryindex
105
      test=!word 1 of $l
106
      !if $test>0
107
        rcode$i=3
108
      !endif
109
    !else
110
      rcode$i=1
111
    !endif
112
  !endif
12457 bpr 113
  !if $t_=exam
114
    rName$i=$n_
115
    l=!record $n_ of wimshome/log/classes/$nei/exams/.exams
116
    rname$i=!line 4 of $l
117
    rstat$i=!word 1 of $l
118
    rcnt$i=!recordcnt wimshome/log/classes/$nei/exams/.exam$n_
119
    test=!positionof line $(rname$i) in $examtit
120
    !if $test!=$empty
121
      test=!item 1 of $test
122
      rmine$i=$test
123
      rcode$i=2
124
      l=!record $test of wimshome/log/classes/$wims_class/exams/.exams
125
      test=!word 1 of $l
126
      !if $test>0
127
        rcode$i=3
128
      !endif
129
    !else
130
      rcode$i=1
131
    !endif
132
  !endif
17524 bpr 133
!next i
23 reyssat 134
 
12907 guerimand 135
!distribute line livret/.comps\
136
doc/.docindex\
137
tool/.toolindex into file_livret,file_pdoc,file_tool
138
!for type in livret,tool,pdoc
139
  li=!recordcnt wimshome/log/classes/$nei/$(file_$type)
140
  !if $li>0
141
    newrec=!append line $type $li 1 to $newrec
142
    i=!linecnt $newrec
143
    rtype$i=$type
144
    rcode$i=1
145
    rstat$i=1
146
    rcnt$i=$li
147
    rName$i=---
148
    rname$i=---
149
    rstat$i=---
150
    rccnt$i=---
151
    test=!recordcnt wimshome/log/classes/$wims_class/$(file_$type)
152
    !if $test>0
153
      rcode$i=2
154
      rmine$i=$test
155
    !endif
12906 guerimand 156
  !endif
12907 guerimand 157
!next type
12906 guerimand 158
newcnt1=!linecnt $newrec
159
 
23 reyssat 160
:user
161
nusercnt=!recordcnt wimshome/log/classes/$nei/.userlist
162
newcnt2=0
163
!if $nei_sup=all
12457 bpr 164
  !exit
23 reyssat 165
!endif
166
!for i=1 to $nusercnt
12457 bpr 167
  l=!record $i of wimshome/log/classes/$nei/.userlist
168
  u=!item 3 of $l
169
  p1=!defof user_password in wimshome/log/classes/$nei/.users/$u
170
  p2=!defof user_password in wimshome/log/classes/$wims_class/.users/$u
171
  !if $p1!=$empty and $p1!=$p2
172
    !advance newcnt2
173
    j=$newcnt2
174
    ulogin$j=$u
175
    uname1$j=!defof user_lastname in wimshome/log/classes/$nei/.users/$u
176
    uname2$j=!defof user_firstname in wimshome/log/classes/$nei/.users/$u
177
    ucode$j=2
178
    !if $p2=$empty
179
      t=!record 0 of wimshome/log/classes/$wims_class/.users/.$u
180
      !if $t=$empty
181
        ucode$j=1
182
      !else
183
        ucode$j=3
184
      !endif
185
    !endif
23 reyssat 186
  !endif
187
!next i