dolibarr  7.0.0-beta
modIncoterm.class.php
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@capnetworks.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
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 
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 = 62000;
50  // Key text used to identify module (for permissions, menus, etc...)
51  $this->rights_class = 'incoterm';
52 
53  // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
54  $this->family = "srm";
55  $this->name = preg_replace('/^mod/i','',get_class($this));
56  $this->description = "Incoterm management";
57  $this->version = 'dolibarr';
58  // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
59  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
60  // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
61  $this->special = 0;
62  $this->picto='generic';
63 
64  $this->module_parts = array();
65  $this->dirs = array();
66 
67  $this->config_page_url = array();
68 
69  // Dependencies
70  $this->depends = array(); // List of modules id that must be enabled if this module is enabled
71  $this->requiredby = array(); // List of modules id to disable if this one is disabled
72  $this->phpmin = array(5,0); // Minimum version of PHP required by module
73  $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module
74  $this->langfiles = array("incoterm");
75 
76  $this->const = array(
77  array('INCOTERM_ACTIVATE', 'chaine', 0, 'Description de INCOTERM_ACTIVATE')
78  );
79 
80  $this->tabs = array();
81 
82  // Dictionaries
83  if (! isset($conf->incoterm->enabled))
84  {
85  $conf->incoterm=new stdClass();
86  $conf->incoterm->enabled=0;
87  }
88  $this->dictionaries=array(
89  'langs'=>'incoterm',
90  'tabname'=>array(MAIN_DB_PREFIX."c_incoterms"), // List of tables we want to see into dictonnary editor
91  'tablib'=>array("Incoterms"), // Label of tables
92  'tabsql'=>array('SELECT rowid, code, libelle, active FROM '.MAIN_DB_PREFIX.'c_incoterms'), // Request to select fields
93  'tabsqlsort'=>array("rowid ASC"), // Sort order
94  'tabfield'=>array("code,libelle"), // List of fields (result of select to show dictionary)
95  'tabfieldvalue'=>array("code,libelle"), // List of fields (list of fields to edit a record)
96  'tabfieldinsert'=>array("code,libelle"), // List of fields (list of fields for insert)
97  'tabrowid'=>array("rowid"), // Name of columns with primary key (try to always name it 'rowid')
98  'tabcond'=>array($conf->incoterm->enabled)
99  );
100 
101  $this->boxes = array(); // List of boxes
102  $r=0;
103 
104  // Permissions
105  $this->rights = array(); // Permission array used by this module
106  $r=0;
107 
108  // Main menu entries
109  $this->menus = array(); // List of menus to add
110  $r=0;
111  }
112 }
Class DolibarrModules.
__construct($db)
Constructor.
</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
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
Description and activation class for module MyModule.