Platform
3.1
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
popupfamdetail.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5
* @package FDL
6
*/
7
/**
8
* Specific menu for family
9
*
10
* @author Anakeen 2000
11
* @version $Id: popupfamdetail.php,v 1.10 2008/11/27 14:18:33 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
* @subpackage
15
*/
16
/**
17
*/
18
19
include_once (
"FDL/popupdoc.php"
);
20
21
function
popupfamdetail
(&
$action
)
22
{
23
$docid
=
GetHttpVars
(
"id"
);
24
if
(
$docid
==
""
)
$action
->exitError(_(
"No identificator"
));
25
$popup =
getpopupfamdetail
(
$action
,
$docid
);
26
27
popupdoc
(
$action
, $popup);
28
}
29
30
function
getpopupfamdetail
(&
$action
,
$docid
)
31
{
32
33
$dbaccess
=
$action
->GetParam(
"FREEDOM_DB"
);
34
$doc
=
new_Doc
(
$dbaccess
,
$docid
);
35
36
if
(
$doc
->isAffected())
$docid
=
$doc
->id;
37
38
$tsubmenu = array();
39
// -------------------- Menu menu ------------------
40
$surl =
$action
->getParam(
"CORE_STANDURL"
);
41
42
$tlink = array(
43
"headers"
=> array(
44
"descr"
=> _(
"Properties"
) ,
45
"url"
=>
"$surl&app=FDL&action=IMPCARD&zone=FDL:VIEWPROPERTIES:T&id=$docid"
,
46
"confirm"
=>
"false"
,
47
"control"
=>
"false"
,
48
"tconfirm"
=>
""
,
49
"target"
=>
"headers"
,
50
"visibility"
=>
POPUP_CTRLACTIVE
,
51
"submenu"
=>
""
,
52
"barmenu"
=>
"false"
53
) ,
54
55
"create"
=> array(
56
"descr"
=> sprintf(_(
"Create %s"
) ,
$doc
->gettitle()) ,
57
"url"
=>
"$surl&app=GENERIC&action=GENERIC_EDIT&classid=$docid"
,
58
"confirm"
=>
"false"
,
59
"control"
=>
"false"
,
60
"tconfirm"
=>
""
,
61
"target"
=>
""
,
62
"visibility"
=>
POPUP_ACTIVE
,
63
"submenu"
=>
""
,
64
"barmenu"
=>
"false"
65
) ,
66
67
"chicon"
=> array(
68
"descr"
=> _(
"Change icon"
) ,
69
"url"
=>
"$surl&app=FREEDOM&action=QUERYFILE&id=$docid"
,
70
"confirm"
=>
"false"
,
71
"control"
=>
"false"
,
72
"tconfirm"
=>
""
,
73
"target"
=>
"_self"
,
74
"visibility"
=>
POPUP_ACTIVE
,
75
"submenu"
=>
""
,
76
"barmenu"
=>
"false"
77
) ,
78
79
"editattr"
=> array(
80
"descr"
=> _(
"Edit attributes"
) ,
81
"url"
=>
"$surl&app=FREEDOM&action=DEFATTR&id=$docid"
,
82
"confirm"
=>
"false"
,
83
"control"
=>
"false"
,
84
"tconfirm"
=>
""
,
85
"target"
=>
""
,
86
"visibility"
=>
POPUP_ACTIVE
,
87
"submenu"
=>
""
,
88
"barmenu"
=>
"false"
89
) ,
90
"editenum"
=> array(
91
"descr"
=> _(
"Edit enum attributes"
) ,
92
"url"
=>
"$surl&app=GENERIC&action=GENERIC_EDITFAMCATG&famid=$docid"
,
93
"confirm"
=>
"false"
,
94
"control"
=>
"false"
,
95
"tconfirm"
=>
""
,
96
"target"
=>
""
,
97
"visibility"
=>
POPUP_ACTIVE
,
98
"submenu"
=>
""
,
99
"barmenu"
=>
"false"
100
) ,
101
"defval"
=> array(
102
"descr"
=> _(
"Set default values"
) ,
103
"url"
=>
"$surl&app=GENERIC&action=GENERIC_EDIT&usefor=D&classid=$docid"
,
104
"confirm"
=>
"false"
,
105
"control"
=>
"false"
,
106
"tconfirm"
=>
""
,
107
"target"
=>
""
,
108
"visibility"
=>
POPUP_ACTIVE
,
109
"submenu"
=>
""
,
110
"barmenu"
=>
"false"
111
) ,
112
"param"
=> array(
113
"descr"
=> _(
"Parameters values"
) ,
114
"url"
=>
"$surl&app=GENERIC&action=GENERIC_EDIT&usefor=Q&classid=$docid"
,
115
"confirm"
=>
"false"
,
116
"control"
=>
"false"
,
117
"tconfirm"
=>
""
,
118
"target"
=>
""
,
119
"visibility"
=>
POPUP_ACTIVE
,
120
"submenu"
=>
""
,
121
"barmenu"
=>
"false"
122
) ,
123
"chgtitle"
=> array(
124
"descr"
=> _(
"Rename"
) ,
125
"url"
=>
"$surl&app=FREEDOM&action=QUERYTITLE&id=$docid"
,
126
"confirm"
=>
"false"
,
127
"control"
=>
"false"
,
128
"tconfirm"
=>
""
,
129
"target"
=>
"_self"
,
130
"visibility"
=>
POPUP_ACTIVE
,
131
"submenu"
=>
""
,
132
"barmenu"
=>
"false"
133
) ,
134
"editprof"
=> array(
135
"descr"
=> _(
"Change profile of family document"
) ,
136
"url"
=>
"$surl&app=FREEDOM&action=EDITPROF&id=$docid"
,
137
"confirm"
=>
"false"
,
138
"control"
=>
"false"
,
139
"tconfirm"
=>
""
,
140
"target"
=>
""
,
141
"visibility"
=>
POPUP_ACTIVE
,
142
"submenu"
=>
"security"
,
143
"barmenu"
=>
"false"
144
) ,
145
"editcprof"
=> array(
146
"descr"
=> _(
"Change profile for new documents"
) ,
147
"url"
=>
"$surl&app=FREEDOM&action=EDITPROF&create=1&id=$docid"
,
148
"confirm"
=>
"false"
,
149
"control"
=>
"false"
,
150
"tconfirm"
=>
""
,
151
"target"
=>
"_self"
,
152
"visibility"
=>
POPUP_ACTIVE
,
153
"submenu"
=>
"security"
,
154
"barmenu"
=>
"false"
155
) ,
156
"editdfld"
=> array(
157
"descr"
=> _(
"Change root folder"
) ,
158
"url"
=>
"$surl&app=FREEDOM&action=EDITDFLD&id=$docid"
,
159
"confirm"
=>
"false"
,
160
"control"
=>
"false"
,
161
"tconfirm"
=>
""
,
162
"target"
=>
"_self"
,
163
"visibility"
=>
POPUP_ACTIVE
,
164
"submenu"
=>
""
,
165
"barmenu"
=>
"false"
166
) ,
167
"editcfld"
=> array(
168
"descr"
=> _(
"Change default search"
) ,
169
"url"
=>
"$surl&app=FREEDOM&action=EDITDFLD¤t=Y&id=$docid"
,
170
"confirm"
=>
"false"
,
171
"control"
=>
"false"
,
172
"tconfirm"
=>
""
,
173
"target"
=>
"_self"
,
174
"visibility"
=>
POPUP_INACTIVE
,
175
"submenu"
=>
""
,
176
"barmenu"
=>
"false"
177
) ,
178
"editwdoc"
=> array(
179
"descr"
=> _(
"Choose workflow"
) ,
180
"url"
=>
"$surl&app=FREEDOM&action=EDITWDOC¤t=Y&id=$docid"
,
181
"confirm"
=>
"false"
,
182
"control"
=>
"false"
,
183
"tconfirm"
=>
""
,
184
"target"
=>
"_self"
,
185
"visibility"
=>
POPUP_ACTIVE
,
186
"submenu"
=>
""
,
187
"barmenu"
=>
"false"
188
) ,
189
190
"histo"
=> array(
191
"descr"
=> _(
"History"
) ,
192
"url"
=>
"$surl&app=FREEDOM&action=HISTO&id=$docid"
,
193
"confirm"
=>
"false"
,
194
"control"
=>
"false"
,
195
"tconfirm"
=>
""
,
196
"target"
=>
""
,
197
"visibility"
=>
POPUP_CTRLACTIVE
,
198
"submenu"
=>
""
,
199
"barmenu"
=>
"false"
200
) ,
201
"access"
=> array(
202
"descr"
=> _(
"goaccess"
) ,
203
"url"
=>
"$surl&app=FREEDOM&action=FREEDOM_GACCESS&id="
.
$doc
->profid,
204
"confirm"
=>
"false"
,
205
"control"
=>
"false"
,
206
"tconfirm"
=>
""
,
207
"target"
=>
""
,
208
"mwidth"
=> 800,
209
"mheight"
=> 300,
210
"visibility"
=>
POPUP_ACTIVE
,
211
"submenu"
=>
"security"
,
212
"barmenu"
=>
"false"
213
) ,
214
"tobasket"
=> array(
215
"descr"
=> _(
"Add to basket"
) ,
216
"url"
=>
"$surl&app=FREEDOM&action=ADDDIRFILE&docid=$docid&dirid="
.
$action
->getParam(
"FREEDOM_IDBASKET"
) ,
217
"confirm"
=>
"false"
,
218
"control"
=>
"false"
,
219
"tconfirm"
=>
""
,
220
"target"
=>
""
,
221
"visibility"
=>
POPUP_CTRLACTIVE
,
222
"submenu"
=>
""
,
223
"barmenu"
=>
"false"
224
) ,
225
"addpostit"
=> array(
226
"descr"
=> _(
"Add postit"
) ,
227
"jsfunction"
=>
"postit('$surl&app=GENERIC&action=GENERIC_EDIT&classid=27&pit_title=&pit_idadoc=$docid',50,50,300,200)"
,
228
"confirm"
=>
"false"
,
229
"control"
=>
"false"
,
230
"tconfirm"
=>
""
,
231
"target"
=>
""
,
232
"visibility"
=>
POPUP_CTRLACTIVE
,
233
"submenu"
=>
""
,
234
"barmenu"
=>
"false"
235
) ,
236
"forumenabled"
=> array(
237
"descr"
=> _(
"enable forum"
) ,
238
"url"
=>
"$surl&app=FREEDOM&action=FORUM_SETDEFAULT&id=$docid&st=Y"
,
239
"confirm"
=>
"false"
,
240
"control"
=>
"false"
,
241
"tconfirm"
=>
""
,
242
"target"
=>
"_self"
,
243
"visibility"
=>
POPUP_INACTIVE
,
244
"submenu"
=>
""
,
245
"barmenu"
=>
"false"
246
) ,
247
"forumdisabled"
=> array(
248
"descr"
=> _(
"disable forum"
) ,
249
"url"
=>
"$surl&app=FREEDOM&action=FORUM_SETDEFAULT&id=$docid&st=N"
,
250
"confirm"
=>
"false"
,
251
"control"
=>
"false"
,
252
"tconfirm"
=>
""
,
253
"target"
=>
"_self"
,
254
"visibility"
=>
POPUP_INACTIVE
,
255
"submenu"
=>
""
,
256
"barmenu"
=>
"false"
257
) ,
258
"exportpref"
=> array(
259
"descr"
=> _(
"export preferences"
) ,
260
"url"
=>
"$surl&app=FREEDOM&action=EDITEXPORTCHOOSECOLS&id=$docid"
,
261
"confirm"
=>
"false"
,
262
"control"
=>
"false"
,
263
"tconfirm"
=>
""
,
264
"target"
=>
"exportpref"
,
265
"visibility"
=>
POPUP_CTRLACTIVE
,
266
"submenu"
=>
""
,
267
"barmenu"
=>
"false"
268
) ,
269
"edithelp"
=> array(
270
"descr"
=> _(
"create help"
) ,
271
"url"
=>
"$surl&app=GENERIC&action=GENERIC_EDIT&classid=HELPPAGE&help_family=$docid"
,
272
"confirm"
=>
"false"
,
273
"control"
=>
"false"
,
274
"tconfirm"
=>
""
,
275
"target"
=>
"edithelp"
,
276
"visibility"
=>
POPUP_ACTIVE
,
277
"submenu"
=>
""
,
278
"barmenu"
=>
"false"
279
)
280
);
281
282
changeFamMenuVisibility
(
$action
, $tlink,
$doc
);
283
284
return
$tlink;
285
}
286
/**
287
* Add control view menu
288
*/
289
function
changeFamMenuVisibility
(&
$action
, &$tlink, &
$doc
)
290
{
291
$clf = (
$doc
->CanEdit() ==
""
);
292
293
if
(
getParam
(
"FREEDOM_IDBASKET"
) == 0) $tlink[
"tobasket"
][
"visibility"
] =
POPUP_INVISIBLE
;
294
295
if
(
$doc
->IsControlled() && (
$doc
->profid > 0) && (
$doc
->Control(
"viewacl"
) ==
""
)) {
296
$tlink[
"access"
][
"visibility"
] =
POPUP_ACTIVE
;
297
}
else
{
298
$tlink[
"access"
][
"visibility"
] =
POPUP_INVISIBLE
;
299
}
300
301
if
(
$doc
->Control(
"modifyacl"
) ==
""
) {
302
$tlink[
"editprof"
][
"visibility"
] =
POPUP_ACTIVE
;
303
}
else
{
304
$tlink[
"editprof"
][
"visibility"
] =
POPUP_INACTIVE
;
305
}
306
307
$param
=
$doc
->getParamAttributes();
308
if
(count(
$param
) == 0) $tlink[
"param"
][
"visibility"
] =
POPUP_INVISIBLE
;
309
310
if
(
$doc
->locked == - 1) {
// fixed document
311
if
(
$doc
->doctype !=
'Z'
) $tlink[
"latest"
][
"visibility"
] =
POPUP_ACTIVE
;
312
$tlink[
"editdoc"
][
"visibility"
] =
POPUP_INVISIBLE
;
313
$tlink[
"delete"
][
"visibility"
] =
POPUP_INVISIBLE
;
314
$tlink[
"editprof"
][
"visibility"
] =
POPUP_INVISIBLE
;
315
$tlink[
"revise"
][
"visibility"
] =
POPUP_INVISIBLE
;
316
$tlink[
"lockdoc"
][
"visibility"
] =
POPUP_INVISIBLE
;
317
}
318
319
if
(
$doc
->dfldid !=
""
) {
320
$tlink[
"editcfld"
][
"visibility"
] =
POPUP_ACTIVE
;
321
}
322
323
if
(
$doc
->postitid > 0) $tlink[
"addpostit"
][
"visibility"
] =
POPUP_INVISIBLE
;
324
else
$tlink[
"addpostit"
][
"visibility"
] =
POPUP_CTRLACTIVE
;
325
326
if
(!$clf) {
327
// actions not available
328
$tlink[
"defval"
][
"visibility"
] =
POPUP_INVISIBLE
;
329
$tlink[
"editattr"
][
"visibility"
] =
POPUP_INVISIBLE
;
330
$tlink[
"editenum"
][
"visibility"
] =
POPUP_INVISIBLE
;
331
$tlink[
"chicon"
][
"visibility"
] =
POPUP_INVISIBLE
;
332
$tlink[
"param"
][
"visibility"
] =
POPUP_INVISIBLE
;
333
$tlink[
"chgtitle"
][
"visibility"
] =
POPUP_INVISIBLE
;
334
$tlink[
"editprof"
][
"visibility"
] =
POPUP_INVISIBLE
;
335
$tlink[
"editcprof"
][
"visibility"
] =
POPUP_INVISIBLE
;
336
$tlink[
"editdfld"
][
"visibility"
] =
POPUP_INVISIBLE
;
337
$tlink[
"editcfld"
][
"visibility"
] =
POPUP_INVISIBLE
;
338
$tlink[
"editwdoc"
][
"visibility"
] =
POPUP_INVISIBLE
;
339
}
340
if
(!
$action
->parent->Haspermission(
"FREEDOM_READ"
,
"FREEDOM"
)) {
341
$tlink[
"histo"
][
"visibility"
] =
POPUP_INVISIBLE
;
342
}
343
344
if
(
$doc
->forumid ==
""
) {
345
$tlink[
"forumdisabled"
][
"visibility"
] =
POPUP_INVISIBLE
;
346
$tlink[
"forumenabled"
][
"visibility"
] =
POPUP_CTRLACTIVE
;
347
}
else
{
348
$tlink[
"forumdisabled"
][
"visibility"
] =
POPUP_CTRLACTIVE
;
349
$tlink[
"forumenabled"
][
"visibility"
] =
POPUP_INVISIBLE
;
350
}
351
include_once (
"FDL/Class.SearchDoc.php"
);
352
$s
=
new
SearchDoc
(
$doc
->dbaccess,
"HELPPAGE"
);
353
$s
->addFilter(
"help_family='%d'"
,
$doc
->id);
354
$help =
$s
->search();
355
if
(
$s
->count() > 0) {
356
$tlink[
"edithelp"
][
"descr"
] = _(
"modify family help"
);
357
$helpid = $help[0][
"id"
];
358
$tlink[
"edithelp"
][
"url"
] =
"?app=GENERIC&action=GENERIC_EDIT&id=$helpid"
;
359
}
360
}
361
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase