dolibarr  13.0.2
modVariants.class.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4  * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2016 Marcos GarcĂ­a <marcosgdf@gmail.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
28 include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
29 
30 
35 {
41  public function __construct($db)
42  {
43  global $langs, $conf;
44 
45  $this->db = $db;
46 
47  // Id for module (must be unique).
48  // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
49  $this->numero = 610;
50  // Key text used to identify module (for permissions, menus, etc...)
51  $this->rights_class = 'variants';
52 
53  // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
54  // It is used to group modules in module setup page
55  $this->family = "products";
56  // Module position in the family on 2 digits ('01', '10', '20', ...)
57  $this->module_position = '50';
58  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
59  $this->name = preg_replace('/^mod/i', '', get_class($this));
60  // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
61  $this->description = 'Allows creating products variant based on new attributes';
62  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
63  $this->version = 'dolibarr';
64  // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
65  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
66  // Name of image file used for this module.
67  // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
68  // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
69  $this->picto = 'product';
70 
71  // Defined all module parts (triggers, login, substitutions, menus, css, etc...)
72  $this->module_parts = array();
73 
74  // Data directories to create when module is enabled.
75  // Example: this->dirs = array("/mymodule/temp");
76  $this->dirs = array();
77 
78  // Config pages. Put here list of php page, stored into mymodule/admin directory, to use to setup module.
79  $this->config_page_url = array('admin.php@variants');
80 
81  // Dependencies
82  $this->hidden = false; // A condition to hide module
83  $this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled
84  $this->requiredby = array(); // List of module ids to disable if this one is disabled
85  $this->conflictwith = array(); // List of module class names as string this module is in conflict with
86  $this->phpmin = array(5, 4); // Minimum version of PHP required by module
87  $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module
88  $this->langfiles = array("products");
89 
90  // Constants
91  $this->const = array();
92 
93  // Array to add new pages in new tabs
94  $this->tabs = array(
95  // 'product:+combinations:Combinaciones:products:1:/variants/combinations.php?id=__ID__'
96  );
97 
98  // Dictionaries
99  if (!isset($conf->mymodule->enabled))
100  {
101  $conf->mymodule = new stdClass();
102  $conf->mymodule->enabled = 0;
103  }
104  $this->dictionaries = array();
105 
106  // Boxes
107  // Add here list of php file(s) stored in core/boxes that contains class to show a box.
108  $this->boxes = array(); // List of boxes
109 
110  // Permissions
111  $this->rights = array(); // Permission array used by this module
112  }
113 }
Class DolibarrModules.
Description and activation class for module Product variants.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</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:750
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:108
$conf db
API class for accounts.
Definition: inc.php:54
__construct($db)
Constructor.