dolibarr  7.0.0-beta
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 {
35 
36 
37  var $nom='Olive'; // Nom du modele
38  var $code_modifiable = 1; // Code modifiable
39  var $code_modifiable_invalide = 1; // Code modifiable si il est invalide
40  var $code_modifiable_null = 1; // Code modifiables si il est null
41  var $code_null = 1; // Code facultatif
42  var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
43  var $code_auto = 0; // Numerotation automatique
44 
45 
51  function info()
52  {
53  global $langs;
54 
55  $langs->load("companies");
56  return $langs->trans("LeopardNumRefModelDesc");
57  }
58 
66  function getNextValue($objsoc,$contract)
67  {
68  global $langs;
69  return '';
70  }
71 
72 
86  function verif($db, &$code, $product, $type)
87  {
88  global $conf;
89 
90  $result=0;
91  $code = strtoupper(trim($code));
92 
93  if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED))
94  {
95  $result=0;
96  }
97  else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) )
98  {
99  $result=-2;
100  }
101 
102  dol_syslog("mod_contract_olive::verif type=".$type." result=".$result);
103  return $result;
104  }
105 }
106 
getNextValue($objsoc, $contract)
Return an example of result returned by getNextValue.
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.