dolibarr 21.0.0-alpha
modIncoterm.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) 2024 MDW <mdeweerd@users.noreply.github.com>
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 <https://www.gnu.org/licenses/>.
19 */
20
28include_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 = 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 $this->picto = 'incoterm';
61
62 $this->module_parts = array();
63 $this->dirs = array();
64
65 $this->config_page_url = array();
66
67 // Dependencies
68 $this->hidden = false; // A condition to hide module
69 $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
70 $this->requiredby = array(); // List of module ids to disable if this one is disabled
71 $this->conflictwith = array(); // List of module class names as string this module is in conflict with
72 $this->phpmin = array(7, 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 $conf->incoterm = new stdClass();
85 $conf->incoterm->enabled = 0;
86 }
87 $this->dictionaries = array(
88 'langs' => 'incoterm',
89 'tabname' => array("c_incoterms"), // List of tables we want to see into dictionary editor
90 'tablib' => array("Incoterms"), // Label of tables
91 'tabsql' => array('SELECT rowid, code, libelle, active FROM '.MAIN_DB_PREFIX.'c_incoterms'), // Request to select fields
92 'tabsqlsort' => array("rowid ASC"), // Sort order
93 'tabfield' => array("code,libelle"), // List of fields (result of select to show dictionary)
94 'tabfieldvalue' => array("code,libelle"), // List of fields (list of fields to edit a record)
95 'tabfieldinsert' => array("code,libelle"), // List of fields (list of fields for insert)
96 'tabrowid' => array("rowid"), // Name of columns with primary key (try to always name it 'rowid')
97 'tabcond' => array($conf->incoterm->enabled),
98 'tabhelp' => array(array())
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->menu = array(); // List of menus to add
110 $r = 0;
111 }
112}
Class DolibarrModules.
Description and activation class for module MyModule.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140