dolibarr  9.0.0
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 <http://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 label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
57  $this->name = preg_replace('/^mod/i','',get_class($this));
58  // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
59  $this->description = 'Allows creating products variant based on new attributes';
60  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
61  $this->version = 'dolibarr';
62  // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
63  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
64  // Name of image file used for this module.
65  // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
66  // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
67  $this->picto='product';
68 
69  // Defined all module parts (triggers, login, substitutions, menus, css, etc...)
70  $this->module_parts = array();
71 
72  // Data directories to create when module is enabled.
73  // Example: this->dirs = array("/mymodule/temp");
74  $this->dirs = array();
75 
76  // Config pages. Put here list of php page, stored into mymodule/admin directory, to use to setup module.
77  $this->config_page_url = array('admin.php@variants');
78 
79  // Dependencies
80  $this->hidden = false; // A condition to hide module
81  $this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled
82  $this->requiredby = array(); // List of module ids to disable if this one is disabled
83  $this->conflictwith = array(); // List of module class names as string this module is in conflict with
84  $this->phpmin = array(5,4); // Minimum version of PHP required by module
85  $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module
86  $this->langfiles = array("products");
87 
88  // Constants
89  $this->const = array();
90 
91  // Array to add new pages in new tabs
92  $this->tabs = array(
93 // 'product:+combinations:Combinaciones:products:1:/variants/combinations.php?id=__ID__'
94  );
95 
96  // Dictionaries
97  if (! isset($conf->mymodule->enabled))
98  {
99  $conf->mymodule=new stdClass();
100  $conf->mymodule->enabled=0;
101  }
102  $this->dictionaries=array();
103 
104  // Boxes
105  // Add here list of php file(s) stored in core/boxes that contains class to show a box.
106  $this->boxes = array(); // List of boxes
107 
108  // Permissions
109  $this->rights = array(); // Permission array used by this module
110  }
111 }
Class DolibarrModules.
Description and activation class for module Product variants.
</td >< td class="liste_titre" align="right"></td ></tr >< tr class="liste_titre">< input type="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< tr class="oddeven">< td >< input type="checkbox" class="check" name="' . $i . '"' . $disabled . '></td >< td >< input type="checkbox" class="check" name="choose'.$i.'"></td >< td class="nowrap"></td >< td >< input type="hidden" name="desc' . $i . '" value="' . dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:573
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
__construct($db)
Constructor.