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