dolibarr 19.0.3
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
25include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
26
27
32{
38 public function __construct($db)
39 {
40 global $langs, $conf;
41
42 $this->db = $db;
43 $this->numero = 30000;
44
45 // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
46 // It is used to group modules in module setup page
47 $this->family = "portal";
48 $this->module_position = '51';
49 // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
50 $this->name = preg_replace('/^mod/i', '', get_class($this));
51 $this->description = "Enable the public collaboration features, like shared pad, shared online sheets, etc...";
52 // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
53 $this->version = 'development';
54 // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
55 $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
56 // Name of image file used for this module.
57 $this->picto = 'collab';
58
59 // Data directories to create when module is enabled
60 $this->dirs = array("/collab/temp");
61
62 // Config pages
63 //-------------
64 $this->config_page_url = array(/*'collab.php'*/);
65
66 // Dependancies
67 //-------------
68 $this->hidden = getDolGlobalString('MODULE_COLLAB_DISABLED'); // A condition to disable module
69 $this->depends = array(); // List of modules id that must be enabled if this module is enabled
70 $this->requiredby = array(); // List of modules id to disable if this one is disabled
71 $this->conflictwith = array(); // List of modules id this module is in conflict with
72 $this->langfiles = array("collab");
73
74 // Constants
75 //-----------
76 $this->const = array();
77
78 // New pages on tabs
79 // -----------------
80 $this->tabs = array();
81
82 // Boxes
83 //------
84 $this->boxes = array();
85
86 // Permissions
87 $this->rights = array(); // Permission array used by this module
88 $this->rights_class = 'collab';
89 $r = 0;
90
91 /*$this->rights[$r][0] = 30001;
92 $this->rights[$r][1] = 'Read website content';
93 $this->rights[$r][3] = 0;
94 $this->rights[$r][4] = 'read';
95 $r++;
96
97 $this->rights[$r][0] = 30002;
98 $this->rights[$r][1] = 'Create/modify website content';
99 $this->rights[$r][3] = 0;
100 $this->rights[$r][4] = 'write';
101 $r++;
102
103 $this->rights[$r][0] = 30003;
104 $this->rights[$r][1] = 'Delete website content';
105 $this->rights[$r][3] = 0;
106 $this->rights[$r][4] = 'delete';
107 $r++;*/
108
109 // Main menu entries
110 $r = 0;
111 $this->menu[$r] = array(
112 'fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
113 'type'=>'top', // This is a Left menu entry
114 'titre'=>'Collab',
115 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
116 'mainmenu'=>'collab',
117 'url'=>'/collab/index.php',
118 'langs'=>'collab', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
119 'position'=>100,
120 '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.
121 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
122 'target'=>'',
123 'user'=>2 // 0=Menu for internal users, 1=external users, 2=both
124 );
125 $r++;
126 }
127}
Class DolibarrModules.
Class to describe Websites module.
__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)
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:124