dolibarr  9.0.0
mod_contract_olive.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2014 Floran Henry <florian.henry@open-concept.pro>
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  * or see http://www.gnu.org/
19  */
20 
27 require_once DOL_DOCUMENT_ROOT .'/core/modules/contract/modules_contract.php';
28 
29 
34 {
40  public $nom='Olive';
41 
45  public $name='Olive';
46 
47  public $code_modifiable = 1; // Code modifiable
48 
49  public $code_modifiable_invalide = 1; // Code modifiable si il est invalide
50 
51  public $code_modifiable_null = 1; // Code modifiables si il est null
52 
53  public $code_null = 1; // Code facultatif
54 
59  public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
60 
61  public $code_auto = 0; // Numerotation automatique
62 
63 
69  function info()
70  {
71  global $langs;
72 
73  $langs->load("companies");
74  return $langs->trans("LeopardNumRefModelDesc");
75  }
76 
84  function getNextValue($objsoc,$contract)
85  {
86  global $langs;
87  return '';
88  }
89 
90 
104  function verif($db, &$code, $product, $type)
105  {
106  global $conf;
107 
108  $result=0;
109  $code = strtoupper(trim($code));
110 
111  if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED))
112  {
113  $result=0;
114  }
115  else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) )
116  {
117  $result=-2;
118  }
119 
120  dol_syslog("mod_contract_olive::verif type=".$type." result=".$result);
121  return $result;
122  }
123 }
124 
getNextValue($objsoc, $contract)
Return an example of result returned by getNextValue.
$version
Dolibarr version of the loaded document string.
verif($db, &$code, $product, $type)
Check validity of code according to its rules.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
info()
Return description of module.
Class to manage contract numbering rules Olive.
Parent class for all contract numbering modules.