dolibarr 20.0.0
modModuleBuilder.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourcefore.net>
3 * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
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
26include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
27
28
33{
39 public function __construct($db)
40 {
41 global $langs, $conf;
42
43 $this->db = $db;
44 $this->numero = 3300;
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 = "technic";
49 $this->module_position = '90';
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 = "A RAD (Rapid Application Development - low-code and no-code) tool to help developers or advanced users to build their own module/application.";
53 // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
54 $this->version = 'dolibarr';
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 = 'bug';
59
60 // Data directories to create when module is enabled
61 $this->dirs = array();
62
63 // Config pages
64 //-------------
65 $this->config_page_url = array('setup.php@modulebuilder');
66
67 // Dependencies
68 //-------------
69 $this->hidden = false; // 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();
74
75 // Constants
76 //-----------
77
78
79 // New pages on tabs
80 // -----------------
81 $this->tabs = array();
82
83 // Boxes
84 //------
85 $this->boxes = array();
86
87 // Permissions
88 //------------
89 $this->rights = array(); // Permission array used by this module
90 $this->rights_class = 'modulebuilder';
91
92 $r = 0;
93
94 $r++;
95 $this->rights[$r][0] = 3301;
96 $this->rights[$r][1] = 'Generate new modules';
97 $this->rights[$r][2] = 'a';
98 $this->rights[$r][3] = 0;
99 $this->rights[$r][4] = 'run';
100
101
102 // Main menu entries
103 //------------------
104 $this->menu = array();
105
106 $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=tools',
107 'type'=>'left',
108 'titre'=>'ModuleBuilder',
109 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
110 'mainmenu'=>'tools',
111 'leftmenu'=>'devtools_modulebuilder',
112 'url'=>'/modulebuilder/index.php?mainmenu=tools&amp;leftmenu=devtools',
113 'langs'=>'modulebuilder',
114 'position'=>100,
115 'perms'=>'$user->hasRight("modulebuilder", "run")',
116 //'enabled'=>'isModEnabled("modulebuilder") && preg_match(\'/^(devtools|all)/\',$leftmenu)',
117 'enabled'=>'isModEnabled("modulebuilder")',
118 'target'=>'_modulebuilder',
119 'user'=>0);
120 }
121}
Class DolibarrModules.
Class to describe a ModuleBuilder 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=0, $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:142