dolibarr  7.0.0-beta
modWorkflow.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
3  * Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
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 <http://www.gnu.org/licenses/>.
17  */
18 
26 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
27 
28 
33 {
34 
40  function __construct($db)
41  {
42  $this->db = $db;
43 
44  // Id for module (must be unique).
45  // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
46  $this->numero = 6000 ;
47  // Key text used to identify module (for permissions, menus, etc...)
48  $this->rights_class = 'workflow';
49 
50  $this->family = "technic";
51  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
52  $this->name = preg_replace('/^mod/i','',get_class($this));
53  // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
54  $this->description = "Workflow management";
55  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
56  $this->version = 'dolibarr';
57  // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
58  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
59  // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
60  $this->special = 2;
61  // Name of png file (without png) used for this module.
62  // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
63  // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
64  $this->picto='technic';
65 
66  // Data directories to create when module is enabled
67  $this->dirs = array("/workflow/temp");
68 
69  // Config pages. Put here list of php page names stored in admmin directory used to setup module.
70  $this->config_page_url = array('workflow.php');
71 
72  // Dependencies
73  $this->depends = array(); // List of modules id that must be enabled if this module is enabled
74  $this->requiredby = array(); // List of modules id to disable if this one is disabled
75  $this->phpmin = array(5,2); // Minimum version of PHP required by module
76  $this->need_dolibarr_version = array(2,8); // Minimum version of Dolibarr required by module
77  $this->langfiles = array("@workflow");
78 
79  // Constants
80  // List of particular constants to add when module is enabled
81  //Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0),
82  // 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) );
83  $this->const=array();
84 
85  // Boxes
86  $this->boxes = array();
87 
88  // Permissions
89  $this->rights = array();
90  $r=0;
91 
92  /*
93  $r++;
94  $this->rights[$r][0] = 6001; // id de la permission
95  $this->rights[$r][1] = "Lire les workflow"; // libelle de la permission
96  $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
97  $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
98  $this->rights[$r][4] = 'read';
99  */
100 
101  // Main menu entries
102  $this->menus = array(); // List of menus to add
103  $r=0;
104  /*
105  $this->menu[$r]=array('fk_menu'=>0,
106  'type'=>'top',
107  'titre'=>'Workflow',
108  'mainmenu'=>'workflow',
109  'url'=>'/workflow/index.php',
110  'langs'=>'@workflow',
111  'position'=>100,
112  'perms'=>'$user->rights->workflow->read',
113  'enabled'=>'$conf->workflow->enabled',
114  'target'=>'',
115  'user'=>0);
116  $r++;
117 
118  $this->menu[$r]=array( 'fk_menu'=>'r=0',
119  'type'=>'left',
120  'titre'=>'Workflow',
121  'mainmenu'=>'workflow',
122  'url'=>'/workflow/index.php',
123  'langs'=>'@workflow',
124  'position'=>101,
125  'enabled'=>1,
126  'perms'=>'$user->rights->workflow->read',
127  'target'=>'',
128  'user'=>0);
129  $r++;
130  */
131  }
132 
133 
142  function init($options='')
143  {
144  // Permissions
145  $this->remove($options);
146 
147  $sql = array();
148 
149  return $this->_init($sql,$options);
150  }
151 }
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
__construct($db)
Constructor.
init($options='')
Function called when module is enabled.
Class to describe and enable module Workflow.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
_init($array_sql, $options='')
Enables a module.