Rev 16687 | 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 |
||
16693 | guerimand | 79 | |
80 | !! add to index fold with number instead of filename |
||
81 | !if $filelist=$empty |
||
82 | nb=!recordcnt wimshome/$Docdir/$doc/.index |
||
83 | !for i=1 to $nb |
||
84 | l=!record $i of wimshome/$Docdir/$doc/.index |
||
85 | l=!line 1 of $l |
||
86 | filelist=!append item $l to $filelist |
||
87 | !next i |
||
88 | !endif |
||
89 | |||
23 | reyssat | 90 | !if $wims_developer!=$empty and $devdoc!=$empty and c notin $doc |
12490 | bpr | 91 | devdoc=!text select $namechars.-~ in $devdoc |
92 | test=!defof tit in wimshome/public_html/modules/devel/$wims_developer/$devdoc/doc/$doc/.def |
||
93 | !if $test!=$empty |
||
94 | Docdir=public_html/modules/devel/$wims_developer/$devdoc/doc |
||
95 | doctype=devel |
||
96 | editable=yes |
||
97 | readable=yes |
||
98 | docopen=yes |
||
99 | !endif |
||
23 | reyssat | 100 | !endif |
101 | docdir=wimshome/$Docdir |
||
102 | wims_priv_docdir=$docdir |
||
103 | openlist=!record 0 of $docdir/open.dist |
||
104 | opensite=!record 0 of $docdir/open.site |
||
105 | openlist=!items2words $openlist $opensite |
||
106 | !if robot notin $session |
||
12490 | bpr | 107 | edlist =!record 0 of wimshome/$wims_sesdir/doc.$module_language.editable |
108 | readlist =!record 0 of wimshome/$wims_sesdir/doc.$module_language.readable |
||
23 | reyssat | 109 | !endif |
110 | !default readcnt=0 |
||
111 | !if $job=creat |
||
12490 | bpr | 112 | !reset doc,tit,desc,author,email,header |
23 | reyssat | 113 | !endif |
114 | doc=!trim $doc |
||
115 | wims_priv_thisdoc=$docdir/$doc |
||
116 | !if $doc!=$empty |
||
7235 | bpr | 117 | !readdef $docdir/.def |
8402 | bpr | 118 | docdir1= !replace internal /doc by in $(docdir) |
12490 | bpr | 119 | !! useful not to change to scripts/docu in $docdir1/var.proc |
8403 | bpr | 120 | docadm=1 |
121 | !read $docdir1/var.proc |
||
122 | !reset docadm |
||
12490 | bpr | 123 | ### common_files can be yes now or the address of a datamodule |
8402 | bpr | 124 | !if datamodule isin $common_files |
125 | m_filedir=!replace datamodule by modules/data in $common_files |
||
126 | !else |
||
127 | m_filedir=$wims_ref_name?session=$wims_session&+cmd=getfile&+special_parm=doc |
||
128 | !endif |
||
129 | #####what is filelink : create a link to doc in the session |
||
12490 | bpr | 130 | !if ($filelink!=$Docdir/$doc and $common_files!=yes) or ($filelink!=$Docdir and $common_files=yes) |
131 | !if $common_files!=yes |
||
132 | filelink=$Docdir/$doc |
||
133 | !else |
||
134 | filelink=$Docdir |
||
135 | !endif |
||
136 | !sh if [ -d $wims_home/$filelink/files ]; then\ |
||
137 | cd $wims_home/$wims_sesdir\ |
||
138 | mkdir -p getfile\ |
||
139 | cd getfile\ |
||
140 | rm -f doc\ |
||
141 | ln -s $wims_home/$filelink/files doc\ |
||
142 | fi |
||
143 | !endif |
||
144 | !readdef $docdir/$doc/.def |
||
145 | !default docopen=no |
||
146 | !if $tit!=$empty |
||
147 | !default block=main |
||
148 | block=!text select $namechars in $block |
||
149 | block=!char 1 to $namelim of $block |
||
150 | !read $docdir/$doc/$block.def |
||
151 | !if $noedit!=yes and $doctype!=class and \ |
||
152 | ($doc iswordof $edlist or $wims_ismanager=2) |
||
153 | editable=yes |
||
154 | !endif |
||
155 | !if $doctype=class and $wims_user!=supervisor |
||
156 | !ifval $docopen=0 |
||
157 | readable=no |
||
158 | !endif |
||
159 | !ifval $docopen=2 |
||
160 | editable=yes |
||
161 | !endif |
||
162 | !endif |
||
163 | !if $doctype notwordof class devel and \ |
||
164 | ($docopen!=yes or $doc notwordof $openlist) and \ |
||
165 | $doc notwordof $edlist $readlist and $wims_ismanager<2 |
||
166 | readable=no |
||
167 | !endif |
||
7235 | bpr | 168 | !else |
12490 | bpr | 169 | error=doc_not_exist |
170 | !reset doc |
||
7235 | bpr | 171 | !endif |
23 | reyssat | 172 | !endif |
173 | !if $job!=home |
||
12490 | bpr | 174 | !if $doctype=class |
175 | !set wims_module_log=$job $wims_class/$doc $block |
||
23 | reyssat | 176 | !else |
12490 | bpr | 177 | !if $doctype=devel |
178 | !set wims_module_log=$job $devdoc@$wims_developer $block |
||
179 | !else |
||
180 | !set wims_module_log=$job $doc $block |
||
181 | !endif |
||
23 | reyssat | 182 | !endif |
183 | !endif |
||
184 | |||
185 | !if $doc=$empty and $job notwordof home creat |
||
12490 | bpr | 186 | job=home |
23 | reyssat | 187 | !endif |
188 | |||
189 | !if $job=erase and $wims_ismanager!=2 and $editable!=yes |
||
12490 | bpr | 190 | job=home |
23 | reyssat | 191 | !endif |
192 | |||
193 | !if $job=openclose and \ |
||
12490 | bpr | 194 | ($wims_ismanager!=2 or $doctype iswordof class devel) |
195 | job=home |
||
23 | reyssat | 196 | !endif |
197 | |||
198 | !if $doctype=class and auth isin $job |
||
12490 | bpr | 199 | job=home |
23 | reyssat | 200 | !endif |
201 | |||
202 | !if $doctype=class and \ |
||
7237 | bpr | 203 | (($job iswordof $readjobs and $readable!=yes) or \ |
204 | ($job iswordof $editjobs and $editable!=yes)) |
||
12490 | bpr | 205 | job=home |
206 | error=unauthorized |
||
23 | reyssat | 207 | !endif |
208 | |||
209 | !if $job=home and $doctype=devel |
||
12490 | bpr | 210 | job=read |
211 | block=main |
||
23 | reyssat | 212 | !endif |
213 | |||
214 | !if $doctype notwordof class devel |
||
12490 | bpr | 215 | !if $job iswordof $readjobs and $readable!=yes |
216 | job=auth1 |
||
217 | readauth=yes |
||
218 | !endif |
||
23 | reyssat | 219 | |
12490 | bpr | 220 | !if $job=auth |
221 | !if $editable=yes |
||
222 | job=read |
||
223 | !else |
||
224 | job=auth1 |
||
225 | !endif |
||
23 | reyssat | 226 | !endif |
227 | |||
12490 | bpr | 228 | !if $editable!=yes and $job iswordof $editjobs |
229 | job=auth1 |
||
230 | !endif |
||
23 | reyssat | 231 | !endif |
232 | |||
233 | !if $doc!=$empty and $job=edit |
||
12490 | bpr | 234 | !if $doctype!=devel |
235 | !read quota.proc |
||
236 | !if $quota_free<0 |
||
237 | error=quota |
||
238 | job=read |
||
239 | !changeto read.proc |
||
240 | !endif |
||
23 | reyssat | 241 | !endif |
12490 | bpr | 242 | !if $rEg!=$empty |
243 | job=reg |
||
244 | !endif |
||
245 | !if $preview!=$empty |
||
246 | job=preview |
||
247 | !endif |
||
248 | !if $abandon!=$empty |
||
249 | job=read |
||
250 | !endif |
||
23 | reyssat | 251 | !endif |
252 | |||
253 | !if $doc!=$empty and $job=prop |
||
12490 | bpr | 254 | !if $abandon!=$empty |
255 | job=read |
||
256 | block=main |
||
257 | !read $docdir/$doc/main.def |
||
258 | !endif |
||
23 | reyssat | 259 | !endif |
10321 | bpr | 260 | !read $job.proc |
23 | reyssat | 261 | |
10321 | bpr | 262 | !! document management |
263 | |||
264 | !if $module=adm/doc and $doctype=devel and $wims_developer!=$empty |
||
265 | !set wims_ariane_self=no |
||
266 | !set wims_ariane=modtool,1,module=adm/modtool\ |
||
267 | modcontent,1,module=adm/modtool&jobreq=flist&modreq=$devdoc\ |
||
268 | docgestion,8 |
||
269 | !endif |