dolibarr  17.0.4
modCollab.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
25 include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
26 
27 
32 {
33 
39  public function __construct($db)
40  {
41  global $langs, $conf;
42 
43  $this->db = $db;
44  $this->numero = 30000;
45 
46  // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
47  // It is used to group modules in module setup page
48  $this->family = "portal";
49  $this->module_position = '51';
50  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
51  $this->name = preg_replace('/^mod/i', '', get_class($this));
52  $this->description = "Enable the public collaboration features, like shared pad, shared online sheets, etc...";
53  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
54  $this->version = 'development';
55  // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
56  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
57  // Name of image file used for this module.
58  $this->picto = 'collab';
59 
60  // Data directories to create when module is enabled
61  $this->dirs = array("/collab/temp");
62 
63  // Config pages
64  //-------------
65  $this->config_page_url = array(/*'collab.php'*/);
66 
67  // Dependancies
68  //-------------
69  $this->hidden = !empty($conf->global->MODULE_COLLAB_DISABLED); // A condition to disable module
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  $this->conflictwith = array(); // List of modules id this module is in conflict with
73  $this->langfiles = array("collab");
74 
75  // Constants
76  //-----------
77  $this->const = array();
78 
79  // New pages on tabs
80  // -----------------
81  $this->tabs = array();
82 
83  // Boxes
84  //------
85  $this->boxes = array();
86 
87  // Permissions
88  $this->rights = array(); // Permission array used by this module
89  $this->rights_class = 'collab';
90  $r = 0;
91 
92  /*$this->rights[$r][0] = 30001;
93  $this->rights[$r][1] = 'Read website content';
94  $this->rights[$r][3] = 0;
95  $this->rights[$r][4] = 'read';
96  $r++;
97 
98  $this->rights[$r][0] = 30002;
99  $this->rights[$r][1] = 'Create/modify website content';
100  $this->rights[$r][3] = 0;
101  $this->rights[$r][4] = 'write';
102  $r++;
103 
104  $this->rights[$r][0] = 30003;
105  $this->rights[$r][1] = 'Delete website content';
106  $this->rights[$r][3] = 0;
107  $this->rights[$r][4] = 'delete';
108  $r++;*/
109 
110  // Main menu entries
111  $r = 0;
112  $this->menu[$r] = array(
113  'fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
114  'type'=>'top', // This is a Left menu entry
115  'titre'=>'Collab',
116  'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
117  'mainmenu'=>'collab',
118  'url'=>'/collab/index.php',
119  'langs'=>'collab', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
120  'position'=>100,
121  'enabled'=>'$conf->collab->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
122  'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
123  'target'=>'',
124  'user'=>2 // 0=Menu for internal users, 1=external users, 2=both
125  );
126  $r++;
127  }
128 }
Class DolibarrModules.
Class to describe Websites module.
__construct($db)
Constructor.
print *****$script_file(".$version.") pid 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:122
$conf db
API class for accounts.
Definition: inc.php:41