Subversion Repositories wimsdev

Rev

Rev 14431 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11804 bpr 1
 
2369 bpr 2
!if $wims_class!=
3
  !read adm/class/classlang names.phtml
4
  !set modu_lang=$moduclass_lang
5
!else
5181 guerimand 6
  !read adm/language lang/names.phtml
2369 bpr 7
!endif
23 reyssat 8
!read defs
8367 bpr 9
 
23 reyssat 10
wims_trustfile=primitives/embed.phtml primitives/fold.phtml \
7237 bpr 11
   primitives/link.phtml primitives/href.phtml primitives/target.phtml \
12
   printlink.proc primitives.phtml \
13
   oef/togetfile.proc
4383 bpr 14
 
23 reyssat 15
wims_nw=job jobsave editable readable doctype doc block docdir Docdir \
16687 guerimand 16
   foldlist filelink sheetdata empty embed_file
23 reyssat 17
wims_nr=wims_sesrandom
8367 bpr 18
 
19
!read docu/docdef
20
 
23 reyssat 21
!if $cmd=help and $special_parm!=about
12490 bpr 22
  job=read
23
  doc=$helpd
24
  block=main
23 reyssat 25
!endif
1407 bpr 26
!if $seq!=
12490 bpr 27
  !set wims_sequence=$seq
1407 bpr 28
!endif
23 reyssat 29
 
30
!bound job within home,auth,auth2,read,print,edit,prop,source,creat,recode,list,\
7237 bpr 31
   erase,openclose,help,file,exosource,transfer default home
23 reyssat 32
readjobs=read source list print exosource
33
editjobs=edit prop erase openclose file
34
!if robot isin $session
12490 bpr 35
  job=home
23 reyssat 36
!endif
37
!read tabletheme
38
!if $job=help
12490 bpr 39
  !exit
23 reyssat 40
!endif
41
 
42
!for i=1 to 20
12490 bpr 43
  m_parm$i=$(parm$i)
44
  parm$i=
23 reyssat 45
!next i
46
 
8367 bpr 47
msg2wims_primitives=if ifval for while\
48
   reload fold ref link docform form resource calcform embed\
7237 bpr 49
   exercise tool doc example help adm tooltip href slib\
14431 bpr 50
   def define comment draw canvasdraw audio glossary
23 reyssat 51
doc=!text select $namechars in $doc
52
block=!text select $namechars in $block
53
Docdir=public_html/bases/doc
54
doctype=doc
55
!if c isin $doc and $wims_class!=$empty
12490 bpr 56
  Docdir=log/classes/$wims_class/doc
57
  doctype=class
58
  !if $wims_user=supervisor
59
    editable=yes
60
    readable=yes
61
  !else
62
    editable=no
63
    readable=yes
64
  !endif
65
  !if $wims_developer!=$empty
66
    transferable=yes
67
  !endif
68
  !if $job=source and $wims_user!=supervisor
69
    job=read
70
  !endif
71
  m_user_login=$wims_user
72
  m_user_lastname=$wims_lastname
73
  m_user_firstname=$wims_firstname
74
  m_class_code=$wims_class
75
!else
23 reyssat 76
  editable=no
77
  readable=yes
78
!endif
79
!if $wims_developer!=$empty and $devdoc!=$empty and c notin $doc
12490 bpr 80
  devdoc=!text select $namechars.-~ in $devdoc
81
  test=!defof tit in wimshome/public_html/modules/devel/$wims_developer/$devdoc/doc/$doc/.def
82
  !if $test!=$empty
83
    Docdir=public_html/modules/devel/$wims_developer/$devdoc/doc
84
    doctype=devel
85
    editable=yes
86
    readable=yes
87
    docopen=yes
88
  !endif
23 reyssat 89
!endif
90
docdir=wimshome/$Docdir
91
wims_priv_docdir=$docdir
92
openlist=!record 0 of $docdir/open.dist
93
opensite=!record 0 of $docdir/open.site
94
openlist=!items2words $openlist $opensite
95
!if robot notin $session
12490 bpr 96
  edlist  =!record 0 of wimshome/$wims_sesdir/doc.$module_language.editable
97
  readlist  =!record 0 of wimshome/$wims_sesdir/doc.$module_language.readable
23 reyssat 98
!endif
99
!default readcnt=0
100
!if $job=creat
12490 bpr 101
  !reset doc,tit,desc,author,email,header
23 reyssat 102
!endif
103
doc=!trim $doc
104
wims_priv_thisdoc=$docdir/$doc
105
!if $doc!=$empty
7235 bpr 106
  !readdef $docdir/.def
8402 bpr 107
  docdir1= !replace internal /doc by in $(docdir)
12490 bpr 108
  !! useful not to change to scripts/docu in $docdir1/var.proc
8403 bpr 109
  docadm=1
110
  !read $docdir1/var.proc
111
  !reset docadm
12490 bpr 112
  ### common_files can be yes now or the address of a datamodule
8402 bpr 113
  !if datamodule isin $common_files
114
    m_filedir=!replace datamodule by modules/data in $common_files
115
  !else
116
    m_filedir=$wims_ref_name?session=$wims_session&+cmd=getfile&+special_parm=doc
117
  !endif
118
 #####what is filelink : create a link to doc in the session
12490 bpr 119
  !if ($filelink!=$Docdir/$doc and $common_files!=yes) or ($filelink!=$Docdir and $common_files=yes)
120
    !if $common_files!=yes
121
      filelink=$Docdir/$doc
122
    !else
123
      filelink=$Docdir
124
    !endif
125
    !sh if [ -d $wims_home/$filelink/files ]; then\
126
     cd $wims_home/$wims_sesdir\
127
     mkdir -p getfile\
128
     cd getfile\
129
    rm -f doc\
130
    ln -s $wims_home/$filelink/files doc\
131
    fi
132
  !endif
133
  !readdef $docdir/$doc/.def
134
  !default docopen=no
135
  !if $tit!=$empty
136
    !default block=main
137
    block=!text select $namechars in $block
138
    block=!char 1 to $namelim of $block
139
    !read $docdir/$doc/$block.def
140
    !if $noedit!=yes and $doctype!=class and \
141
        ($doc iswordof $edlist or $wims_ismanager=2)
142
      editable=yes
143
    !endif
144
    !if $doctype=class and $wims_user!=supervisor
145
      !ifval $docopen=0
146
        readable=no
147
      !endif
148
      !ifval $docopen=2
149
        editable=yes
150
      !endif
151
    !endif
152
    !if $doctype notwordof class devel and \
153
        ($docopen!=yes or $doc notwordof $openlist) and \
154
        $doc notwordof $edlist $readlist and $wims_ismanager<2
155
      readable=no
156
    !endif
7235 bpr 157
  !else
12490 bpr 158
    error=doc_not_exist
159
    !reset doc
7235 bpr 160
  !endif
23 reyssat 161
!endif
162
!if $job!=home
12490 bpr 163
  !if $doctype=class
164
    !set wims_module_log=$job $wims_class/$doc $block
23 reyssat 165
  !else
12490 bpr 166
    !if $doctype=devel
167
      !set wims_module_log=$job $devdoc@$wims_developer $block
168
    !else
169
      !set wims_module_log=$job $doc $block
170
    !endif
23 reyssat 171
  !endif
172
!endif
173
 
174
!if $doc=$empty and $job notwordof home creat
12490 bpr 175
  job=home
23 reyssat 176
!endif
177
 
178
!if $job=erase and $wims_ismanager!=2 and $editable!=yes
12490 bpr 179
  job=home
23 reyssat 180
!endif
181
 
182
!if $job=openclose and \
12490 bpr 183
    ($wims_ismanager!=2 or $doctype iswordof class devel)
184
  job=home
23 reyssat 185
!endif
186
 
187
!if $doctype=class and auth isin $job
12490 bpr 188
  job=home
23 reyssat 189
!endif
190
 
191
!if $doctype=class and \
7237 bpr 192
   (($job iswordof $readjobs and $readable!=yes) or \
193
   ($job iswordof $editjobs and $editable!=yes))
12490 bpr 194
  job=home
195
  error=unauthorized
23 reyssat 196
!endif
197
 
198
!if $job=home and $doctype=devel
12490 bpr 199
  job=read
200
  block=main
23 reyssat 201
!endif
202
 
203
!if $doctype notwordof class devel
12490 bpr 204
  !if $job iswordof $readjobs and $readable!=yes
205
    job=auth1
206
    readauth=yes
207
  !endif
23 reyssat 208
 
12490 bpr 209
  !if $job=auth
210
    !if $editable=yes
211
      job=read
212
    !else
213
      job=auth1
214
    !endif
23 reyssat 215
  !endif
216
 
12490 bpr 217
  !if $editable!=yes and $job iswordof $editjobs
218
    job=auth1
219
  !endif
23 reyssat 220
!endif
221
 
222
!if $doc!=$empty and $job=edit
12490 bpr 223
  !if $doctype!=devel
224
    !read quota.proc
225
    !if $quota_free<0
226
      error=quota
227
      job=read
228
      !changeto read.proc
229
    !endif
23 reyssat 230
  !endif
12490 bpr 231
  !if $rEg!=$empty
232
    job=reg
233
  !endif
234
  !if $preview!=$empty
235
    job=preview
236
  !endif
237
  !if $abandon!=$empty
238
    job=read
239
  !endif
23 reyssat 240
!endif
241
 
242
!if $doc!=$empty and $job=prop
12490 bpr 243
  !if $abandon!=$empty
244
    job=read
245
    block=main
246
    !read $docdir/$doc/main.def
247
  !endif
23 reyssat 248
!endif
10321 bpr 249
!read $job.proc
23 reyssat 250
 
10321 bpr 251
!! document management
252
 
253
!if $module=adm/doc and $doctype=devel and $wims_developer!=$empty
254
  !set wims_ariane_self=no
255
  !set wims_ariane=modtool,1,module=adm/modtool\
256
modcontent,1,module=adm/modtool&jobreq=flist&modreq=$devdoc\
257
docgestion,8
258
!endif