Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
folder_barmenu.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  * Folder barmenu
9  *
10  * @author Anakeen 2000
11  * @version $Id: folder_barmenu.php,v 1.16 2007/10/15 13:01:06 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage GED
15  */
16 /**
17  */
18 
19 include_once ("FDL/Class.Dir.php");
20 include_once ("FDL/Class.QueryDir.php");
21 include_once ("FDL/freedom_util.php");
22 
23 include_once ("FDL/popup_util.php");
24 // -----------------------------------
26 {
27  // -----------------------------------
28  // Get all the params
29  $nbdoc = GetHttpVars("nbdoc");
30  $dirid = GetHttpVars("dirid");
31  $target = GetHttpVars("target"); // target for hyperlinks
32  $dbaccess = $action->GetParam("FREEDOM_DB");
33 
34  $dir = new_Doc($dbaccess, $dirid);
35 
36  $action->lay->Set("wtarget", $target);
37  $action->lay->set("title", $dir->getTitle());
38  $action->lay->set("pds", $dir->urlWhatEncodeSpec("")); // parameters for searches
39  if ($nbdoc > 1) $action->lay->set("nbdoc", sprintf(_("%d documents") , $nbdoc));
40  else $action->lay->set("nbdoc", sprintf(_("%d document") , $nbdoc));
41 
42  $action->lay->set("dirid", $dirid);
43  $tarch = array();
44  $toolmenu = array(
45  'tobasket',
46  'insertbasket',
47  'clear',
48  'props',
49  'openfolio',
50  'applybatch',
51  'export',
52  'insert'
53  );
54  if ($dir->fromname != "ARCHIVING") { // no archive archive
55  include_once ("FDL/Class.SearchDoc.php");
56  $s = new SearchDoc($dir->dbaccess, "ARCHIVING");
57  $s->setObjectReturn();
58  $s->addFilter("arc_status = 'O'");
59  $s->search();
60  if ($s->count() > 0) {
61  while ($archive = $s->nextDoc()) {
62  if ($archive->control("modify") == "") {
63  $toolmenu[] = "arch" . $archive->id;
64  $tarch[] = array(
65  "archid" => $archive->id,
66  "archtitle" => sprintf(_("Insert all into %s archive") , $archive->getTitle())
67  );
68  }
69  }
70  }
71  $action->lay->setBlockdata("ARCH", $tarch);
72  }
73 
74  popupInit("viewmenu", array(
75  'vlist',
76  'vicon',
77  'vcol',
78  'vdetail'
79  ));
80  popupInit("toolmenu", $toolmenu);
81  foreach ($tarch as $arch) {
82  popupActive("toolmenu", 1, "arch" . $arch["archid"]);
83  }
84  popupActive("viewmenu", 1, 'vlist');
85  popupActive("viewmenu", 1, 'vicon');
86  popupActive("viewmenu", 1, 'vcol');
87  popupActive("viewmenu", 1, 'vdetail');
88  // clear only for basket :: too dangerous
89  if (($dir->fromid == getFamIdFromName($dbaccess, "BASKET")) || ($dir->fromid == getFamIdFromName($dbaccess, "ARCHIVING"))) {
90  popupInvisible("toolmenu", 1, 'tobasket');
91  popupInvisible("toolmenu", 1, 'insertbasket');
92  popupActive("toolmenu", 1, 'clear');
93  } else {
94  popupActive("toolmenu", 1, 'tobasket');
95  if ($dir->defDoctype != 'D') popupInvisible("toolmenu", 1, 'insertbasket');
96  else {
97  popupActive("toolmenu", 1, 'insertbasket');
98  popupActive("toolmenu", 1, 'insert');
99  }
100  popupInvisible("toolmenu", 1, 'clear');
101  }
102  if ($dir->initid == 10) {
103  popupActive("toolmenu", 1, 'clear'); // import folder
104 
105  }
106  popupActive("toolmenu", 1, 'props');
107  popupActive("toolmenu", 1, 'openfolio');
108  if ($action->HasPermission("FREEDOM_ADMIN")) {
109  popupActive("toolmenu", 1, 'applybatch');
110  }
111  if ($action->HasPermission("EXPORT", "FDL")) {
112  popupActive("toolmenu", 1, 'export');
113  }
114 
115  popupGen(1);
116 }
117 ?>
← centre documentaire © anakeen - published under CC License - Dynacase