Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
15453 guerimand 1
classnumber=!record 0 of wimshome/sessions/$wims_session/upload/class/serial
2
 
3
docpubliccnt=!recordcnt wimshome/sessions/$wims_session/upload/class/doc/.docindex
4
classdocpubliccnt=!recordcnt wimshome/log/classes/$wims_class/doc/.docindex
5
doccnt=!recordcnt wimshome/sessions/$wims_session/upload/class/doc/.index
6
classdoccnt=!recordcnt wimshome/log/classes/$wims_class/doc/.index
7
sheetcnt=!recordcnt wimshome/sessions/$wims_session/upload/class/sheets/.sheets
8
classsheetcnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets
9
examcnt=!recordcnt wimshome/sessions/$wims_session/upload/class/exams/.exams
10
classexamcnt=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
11
votecnt=!recordcnt wimshome/sessions/$wims_session/upload/class/vote/.votes
12
classvotecnt=!recordcnt wimshome/log/classes/$wims_class/vote/.votes
13
toolcnt=!recordcnt wimshome/sessions/$wims_session/upload/class/tool/.toolindex
14
classtoolcnt=!recordcnt wimshome/log/classes/$wims_class/tool/.toolindex
15
glossarycnt=!recordcnt wimshome/sessions/$wims_session/upload/class/tool/.glossaryindex
16
classglossarycnt=!recordcnt wimshome/log/classes/$wims_class/tool/.glossaryindex
17
freeworkcnt=!recordcnt wimshome/sessions/$wims_session/upload/class/freeworks/.freeworks
18
classfreeworkcnt=!recordcnt wimshome/log/classes/$wims_class/freeworks/.freeworks
19
 
20
 
15477 guerimand 21
!! -------------  make list of ressources not in the class
16098 guerimand 22
!for k in sheet,doc,glossary,freework
15477 guerimand 23
  list$(k)import=$empty
24
!next k
25
data=!mexec script/newrec.sh
26
nbdata=!linecnt $data
27
!for k=1 to $nbdata
28
  dt=!line $k of $data
29
  !distribute word $dt into ty,nu,bl
30
  list$(ty)import=!append item $nu to $(list$(ty)import)
31
!next k
32
 
15453 guerimand 33
!! ------------ analyse of sheet
16680 guerimand 34
listsheeterror=!values 0 for v=1 to $sheetcnt
35
listnoimport=$empty
36
!! ---- error code (notnull = cannot import) :
37
!! 0 can import
38
!! 1 with exo of the class
39
!! 2 with a public module not install on serveur
40
!! 3 sheet with techvar individualisation
15477 guerimand 41
!for k in $(listsheetimport)
16680 guerimand 42
  shinfo=!record $k of wimshome/sessions/$wims_session/upload/class/sheets/.sheets
43
  shinfo=!line 10 of $shinfo
44
  !if $shinfo=$empty
45
    nbexo=!recordcnt wimshome/sessions/$wims_session/upload/class/sheets/.sheet$k
46
    exo=1
47
    test=1
48
    !while $exo<=$nbexo and $test=1
49
      data=!record $exo of wimshome/sessions/$wims_session/upload/class/sheets/.sheet$k
50
      mod=!line 1 of $data
51
      modc=!char 1 to 8 of $mod
52
      !if classes/=$modc
53
        listnoimport=!append item $k to $listnoimport
54
        listsheeterror=!replace item number $k by 1 in $listsheeterror
15453 guerimand 55
        test=0
16680 guerimand 56
      !else
57
        mod=!nospace $mod
58
        t=!fileexists wimshome/public_html/modules/$mod/var.proc
59
        !if $t!=yes
60
          listnoimport=!append item $k to $listnoimport
61
          listsheeterror=!replace item number $k by 2 in $listsheeterror
62
          test=0
63
        !endif
15453 guerimand 64
      !endif
16680 guerimand 65
      !increase exo
66
    !endwhile
67
  !else
68
    listsheeterror=!replace item number $k by 3 in $listsheeterror
69
    listnoimport=!append item $k to $listnoimport
70
  !endif
15459 bpr 71
!next k
16680 guerimand 72
listsheetimport=!listcomplement $listnoimport in $listsheetimport
15528 guerimand 73
 
15701 guerimand 74
!! ---------- make list of sheet in a class which are in status=0 (can be replaced)
15642 guerimand 75
dropbuttonlink=$empty
76
!for k=0 to $classsheetcnt
77
  t=!record $k of wimshome/log/classes/$wims_class/sheets/.sheets
78
  t=!line 1 of $t
79
  !if $t=0
80
    l=cmd=reply&+module=$module&+job=replace&+type=sheet&+num=IIII&+target=$k $name_sheet $k
81
    dropbuttonlink=!append line $l to $dropbuttonlink 
82
  !endif
83
!next k
84
 
15528 guerimand 85
!! ------------ analyse of document
16098 guerimand 86
!! ---- list of doclink in class
15528 guerimand 87
!reset listclsdoclink listdocpublicnomodule listshdoc
88
!if $docpubliccnt>0
89
  !for k=1 to $classdocpubliccnt
90
     d=!record $k of wimshome/log/classes/$wims_class/doc/.docindex
91
     d=!line 1 of $d
92
     listclsdoclink=!append item $d to $listclsdoclink
93
  !next k
94
  !for k=1 to $docpubliccnt
95
    d=!record $k of wimshome/sessions/$wims_session/upload/class/doc/.docindex
96
    !distribute line $d into d,bl,bl,bl,bl,shd
97
    !if $d notitemof $listclsdoclink
15700 guerimand 98
      d=!nospace $d
15528 guerimand 99
      test=!fileexists wimshome/public_html/modules/$d/var.proc
100
      !if $test!=yes
101
        listdocpublicnomodule=!append item $k to $listdocpublicnomodule
102
      !else
103
        listdocimport=!append item P$k to $listdocimport
104
        !if $shd>0
105
          listshdoc=!append item $k to $listshdoc
106
        !endif
107
      !endif
108
    !endif
109
  !next k
110
!endif
15701 guerimand 111
 
112
!! ------------ analyse of tool
113
!! ---- list of toollink in class
114
!reset listclstool
115
!if $toolcnt>0
116
  !for k=1 to $classtoolcnt
117
     d=!record $k of wimshome/log/classes/$wims_class/tool/.toolindex
118
     d=!line 1 of $d
119
     d=!nospace $d
120
     listclstool=!append item $d to $listclstool
121
  !next k
122
  !for k=1 to $toolcnt
123
    d=!record $k of wimshome/sessions/$wims_session/upload/class/tool/.toolindex
124
    d=!line 1 of $d
125
    d=!nospace $d
126
    !if $d notitemof $listclstool
127
      test=!fileexists wimshome/public_html/modules/$d/var.proc
128
      !if $test!=yes
129
        listtoolnomodule=!append item $k to $listtoolnomodule
130
      !else
131
        listtoolimport=!append item $k to $listtoolimport
132
      !endif
133
    !endif
134
  !next k
135
!endif
136
 
16098 guerimand 137
!! ------------ analyse of freework
138
!reset listclsfreework
139
!!listfreeworkimport=!values v for v=1 to $freeworkcnt
140
!! ---------- make list of freework in a class which are in status=0 (can be replaced)
141
fwdropbuttonlink=$empty
142
!for k=0 to $classfreeworkcnt
143
  t=!record $k of wimshome/log/classes/$wims_class/freeworks/.freeworks
144
  t=!line 1 of $t
145
  !if $t=0
146
    l=cmd=reply&+module=$module&+job=replace&+type=freework&+num=IIII&+target=$k $name_freework $k
147
    fwdropbuttonlink=!append line $l to $fwdropbuttonlink
148
  !endif
149
!next k
15701 guerimand 150