dolibarr  9.0.0
modECM.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
26 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
27 
28 
32 class modECM extends DolibarrModules
33 {
34 
40  function __construct($db)
41  {
42  $this->db = $db;
43 
44  // Id for module (must be unique).
45  // Use here a free id.
46  $this->numero = 2500;
47 
48  // Family can be 'crm','financial','hr','projects','product','ecm','technic','other'
49  // It is used to sort modules in module setup page
50  $this->family = "ecm";
51  $this->module_position = '10';
52  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
53  $this->name = preg_replace('/^mod/i','',get_class($this));
54  // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
55  $this->description = "Electronic Content Management";
56  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
57  $this->version = 'dolibarr';
58  // Key used in llx_const table to save module status enabled/disabled (XXX is id value)
59  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
60  // Name of png file (without png) used for this module
61  $this->picto='dir';
62 
63  // Data directories to create when module is enabled
64  $this->dirs = array("/ecm/temp");
65 
66  // Config pages. Put here list of php page names stored in admmin directory used to setup module
67  $this->config_page_url = array('ecm.php');
68 
69  // Dependencies
70  $this->depends = array(); // List of modules id that must be enabled if this module is enabled
71  $this->requiredby = array(); // List of modules id to disable if this one is disabled
72 
73  // Constants
74  $this->const = array(); // List of parameters
75  $r=0;
76 
77  $this->const[$r][0] = "ECM_AUTO_TREE_ENABLED";
78  $this->const[$r][1] = "chaine";
79  $this->const[$r][2] = "1";
80  $this->const[$r][3] = 'Auto tree is enabled by default';
81  $this->const[$r][4] = 0;
82 
83  // Boxes
84  $this->boxes = array(); // List of boxes
85  $r=0;
86 
87  // Add here list of php file(s) stored in core/boxes that contains class to show a box.
88  // Example:
89  //$this->boxes[$r][1] = "myboxa.php";
90  //$r++;
91  //$this->boxes[$r][1] = "myboxb.php";
92  //$r++;
93 
94  // Permissions
95  $this->rights_class = 'ecm'; // Permission key
96  $this->rights = array(); // Permission array used by this module
97 
98  $r++;
99  $this->rights[$r][0] = 2501;
100  $this->rights[$r][1] = 'Consulter/Télécharger les documents';
101  $this->rights[$r][2] = 'r';
102  $this->rights[$r][3] = 0;
103  $this->rights[$r][4] = 'read';
104 
105  $r++;
106  $this->rights[$r][0] = 2503;
107  $this->rights[$r][1] = 'Soumettre ou supprimer des documents';
108  $this->rights[$r][2] = 'w';
109  $this->rights[$r][3] = 0;
110  $this->rights[$r][4] = 'upload';
111 
112  $r++;
113  $this->rights[$r][0] = 2515;
114  $this->rights[$r][1] = 'Administrer les rubriques de documents';
115  $this->rights[$r][2] = 'w';
116  $this->rights[$r][3] = 0;
117  $this->rights[$r][4] = 'setup';
118 
119 
120  // Menus
121  //------
122  $this->menus = array(); // List of menus to add
123  $r=0;
124 
125  // Top menu
126  $this->menu[$r]=array('fk_menu'=>0,
127  'type'=>'top',
128  'titre'=>'MenuECM',
129  'mainmenu'=>'ecm',
130  'url'=>'/ecm/index.php',
131  'langs'=>'ecm',
132  'position'=>82,
133  'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup',
134  'enabled'=>'$conf->ecm->enabled',
135  'target'=>'',
136  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
137  $r++;
138 
139  // Left menu linked to top menu
140  $this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm',
141  'type'=>'left',
142  'titre'=>'ECMArea',
143  'mainmenu'=>'ecm',
144  'leftmenu'=>'ecm',
145  'url'=>'/ecm/index.php?mainmenu=ecm&leftmenu=ecm',
146  'langs'=>'ecm',
147  'position'=>101,
148  'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
149  'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
150  'target'=>'',
151  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
152  $r++;
153 
154  $this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm',
155  'type'=>'left',
156  'titre'=>'ECMSectionsManual',
157  'mainmenu'=>'ecm',
158  'leftmenu'=>'ecm_manual',
159  'url'=>'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm',
160  'langs'=>'ecm',
161  'position'=>102,
162  'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
163  'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
164  'target'=>'',
165  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
166  $r++;
167 
168  $this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm',
169  'type'=>'left',
170  'titre'=>'ECMSectionsAuto',
171  'mainmenu'=>'ecm',
172  'url'=>'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm',
173  'langs'=>'ecm',
174  'position'=>103,
175  'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
176  'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)',
177  'target'=>'',
178  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
179  $r++;
180  }
181 }
182 
Class DolibarrModules.
Description and activation class for module ECM.
</td >< td class="liste_titre" align="right"></td ></tr >< tr class="liste_titre">< input type="checkbox" onClick="toggle(this)"/> Ref p ref Label p label Duration p duration warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow img yes disabled img no img no< tr class="oddeven">< td >< input type="checkbox" class="check" name="' . $i . '"' . $disabled . '></td >< td >< input type="checkbox" class="check" name="choose'.$i.'"></td >< td class="nowrap"></td >< td >< input type="hidden" name="desc' . $i . '" value="' . dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:573
__construct($db)
Constructor.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103