dolibarr 19.0.3
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-2020 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 <https://www.gnu.org/licenses/>.
17 */
18
28include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
29
30
35{
41 public function __construct($db)
42 {
43 $this->db = $db;
44
45 // Id for module (must be unique).
46 // Use here a free id.
47 $this->numero = 2500;
48
49 // Family can be 'crm','financial','hr','projects','product','ecm','technic','other'
50 // It is used to sort modules in module setup page
51 $this->family = "ecm";
52 $this->module_position = '10';
53 // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
54 $this->name = preg_replace('/^mod/i', '', get_class($this));
55 // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
56 $this->description = "Electronic Content Management";
57 // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
58 $this->version = 'dolibarr';
59 // Key used in llx_const table to save module status enabled/disabled (XXX is id value)
60 $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
61 // Name of png file (without png) used for this module
62 $this->picto = 'folder-open';
63
64 // Data directories to create when module is enabled
65 $this->dirs = array("/ecm/temp");
66
67 // Config pages. Put here list of php page names stored in admmin directory used to setup module
68 $this->config_page_url = array('ecm.php');
69
70 // Dependencies
71 $this->depends = array(); // List of modules id that must be enabled if this module is enabled
72 $this->requiredby = array(); // List of modules id to disable if this one is disabled
73
74 // Constants
75 $this->const = array(); // List of parameters
76 $r = 0;
77
78 // Boxes
79 $this->boxes = array(); // List of boxes
80 $r = 0;
81
82 // Add here list of php file(s) stored in core/boxes that contains class to show a box.
83 // Example:
84 //$this->boxes[$r][1] = "myboxa.php";
85 //$r++;
86 //$this->boxes[$r][1] = "myboxb.php";
87 //$r++;
88
89 // Permissions
90 $this->rights_class = 'ecm'; // Permission key
91 $this->rights = array(); // Permission array used by this module
92
93 $r++;
94 $this->rights[$r][0] = 2501;
95 $this->rights[$r][1] = 'Read or download documents';
96 $this->rights[$r][2] = 'r';
97 $this->rights[$r][3] = 0;
98 $this->rights[$r][4] = 'read';
99
100 $r++;
101 $this->rights[$r][0] = 2503;
102 $this->rights[$r][1] = 'Upload a document';
103 $this->rights[$r][2] = 'w';
104 $this->rights[$r][3] = 0;
105 $this->rights[$r][4] = 'upload';
106
107 $r++;
108 $this->rights[$r][0] = 2515;
109 $this->rights[$r][1] = 'Administer directories of documents';
110 $this->rights[$r][2] = 'w';
111 $this->rights[$r][3] = 0;
112 $this->rights[$r][4] = 'setup';
113
114
115 // Menus
116 //------
117 $this->menu = array(); // List of menus to add
118 $r = 0;
119
120 // Top menu
121 $this->menu[$r] = array(
122 'fk_menu'=>0,
123 'type'=>'top',
124 'titre'=>'MenuECM',
125 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'),
126 'mainmenu'=>'ecm',
127 'url'=>'/ecm/index.php',
128 'langs'=>'ecm',
129 'position'=>82,
130 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup',
131 'enabled'=>'isModEnabled("ecm")',
132 'target'=>'',
133 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
134 );
135 $r++;
136
137 // Left menu linked to top menu
138 $this->menu[$r] = array(
139 'fk_menu'=>'fk_mainmenu=ecm',
140 'type'=>'left',
141 'titre'=>'ECMArea',
142 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
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 );
153 $r++;
154
155 $this->menu[$r] = array(
156 '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 );
169 $r++;
170
171 $this->menu[$r] = array(
172 'fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm',
173 'type'=>'left',
174 'titre'=>'ECMSectionsAuto',
175 'mainmenu'=>'ecm',
176 'url'=>'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm',
177 'langs'=>'ecm',
178 'position'=>103,
179 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
180 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && !getDolGlobalInt("ECM_AUTO_TREE_HIDEN")',
181 'target'=>'',
182 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
183 );
184 $r++;
185
186 $this->menu[$r] = array(
187 'fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm',
188 'type'=>'left',
189 'titre'=>'ECMSectionsMedias',
190 'mainmenu'=>'ecm',
191 'url'=>'/ecm/index_medias.php?action=file_manager&mainmenu=ecm&leftmenu=ecm',
192 'langs'=>'ecm',
193 'position'=>104,
194 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
195 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && getDolGlobalInt("MAIN_FEATURES_LEVEL") == 2',
196 'target'=>'',
197 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
198 );
199 $r++;
200 }
201}
Class DolibarrModules.
Description and activation class for module ECM.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:124