2017-03-29 21:36:50 +02:00
< ? php
/* Copyright ( C ) 2017 Laurent Destailleur < eldy @ users . sourcefore . net >
2018-05-30 13:54:43 +02:00
* Copyright ( C ) 2018 Nicolas ZABOURI < info @ inovea - conseil . com >
2017-03-29 21:36:50 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2017-03-29 21:36:50 +02:00
*/
/**
* \defgroup modulebuilder Module ModuleBuilder
* \brief Add a log into a block chain for some actions .
* \file htdocs / core / modules / modBlockedLog . class . php
* \ingroup blockedlog
2021-03-20 13:55:43 +01:00
* \brief Description and activation file for the module ModuleBuilder
2017-03-29 21:36:50 +02:00
*/
2020-04-10 10:59:32 +02:00
include_once DOL_DOCUMENT_ROOT . '/core/modules/DolibarrModules.class.php' ;
2017-03-29 21:36:50 +02:00
/**
* Class to describe a ModuleBuilder module
*/
class modModuleBuilder extends DolibarrModules
{
2020-10-31 14:32:18 +01:00
/**
2017-03-29 21:36:50 +02:00
* Constructor . Define names , constants , directories , boxes , permissions
*
* @ param DoliDB $db Database handler
2020-10-31 14:32:18 +01:00
*/
public function __construct ( $db )
{
global $langs , $conf ;
2017-03-29 21:36:50 +02:00
2020-10-31 14:32:18 +01:00
$this -> db = $db ;
$this -> numero = 3300 ;
2017-03-29 21:36:50 +02:00
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
2020-10-31 14:32:18 +01:00
$this -> family = " technic " ;
$this -> module_position = '90' ;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this -> name = preg_replace ( '/^mod/i' , '' , get_class ( $this ));
2023-01-06 14:57:06 +01:00
$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. " ;
2017-08-22 18:34:58 +02:00
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
2020-10-31 14:32:18 +01:00
$this -> version = 'dolibarr' ;
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this -> const_name = 'MAIN_MODULE_' . strtoupper ( $this -> name );
// Name of image file used for this module.
$this -> picto = 'bug' ;
// Data directories to create when module is enabled
$this -> dirs = array ();
// Config pages
//-------------
$this -> config_page_url = array ( 'setup.php@modulebuilder' );
// Dependencies
//-------------
$this -> hidden = false ; // A condition to disable module
$this -> depends = array (); // List of modules id that must be enabled if this module is enabled
$this -> requiredby = array (); // List of modules id to disable if this one is disabled
$this -> conflictwith = array (); // List of modules id this module is in conflict with
$this -> langfiles = array ();
// Constants
//-----------
// New pages on tabs
// -----------------
$this -> tabs = array ();
// Boxes
//------
$this -> boxes = array ();
// Permissions
//------------
$this -> rights = array (); // Permission array used by this module
$this -> rights_class = 'modulebuilder' ;
$r = 0 ;
$r ++ ;
$this -> rights [ $r ][ 0 ] = 3301 ;
$this -> rights [ $r ][ 1 ] = 'Generate new modules' ;
$this -> rights [ $r ][ 2 ] = 'a' ;
$this -> rights [ $r ][ 3 ] = 0 ;
$this -> rights [ $r ][ 4 ] = 'run' ;
// Main menu entries
//------------------
$this -> menu = array ();
2022-11-01 11:46:21 +01:00
$this -> menu [ $r ] = array ( 'fk_menu' => 'fk_mainmenu=tools' ,
2020-10-31 14:32:18 +01:00
'type' => 'left' ,
'titre' => 'ModuleBuilder' ,
2022-11-01 11:46:21 +01:00
'prefix' => img_picto ( '' , $this -> picto , 'class="paddingright pictofixedwidth"' ),
'mainmenu' => 'tools' ,
'leftmenu' => 'devtools_modulebuilder' ,
'url' => '/modulebuilder/index.php?mainmenu=tools&leftmenu=devtools' ,
2020-10-31 14:32:18 +01:00
'langs' => 'modulebuilder' ,
'position' => 100 ,
2022-11-01 11:46:21 +01:00
'perms' => '$user->hasRight("modulebuilder", "run")' ,
//'enabled'=>'isModEnabled("modulebuilder") && preg_match(\'/^(devtools|all)/\',$leftmenu)',
'enabled' => 'isModEnabled("modulebuilder")' ,
2020-10-31 14:32:18 +01:00
'target' => '_modulebuilder' ,
'user' => 0 );
}
2017-03-29 21:36:50 +02:00
}