dolibarr  7.0.0-beta
mod_codeclient_leopard.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  * or see http://www.gnu.org/
18  */
19 
26 require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php';
27 
28 
33 {
34  /*
35  * Attention ce module est utilise par defaut si aucun module n'a
36  * ete definit dans la configuration
37  *
38  * Le fonctionnement de celui-ci doit donc rester le plus ouvert possible
39  */
40 
41  var $nom='Leopard'; // Nom du modele
42  var $name='Leopard'; // Nom du modele
43  var $code_modifiable; // Code modifiable
44  var $code_modifiable_invalide; // Code modifiable si il est invalide
45  var $code_modifiable_null; // Code modifiables si il est null
46  var $code_null; // Code facultatif
47  var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
48  var $code_auto; // Numerotation automatique
49 
50 
54  function __construct()
55  {
56  $this->code_null = 1;
57  $this->code_modifiable = 1;
58  $this->code_modifiable_invalide = 1;
59  $this->code_modifiable_null = 1;
60  $this->code_auto = 0;
61  }
62 
63 
69  function info($langs)
70  {
71  $langs->load("companies");
72  return $langs->trans("LeopardNumRefModelDesc");
73  }
74 
75 
83  function getNextValue($objsoc=0,$type=-1)
84  {
85  global $langs;
86  return '';
87  }
88 
89 
103  function verif($db, &$code, $soc, $type)
104  {
105  global $conf;
106 
107  $result=0;
108  $code = trim($code);
109 
110  if (empty($code) && $this->code_null && empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED))
111  {
112  $result=0;
113  }
114  else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
115  {
116  $result=-2;
117  }
118 
119  dol_syslog(get_class($this)."::verif type=".$type." result=".$result);
120  return $result;
121  }
122 }
123 
verif($db, &$code, $soc, $type)
Check validity of code according to its rules.
Parent class for third parties code generators.
Class to manage numbering of thirdparties code.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
getNextValue($objsoc=0, $type=-1)
Return an example of result returned by getNextValue.
info($langs)
Return description of module.