dolibarr  9.0.0
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 <http://www.gnu.org/licenses/>.
16  */
17 
25 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
26 
27 
32 {
33 
39  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='globe';
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( '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  'mainmenu'=>'collab',
116  'url'=>'/collab/index.php',
117  'langs'=>'collab', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
118  'position'=>100,
119  '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.
120  'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
121  'target'=>'',
122  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
123  $r++;
124  }
125 }
Class DolibarrModules.
</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
Class to describe Websites module.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
__construct($db)
Constructor.