dolibarr  9.0.0
modProductBatch.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2013-2014 Cedric GROSS <c.gross@kreiz-it.fr>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
28 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
29 
30 
35 {
41  function __construct($db)
42  {
43  global $langs,$conf;
44 
45  $this->db = $db;
46  $this->numero = 39000;
47 
48  $this->family = "products";
49  $this->module_position = '45';
50 
51  $this->name = preg_replace('/^mod/i','',get_class($this));
52  $this->description = "Batch number, eat-by and sell-by date management module";
53 
54  $this->rights_class = 'productbatch';
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 dluo is value of property name of module in uppercase)
58  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
59 
60  $this->picto='stock';
61 
62  $this->module_parts = array();
63 
64  // Data directories to create when module is enabled.
65  $this->dirs = array();
66 
67  // Config pages. Put here list of php page, stored into productdluo/admin directory, to use to setup module.
68  $this->config_page_url = array("product_lot_extrafields.php@product");
69 
70  // Dependencies
71  $this->hidden = false; // A condition to hide module
72  $this->depends = array("modProduct","modStock","modExpedition","modFournisseur"); // List of module class names as string that must be enabled if this module is enabled
73  $this->requiredby = array(); // List of module ids to disable if this one is disabled
74  $this->conflictwith = array(); // List of module class names as string this module is in conflict with
75  $this->phpmin = array(5,4); // Minimum version of PHP required by module
76  $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module
77  $this->langfiles = array("productbatch");
78 
79  // Constants
80  $this->const = array();
81 
82  $this->tabs = array();
83 
84  // Dictionaries
85  if (! isset($conf->productbatch->enabled))
86  {
87  $conf->productbatch=new stdClass();
88  $conf->productbatch->enabled=0;
89  }
90  $this->dictionaries=array();
91 
92  // Boxes
93  $this->boxes = array(); // List of boxes
94 
95  // Permissions
96  $this->rights = array(); // Permission array used by this module
97  $r=0;
98 
99 
100  // Menus
101  //-------
102  $this->menu = 1; // This module add menu entries. They are coded into menu manager.
103 
104 
105  // Exports
106  $r=0;
107  }
108 
117  function init($options='')
118  {
119  global $db,$conf;
120 
121  $sql = array();
122 
123  if (! empty($conf->cashdesk->enabled)) {
124  if (empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) {
125  include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
126  $res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity);
127  }
128  }
129 
130  return $this->_init($sql, $options);
131  }
132 }
133 
Class DolibarrModules.
</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
__construct($db)
Constructor.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:510
init($options='')
Function called when module is enabled.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
Description and activation class for module productdluo.
_init($array_sql, $options='')
Enables a module.