dolibarr 21.0.0-alpha
ModeleThirdPartyCode Class Reference

Parent class for third parties code generators. More...

Inheritance diagram for ModeleThirdPartyCode:
Collaboration diagram for ModeleThirdPartyCode:

Public Member Functions

 __construct ($db)
 Constructor.
 
 getNextValue ($objsoc='', $type=-1)
 Return an example of result returned by getNextValue.
 
 getToolTip ($langs, $soc, $type)
 Return description of module parameters.
 
 verif_prefixIsUsed ()
 Check if mask/numbering use prefix.
 
 verif ($db, &$code, $soc, $type)
 Check validity of code according to its rules.
 
- Public Member Functions inherited from CommonNumRefGenerator
 getNom ($langs)
 Return model name.
 
 getName ($langs)
 Return model name.
 
 isEnabled ()
 Return if a module can be used or not.
 
 info ($langs)
 Returns the default description of the numbering template.
 
 canBeActivated ($object)
 Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working.
 
 getVersion ()
 Returns version of numbering module.
 

Static Public Member Functions

static liste_modeles ($dbs, $maxfilenamelength=0)
 Return list of active generation modules.
 

Detailed Description

Parent class for third parties code generators.

Definition at line 78 of file modules_societe.class.php.

Constructor & Destructor Documentation

◆ __construct()

ModeleThirdPartyCode::__construct ( $db)
abstract

Constructor.

Parameters
DoliDB$dbDatabase object

Reimplemented in mod_codeclient_elephant, mod_codeclient_leopard, and mod_codeclient_monkey.

Member Function Documentation

◆ getNextValue()

ModeleThirdPartyCode::getNextValue ( $objsoc = '',
$type = -1 )

Return an example of result returned by getNextValue.

Parameters
?Translate$langsObject langs
Societe | string$objsocObject thirdparty
int<-1,2>$type Type of third party (1:customer, 2:supplier, -1:autodetect)
Returns
string Return string example Return next value available
Parameters
Societe | string$objsocObject thirdparty
int$typeType
Returns
string Value

Reimplemented in mod_codeclient_elephant, mod_codeclient_leopard, and mod_codeclient_monkey.

Definition at line 106 of file modules_societe.class.php.

Referenced by getToolTip().

◆ getToolTip()

ModeleThirdPartyCode::getToolTip ( $langs,
$soc,
$type )

Return description of module parameters.

Parameters
Translate$langsOutput language
Societe$socThird party object
int$type-1=Nothing, 0=Customer, 1=Supplier
Returns
string HTML translated description

Definition at line 151 of file modules_societe.class.php.

References getDolGlobalString(), CommonNumRefGenerator\getName(), getNextValue(), and yn().

◆ liste_modeles()

static ModeleThirdPartyCode::liste_modeles ( $dbs,
$maxfilenamelength = 0 )
static

Return list of active generation modules.

Parameters
DoliDB$dbsDatabase handler
int<0,max>$maxfilenamelength Max length of value to show
Returns
string[]|int<-1,0> List of templates

Definition at line 121 of file modules_societe.class.php.

◆ verif()

ModeleThirdPartyCode::verif ( $db,
& $code,
$soc,
$type )
abstract

Check validity of code according to its rules.

Parameters
DoliDB$dbDatabase handler
string$codeCode to check/correct
Societe$socObject third party
int<0,1>$type 0 = customer/prospect , 1 = supplier
Returns
int<-6,0> 0 if OK -1 ErrorBadCustomerCodeSyntax -2 ErrorCustomerCodeRequired -3 ErrorCustomerCodeAlreadyUsed -4 ErrorPrefixRequired -5 NotConfigured - Setup empty so any value may be ok or not -6 Other (see this->error)

Reimplemented in mod_codeclient_elephant, mod_codeclient_leopard, and mod_codeclient_monkey.

◆ verif_prefixIsUsed()

ModeleThirdPartyCode::verif_prefixIsUsed ( )

Check if mask/numbering use prefix.

Returns
int 0=no, 1=yes

Reimplemented in mod_codeclient_elephant.

Definition at line 217 of file modules_societe.class.php.


The documentation for this class was generated from the following file: