dolibarr  7.0.0-beta
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  // Where to store the module in setup page (0=common,1=interface,2=other)
61  $this->special = 0;
62  // Name of png file (without png) used for this module
63  $this->picto='dir';
64 
65  // Data directories to create when module is enabled
66  $this->dirs = array("/ecm/temp");
67 
68  // Config pages. Put here list of php page names stored in admmin directory used to setup module
69  $this->config_page_url = array('ecm.php');
70 
71  // Dependencies
72  $this->depends = array(); // List of modules id that must be enabled if this module is enabled
73  $this->requiredby = array(); // List of modules id to disable if this one is disabled
74 
75  // Constants
76  $this->const = array(); // List of parameters
77  $r=0;
78 
79  $this->const[$r][0] = "ECM_AUTO_TREE_ENABLED";
80  $this->const[$r][1] = "chaine";
81  $this->const[$r][2] = "1";
82  $this->const[$r][3] = 'Auto tree is enabled by default';
83  $this->const[$r][4] = 0;
84 
85  // Boxes
86  $this->boxes = array(); // List of boxes
87  $r=0;
88 
89  // Add here list of php file(s) stored in core/boxes that contains class to show a box.
90  // Example:
91  //$this->boxes[$r][1] = "myboxa.php";
92  //$r++;
93  //$this->boxes[$r][1] = "myboxb.php";
94  //$r++;
95 
96  // Permissions
97  $this->rights_class = 'ecm'; // Permission key
98  $this->rights = array(); // Permission array used by this module
99 
100  $r++;
101  $this->rights[$r][0] = 2501;
102  $this->rights[$r][1] = 'Consulter/Télécharger les documents';
103  $this->rights[$r][2] = 'r';
104  $this->rights[$r][3] = 0;
105  $this->rights[$r][4] = 'read';
106 
107  $r++;
108  $this->rights[$r][0] = 2503;
109  $this->rights[$r][1] = 'Soumettre ou supprimer des documents';
110  $this->rights[$r][2] = 'w';
111  $this->rights[$r][3] = 0;
112  $this->rights[$r][4] = 'upload';
113 
114  $r++;
115  $this->rights[$r][0] = 2515;
116  $this->rights[$r][1] = 'Administrer les rubriques de documents';
117  $this->rights[$r][2] = 'w';
118  $this->rights[$r][3] = 0;
119  $this->rights[$r][4] = 'setup';
120 
121 
122  // Menus
123  //------
124  $this->menus = array(); // List of menus to add
125  $r=0;
126 
127  // Top menu
128  $this->menu[$r]=array('fk_menu'=>0,
129  'type'=>'top',
130  'titre'=>'MenuECM',
131  'mainmenu'=>'ecm',
132  'url'=>'/ecm/index.php',
133  'langs'=>'ecm',
134  'position'=>100,
135  'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup',
136  'enabled'=>'$conf->ecm->enabled',
137  'target'=>'',
138  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
139  $r++;
140 
141  // Left menu linked to top menu
142  $this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm',
143  'type'=>'left',
144  'titre'=>'ECMArea',
145  'mainmenu'=>'ecm',
146  'leftmenu'=>'ecm',
147  'url'=>'/ecm/index.php?mainmenu=ecm&leftmenu=ecm',
148  'langs'=>'ecm',
149  'position'=>101,
150  'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
151  'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
152  'target'=>'',
153  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
154  $r++;
155 
156  $this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm',
157  'type'=>'left',
158  'titre'=>'ECMSectionsManual',
159  'mainmenu'=>'ecm',
160  'leftmenu'=>'ecm_manual',
161  'url'=>'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm',
162  'langs'=>'ecm',
163  'position'=>102,
164  'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
165  'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
166  'target'=>'',
167  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
168  $r++;
169 
170  $this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm',
171  'type'=>'left',
172  'titre'=>'ECMSectionsAuto',
173  'mainmenu'=>'ecm',
174  'url'=>'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm',
175  'langs'=>'ecm',
176  'position'=>103,
177  'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
178  'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)',
179  'target'=>'',
180  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
181  $r++;
182  }
183 }
184 
Class DolibarrModules.
Description and activation class for module ECM.
</td >< tdclass="liste_titre"align="right"></td ></tr >< trclass="liste_titre">< inputtype="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< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="'.$i.'"'.$disabled.'></td >< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"></td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:554
__construct($db)
Constructor.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104