dolibarr  7.0.0-beta
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  // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
58  $this->special = 0;
59  // Name of image file used for this module.
60  $this->picto='globe';
61 
62  // Data directories to create when module is enabled
63  $this->dirs = array("/collab/temp");
64 
65  // Config pages
66  //-------------
67  $this->config_page_url = array('collab.php');
68 
69  // Dependancies
70  //-------------
71  $this->hidden = ! empty($conf->global->MODULE_COLLAB_DISABLED); // A condition to disable module
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  $this->conflictwith = array(); // List of modules id this module is in conflict with
75  $this->langfiles = array("collab");
76 
77  // Constants
78  //-----------
79  $this->const = array();
80 
81  // New pages on tabs
82  // -----------------
83  $this->tabs = array();
84 
85  // Boxes
86  //------
87  $this->boxes = array();
88 
89  // Permissions
90  $this->rights = array(); // Permission array used by this module
91  $this->rights_class = 'collab';
92  $r=0;
93 
94  /*$this->rights[$r][0] = 30001;
95  $this->rights[$r][1] = 'Read website content';
96  $this->rights[$r][3] = 0;
97  $this->rights[$r][4] = 'read';
98  $r++;
99 
100  $this->rights[$r][0] = 30002;
101  $this->rights[$r][1] = 'Create/modify website content';
102  $this->rights[$r][3] = 0;
103  $this->rights[$r][4] = 'write';
104  $r++;
105 
106  $this->rights[$r][0] = 30003;
107  $this->rights[$r][1] = 'Delete website content';
108  $this->rights[$r][3] = 0;
109  $this->rights[$r][4] = 'delete';
110  $r++;*/
111 
112  // Main menu entries
113  $r=0;
114  $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
115  'type'=>'top', // This is a Left menu entry
116  'titre'=>'Collab',
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  $r++;
126  }
127 }
Class DolibarrModules.
</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
Class to describe Websites module.
__construct($db)
Constructor.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104