NEW Factorize a lot of code for numbering modules

This commit is contained in:
Laurent Destailleur
2023-08-09 14:50:28 +02:00
parent 7bbaf37ffe
commit db2a70b86a
40 changed files with 147 additions and 3648 deletions

View File

@@ -54,6 +54,27 @@ abstract class CommonNumRefGenerator
protected $db; protected $db;
/** Return model name
* TODO Replace with getName()
*
* @param Translate $langs Object langs
* @return string Model name
*/
public function getNom($langs)
{
return empty($this->name) ? get_class($this) : $this->name;
}
/** Return model name
*
* @param Translate $langs Object langs
* @return string Model name
*/
public function getName($langs)
{
return empty($this->name) ? get_class($this) : $this->name;
}
/** /**
* Return if a module can be used or not * Return if a module can be used or not
* *

View File

@@ -29,6 +29,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -37,42 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFAsset extends CommonDocGenerator abstract class ModelePDFAsset extends CommonDocGenerator
{ {
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -99,98 +64,7 @@ abstract class ModelePDFAsset extends CommonDocGenerator
/** /**
* Parent class to manage numbering of Asset * Parent class to manage numbering of Asset
*/ */
abstract class ModeleNumRefAsset abstract class ModeleNumRefAsset extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("asset@asset");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("asset@asset");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @param Object $object Object we need next value for
* @return boolean false if conflict, true if ok
*/
public function canBeActivated($object)
{
return true;
}
/**
* Returns next assigned value
*
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -31,12 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/ */
abstract class ModeleBankAccountDoc extends CommonDocGenerator abstract class ModeleBankAccountDoc extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules

View File

@@ -22,6 +22,7 @@
* \brief File with parent classes for barcode document modules and numbering modules * \brief File with parent classes for barcode document modules and numbering modules
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -50,50 +51,8 @@ abstract class ModeleBarCode
/** /**
* Parent class for barcode numbering models * Parent class for barcode numbering models
*/ */
abstract class ModeleNumRefBarCode abstract class ModeleNumRefBarCode extends CommonNumRefGenerator
{ {
/**
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/** Return default description of numbering model
*
* @param Translate $langs Object langs
* @return string Descriptive text
*/
public function info($langs)
{
$langs->load("bills");
return $langs->trans("NoDescription");
}
/** Return model name
*
* @param Translate $langs Object langs
* @return string Model name
*/
public function getNom($langs)
{
return empty($this->name) ? get_class($this) : $this->name;
}
/** Return a numbering example
*
* @param Translate $langs Object langs
* @return string Example
*/
public function getExample($langs)
{
$langs->load("bills");
return $langs->trans("NoExample");
}
/** /**
* Return next value available * Return next value available
* *
@@ -107,30 +66,6 @@ abstract class ModeleNumRefBarCode
return $langs->trans("Function_getNextValue_InModuleNotWorking"); return $langs->trans("Function_getNextValue_InModuleNotWorking");
} }
/** Return version of module
*
* @return string Version
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
/** /**
* Return description of module parameters * Return description of module parameters
* *

View File

@@ -30,6 +30,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -38,7 +39,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFBom extends CommonDocGenerator abstract class ModelePDFBom extends CommonDocGenerator
{ {
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -65,98 +65,7 @@ abstract class ModelePDFBom extends CommonDocGenerator
/** /**
* Parent class to manage numbering of BOMs * Parent class to manage numbering of BOMs
*/ */
abstract class ModeleNumRefBoms abstract class ModeleNumRefBoms extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("mrp");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("mrp");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns next assigned value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -29,6 +29,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -37,43 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFBooking extends CommonDocGenerator abstract class ModelePDFBooking extends CommonDocGenerator
{ {
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -102,93 +66,7 @@ abstract class ModelePDFBooking extends CommonDocGenerator
/** /**
* Parent class to manage numbering of MyObject * Parent class to manage numbering of MyObject
*/ */
abstract class ModeleNumRefBooking abstract class ModeleNumRefBooking extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("mymodule@mymodule");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("mymodule@mymodule");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @param Object $object Object we need next value for
* @return boolean false if conflict, true if ok
*/
public function canBeActivated($object)
{
return true;
}
/**
* Returns next assigned value
*
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -27,107 +27,16 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis car utilise dans les classes qui heritent require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis car utilise dans les classes qui heritent
/** /**
* \class ModeleNumRefChequeReceipts * Class parent for cheque Receipts numbering references mother class
* \brief Cheque Receipts numbering references mother class
*/ */
abstract class ModeleNumRefChequeReceipts abstract class ModeleNumRefChequeReceipts extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Return the default description of numbering module
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoDescription");
}
/**
* Return numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns the next value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns the module numbering version
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }
/** /**

View File

@@ -30,6 +30,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
@@ -83,98 +84,7 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
/** /**
* Parent class to manage numbering of Sale Orders * Parent class to manage numbering of Sale Orders
*/ */
abstract class ModeleNumRefCommandes abstract class ModeleNumRefCommandes extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("orders");
return $langs->trans("NoDescription");
}
/**
* Renvoie un exemple de numerotation
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("orders");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns next assigned value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -29,7 +29,8 @@
* \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering * \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -37,12 +38,6 @@
*/ */
abstract class ModelePDFContract extends CommonDocGenerator abstract class ModelePDFContract extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -68,92 +63,7 @@ abstract class ModelePDFContract extends CommonDocGenerator
/** /**
* Parent class for all contract numbering modules * Parent class for all contract numbering modules
*/ */
class ModelNumRefContracts class ModelNumRefContracts extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Return default description of numbering model
*
* @return string text description
*/
public function info()
{
global $langs;
$langs->load("contracts");
return $langs->trans("NoDescription");
}
/**
* Return numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("contracts");
return $langs->trans("NoExample");
}
/**
* Test if existing numbers make problems with numbering
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Return next value
*
* @param Societe $objsoc third party object
* @param Object $contract contract object
* @return string Value
*/
public function getNextValue($objsoc, $contract)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Return numbering version module
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -29,6 +29,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -36,11 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/ */
abstract class ModelePDFDeliveryOrder extends CommonDocGenerator abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -63,101 +59,10 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
} }
/** /**
* \class ModeleNumRefDeliveryOrder * Classe mere des modeles de numerotation des references de bon de livraison
* \brief Classe mere des modeles de numerotation des references de bon de livraison
*/ */
abstract class ModeleNumRefDeliveryOrder abstract class ModeleNumRefDeliveryOrder extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("deliveries");
return $langs->trans("NoDescription");
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("deliveries");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @param Societe $objsoc Object third party
* @param Object $object Object delivery
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Renvoi version du module numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
} }

View File

@@ -25,6 +25,7 @@
* \brief File of class to manage donation document generation * \brief File of class to manage donation document generation
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
@@ -34,11 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
*/ */
abstract class ModeleDon extends CommonDocGenerator abstract class ModeleDon extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -64,96 +60,7 @@ abstract class ModeleDon extends CommonDocGenerator
/** /**
* Parent class of donation numbering templates * Parent class of donation numbering templates
*/ */
abstract class ModeleNumRefDons abstract class ModeleNumRefDons extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoDescription");
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @return string Valeur
*/
public function getNextValue()
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Renvoi version du module numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -29,19 +29,16 @@
* \brief File that contains parent class for sending receipts models * \brief File that contains parent class for sending receipts models
* and parent class for sending receipts numbering models * and parent class for sending receipts numbering models
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
/** /**
* Parent class of sending receipts models * Parent class of sending receipts models
*/ */
abstract class ModelePdfExpedition extends CommonDocGenerator abstract class ModelePdfExpedition extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation models * Return list of active generation models
@@ -67,94 +64,7 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
/** /**
* Parent Class of numbering models of sending receipts references * Parent Class of numbering models of sending receipts references
*/ */
abstract class ModelNumRefExpedition abstract class ModelNumRefExpedition extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Error code (or message)
*/
public $error = '';
public $version;
/** Return if a model can be used or not
*
* @return boolean true if model can be used
*/
public function isEnabled()
{
return true;
}
/**
* Return default description of numbering model
*
* @return string text description
*/
public function info()
{
global $langs;
$langs->load("sendings");
return $langs->trans("NoDescription");
}
/**
* Returns numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("sendings");
return $langs->trans("NoExample");
}
/**
* Test if existing numbers make problems with numbering
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns next value assigned
*
* @param Societe $objsoc Third party object
* @param Object $shipment Shipment object
* @return string Value
*/
public function getNextValue($objsoc, $shipment)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of the numbering model
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -16,6 +16,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -23,47 +24,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/ */
abstract class ModeleExpenseReport extends CommonDocGenerator abstract class ModeleExpenseReport extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active models generation * Return list of active models generation
@@ -104,99 +64,9 @@ function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $
} }
/** /**
* \class ModeleNumRefExpenseReport * Parent class for numbering masks of expense reports
* \brief Parent class for numbering masks of expense reports
*/ */
abstract class ModeleNumRefExpenseReport extends CommonNumRefGenerator
abstract class ModeleNumRefExpenseReport
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a model can be used or not
*
* @return boolean true if model can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering model
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("orders");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("trips");
return $langs->trans("NoExample");
}
/**
* Test whether the numbers already in force in the base do not cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns next assigned value
*
* @param Object $object Object we need next value for
* @return string Value
*/
public function getNextValue($object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns the version of the numbering module
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
} }

View File

@@ -28,6 +28,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required because used in classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required because used in classes that inherit
@@ -39,11 +40,6 @@ use Sprain\SwissQrBill;
*/ */
abstract class ModelePDFFactures extends CommonDocGenerator abstract class ModelePDFFactures extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
public $posxpicture; public $posxpicture;
public $posxtva; public $posxtva;
public $posxup; public $posxup;
@@ -61,6 +57,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator
public $atleastonediscount = 0; public $atleastonediscount = 0;
public $atleastoneratenotnull = 0; public $atleastoneratenotnull = 0;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -251,98 +248,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator
/** /**
* Parent class of invoice reference numbering templates * Parent class of invoice reference numbering templates
*/ */
abstract class ModeleNumRefFactures abstract class ModeleNumRefFactures extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoDescription");
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @param Societe $objsoc Objet societe
* @param Facture $invoice Objet facture
* @param string $mode 'next' for next value or 'last' for last value
* @return string Value
*/
public function getNextValue($objsoc, $invoice, $mode = 'next')
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Renvoi version du modele de numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
} }

View File

@@ -27,6 +27,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -34,12 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/ */
abstract class ModelePDFFicheinter extends CommonDocGenerator abstract class ModelePDFFicheinter extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -65,99 +60,9 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
/** /**
* Parent class numbering models of intervention sheet references * Parent class numbering models of intervention sheet references
*/ */
abstract class ModeleNumRefFicheinter abstract class ModeleNumRefFicheinter extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("ficheinter");
return $langs->trans("NoDescription");
}
/**
* Return a numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("ficheinter");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Return the next assigned value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Value if KO, <0 if KO
*/
public function getNextValue($objsoc = 0, $object = '')
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Return the version of the numbering module
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
} }
@@ -177,7 +82,7 @@ abstract class ModeleNumRefFicheinter
function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs, $user; global $conf, $langs;
$langs->load("ficheinter"); $langs->load("ficheinter");
$error = 0; $error = 0;

View File

@@ -30,7 +30,8 @@
* \brief File with parent class for generating holiday to PDF and File of class to manage contract numbering * \brief File with parent class for generating holiday to PDF and File of class to manage contract numbering
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -38,12 +39,6 @@
*/ */
abstract class ModelePDFHoliday extends CommonDocGenerator abstract class ModelePDFHoliday extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -69,90 +64,7 @@ abstract class ModelePDFHoliday extends CommonDocGenerator
/** /**
* Parent class for all holidays numbering modules * Parent class for all holidays numbering modules
*/ */
class ModelNumRefHolidays class ModelNumRefHolidays extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Return default description of numbering model
*
* @return string text description
*/
public function info()
{
global $langs;
$langs->load("holiday");
return $langs->trans("NoDescription");
}
/**
* Return numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("holiday");
return $langs->trans("NoExample");
}
/**
* Test if existing numbers make problems with numbering
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Return next value
*
* @param Societe $objsoc third party object
* @param Object $holiday Holiday object
* @return string Value if OK, 0 if KO
*/
public function getNextValue($objsoc, $holiday)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Return numbering version module
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
} }

View File

@@ -29,6 +29,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -37,7 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFEvaluation extends CommonDocGenerator abstract class ModelePDFEvaluation extends CommonDocGenerator
{ {
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -64,99 +64,7 @@ abstract class ModelePDFEvaluation extends CommonDocGenerator
/** /**
* Parent class to manage numbering of Evaluation * Parent class to manage numbering of Evaluation
*/ */
abstract class ModeleNumRefEvaluation abstract class ModeleNumRefEvaluation extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("hrm");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("hrm");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @param Object $object Object we need next value for
* @return boolean false if conflict, true if ok
*/
public function canBeActivated($object)
{
return true;
}
/**
* Returns next assigned value
*
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -27,19 +27,15 @@
* \brief File with parent class for generating members to PDF * \brief File with parent class for generating members to PDF
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
* Parent class to manage intervention document templates * Parent class to manage intervention document templates
*/ */
abstract class ModelePDFMember extends CommonDocGenerator abstract class ModelePDFMember extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -65,13 +61,8 @@ abstract class ModelePDFMember extends CommonDocGenerator
/** /**
* Classe mere des modeles de numerotation des references de members * Classe mere des modeles de numerotation des references de members
*/ */
abstract class ModeleNumRefMembers abstract class ModeleNumRefMembers extends CommonNumRefGenerator
{ {
/**
* @var string Version
*/
public $version = '';
public $code_modifiable; // Editable code public $code_modifiable; // Editable code
public $code_modifiable_invalide; // Modified code if it is invalid public $code_modifiable_invalide; // Modified code if it is invalid
@@ -80,101 +71,6 @@ abstract class ModeleNumRefMembers
public $code_null; // public $code_null; //
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("members");
return $langs->trans("NoDescription");
}
/**
* Return name of module
*
* @return string Module name
*/
public function getName()
{
return $this->name;
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("members");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @param Societe $objsoc Object third party
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Renvoi version du module numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
/** /**
* Return description of module parameters * Return description of module parameters
@@ -197,10 +93,10 @@ abstract class ModeleNumRefMembers
} }
$s = ''; $s = '';
$s .= $langs->trans("Name").': <b>'.$this->getName().'</b><br>'; $s .= $langs->trans("Name").': <b>'.$this->getName($langs).'</b><br>';
$s .= $langs->trans("Version").': <b>'.$this->getVersion().'</b><br>'; $s .= $langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
$s .= $langs->trans("MemberCodeDesc").'<br>'; $s .= $langs->trans("MemberCodeDesc").'<br>';
$s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getName().'</b><br>'; $s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getName($langs).'</b><br>';
$s .= '<br>'; $s .= '<br>';
$s .= '<u>'.$langs->trans("ThisIsModuleRules").':</u><br>'; $s .= '<u>'.$langs->trans("ThisIsModuleRules").':</u><br>';

View File

@@ -30,47 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/ */
abstract class ModelePDFMovement extends CommonDocGenerator abstract class ModelePDFMovement extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
public $option_codestockservice; public $option_codestockservice;

View File

@@ -30,6 +30,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -38,7 +39,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFMo extends CommonDocGenerator abstract class ModelePDFMo extends CommonDocGenerator
{ {
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -61,103 +61,10 @@ abstract class ModelePDFMo extends CommonDocGenerator
} }
/** /**
* Parent class to manage numbering of MOs * Parent class to manage numbering of MOs
*/ */
abstract class ModeleNumRefMos abstract class ModeleNumRefMos extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("mrp");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("mrp");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns next assigned value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -16,102 +16,12 @@
* or see https://www.gnu.org/ * or see https://www.gnu.org/
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
* \class ModeleNumRefPayments * Payment numbering references mother class
* \brief Payment numbering references mother class
*/ */
abstract class ModeleNumRefPayments extends CommonNumRefGenerator
abstract class ModeleNumRefPayments
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Return the default description of numbering module
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoDescription");
}
/**
* Return numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns the next value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns the module numbering version
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
} }

View File

@@ -26,54 +26,15 @@
* \brief File with parent class for generating products to PDF and File of class to manage product numbering * \brief File with parent class for generating products to PDF and File of class to manage product numbering
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
* Parent class to manage intervention document templates * Parent class to manage intervention document templates
*/ */
abstract class ModelePDFProduct extends CommonDocGenerator abstract class ModelePDFProduct extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -97,56 +58,8 @@ abstract class ModelePDFProduct extends CommonDocGenerator
/** /**
* Class template for classes of numbering product * Class template for classes of numbering product
*/ */
abstract class ModeleProductCode abstract class ModeleProductCode extends CommonNumRefGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
/** Returns the default description of the numbering pattern
*
* @param Translate $langs Object langs
* @return string Descriptive text
*/
public function info($langs)
{
$langs->load("bills");
return $langs->trans("NoDescription");
}
/** Renvoi nom module
*
* @param Translate $langs Object langs
* @return string Nom du module
*/
public function getNom($langs)
{
return empty($this->name) ? $this->nom : $this->name;
}
/** Return an example of numbering
*
* @param Translate $langs Object langs
* @return string Example
*/
public function getExample($langs)
{
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/** /**
* Return next value available * Return next value available
* *
@@ -160,31 +73,6 @@ abstract class ModeleProductCode
return $langs->trans("Function_getNextValue_InModuleNotWorking"); return $langs->trans("Function_getNextValue_InModuleNotWorking");
} }
/** Return version of module
*
* @return string Version
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Renvoi la liste des modeles de numérotation * Renvoi la liste des modeles de numérotation

View File

@@ -31,19 +31,15 @@
* \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering * \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
* Parent class to manage intervention document templates * Parent class to manage intervention document templates
*/ */
abstract class ModelePDFProductBatch extends CommonDocGenerator abstract class ModelePDFProductBatch extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -67,90 +63,7 @@ abstract class ModelePDFProductBatch extends CommonDocGenerator
/** /**
* Parent class to manage numbering of batch products * Parent class to manage numbering of batch products
*/ */
abstract class ModeleNumRefBatch abstract class ModeleNumRefBatch extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("productbatch");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("productbatch");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns next assigned value
*
* @param Societe $objsoc Object thirdparty
* @param Productlot $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') return $langs->trans("VersionDevelopment");
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
if ($this->version == 'dolibarr') return DOL_VERSION;
if ($this->version) return $this->version;
return $langs->trans("NotAvailable");
}
} }

View File

@@ -24,6 +24,7 @@
* and parent class for projects numbering models * and parent class for projects numbering models
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -36,61 +37,11 @@ abstract class ModelePDFProjects extends CommonDocGenerator
*/ */
public $db; public $db;
/**
* @var string model name
*/
public $name;
/** /**
* @var string model description (short text) * @var string model description (short text)
*/ */
public $description; public $description;
/**
* @var string document type
*/
public $type;
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
@@ -118,96 +69,7 @@ abstract class ModelePDFProjects extends CommonDocGenerator
/** /**
* Classe mere des modeles de numerotation des references de projets * Classe mere des modeles de numerotation des references de projets
*/ */
abstract class ModeleNumRefProjects abstract class ModeleNumRefProjects extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("projects");
return $langs->trans("NoDescription");
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("projects");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @param Societe $objsoc Object third party
* @param Project $project Object project
* @return string Valeur
*/
public function getNextValue($objsoc, $project)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Renvoi version du module numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
} }

View File

@@ -28,6 +28,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis car utilise dans les classes qui heritent require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis car utilise dans les classes qui heritent
@@ -36,11 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis
*/ */
abstract class ModelePDFPropales extends CommonDocGenerator abstract class ModelePDFPropales extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
public $posxpicture; public $posxpicture;
public $posxtva; public $posxtva;
public $posxup; public $posxup;
@@ -84,99 +80,7 @@ abstract class ModelePDFPropales extends CommonDocGenerator
/** /**
* Parent class for numbering rules of proposals * Parent class for numbering rules of proposals
*/ */
abstract class ModeleNumRefPropales abstract class ModeleNumRefPropales extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("propale");
return $langs->trans("NoDescription");
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("propale");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @param Societe $objsoc Object third party
* @param Propal $propal Object commercial proposal
* @return string Valeur
*/
public function getNextValue($objsoc, $propal)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Renvoi version du module numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -22,16 +22,15 @@
* \brief File that contains parent class for sending receipts models * \brief File that contains parent class for sending receipts models
* and parent class for sending receipts numbering models * and parent class for sending receipts numbering models
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
* Parent class of sending receipts models * Parent class of sending receipts models
*/ */
abstract class ModelePdfReception extends CommonDocGenerator abstract class ModelePdfReception extends CommonDocGenerator
{ {
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -57,89 +56,7 @@ abstract class ModelePdfReception extends CommonDocGenerator
/** /**
* Parent Class of numbering models of sending receipts references * Parent Class of numbering models of sending receipts references
*/ */
abstract class ModelNumRefReception abstract class ModelNumRefReception extends CommonNumRefGenerator
{ {
public $error = ''; // No overload code
public $version;
/**
* Return if a model can be used or not
*
* @return boolean true if model can be used
*/
public function isEnabled()
{
return true;
}
/**
* Return default description of numbering model
*
* @return string text description
*/
public function info()
{
global $langs;
$langs->load("reception");
return $langs->trans("NoDescription");
}
/**
* Returns numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("reception");
return $langs->trans("NoExample");
}
/**
* Test if existing numbers make problems with numbering
*
* @return boolean false if conflit, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns next value assigned
*
* @param Societe $objsoc Third party object
* @param Object $reception Reception object
* @return string Value
*/
public function getNextValue($objsoc, $reception)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of the numbering model
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -25,6 +25,7 @@
* \brief File with parent class of submodules to manage numbering and document generation * \brief File with parent class of submodules to manage numbering and document generation
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -32,11 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/ */
abstract class ModeleThirdPartyDoc extends CommonDocGenerator abstract class ModeleThirdPartyDoc extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -61,63 +57,8 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
/** /**
* Parent class for third parties code generators * Parent class for third parties code generators
*/ */
abstract class ModeleThirdPartyCode abstract class ModeleThirdPartyCode extends CommonNumRefGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* @var array Error code (or message) array
*/
public $errors;
/** Returns the default description of the numbering pattern
*
* @param Translate $langs Object langs
* @return string Descriptive text
*/
public function info($langs)
{
$langs->load("bills");
return $langs->trans("NoDescription");
}
/** Return name of module
*
* @param Translate $langs Object langs
* @return string Nom du module
*/
public function getNom($langs)
{
return $this->name;
}
/** Return an example of numbering
*
* @param Translate $langs Object langs
* @return string Example
*/
public function getExample($langs)
{
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/** /**
* Return next value available * Return next value available
* *
@@ -131,30 +72,6 @@ abstract class ModeleThirdPartyCode
return $langs->trans("Function_getNextValue_InModuleNotWorking"); return $langs->trans("Function_getNextValue_InModuleNotWorking");
} }
/**
* Return version of module
*
* @return string Version
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Renvoie la liste des modeles de numérotation * Renvoie la liste des modeles de numérotation
@@ -273,74 +190,8 @@ abstract class ModeleThirdPartyCode
/** /**
* Parent class for third parties accountancy code generators * Parent class for third parties accountancy code generators
*/ */
abstract class ModeleAccountancyCode abstract class ModeleAccountancyCode extends CommonNumRefGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return description of module
*
* @param Translate $langs Object langs
* @return string Description of module
*/
public function info($langs)
{
$langs->load("bills");
return $langs->trans("NoDescription");
}
/**
* Return an example of result returned by getNextValue
*
* @param Translate $langs Object langs
* @param societe $objsoc Object thirdparty
* @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Example
*/
public function getExample($langs, $objsoc = 0, $type = -1)
{
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Return version of module
*
* @return string Version
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("NotAvailable");
}
}
/** /**
* Return description of module parameters * Return description of module parameters
* *

View File

@@ -23,47 +23,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/ */
abstract class ModelePDFStock extends CommonDocGenerator abstract class ModelePDFStock extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules

View File

@@ -30,6 +30,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -38,7 +39,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFStockTransfer extends CommonDocGenerator abstract class ModelePDFStockTransfer extends CommonDocGenerator
{ {
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -65,91 +65,7 @@ abstract class ModelePDFStockTransfer extends CommonDocGenerator
/** /**
* Parent class to manage numbering of StockTransfer * Parent class to manage numbering of StockTransfer
*/ */
abstract class ModeleNumRefStockTransfer abstract class ModeleNumRefStockTransfer extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("stocktransfer@stocktransfer");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("stocktransfer@stocktransfer");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @param Object $object Object we need next value for
* @return boolean false if conflict, true if ok
*/
public function canBeActivated($object)
{
return true;
}
/**
* Returns next assigned value
*
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') return $langs->trans("VersionDevelopment");
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
if ($this->version == 'dolibarr') return DOL_VERSION;
if ($this->version) return $this->version;
return $langs->trans("NotAvailable");
}
} }

View File

@@ -26,6 +26,7 @@
* and parent class for supplier invoices numbering models * and parent class for supplier invoices numbering models
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -34,12 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation models * Return list of active generation models
@@ -64,93 +59,7 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
/** /**
* Parent Class of numbering models of suppliers invoices references * Parent Class of numbering models of suppliers invoices references
*/ */
abstract class ModeleNumRefSuppliersInvoices abstract class ModeleNumRefSuppliersInvoices extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/** Return if a model can be used or not
*
* @return boolean true if model can be used
*/
public function isEnabled()
{
return true;
}
/** Returns the default description of the model numbering
*
* @return string Description Text
*/
public function info()
{
global $langs;
$langs->load("invoices");
return $langs->trans("NoDescription");
}
/** Returns a numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("invoices");
return $langs->trans("NoExample");
}
/** Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/** Returns next value assigned
*
* @param Societe $objsoc Object third party
* @param Object $object Object
* @param string $mode 'next' for next value or 'last' for last value
* @return string Value if OK, 0 if KO
*/
public function getNextValue($objsoc, $object, $mode = 'next')
{
global $langs;
return $langs->trans("NotAvailable");
}
/** Returns version of the model numbering
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -29,6 +29,7 @@
* and parent class for supplier orders numbering models * and parent class for supplier orders numbering models
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -54,12 +55,6 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
public $atleastoneratenotnull = 0; public $atleastoneratenotnull = 0;
public $atleastonediscount = 0; public $atleastonediscount = 0;
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation models * Return list of active generation models
@@ -86,92 +81,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
/** /**
* Parent Class of numbering models of suppliers orders references * Parent Class of numbering models of suppliers orders references
*/ */
abstract class ModeleNumRefSuppliersOrders abstract class ModeleNumRefSuppliersOrders extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/** Return if a model can be used or not
*
* @return boolean true if model can be used
*/
public function isEnabled()
{
return true;
}
/** Returns default description of numbering model
*
* @return string Description Text
*/
public function info()
{
global $langs;
$langs->load("orders");
return $langs->trans("NoDescription");
}
/** Returns a numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("orders");
return $langs->trans("NoExample");
}
/** Tests if existing numbers make problems with numbering
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/** Returns next value assigned
*
* @param Societe $objsoc Object third party
* @param Object $object Object
* @return string Valeur
*/
public function getNextValue($objsoc = 0, $object = '')
{
global $langs;
return $langs->trans("NotAvailable");
}
/** Returns version of the numbering model
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -17,6 +17,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -24,47 +25,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/ */
abstract class ModelePDFSuppliersPayments extends CommonDocGenerator abstract class ModelePDFSuppliersPayments extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation models * Return list of active generation models
@@ -91,97 +51,7 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator
* *
* Payment numbering references mother class * Payment numbering references mother class
*/ */
abstract class ModeleNumRefSupplierPayments extends CommonNumRefGenerator
abstract class ModeleNumRefSupplierPayments
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Return the default description of numbering module
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoDescription");
}
/**
* Return numbering example
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Returns the next value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($objsoc, $object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns the module numbering version
*
* @return string Value
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
} elseif ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -28,6 +28,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis car utilise dans les classes qui heritent require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis car utilise dans les classes qui heritent
@@ -36,12 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis
*/ */
abstract class ModelePDFSupplierProposal extends CommonDocGenerator abstract class ModelePDFSupplierProposal extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -67,99 +62,7 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator
/** /**
* Classe mere des modeles de numerotation des references de propales * Classe mere des modeles de numerotation des references de propales
*/ */
abstract class ModeleNumRefSupplierProposal abstract class ModeleNumRefSupplierProposal extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("supplier_proposal");
return $langs->trans("NoDescription");
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("supplier_proposal");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @param Societe $objsoc Object third party
* @param SupplierProposal $supplier_proposal Object commercial proposal
* @return string Valeur
*/
public function getNextValue($objsoc, $supplier_proposal)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Renvoi version du module numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -26,105 +26,13 @@
* \brief File containing the parent class for the numbering of cash register receipts * \brief File containing the parent class for the numbering of cash register receipts
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
* \class ModeleNumRefTakepos * Classe mere des modeles de numerotation des tickets de caisse
* \brief Classe mere des modeles de numerotation des tickets de caisse
*/ */
abstract class ModeleNumRefTakepos abstract class ModeleNumRefTakepos extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("cashdesk@cashdesk");
return $langs->trans("NoDescription");
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load('cashdesk@cashdesk');
return $langs->trans('NoExample');
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @param Societe $objsoc Object thirdparty
* @param Facture $invoice Object invoice
* @param string $mode 'next' for next value or 'last' for last value
* @return string Value if KO, <0 if KO
*/
public function getNextValue($objsoc = null, $invoice = null, $mode = 'next')
{
global $langs;
return $langs->trans('NotAvailable');
}
/**
* Renvoi version du modele de numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans('VersionDevelopment');
}
if ($this->version == 'experimental') {
return $langs->trans('VersionExperimental');
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans('NotAvailable');
}
} }

View File

@@ -26,13 +26,14 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
* Parent class for documents models * Parent class for documents models
*/ */
abstract class ModelePDFTicket extends CommonDocGenerator abstract class ModelePDFTicket extends CommonDocGenerator
{ {
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -58,103 +59,7 @@ abstract class ModelePDFTicket extends CommonDocGenerator
/** /**
* Classe mere des modeles de numerotation des references de projets * Classe mere des modeles de numerotation des references de projets
*/ */
abstract class ModeleNumRefTicket abstract class ModeleNumRefTicket extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering pattern
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("ticket");
return $langs->trans("NoDescription");
}
/**
* Return an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("ticket");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @return boolean false if conflict, true if ok
*/
public function canBeActivated()
{
return true;
}
/**
* Renvoi prochaine valeur attribuee
*
* @param Societe $objsoc Object third party
* @param Ticket $ticket Object ticket
* @return string Valeur
*/
public function getNextValue($objsoc, $ticket)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Renvoi version du module numerotation
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -19,31 +19,20 @@
* or see https://www.gnu.org/ * or see https://www.gnu.org/
*/ */
/**
* \class ModeleProductCode
* \brief Parent class for product code generators
*/
/** /**
* \file htdocs/core/modules/contract/modules_contract.php * \file htdocs/core/modules/contract/modules_contract.php
* \ingroup contract * \ingroup contract
* \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering * \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
/** /**
* Parent class to manage intervention document templates * Parent class to manage intervention document templates
*/ */
abstract class ModelePDFUserGroup extends CommonDocGenerator abstract class ModelePDFUserGroup extends CommonDocGenerator
{ {
/**
* @var string Error code (or message)
*/
public $error = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules

View File

@@ -30,6 +30,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -38,7 +39,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFWorkstation extends CommonDocGenerator abstract class ModelePDFWorkstation extends CommonDocGenerator
{ {
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -61,103 +61,10 @@ abstract class ModelePDFWorkstation extends CommonDocGenerator
} }
/** /**
* Parent class to manage numbering of Workstation * Parent class to manage numbering of Workstation
*/ */
abstract class ModeleNumRefWorkstation abstract class ModeleNumRefWorkstation extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Version
*/
public $version = '';
/**
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("workstation@workstation");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("workstation@workstation");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @param Object $object Object we need next value for
* @return boolean false if conflict, true if ok
*/
public function canBeActivated($object)
{
return true;
}
/**
* Returns next assigned value
*
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -29,7 +29,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/** /**
@@ -37,43 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFMyObject extends CommonDocGenerator abstract class ModelePDFMyObject extends CommonDocGenerator
{ {
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -85,8 +48,6 @@ abstract class ModelePDFMyObject extends CommonDocGenerator
public static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf;
$type = 'myobject'; $type = 'myobject';
$list = array(); $list = array();
@@ -98,97 +59,10 @@ abstract class ModelePDFMyObject extends CommonDocGenerator
} }
/** /**
* Parent class to manage numbering of MyObject * Parent class to manage numbering of MyObject
*/ */
abstract class ModeleNumRefMyObject abstract class ModeleNumRefMyObject extends CommonNumRefGenerator
{ {
/** // No overload code
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("mymodule@mymodule");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("mymodule@mymodule");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @param Object $object Object we need next value for
* @return boolean false if conflict, true if ok
*/
public function canBeActivated($object)
{
return true;
}
/**
* Returns next assigned value
*
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -29,6 +29,7 @@
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
@@ -66,91 +67,5 @@ abstract class ModelePDFRecruitmentCandidature extends CommonDocGenerator
*/ */
abstract class ModeleNumRefRecruitmentCandidature abstract class ModeleNumRefRecruitmentCandidature
{ {
/** // No overloaded code
* @var string Error code (or message)
*/
public $error = '';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
public function isEnabled()
{
return true;
}
/**
* Returns the default description of the numbering template
*
* @return string Descriptive text
*/
public function info()
{
global $langs;
$langs->load("recruitment");
return $langs->trans("NoDescription");
}
/**
* Returns an example of numbering
*
* @return string Example
*/
public function getExample()
{
global $langs;
$langs->load("recruitment");
return $langs->trans("NoExample");
}
/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
*
* @param Object $object Object we need next value for
* @return boolean false if conflict, true if ok
*/
public function canBeActivated($object)
{
return true;
}
/**
* Returns next assigned value
*
* @param Object $object Object we need next value for
* @return string Valeur
*/
public function getNextValue($object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns version of numbering module
*
* @return string Valeur
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
} }

View File

@@ -38,42 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/ */
abstract class ModelePDFRecruitmentJobPosition extends CommonDocGenerator abstract class ModelePDFRecruitmentJobPosition extends CommonDocGenerator
{ {
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
@@ -102,5 +66,5 @@ abstract class ModelePDFRecruitmentJobPosition extends CommonDocGenerator
*/ */
abstract class ModeleNumRefRecruitmentJobPosition extends CommonNumRefGenerator abstract class ModeleNumRefRecruitmentJobPosition extends CommonNumRefGenerator
{ {
// No overloaded code // No overload code
} }