\n";
if (method_exists($module, 'info')) {
- print $module->info($langs);
+ print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
} else {
print $module->description;
}
diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php
index 4e4ef01d9f0..8440bee8e74 100644
--- a/htdocs/admin/expensereport_rules.php
+++ b/htdocs/admin/expensereport_rules.php
@@ -3,6 +3,7 @@
* Copyright (C) 2017 ATM Consulting
* Copyright (C) 2017 Pierre-Henry Favre
* Copyright (C) 2018-2019 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -355,7 +356,7 @@ foreach ($rules as $rule) {
echo '
';
+ // @phan-suppress-next-line PhanEmptyForeach
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled'] == 1) {
$setupnotempty++;
@@ -280,6 +281,7 @@ if ($action == 'edit') {
print '
';
print '
'.$langs->trans("Parameter").'
'.$langs->trans("Value").'
';
+ // @phan-suppress-next-line PhanEmptyForeach
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled'] == 1) {
$setupnotempty++;
@@ -379,6 +381,8 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db);
+ '@phan-var-force ModeleNumRefKnowledgeRecord $module';
+
// Show modules according to features level
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
@@ -520,6 +524,8 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
require_once $dir.'/'.$file;
$module = new $className($db);
+ '@phan-var-force ModelePDFKnowledgeRecord $module';
+
$modulequalified = 1;
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
@@ -533,7 +539,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print(empty($module->name) ? $name : $module->name);
print "
\n";
if (method_exists($module, 'info')) {
- print $module->info($langs);
+ print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
} else {
print $module->description;
}
diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php
index e2fe6e501c8..787c011fcb2 100644
--- a/htdocs/admin/mrp.php
+++ b/htdocs/admin/mrp.php
@@ -211,6 +211,8 @@ foreach ($dirmodels as $reldir) {
$module = new $file($db);
+ '@phan-var-force ModeleNumRefMos $module';
+
// Show modules according to features level
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
@@ -346,6 +348,8 @@ foreach ($dirmodels as $reldir) {
require_once $dir.'/'.$file;
$module = new $classname($db);
+ '@phan-var-force ModelePDFMo $module';
+
$modulequalified = 1;
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
@@ -359,7 +363,7 @@ foreach ($dirmodels as $reldir) {
print(empty($module->name) ? $name : $module->name);
print "
\n";
if (method_exists($module, 'info')) {
- print $module->info($langs);
+ print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
} else {
print $module->description;
}
diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php
index 5c346d18e61..43819c9e093 100644
--- a/htdocs/admin/oauthlogintokens.php
+++ b/htdocs/admin/oauthlogintokens.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2013-2016 Laurent Destailleur
* Copyright (C) 2014-2018 Frederic France
* Copyright (C) 2020 Nicolas ZABOURI
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -511,6 +512,9 @@ if ($mode == 'test' && $user->admin) {
$classname = 'printing_'.$driver;
$langs->load($driver);
$printer = new $classname($db);
+
+ '@phan-var-force PrintingDriver $printer';
+
//print '
'.print_r($printer, true).'
';
if (count($printer->getlistAvailablePrinters())) {
if ($printer->listAvailablePrinters() == 0) {
diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php
index 2b5b97dc90d..c6ad34ebbe5 100644
--- a/htdocs/admin/order.php
+++ b/htdocs/admin/order.php
@@ -297,6 +297,8 @@ foreach ($dirmodels as $reldir) {
$module = new $file($db);
+ '@phan-var-force ModeleNumRefCommandes $module';
+
// Show modules according to features level
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
@@ -434,6 +436,8 @@ foreach ($dirmodels as $reldir) {
require_once $dir.'/'.$file;
$module = new $classname($db);
+ '@phan-var-force ModelePDFCommandes $module';
+
$modulequalified = 1;
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
@@ -447,7 +451,7 @@ foreach ($dirmodels as $reldir) {
print(empty($module->name) ? $name : $module->name);
print "
\n";
if (method_exists($module, 'info')) {
- print $module->info($langs);
+ print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
} else {
print $module->description;
}
diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php
index f41c9e41d76..b6a833c7897 100644
--- a/htdocs/admin/perms.php
+++ b/htdocs/admin/perms.php
@@ -91,6 +91,8 @@ foreach ($modulesdir as $dir) {
include_once $dir.$file;
$objMod = new $modName($db);
+ '@phan-var-force DolibarrModules $objMod';
+
// Load all lang files of module
if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
foreach ($objMod->langfiles as $domain) {
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index e1dd61d594c..f4103e2609e 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -274,6 +274,8 @@ foreach ($dirmodels as $reldir) {
$module = new $file();
+ '@phan-var-force ModeleNumRefPropales $module';
+
// Show modules according to features level
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
@@ -283,7 +285,7 @@ foreach ($dirmodels as $reldir) {
}
if ($module->isEnabled()) {
- print '
';
print '';
diff --git a/htdocs/core/boxes/box_last_knowledgerecord.php b/htdocs/core/boxes/box_last_knowledgerecord.php
index 354c21b00ce..499b108ed0e 100644
--- a/htdocs/core/boxes/box_last_knowledgerecord.php
+++ b/htdocs/core/boxes/box_last_knowledgerecord.php
@@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Jean-François FERRY
* Copyright (C) 2016 Christophe Battarel
* Copyright (C) 2018-2023 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,12 +42,12 @@ class box_last_knowledgerecord extends ModeleBoxes
public $boximg = "knowledgemanagement";
/**
- * @var string boc label
+ * @var string box label
*/
public $boxlabel;
/**
- * @var array box dependencies
+ * @var string[] box dependencies
*/
public $depends = array("knowledgemanagement");
@@ -98,7 +99,7 @@ class box_last_knowledgerecord extends ModeleBoxes
$sql .= " AND k.fk_soc= ".((int) $user->socid);
}
- $sql.= " AND k.status > 0";
+ $sql .= " AND k.status > 0";
$sql .= " ORDER BY k.date_creation DESC, k.rowid DESC ";
$sql .= $this->db->plimit($max, 0);
diff --git a/htdocs/core/boxes/box_last_modified_knowledgerecord.php b/htdocs/core/boxes/box_last_modified_knowledgerecord.php
index baf376bcbe7..8a574e2d237 100644
--- a/htdocs/core/boxes/box_last_modified_knowledgerecord.php
+++ b/htdocs/core/boxes/box_last_modified_knowledgerecord.php
@@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Jean-François FERRY
* Copyright (C) 2016 Christophe Battarel
* Copyright (C) 2018-2023 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,7 +47,7 @@ class box_last_modified_knowledgerecord extends ModeleBoxes
public $boxlabel;
/**
- * @var array box dependencies
+ * @var string[] box dependencies
*/
public $depends = array("knowledgemanagement");
@@ -98,7 +99,7 @@ class box_last_modified_knowledgerecord extends ModeleBoxes
$sql .= " AND k.fk_soc= ".((int) $user->socid);
}
- $sql.= " AND k.status > 0";
+ $sql .= " AND k.status > 0";
$sql .= " ORDER BY k.tms DESC, k.rowid DESC ";
$sql .= $this->db->plimit($max, 0);
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index ea727fbf289..7520d84c6bc 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -1,8 +1,8 @@
- * Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2014 Raphaël Doursenaud
- * Copyright (C) 2015 Frederic France
+/* Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2014 Raphaël Doursenaud
+ * Copyright (C) 2015 Frederic France
* Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
@@ -39,6 +39,13 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
*/
public $db;
+ /**
+ * Must be defined in the box class
+ *
+ * @var ''|'development'|'experimental'|'dolibarr'
+ */
+ public $version;
+
/**
* @var string param
*/
@@ -60,7 +67,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
public $error = '';
/**
- * @var int Maximum lines
+ * @var int<0,max> Maximum lines
*/
public $max = 5;
@@ -131,6 +138,24 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
public $widgettype = '';
+ //! Must be provided in child classes
+ /**
+ * Note $picto is deprecated
+ *
+ * @var string Example "accountancy"
+ */
+ public $boximg;
+ /**
+ * @var string Example "BoxLastManualEntries"
+ */
+ public $boxlabel;
+ /**
+ * @var string[] Example array("accounting")
+ */
+ public $depends;
+
+
+
/**
* Constructor
*
@@ -156,9 +181,9 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
/**
* Load a box line from its rowid
*
- * @param int $rowid Row id to load
+ * @param int $rowid Row id to load
*
- * @return int Return integer <0 if KO, >0 if OK
+ * @return int<-1,1> Return integer <0 if KO, >0 if OK
*/
public function fetch($rowid)
{
@@ -196,7 +221,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
*
* @param array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
* @param array> $contents Array with properties of box lines
- * @param int $nooutput No print, only return string
+ * @param int<0,1> $nooutput No print, only return string
* @return string
*/
public function showBox($head, $contents, $nooutput = 0)
@@ -417,7 +442,8 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
* List is sorted by widget filename so by priority to run.
*
* @param ?string[] $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only.
- * @return array Array list of widget
+ * @return array Array list of widgets
+ *
*/
public static function getWidgetsList($forcedirwidget = null)
{
@@ -503,6 +529,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
}
$objMod = new $modName($db);
+ '@phan-var-force ModeleBoxes $objMod';
if (is_object($objMod)) {
// Define disabledbyname and disabledbymodule
$disabledbyname = 0;
@@ -513,9 +540,8 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
if (preg_match('/NORUN$/i', $files[$key])) {
$disabledbyname = 1;
}
-
// We set info of modules
- $widget[$j]['picto'] = (empty($objMod->picto) ? (empty($objMod->boximg) ? img_object('', 'generic') : $objMod->boximg) : img_object('', $objMod->picto));
+ $widget[$j]['picto'] = ((!property_exists($objMod, 'picto') || empty($objMod->picto)) ? (empty($objMod->boximg) ? img_object('', 'generic') : $objMod->boximg) : img_object('', $objMod->picto));
$widget[$j]['file'] = $files[$key];
$widget[$j]['fullpath'] = $fullpath[$key];
$widget[$j]['relpath'] = $relpath[$key];
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 38060f89b73..aff8e70e489 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -43,7 +43,7 @@ abstract class CommonDocGenerator
public $name = '';
/**
- * @var string Version
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Version
*/
public $version = '';
@@ -1033,6 +1033,7 @@ abstract class CommonDocGenerator
dol_include_once($InfoFieldList[1]);
if ($classname && class_exists($classname)) {
$tmpobject = new $classname($this->db);
+ '@phan-var-force CommonObject $tmpobject';
$tmpobject->fetch($id);
// completely replace the id with the linked object name
$formatedarrayoption['options_'.$key] = $tmpobject->name;
diff --git a/htdocs/core/class/commonnumrefgenerator.class.php b/htdocs/core/class/commonnumrefgenerator.class.php
index bdffbf7a372..20b956034b0 100644
--- a/htdocs/core/class/commonnumrefgenerator.class.php
+++ b/htdocs/core/class/commonnumrefgenerator.class.php
@@ -36,7 +36,7 @@ abstract class CommonNumRefGenerator
public $name = '';
/**
- * @var string Version
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'experimental'|'dolibarr' Version
*/
public $version = '';
@@ -164,4 +164,12 @@ abstract class CommonNumRefGenerator
}
return $langs->trans("NotAvailable");
}
+
+
+ /**
+ * Return an example of numbering
+ *
+ * @return string Example
+ */
+ abstract public function getExample();
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index aa8089f82a7..74a7ccd6ac3 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -166,12 +166,12 @@ abstract class CommonObject
public $linkedObjectsIds;
/**
- * @var mixed Array of linked objects. Loaded by ->fetchObjectLinked
+ * @var array Array of linked objects. Loaded by ->fetchObjectLinked, key = object type
*/
public $linkedObjects;
/**
- * @var boolean[] Array of boolean with object id as key and value as true if linkedObjects full loaded for object id. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction.
+ * @var array Array of boolean with object id as key and value as true if linkedObjects full loaded for object id. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction.
*/
private $linkedObjectsFullLoaded = array();
diff --git a/htdocs/core/class/commonsocialnetworks.class.php b/htdocs/core/class/commonsocialnetworks.class.php
index e82e35ba067..0c7a61a9c5b 100644
--- a/htdocs/core/class/commonsocialnetworks.class.php
+++ b/htdocs/core/class/commonsocialnetworks.class.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,7 +29,7 @@
trait CommonSocialNetworks
{
/**
- * @var array array of socialnetworks
+ * @var array
*/
public $socialnetworks;
@@ -36,7 +37,7 @@ trait CommonSocialNetworks
/**
* Show social network part if the module is enabled with hiding functionality
*
- * @param array $socialnetworks Array of social networks
+ * @param array,icon:string,label:string}> $socialnetworks Array of social networks
* @param int $colspan Colspan
* @return void
*/
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index e43bd09705e..71f6df7c1cb 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -2093,6 +2093,7 @@ class ExtraFields
dol_include_once($InfoFieldList[1]);
if ($classname && class_exists($classname)) {
$object = new $classname($this->db);
+ '@phan-var-force CommonObject $object';
$object->fetch($value);
$value = $object->getNomUrl(3);
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 7cb4995469d..99dab2ef8ad 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5036,7 +5036,7 @@ class Form
/**
* Creates HTML units selector (code => label)
*
- * @param string $selected Preselected Unit ID
+ * @param int|'' $selected Preselected Unit ID
* @param string $htmlname Select name
* @param int<0,1> $showempty Add an empty line
* @param string $unit_type Restrict to one given unit type
@@ -5085,7 +5085,7 @@ class Form
/**
* Return a HTML select list of bank accounts
*
- * @param int|string $selected Id account preselected
+ * @param int|'' $selected Id account preselected
* @param string $htmlname Name of select zone
* @param int $status Status of searched accounts (0=open, 1=closed, 2=both)
* @param string $filtre To filter the list. This parameter must not come from input of users
@@ -9067,7 +9067,7 @@ class Form
$tmpvalue = empty($value['label']) ? '' : $value['label'];
$tmpcolor = empty($value['color']) ? '' : $value['color'];
$tmppicto = empty($value['picto']) ? '' : $value['picto'];
- $tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']): $value['labelhtml'];
+ $tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml'];
}
$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 8b7c851a830..e2952c83135 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -1776,14 +1776,14 @@ class FormMail extends Form
}
/**
- * Find if template exists and are available for current user, then set them into $this->lines_model.
- * Search into table c_email_templates
+ * Find if template exists and are available for current user, then set them into $this->lines_model.
+ * Search in table c_email_templates
*
- * @param string $type_template Get message for key module
- * @param User $user Use template public or limited to this user
- * @param Translate $outputlangs Output lang object
- * @param int $active 1=Only active template, 0=Only disabled, -1=All
- * @return int Return integer <0 if KO, nb of records found if OK
+ * @param string $type_template Get message for key module
+ * @param User $user Use template public or limited to this user
+ * @param ?Translate $outputlangs Output lang object
+ * @param int<-1,1> $active 1=Only active template, 0=Only disabled, -1=All
+ * @return int<-1,max> Return integer <0 if KO, nb of records found if OK
*/
public function fetchAllEMailTemplate($type_template, $user, $outputlangs, $active = 1)
{
@@ -2036,28 +2036,28 @@ class ModelMail extends CommonObject
/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
- public $fields=array(
- "rowid" => array("type"=>"integer", "label"=>"TechnicalID", "enabled"=>"1", 'position'=>10, 'notnull'=>1, "visible"=>"-1",),
- "module" => array("type"=>"varchar(32)", "label"=>"Module", "enabled"=>"1", 'position'=>20, 'notnull'=>0, "visible"=>"-1",),
- "type_template" => array("type"=>"varchar(32)", "label"=>"Typetemplate", "enabled"=>"1", 'position'=>25, 'notnull'=>0, "visible"=>"-1",),
- "lang" => array("type"=>"varchar(6)", "label"=>"Lang", "enabled"=>"1", 'position'=>30, 'notnull'=>0, "visible"=>"-1",),
- "private" => array("type"=>"smallint(6)", "label"=>"Private", "enabled"=>"1", 'position'=>35, 'notnull'=>1, "visible"=>"-1",),
- "fk_user" => array("type"=>"integer:User:user/class/user.class.php", "label"=>"Fkuser", "enabled"=>"1", 'position'=>40, 'notnull'=>0, "visible"=>"-1", "css"=>"maxwidth500 widthcentpercentminusxx", "csslist"=>"tdoverflowmax150",),
- "datec" => array("type"=>"datetime", "label"=>"DateCreation", "enabled"=>"1", 'position'=>45, 'notnull'=>0, "visible"=>"-1",),
- "tms" => array("type"=>"timestamp", "label"=>"DateModification", "enabled"=>"1", 'position'=>50, 'notnull'=>1, "visible"=>"-1",),
- "label" => array("type"=>"varchar(255)", "label"=>"Label", "enabled"=>"1", 'position'=>55, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1", "css"=>"minwidth300", "cssview"=>"wordbreak", "csslist"=>"tdoverflowmax150",),
- "position" => array("type"=>"smallint(6)", "label"=>"Position", "enabled"=>"1", 'position'=>60, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "active" => array("type"=>"integer", "label"=>"Active", "enabled"=>"1", 'position'=>65, 'notnull'=>1, "visible"=>"-1", "alwayseditable"=>"1",),
- "topic" => array("type"=>"text", "label"=>"Topic", "enabled"=>"1", 'position'=>70, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "content" => array("type"=>"mediumtext", "label"=>"Content", "enabled"=>"1", 'position'=>75, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "content_lines" => array("type"=>"text", "label"=>"Contentlines", "enabled"=>"1", 'position'=>80, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "enabled" => array("type"=>"varchar(255)", "label"=>"Enabled", "enabled"=>"1", 'position'=>85, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "joinfiles" => array("type"=>"varchar(255)", "label"=>"Joinfiles", "enabled"=>"1", 'position'=>90, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "email_from" => array("type"=>"varchar(255)", "label"=>"Emailfrom", "enabled"=>"1", 'position'=>95, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "email_to" => array("type"=>"varchar(255)", "label"=>"Emailto", "enabled"=>"1", 'position'=>100, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "email_tocc" => array("type"=>"varchar(255)", "label"=>"Emailtocc", "enabled"=>"1", 'position'=>105, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "email_tobcc" => array("type"=>"varchar(255)", "label"=>"Emailtobcc", "enabled"=>"1", 'position'=>110, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
- "defaultfortype" => array("type"=>"smallint(6)", "label"=>"Defaultfortype", "enabled"=>"1", 'position'=>115, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",),
+ public $fields = array(
+ "rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "-1",),
+ "module" => array("type" => "varchar(32)", "label" => "Module", "enabled" => "1", 'position' => 20, 'notnull' => 0, "visible" => "-1",),
+ "type_template" => array("type" => "varchar(32)", "label" => "Typetemplate", "enabled" => "1", 'position' => 25, 'notnull' => 0, "visible" => "-1",),
+ "lang" => array("type" => "varchar(6)", "label" => "Lang", "enabled" => "1", 'position' => 30, 'notnull' => 0, "visible" => "-1",),
+ "private" => array("type" => "smallint(6)", "label" => "Private", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1",),
+ "fk_user" => array("type" => "integer:User:user/class/user.class.php", "label" => "Fkuser", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",),
+ "datec" => array("type" => "datetime", "label" => "DateCreation", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1",),
+ "tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 50, 'notnull' => 1, "visible" => "-1",),
+ "label" => array("type" => "varchar(255)", "label" => "Label", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1", "css" => "minwidth300", "cssview" => "wordbreak", "csslist" => "tdoverflowmax150",),
+ "position" => array("type" => "smallint(6)", "label" => "Position", "enabled" => "1", 'position' => 60, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "active" => array("type" => "integer", "label" => "Active", "enabled" => "1", 'position' => 65, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",),
+ "topic" => array("type" => "text", "label" => "Topic", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "content" => array("type" => "mediumtext", "label" => "Content", "enabled" => "1", 'position' => 75, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "content_lines" => array("type" => "text", "label" => "Contentlines", "enabled" => "1", 'position' => 80, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "enabled" => array("type" => "varchar(255)", "label" => "Enabled", "enabled" => "1", 'position' => 85, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "joinfiles" => array("type" => "varchar(255)", "label" => "Joinfiles", "enabled" => "1", 'position' => 90, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "email_from" => array("type" => "varchar(255)", "label" => "Emailfrom", "enabled" => "1", 'position' => 95, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "email_to" => array("type" => "varchar(255)", "label" => "Emailto", "enabled" => "1", 'position' => 100, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "email_tocc" => array("type" => "varchar(255)", "label" => "Emailtocc", "enabled" => "1", 'position' => 105, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "email_tobcc" => array("type" => "varchar(255)", "label" => "Emailtobcc", "enabled" => "1", 'position' => 110, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
+ "defaultfortype" => array("type" => "smallint(6)", "label" => "Defaultfortype", "enabled" => "1", 'position' => 115, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
);
public $rowid;
public $type_template;
diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php
index a61eff37261..1860dd3c404 100644
--- a/htdocs/core/class/ldap.class.php
+++ b/htdocs/core/class/ldap.class.php
@@ -1063,9 +1063,11 @@ class Ldap
/**
* Returns an array containing attributes and values for first record
*
+ * array{count:int,0..max:string,string:array}
+ *
* @param string $dn DN entry key
* @param string $filter Filter
- * @return int|array if KO: <=0 || if OK: array
+ * @return int|array<'count'|int|string,int|string|array> if KO: <=0 || if OK: array
*/
public function getAttribute($dn, $filter)
{
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 16a76979147..016906d0430 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -909,8 +909,8 @@ function security_prepare_head()
/**
* Prepare array with list of tabs
*
- * @param object $object Descriptor class
- * @return array Array of tabs to show
+ * @param DolibarrModules $object Descriptor class
+ * @return array> Array of tabs to show
*/
function modulehelp_prepare_head($object)
{
@@ -1172,6 +1172,7 @@ function activateModule($value, $withdeps = 1, $noconfverification = 0)
}
$objMod = new $modName($db);
+ '@phan-var-force DolibarrModules $objMod';
// Test if PHP version ok
$verphp = versionphparray();
@@ -1313,6 +1314,7 @@ function unActivateModule($value, $requiredby = 1)
if ($found) {
$objMod = new $modName($db);
+ '@phan-var-force DolibarrModules $objMod';
$result = $objMod->remove();
if ($result <= 0) {
$ret = $objMod->error;
@@ -1385,6 +1387,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab
if ($modName) {
include_once $dir.$file;
$objMod = new $modName($db);
+ '@phan-var-force DolibarrModules $objMod';
if ($objMod->numero > 0) {
$j = $objMod->numero;
@@ -1417,7 +1420,9 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab
// phpcs:disable
// Complete the arrays &$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond
+ // @phan-suppress-next-line PhanUndeclaredProperty
if (empty($objMod->dictionaries) && !empty($objMod->{"dictionnaries"})) {
+ // @phan-suppress-next-line PhanUndeclaredProperty
$objMod->dictionaries = $objMod->{"dictionnaries"}; // For backward compatibility
}
// phpcs:enable
@@ -1549,6 +1554,7 @@ function activateModulesRequiredByCountry($country_code)
if ($modName) {
include_once $dir.$file;
$objMod = new $modName($db);
+ '@phan-var-force DolibarrModules $objMod';
$modulequalified = 1;
@@ -1567,7 +1573,7 @@ function activateModulesRequiredByCountry($country_code)
if ($modulequalified) {
// Load languages files of module
- if (isset($objMod->automatic_activation) && is_array($objMod->automatic_activation) && isset($objMod->automatic_activation[$country_code])) {
+ if (property_exists($objMod, 'automatic_activation') && isset($objMod->automatic_activation) && is_array($objMod->automatic_activation) && isset($objMod->automatic_activation[$country_code])) {
activateModule($modName);
setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings');
diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php
index 5e8a982ddbe..a3ea72226a1 100644
--- a/htdocs/core/lib/ldap.lib.php
+++ b/htdocs/core/lib/ldap.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2006-2021 Regis Houssin
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -121,12 +122,12 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass)
/**
* Show a LDAP array into an HTML output array.
*
- * @param array $result Array to show. This array is already encoded into charset_output
- * @param int $level Level
- * @param int $count Count
- * @param string $var Var
- * @param int $hide Hide
- * @param int $subcount Subcount
+ * @param array<'count'|int|string,int|string|array> $result Array to show. This array is already encoded into charset_output
+ * @param int $level Level
+ * @param int $count Count
+ * @param string $var Var
+ * @param int<0,1> $hide Hide
+ * @param int $subcount Subcount
* @return int
*/
function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount = 0)
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index c16be0eb8b3..8eeea4da03a 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1551,6 +1551,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
$desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc);
}
+ $libelleproduitservice = ''; // Default value
if (!getDolGlobalString('PDF_HIDE_PRODUCT_LABEL_IN_SUPPLIER_LINES')) {
// Description short of product line
$libelleproduitservice = $label;
diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php
index b362e44a4e5..a37790cbd9e 100644
--- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php
+++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php
@@ -5,6 +5,7 @@
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018-2021 Philippe Grand
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
class doc_generic_asset_odt extends ModelePDFAsset
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
index 4f2b3b61e64..d06bcf717a6 100644
--- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
+++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
@@ -71,7 +71,7 @@ class pdf_standard_asset extends ModelePDFAsset
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/asset/mod_asset_advanced.php b/htdocs/core/modules/asset/mod_asset_advanced.php
index 5495d8b886f..06e4410a5b3 100644
--- a/htdocs/core/modules/asset/mod_asset_advanced.php
+++ b/htdocs/core/modules/asset/mod_asset_advanced.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,7 +36,7 @@ class mod_asset_advanced extends ModeleNumRefAsset
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -116,7 +117,7 @@ class mod_asset_advanced extends ModeleNumRefAsset
* Return next free value
*
* @param Asset $object Object we need next value for
- * @return string|int Next value if OK, 0 if KO
+ * @return string|int<-1,1> Next value if OK, <=0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/core/modules/asset/mod_asset_standard.php b/htdocs/core/modules/asset/mod_asset_standard.php
index d09748f158c..506a60388ca 100644
--- a/htdocs/core/modules/asset/mod_asset_standard.php
+++ b/htdocs/core/modules/asset/mod_asset_standard.php
@@ -35,7 +35,7 @@ class mod_asset_standard extends ModeleNumRefAsset
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -117,11 +117,12 @@ class mod_asset_standard extends ModeleNumRefAsset
return true;
}
+
/**
* Return next free value
*
- * @param Asset $object Object we need next value for
- * @return string|-1 Next value if OK, -1 if KO
+ * @param Asset $object Object we need next value for
+ * @return string|int<-1,1> Next value if OK, <=0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/core/modules/asset/modules_asset.php b/htdocs/core/modules/asset/modules_asset.php
index 2d196e395ba..b2b3c1e8e0a 100644
--- a/htdocs/core/modules/asset/modules_asset.php
+++ b/htdocs/core/modules/asset/modules_asset.php
@@ -6,6 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -81,5 +82,11 @@ abstract class ModelePDFAsset extends CommonDocGenerator
*/
abstract class ModeleNumRefAsset extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param Asset $object Object we need next value for
+ * @return string|int<-1,1> Next value if OK, <=0 if KO
+ */
+ abstract public function getNextValue($object);
}
diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php
index cd705085d61..babe8791bdc 100644
--- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php
+++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
class pdf_ban extends ModeleBankAccountDoc
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'development';
diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
index 9da84b80400..6b7441a25ce 100644
--- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
+++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
@@ -39,7 +39,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php
index 3ef61f9e1e3..b066f2a460c 100644
--- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php
+++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php
@@ -1,6 +1,7 @@
* Copyright (C) 2005 Regis Houssin
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,9 +35,9 @@ class modPhpbarcode extends ModeleBarCode
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z''development'|'experimental'|'dolibarr'
*/
- public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
+ public $version = 'dolibarr';
/**
* @var string Error code (or message)
diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
index c114ab8d694..e93e8dfee23 100644
--- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
+++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
@@ -34,9 +34,9 @@ class modTcpdfbarcode extends ModeleBarCode
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z''development'|'experimental'|'dolibarr'
*/
- public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
+ public $version = 'dolibarr';
/**
* @var string Error code (or message)
diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
index c1470f290ef..944e244fd17 100644
--- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php
+++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
@@ -39,7 +39,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -109,12 +109,16 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
/**
* Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
- * @param ?Product $objproduct Object product
- * @return string Return string example
+ * @param ?Translate $langs Object langs
+ * @param ?CommonObject $objproduct Object
+ * @return string Return string example
*/
- public function getExample($langs, $objproduct = null)
+ public function getExample($langs = null, $objproduct = null)
{
+ if (!$langs instanceof Translate) {
+ $langs = $GLOBALS['langs'];
+ '@phan-var-force Translate $langs';
+ }
$examplebarcode = $this->getNextValue($objproduct, '');
if (!$examplebarcode) {
$examplebarcode = $langs->trans('NotConfigured');
diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php
index 036a5b4a4cb..9cb371267b6 100644
--- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php
+++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php
@@ -38,25 +38,48 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode
{
public $name = 'Standard'; // Model Name
- public $code_modifiable; // Editable code
+ /**
+ * @var int<0,1> Editable code
+ */
+ public $code_modifiable;
- public $code_modifiable_invalide; // Modified code if it is invalid
+ /**
+ * @var int<0,1> Modified code if it is invalid
+ */
+ public $code_modifiable_invalide;
- public $code_modifiable_null; // Modified code if it is null
+ /**
+ * @var int<0,1> Modified code if it is null
+ */
+ public $code_modifiable_null;
- public $code_null; // Optional code
+ /**
+ * @var int<0,1> Optional code
+ */
+ public $code_null;
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
- public $searchcode; // Search string
+ /**
+ * @var string Search string
+ */
+ public $searchcode;
- public $numbitcounter; // Number of digits the counter
+ /**
+ * Number of digits for the counter (not bits, but digits)
+ *
+ * @var int<0,max>
+ */
+ public $numbitcounter;
- public $prefixIsRequired; // The prefix field of third party must be filled when using {pre}
+ /**
+ * @var int<0,1> If the prefix field of third party must be filled when using {pre}
+ */
+ public $prefixIsRequired;
/**
@@ -122,12 +145,16 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode
/**
* Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
- * @param ?Societe $objthirdparty Object third-party
- * @return string Return string example
+ * @param ?Translate $langs Object langs
+ * @param ?CommonObject $objthirdparty Object third-party / Societe
+ * @return string Return string example
*/
- public function getExample($langs, $objthirdparty = null)
+ public function getExample($langs = null, $objthirdparty = null)
{
+ if (!$langs instanceof Translate) {
+ $langs = $GLOBALS['langs'];
+ '@phan-var-force Translate $langs';
+ }
$examplebarcode = $this->getNextValue($objthirdparty, '');
if (!$examplebarcode) {
$examplebarcode = $langs->trans('NotConfigured');
diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php
index 51ba9c9a0d6..9512e3e2036 100644
--- a/htdocs/core/modules/barcode/modules_barcode.class.php
+++ b/htdocs/core/modules/barcode/modules_barcode.class.php
@@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
/**
* Parent class for barcode document generators (image)
+ *
+ * @property 'development'|'experimental'|'dolibarr' $version Dolibarr version of loaded document
*/
abstract class ModeleBarCode
{
@@ -48,6 +50,16 @@ abstract class ModeleBarCode
return true;
}
+
+ /**
+ * Return description
+ *
+ * @param Translate $langs Lang object to use for output
+ * @return string Descriptive text
+ */
+ abstract public function info($langs);
+
+
/**
* Save an image file on disk (with no output)
*
@@ -67,6 +79,8 @@ abstract class ModeleBarCode
/**
* Parent class for barcode numbering models
+ *
+ * @property string $nom Name for the GeneratorModel
*/
abstract class ModeleNumRefBarCode extends CommonNumRefGenerator
{
@@ -87,11 +101,22 @@ abstract class ModeleNumRefBarCode extends CommonNumRefGenerator
return $langs->trans("Function_getNextValue_InModuleNotWorking");
}
+
+ /**
+ * Return an example of result returned by getNextValue
+ *
+ * @param ?Translate $langs Object langs
+ * @param ?CommonObject $object Object product
+ * @return string Return string example
+ */
+ abstract public function getExample($langs = null, $object = null);
+
+
/**
* Return description of module parameters
*
* @param Translate $langs Output language
- * @param Societe $soc Third party object
+ * @param ?Societe $soc Third party object
* @param int $type -1=Nothing, 0=Product, 1=Service
* @return string HTML translated description
*/
diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
index a031761dafd..3f22a2b274c 100644
--- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
+++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
@@ -5,6 +5,7 @@
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018-2019 Philippe Grand
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
class doc_generic_bom_odt extends ModelePDFBom
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php
index 5e63218488b..65b3edf3b68 100644
--- a/htdocs/core/modules/bom/mod_bom_advanced.php
+++ b/htdocs/core/modules/bom/mod_bom_advanced.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,7 +37,7 @@ class mod_bom_advanced extends ModeleNumRefBoms
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php
index 69656164461..5b3d8006cfa 100644
--- a/htdocs/core/modules/bom/mod_bom_standard.php
+++ b/htdocs/core/modules/bom/mod_bom_standard.php
@@ -33,7 +33,7 @@ class mod_bom_standard extends ModeleNumRefBoms
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -116,7 +116,7 @@ class mod_bom_standard extends ModeleNumRefBoms
*
* @param Product $objprod Object product
* @param Bom $object Object we need next value for
- * @return string|-1 Next value if OK, -1 if KO
+ * @return string|int<-1,-1> Next value if OK, -1 if KO
*/
public function getNextValue($objprod, $object)
{
diff --git a/htdocs/core/modules/bom/modules_bom.php b/htdocs/core/modules/bom/modules_bom.php
index 38803e96ad6..ed78515888a 100644
--- a/htdocs/core/modules/bom/modules_bom.php
+++ b/htdocs/core/modules/bom/modules_bom.php
@@ -6,6 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -83,4 +84,13 @@ abstract class ModelePDFBom extends CommonDocGenerator
abstract class ModeleNumRefBoms extends CommonNumRefGenerator
{
// No overload code
+
+ /**
+ * Return next free value
+ *
+ * @param Product $objprod Object product
+ * @param Bom $object Object we need next value for
+ * @return string|int<-1,-1> Next value if OK, -1 if KO
+ */
+ abstract public function getNextValue($objprod, $object);
}
diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
index 68953dc4837..d5cce12be70 100644
--- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
+++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
@@ -56,23 +56,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
*/
public $line_per_page;
- /**
- * @var Account bank account
- */
- public $account;
-
- public $amount;
- public $date;
- public $nbcheque;
- public $ref;
public $ref_ext;
- /**
- * @var array lines
- */
- public $lines;
-
/**
* Constructor
*
diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php
index 3f760794750..5213c2def53 100644
--- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php
+++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php
@@ -33,7 +33,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php
index 0910f6e77b6..6ae0b8ea3e9 100644
--- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php
+++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php
@@ -1,6 +1,7 @@
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,7 +34,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php
index 30d36660b97..5c2f2fb9532 100644
--- a/htdocs/core/modules/cheque/modules_chequereceipts.php
+++ b/htdocs/core/modules/cheque/modules_chequereceipts.php
@@ -4,6 +4,7 @@
* Copyright (C) 2004 Eric Seigne
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2016 Juanjo Menent
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,6 +45,31 @@ abstract class ModeleNumRefChequeReceipts extends CommonNumRefGenerator
*/
abstract class ModeleChequeReceipts extends CommonDocGenerator
{
+ /**
+ * @var Account bank account
+ */
+ public $account;
+
+ /**
+ * @var string|float
+ */
+ public $amount;
+ /**
+ * @var string
+ */
+ public $date;
+ /**
+ * @var int
+ */
+ public $nbcheque;
+ /**
+ * @var string
+ */
+ public $ref;
+ /**
+ * @var stdClass[] lines
+ */
+ public $lines;
/**
* @var string Error code (or message)
*/
@@ -66,7 +92,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$list = getListOfModels($db, $type, $maxfilenamelength);
// TODO Remove this to use getListOfModels only
- $list = array('blochet'=>'blochet');
+ $list = array('blochet' => 'blochet');
return $list;
}
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index d0cf4df150d..36d42c7742b 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -5,6 +5,7 @@
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018-2021 Philippe Grand
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,7 +43,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index d932881191d..6ae70f28639 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -75,7 +75,7 @@ class pdf_einstein extends ModelePDFCommandes
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index 7b527980c50..efbab48188a 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -75,7 +75,7 @@ class pdf_eratosthene extends ModelePDFCommandes
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php
index e5e2e525342..348f0839022 100644
--- a/htdocs/core/modules/commande/mod_commande_marbre.php
+++ b/htdocs/core/modules/commande/mod_commande_marbre.php
@@ -33,7 +33,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -128,7 +128,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
*
* @param Societe $objsoc Object thirdparty
* @param Commande $object Object we need next value for
- * @return string|-1 Value if OK, -1 if KO
+ * @return string|int<-1,0> Value if OK, -1 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php
index ca1b476eb24..a3280fa1455 100644
--- a/htdocs/core/modules/commande/mod_commande_saphir.php
+++ b/htdocs/core/modules/commande/mod_commande_saphir.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,7 +37,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -124,7 +125,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
*
* @param Societe $objsoc Object thirdparty
* @param Commande $object Object we need next value for
- * @return string|int Next value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, -1 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php
index 00e765832e2..7f0f1456189 100644
--- a/htdocs/core/modules/commande/modules_commande.php
+++ b/htdocs/core/modules/commande/modules_commande.php
@@ -6,6 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -102,5 +103,12 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
*/
abstract class ModeleNumRefCommandes extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param Societe $objsoc Object thirdparty
+ * @param Commande $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, -1 if KO
+ */
+ abstract public function getNextValue($objsoc, $object);
}
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index ac846f7bebb..f5326c0cc54 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -3,6 +3,7 @@
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2018 Ferran Marcet
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
class doc_generic_contract_odt extends ModelePDFContract
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
index 60f368ce3ec..a5a0c6710b0 100644
--- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php
+++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
@@ -73,7 +73,7 @@ class pdf_strato extends ModelePDFContract
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php
index aa5c9114810..7af0d9e16bb 100644
--- a/htdocs/core/modules/contract/mod_contract_magre.php
+++ b/htdocs/core/modules/contract/mod_contract_magre.php
@@ -1,6 +1,7 @@
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,7 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
*/
class mod_contract_magre extends ModelNumRefContracts
{
-
// variables inherited from ModelNumRefContracts class
public $name = 'Magre';
public $version = 'dolibarr';
@@ -113,7 +113,7 @@ class mod_contract_magre extends ModelNumRefContracts
*
* @param Societe $objsoc third party object
* @param Contrat $contract contract object
- * @return string|int Next value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $contract)
{
diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php
index ca517b5a8a4..3ebb48d59e8 100644
--- a/htdocs/core/modules/contract/mod_contract_olive.php
+++ b/htdocs/core/modules/contract/mod_contract_olive.php
@@ -77,9 +77,9 @@ class mod_contract_olive extends ModelNumRefContracts
/**
* Return an example of result returned by getNextValue
*
- * @param Societe $objsoc Object thirdparty
- * @param Contrat $contract Object contract
- * @return string Return next value
+ * @param Societe $objsoc Object thirdparty
+ * @param Contrat $contract Object contract
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $contract)
{
diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php
index e0ffb17003c..10f93b547e1 100644
--- a/htdocs/core/modules/contract/mod_contract_serpis.php
+++ b/htdocs/core/modules/contract/mod_contract_serpis.php
@@ -114,7 +114,7 @@ class mod_contract_serpis extends ModelNumRefContracts
*
* @param Societe $objsoc third party object
* @param Contrat $contract contract object
- * @return string|-1 Value if OK, -1 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $contract)
{
diff --git a/htdocs/core/modules/contract/modules_contract.php b/htdocs/core/modules/contract/modules_contract.php
index 40a51bd4a51..5a8f0fcd64f 100644
--- a/htdocs/core/modules/contract/modules_contract.php
+++ b/htdocs/core/modules/contract/modules_contract.php
@@ -7,6 +7,7 @@
* Copyright (C) 2011 Juanjo Menent
* Copyright (C) 2013 Philippe Grand
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -79,7 +80,14 @@ abstract class ModelePDFContract extends CommonDocGenerator
/**
* Parent class for all contract numbering modules
*/
-class ModelNumRefContracts extends CommonNumRefGenerator
+abstract class ModelNumRefContracts extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next value
+ *
+ * @param Societe $objsoc third party object
+ * @param Contrat $contract contract object
+ * @return string|int<0,-1> Next value if OK, -1 or 0 if KO
+ */
+ abstract public function getNextValue($objsoc, $contract);
}
diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
index 541c055d2c6..f7faae2f82a 100644
--- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
@@ -68,7 +68,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
index b64b1b54428..81a6d2e574d 100644
--- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
@@ -67,7 +67,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/delivery/mod_delivery_jade.php b/htdocs/core/modules/delivery/mod_delivery_jade.php
index 8cc8ec7f234..37e6112b81c 100644
--- a/htdocs/core/modules/delivery/mod_delivery_jade.php
+++ b/htdocs/core/modules/delivery/mod_delivery_jade.php
@@ -38,7 +38,7 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -129,7 +129,7 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder
*
* @param Societe $objsoc Object thirdparty
* @param Delivery $object Object we need next value for
- * @return string|-1 Value if OK, -1 if KO
+ * @return string|int<-1,0> Value if OK, 0 or -1 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php
index e5daaffe518..60cbc9420ab 100644
--- a/htdocs/core/modules/delivery/mod_delivery_saphir.php
+++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur
* Copyright (C) 2005-2007 Regis Houssin
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,7 +35,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -126,11 +127,11 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder
/**
- * Return next value
+ * Return next free value
*
- * @param Societe $objsoc Object third party
- * @param Delivery $object Object delivery
- * @return string|int Value if OK, 0 if KO
+ * @param Societe $objsoc Object thirdparty
+ * @param Delivery $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, 0 or -1 if KO
*/
public function getNextValue($objsoc, $object)
{
@@ -157,7 +158,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder
*
* @param Societe $objsoc Object third party
* @param Delivery $objforref Object for number to search
- * @return string|int Next free value, 0 if KO
+ * @return string|int<-1,0> Next free value, 0 if KO
* @deprecated see getNextValue
*/
public function getNumRef($objsoc, $objforref)
diff --git a/htdocs/core/modules/delivery/modules_delivery.php b/htdocs/core/modules/delivery/modules_delivery.php
index 00c057590bc..c1f919924f6 100644
--- a/htdocs/core/modules/delivery/modules_delivery.php
+++ b/htdocs/core/modules/delivery/modules_delivery.php
@@ -5,6 +5,7 @@
* Copyright (C) 2006-2011 Regis Houssin
* Copyright (C) 2011-2012 Philippe Grand
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -79,5 +80,12 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
*/
abstract class ModeleNumRefDeliveryOrder extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param Societe $objsoc Object thirdparty
+ * @param Delivery $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, 0 or -1 if KO
+ */
+ abstract public function getNextValue($objsoc, $object);
}
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index bdd7995fa8d..a423a41f07c 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -5,6 +5,7 @@
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018-2021 Philippe Grand
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,7 +43,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index 51c8743a331..52b5ca67b27 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -65,7 +65,7 @@ class pdf_espadon extends ModelePdfExpedition
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
index a0f4d4983a0..4dc927d275a 100644
--- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
@@ -70,7 +70,7 @@ class pdf_merou extends ModelePdfExpedition
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index 4c6e4896d81..593525650f7 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -65,7 +65,7 @@ class pdf_rouget extends ModelePdfExpedition
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php
index 192d1a0c0c5..c87f4982c5c 100644
--- a/htdocs/core/modules/expedition/mod_expedition_ribera.php
+++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php
@@ -1,6 +1,7 @@
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,7 +33,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
@@ -122,7 +123,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
*
* @param Societe $objsoc Third party object
* @param Expedition $shipment Shipment object
- * @return string|int Value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, 0 or -1 if KO
*/
public function getNextValue($objsoc, $shipment)
{
diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php
index a96b405e694..55f109e47d5 100644
--- a/htdocs/core/modules/expedition/mod_expedition_safor.php
+++ b/htdocs/core/modules/expedition/mod_expedition_safor.php
@@ -32,7 +32,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
@@ -121,7 +121,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
*
* @param Societe $objsoc Third party object
* @param Expedition $shipment Shipment object
- * @return string|-1 Value if OK, -1 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $shipment)
{
diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php
index bb707135fc7..6e606571fda 100644
--- a/htdocs/core/modules/expedition/modules_expedition.php
+++ b/htdocs/core/modules/expedition/modules_expedition.php
@@ -7,6 +7,7 @@
* Copyright (C) 2011 Juanjo Menent
* Copyright (C) 2011-2019 Philippe Grand
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -82,5 +83,12 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
*/
abstract class ModelNumRefExpedition extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next value
+ *
+ * @param Societe $objsoc Third party object
+ * @param Expedition $shipment Shipment object
+ * @return string|int<-1,0> Value if OK, 0 or -1 if KO
+ */
+ abstract public function getNextValue($objsoc, $shipment);
}
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php
index 471886daf04..ac86ca57ff4 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php
@@ -72,7 +72,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php
index 575d3ab499c..60600810b1f 100644
--- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php
+++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php
@@ -32,7 +32,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -118,10 +118,10 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
}
/**
- * Return next free value
+ * Return next free value
*
- * @param Object $object Object we need next value for
- * @return string|int Next value if OK, 0 if KO
+ * @param ExpenseReport $object Object we need next value for
+ * @return string|int<-1,0> Next value if OK, 0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php
index dcdb17f7763..0c5962c871e 100644
--- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php
+++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,7 +34,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -123,7 +124,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
* Return next free value
*
* @param ExpenseReport $object Object we need next value for
- * @return string|int Next value if OK, 0 if KO
+ * @return string|int<-1,0> Next value if OK, -1 or 0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/core/modules/expensereport/modules_expensereport.php b/htdocs/core/modules/expensereport/modules_expensereport.php
index 0387a91de5d..64d5a4c4a27 100644
--- a/htdocs/core/modules/expensereport/modules_expensereport.php
+++ b/htdocs/core/modules/expensereport/modules_expensereport.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -83,5 +84,11 @@ function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $
*/
abstract class ModeleNumRefExpenseReport extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param ExpenseReport $object Object we need next value for
+ * @return string|int<-1,0> Next value if OK, -1 or 0 if KO
+ */
+ abstract public function getNextValue($object);
}
diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php
index 3f166308cc7..b6a4960a4aa 100644
--- a/htdocs/core/modules/export/export_excel2007.modules.php
+++ b/htdocs/core/modules/export/export_excel2007.modules.php
@@ -3,6 +3,7 @@
* Copyright (C) 2012 Marcos García
* Copyright (C) 2024 William Mead
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,7 +51,7 @@ class ExportExcel2007 extends ModeleExports
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php
index f247b006f89..580a7ffa46f 100644
--- a/htdocs/core/modules/export/export_tsv.modules.php
+++ b/htdocs/core/modules/export/export_tsv.modules.php
@@ -1,6 +1,7 @@
* Copyright (C) 2012 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,7 +45,7 @@ class ExportTsv extends ModeleExports
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/export/exportcsv.class.php b/htdocs/core/modules/export/exportcsv.class.php
index c52779bc74e..a9212047981 100644
--- a/htdocs/core/modules/export/exportcsv.class.php
+++ b/htdocs/core/modules/export/exportcsv.class.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -45,7 +46,7 @@ class ExportCsv extends ModeleExports
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 5d84866fbad..1b6e57d1a52 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -4,6 +4,7 @@
* Copyright (C) 2014 Marcos García
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,7 +42,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index c665d805b0a..57b2f249863 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -73,7 +73,7 @@ class pdf_crabe extends ModelePDFFactures
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
index c8ca1d4b630..82a1df10e8c 100644
--- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
@@ -75,7 +75,7 @@ class pdf_octopus extends ModelePDFFactures
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2.
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index 0f8704107c6..6d6fb8aad82 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -73,7 +73,7 @@ class pdf_sponge extends ModelePDFFactures
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php
index 348ee5bbaac..3bf4271aa06 100644
--- a/htdocs/core/modules/facture/mod_facture_mars.php
+++ b/htdocs/core/modules/facture/mod_facture_mars.php
@@ -34,7 +34,7 @@ class mod_facture_mars extends ModeleNumRefFactures
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -160,9 +160,9 @@ class mod_facture_mars extends ModeleNumRefFactures
* Return next value not used or last value used
*
* @param Societe $objsoc Object third party
- * @param Facture $invoice Object invoice
- * @param string $mode 'next' for next value or 'last' for last value
- * @return string|int<-1,0> Value if OK, <=0 if KO
+ * @param Facture $invoice Object invoice
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @return string|int<-1,1> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $invoice, $mode = 'next')
{
diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php
index 55b74491ad4..9ff41aa2258 100644
--- a/htdocs/core/modules/facture/mod_facture_mercure.php
+++ b/htdocs/core/modules/facture/mod_facture_mercure.php
@@ -38,7 +38,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -139,9 +139,9 @@ class mod_facture_mercure extends ModeleNumRefFactures
* Return next value not used or last value used
*
* @param Societe $objsoc Object third party
- * @param Facture $invoice Object invoice
- * @param string $mode 'next' for next value or 'last' for last value
- * @return string|int<-1,0> Value if OK, <=0 if KO
+ * @param Facture $invoice Object invoice
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @return string|int<-1,1> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $invoice, $mode = 'next')
{
diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php
index 66cbfc46b56..25ac8001b86 100644
--- a/htdocs/core/modules/facture/mod_facture_terre.php
+++ b/htdocs/core/modules/facture/mod_facture_terre.php
@@ -34,7 +34,7 @@ class mod_facture_terre extends ModeleNumRefFactures
{
/**
* Dolibarr version of the loaded document 'development', 'experimental', 'dolibarr'
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
@@ -200,10 +200,10 @@ class mod_facture_terre extends ModeleNumRefFactures
* ALTER TABLE llx_facture ADD COLUMN calculated_numrefonly INTEGER AS (CASE SUBSTRING(ref FROM 1 FOR 2) WHEN 'FA' THEN CAST(SUBSTRING(ref FROM 10) AS SIGNED) ELSE 0 END) PERSISTENT;
* ALTER TABLE llx_facture ADD INDEX calculated_numrefonly_idx (calculated_numrefonly);
*
- * @param Societe $objsoc Object third party
+ * @param Societe $objsoc Object third party
* @param Facture $invoice Object invoice
- * @param string $mode 'next' for next value or 'last' for last value
- * @return string|int<-1,0> Next ref value or last ref if $mode is 'last', -1 or 0 if KO
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @return string|int<-1,1> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $invoice, $mode = 'next')
{
diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php
index 740caf8c174..2bf9f1fc516 100644
--- a/htdocs/core/modules/facture/modules_facture.php
+++ b/htdocs/core/modules/facture/modules_facture.php
@@ -272,9 +272,9 @@ abstract class ModeleNumRefFactures extends CommonNumRefGenerator
* Return next value not used or last value used
*
* @param Societe $objsoc Object third party
- * @param Facture $invoice Object invoice
- * @param string $mode 'next' for next value or 'last' for last value
- * @return string|int<-1,0> Value if OK, <=0 if KO
+ * @param Facture $invoice Object invoice
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @return string|int<-1,1> Value if OK, <=0 if KO
*/
abstract public function getNextValue($objsoc, $invoice, $mode = 'next');
}
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index 67a5ac4056c..13c2691d9fa 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -68,7 +68,7 @@ class pdf_soleil extends ModelePDFFicheinter
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php
index 285a465cc1e..0ac08eb7e06 100644
--- a/htdocs/core/modules/fichinter/mod_arctic.php
+++ b/htdocs/core/modules/fichinter/mod_arctic.php
@@ -5,6 +5,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2013 Juanjo Menent
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,7 +36,7 @@ class mod_arctic extends ModeleNumRefFicheinter
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -46,7 +47,7 @@ class mod_arctic extends ModeleNumRefFicheinter
/**
* @var string Nom du modele
- * @deprecated
+ * @deprecated Use $name, getName()
* @see $name
*/
public $nom = 'arctic';
@@ -124,7 +125,7 @@ class mod_arctic extends ModeleNumRefFicheinter
*
* @param Societe|string $objsoc Object thirdparty
* @param Fichinter|string $object Object we need next value for
- * @return string|int Value if OK, 0 if KO
+ * @return string|int<-1,0> Next value if OK, <=0 if KO
*/
public function getNextValue($objsoc = '', $object = '')
{
diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php
index f721029b132..15ee3e339b3 100644
--- a/htdocs/core/modules/fichinter/mod_pacific.php
+++ b/htdocs/core/modules/fichinter/mod_pacific.php
@@ -34,7 +34,7 @@ class mod_pacific extends ModeleNumRefFicheinter
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -47,7 +47,7 @@ class mod_pacific extends ModeleNumRefFicheinter
/**
* @var string Nom du modele
- * @deprecated
+ * @deprecated Use $name, getName()
* @see $name
*/
public $nom = 'pacific';
@@ -124,7 +124,7 @@ class mod_pacific extends ModeleNumRefFicheinter
*
* @param Societe|string $objsoc Object thirdparty
* @param Fichinter|string $object Object we need next value for
- * @return string Value if KO, <0 if KO
+ * @return string|int<-1,0> Next value if OK, <=0 if KO
*/
public function getNextValue($objsoc = '', $object = '')
{
diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php
index ff97725ace5..727e1441ab2 100644
--- a/htdocs/core/modules/fichinter/modules_fichinter.php
+++ b/htdocs/core/modules/fichinter/modules_fichinter.php
@@ -78,7 +78,14 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
*/
abstract class ModeleNumRefFicheinter extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param Societe|string $objsoc Object thirdparty
+ * @param Fichinter|string $object Object we need next value for
+ * @return string|int<-1,0> Next value if OK, <=0 if KO
+ */
+ abstract public function getNextValue($objsoc = '', $object = '');
}
diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php
index 3f3225b3990..03029517427 100644
--- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php
+++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2011-2019 Juanjo Menent
* Copyright (C) 2018 Charlene Benke
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -111,7 +112,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays
*
* @param Societe $objsoc third party object
* @param Holiday $holiday holiday object
- * @return string|int Value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $holiday)
{
diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php
index c084f48e46d..9f10ed28eef 100644
--- a/htdocs/core/modules/holiday/mod_holiday_madonna.php
+++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php
@@ -113,9 +113,9 @@ class mod_holiday_madonna extends ModelNumRefHolidays
/**
* Return next value
*
- * @param Societe $objsoc third party object
- * @param Holiday $holiday Holiday object
- * @return string|-1 Value if OK, -1 if KO
+ * @param Societe $objsoc third party object
+ * @param Holiday $holiday holiday object
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $holiday)
{
diff --git a/htdocs/core/modules/holiday/modules_holiday.php b/htdocs/core/modules/holiday/modules_holiday.php
index bba1aa62d9f..3b5dae7cf95 100644
--- a/htdocs/core/modules/holiday/modules_holiday.php
+++ b/htdocs/core/modules/holiday/modules_holiday.php
@@ -8,6 +8,7 @@
* Copyright (C) 2013 Philippe Grand
* Copyright (C) 2014 Marcos García
* Copyright (C) 2018 Charlene Benke
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -79,7 +80,14 @@ abstract class ModelePDFHoliday extends CommonDocGenerator
/**
* Parent class for all holidays numbering modules
*/
-class ModelNumRefHolidays extends CommonNumRefGenerator
+abstract class ModelNumRefHolidays extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next value
+ *
+ * @param Societe $objsoc third party object
+ * @param Holiday $holiday holiday object
+ * @return string|int<-1,0> Value if OK, <=0 if KO
+ */
+ abstract public function getNextValue($objsoc, $holiday);
}
diff --git a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php
index 16c6bbe552e..6553d152052 100644
--- a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php
+++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php
@@ -67,7 +67,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/hrm/mod_evaluation_advanced.php b/htdocs/core/modules/hrm/mod_evaluation_advanced.php
index 79bc43b2480..9482b998962 100644
--- a/htdocs/core/modules/hrm/mod_evaluation_advanced.php
+++ b/htdocs/core/modules/hrm/mod_evaluation_advanced.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,7 +27,7 @@
* \brief File containing class for advanced numbering model of Evaluation
*/
- require_once DOL_DOCUMENT_ROOT . '/core/modules/hrm/modules_evaluation.php';
+require_once DOL_DOCUMENT_ROOT . '/core/modules/hrm/modules_evaluation.php';
/**
@@ -36,7 +37,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -125,7 +126,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation
* Return next free value
*
* @param Evaluation $object Object we need next value for
- * @return string|int Value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/core/modules/hrm/mod_evaluation_standard.php b/htdocs/core/modules/hrm/mod_evaluation_standard.php
index 98fd02255c7..56555a4b8f7 100644
--- a/htdocs/core/modules/hrm/mod_evaluation_standard.php
+++ b/htdocs/core/modules/hrm/mod_evaluation_standard.php
@@ -34,7 +34,7 @@ class mod_evaluation_standard extends ModeleNumRefEvaluation
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -119,8 +119,8 @@ class mod_evaluation_standard extends ModeleNumRefEvaluation
/**
* Return next free value
*
- * @param Evaluation $object Object we need next value for
- * @return string|-1 Value if OK, -1 if KO
+ * @param Evaluation $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/core/modules/hrm/modules_evaluation.php b/htdocs/core/modules/hrm/modules_evaluation.php
index 587e1bc6d55..c2127651aad 100644
--- a/htdocs/core/modules/hrm/modules_evaluation.php
+++ b/htdocs/core/modules/hrm/modules_evaluation.php
@@ -6,6 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -82,5 +83,11 @@ abstract class ModelePDFEvaluation extends CommonDocGenerator
*/
abstract class ModeleNumRefEvaluation extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param Evaluation $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, <=0 if KO
+ */
+ abstract public function getNextValue($object);
}
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index bfc094a6913..ecfb9612891 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -4,6 +4,7 @@
* Copyright (C) 2012 Christophe Battarel
* Copyright (C) 2012-2016 Juanjo Menent
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,7 +47,7 @@ class ImportCsv extends ModeleImports
/**
* Dolibarr version of driver
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index eaacc8c6d82..049537a4911 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -52,7 +52,7 @@ class ImportXlsx extends ModeleImports
/**
* Dolibarr version of driver
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php
index 5e5a45163a1..243b83ad7ad 100644
--- a/htdocs/core/modules/import/modules_import.php
+++ b/htdocs/core/modules/import/modules_import.php
@@ -71,7 +71,7 @@ class ModeleImports
/**
* Dolibarr version of driver
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
index 706bead376d..4c0f279e92f 100644
--- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
+++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
@@ -39,7 +39,7 @@ class doc_generic_member_odt extends ModelePDFMember
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/member/doc/pdf_standard_member.class.php b/htdocs/core/modules/member/doc/pdf_standard_member.class.php
index 6d35d7e4bf9..7664273c542 100644
--- a/htdocs/core/modules/member/doc/pdf_standard_member.class.php
+++ b/htdocs/core/modules/member/doc/pdf_standard_member.class.php
@@ -6,6 +6,7 @@
* Copyright (C) 2006-2013 Laurent Destailleur
* Copyright (C) 2015 Francis Appels
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,7 +37,7 @@ class pdf_standard_member extends CommonStickerGenerator
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/movement/modules_movement.php b/htdocs/core/modules/movement/modules_movement.php
index 0f10da20445..063f8f628fb 100644
--- a/htdocs/core/modules/movement/modules_movement.php
+++ b/htdocs/core/modules/movement/modules_movement.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,7 +48,7 @@ abstract class ModelePDFMovement extends CommonDocGenerator
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
index 5808de2264a..dc48a7f5fa1 100644
--- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
+++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
@@ -5,6 +5,7 @@
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018-2021 Philippe Grand
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
class doc_generic_mo_odt extends ModelePDFMo
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
index c587826d7ff..61904c07c67 100644
--- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
+++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
@@ -71,7 +71,7 @@ class pdf_vinci extends ModelePDFMo
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php
index eb147ff2f2a..3c8e8bae564 100644
--- a/htdocs/core/modules/mrp/mod_mo_advanced.php
+++ b/htdocs/core/modules/mrp/mod_mo_advanced.php
@@ -5,6 +5,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2019-2024 Frédéric France
* Copyright (C) 2020 Josep Lluís Amador
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,7 +38,7 @@ class mod_mo_advanced extends ModeleNumRefMos
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -126,7 +127,7 @@ class mod_mo_advanced extends ModeleNumRefMos
*
* @param Product $objprod Object product
* @param Mo $object Object we need next value for
- * @return string|int Value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objprod, $object)
{
diff --git a/htdocs/core/modules/mrp/mod_mo_standard.php b/htdocs/core/modules/mrp/mod_mo_standard.php
index b835a07614f..599ceef2c0d 100644
--- a/htdocs/core/modules/mrp/mod_mo_standard.php
+++ b/htdocs/core/modules/mrp/mod_mo_standard.php
@@ -33,7 +33,7 @@ class mod_mo_standard extends ModeleNumRefMos
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -116,7 +116,7 @@ class mod_mo_standard extends ModeleNumRefMos
*
* @param Product $objprod Object product
* @param Mo $object Object we need next value for
- * @return string|-1 Value if OK, -1 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objprod, $object)
{
diff --git a/htdocs/core/modules/mrp/modules_mo.php b/htdocs/core/modules/mrp/modules_mo.php
index 660018da03c..1e9955a27b1 100644
--- a/htdocs/core/modules/mrp/modules_mo.php
+++ b/htdocs/core/modules/mrp/modules_mo.php
@@ -6,6 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -80,5 +81,12 @@ abstract class ModelePDFMo extends CommonDocGenerator
*/
abstract class ModeleNumRefMos extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param Product $objprod Object product
+ * @param Mo $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, <=0 if KO
+ */
+ abstract public function getNextValue($objprod, $object);
}
diff --git a/htdocs/core/modules/oauth/generic_oauthcallback.php b/htdocs/core/modules/oauth/generic_oauthcallback.php
index 95787285b1c..0c06bc54aef 100644
--- a/htdocs/core/modules/oauth/generic_oauthcallback.php
+++ b/htdocs/core/modules/oauth/generic_oauthcallback.php
@@ -1,6 +1,7 @@
* Copyright (C) 2015 Frederic France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -206,7 +207,7 @@ if (!GETPOST('code') && !GETPOST('error')) {
$url .= '&scope='.str_replace(',', '+', $statewithscopeonly);
// Add more param
- $url .= '&nonce='.bin2hex(random_bytes(64/8));
+ $url .= '&nonce='.bin2hex(random_bytes(64 / 8));
if ($forlogin) {
// TODO Add param hd. What is it for ?
@@ -263,6 +264,8 @@ if (!GETPOST('code') && !GETPOST('error')) {
// Result is stored into object managed by class DoliStorage into includes/OAuth/Common/Storage/DoliStorage.php and into database table llx_oauth_token
$token = $apiService->requestAccessToken(GETPOST('code'), $state);
+ '@phan-var-force OAuth\Common\Token\AbstractToken $token';
+
// The refresh token is inside the object token if the prompt was forced only.
//$refreshtoken = $token->getRefreshToken();
//var_dump($refreshtoken);
diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php
index 68a544ec8f1..0de13302b82 100644
--- a/htdocs/core/modules/payment/mod_payment_ant.php
+++ b/htdocs/core/modules/payment/mod_payment_ant.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,7 +33,7 @@ class mod_payment_ant extends ModeleNumRefPayments
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php
index 5991cc2be93..53913df75d8 100644
--- a/htdocs/core/modules/payment/mod_payment_cicada.php
+++ b/htdocs/core/modules/payment/mod_payment_cicada.php
@@ -32,7 +32,7 @@ class mod_payment_cicada extends ModeleNumRefPayments
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php
index d082604c707..d7fef7f516d 100644
--- a/htdocs/core/modules/printing/modules_printing.php
+++ b/htdocs/core/modules/printing/modules_printing.php
@@ -42,6 +42,12 @@ class PrintingDriver
*/
public $error = '';
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
+
+
/**
* @var string Name
*/
@@ -115,4 +121,30 @@ class PrintingDriver
return $this->desc;
}
}
+
+ /**
+ * Return list of available printers
+ *
+ * @return int 0 if OK, >0 if KO
+ */
+ public function listAvailablePrinters()
+ {
+ $msg = get_class($this)."::".__FUNCTION__." not implemented";
+ dol_syslog($msg, LOG_ERR);
+ $this->errors[] = $msg;
+ return 1;
+ }
+
+ /**
+ * Return list of available printers
+ *
+ * @return array list of printers
+ */
+ public function getlistAvailablePrinters()
+ {
+ $msg = get_class($this)."::".__FUNCTION__." not implemented";
+ dol_syslog($msg, LOG_ERR);
+ $this->errors[] = $msg;
+ return [];
+ }
}
diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php
index eac957eaaa4..27788188ea1 100644
--- a/htdocs/core/modules/printing/printgcp.modules.php
+++ b/htdocs/core/modules/printing/printgcp.modules.php
@@ -1,6 +1,7 @@
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -69,16 +70,6 @@ class printing_printgcp extends PrintingDriver
*/
public $google_secret = '';
- /**
- * @var string Error code (or message)
- */
- public $error = '';
-
- /**
- * @var string[] Error codes (or messages)
- */
- public $errors = array();
-
/**
* @var DoliDB Database handler.
*/
@@ -110,9 +101,9 @@ class printing_printgcp extends PrintingDriver
if (!$conf->oauth->enabled) {
$this->conf[] = array(
- 'varname'=>'PRINTGCP_INFO',
- 'info'=>$langs->transnoentitiesnoconv("WarningModuleNotActive", "OAuth"),
- 'type'=>'info',
+ 'varname' => 'PRINTGCP_INFO',
+ 'info' => $langs->transnoentitiesnoconv("WarningModuleNotActive", "OAuth"),
+ 'type' => 'info',
);
} else {
$keyforprovider = ''; // @FIXME
@@ -158,13 +149,13 @@ class printing_printgcp extends PrintingDriver
}
}
if ($this->google_id != '' && $this->google_secret != '') {
- $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthConfigured', 'type'=>'info');
+ $this->conf[] = array('varname' => 'PRINTGCP_INFO', 'info' => 'GoogleAuthConfigured', 'type' => 'info');
$this->conf[] = array(
- 'varname'=>'PRINTGCP_TOKEN_ACCESS',
- 'info'=>$access,
- 'type'=>'info',
- 'renew'=>$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'),
- 'delete'=>($storage->hasAccessToken($this->OAUTH_SERVICENAME_GOOGLE) ? $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp') : '')
+ 'varname' => 'PRINTGCP_TOKEN_ACCESS',
+ 'info' => $access,
+ 'type' => 'info',
+ 'renew' => $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'),
+ 'delete' => ($storage->hasAccessToken($this->OAUTH_SERVICENAME_GOOGLE) ? $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp') : '')
);
if ($token_ok) {
$expiredat = '';
@@ -181,9 +172,9 @@ class printing_printgcp extends PrintingDriver
$expiredat = dol_print_date($endoflife, "dayhour");
}
- $this->conf[] = array('varname'=>'TOKEN_REFRESH', 'info'=>((!empty($refreshtoken)) ? 'Yes' : 'No'), 'type'=>'info');
- $this->conf[] = array('varname'=>'TOKEN_EXPIRED', 'info'=>($expire ? 'Yes' : 'No'), 'type'=>'info');
- $this->conf[] = array('varname'=>'TOKEN_EXPIRE_AT', 'info'=>($expiredat), 'type'=>'info');
+ $this->conf[] = array('varname' => 'TOKEN_REFRESH', 'info' => ((!empty($refreshtoken)) ? 'Yes' : 'No'), 'type' => 'info');
+ $this->conf[] = array('varname' => 'TOKEN_EXPIRED', 'info' => ($expire ? 'Yes' : 'No'), 'type' => 'info');
+ $this->conf[] = array('varname' => 'TOKEN_EXPIRE_AT', 'info' => ($expiredat), 'type' => 'info');
}
/*
if ($storage->hasAccessToken($this->OAUTH_SERVICENAME_GOOGLE)) {
@@ -193,11 +184,11 @@ class printing_printgcp extends PrintingDriver
$this->conf[] = array('varname'=>'PRINTGCP_AUTHLINK', 'link'=>$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'authlink');
}*/
} else {
- $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthNotConfigured', 'type'=>'info');
+ $this->conf[] = array('varname' => 'PRINTGCP_INFO', 'info' => 'GoogleAuthNotConfigured', 'type' => 'info');
}
}
// do not display submit button
- $this->conf[] = array('enabled'=>0, 'type'=>'submit');
+ $this->conf[] = array('enabled' => 0, 'type' => 'submit');
}
/**
@@ -250,7 +241,7 @@ class printing_printgcp extends PrintingDriver
/**
* Return list of available printers
*
- * @return array list of printers
+ * @return array{available:array} list of printers
*/
public function getlistAvailablePrinters()
{
@@ -380,12 +371,12 @@ class printing_printgcp extends PrintingDriver
global $conf;
// Check if printer id
if (empty($printerid)) {
- return array('status' =>0, 'errorcode' =>'', 'errormessage'=>'No provided printer ID');
+ return array('status' => 0, 'errorcode' => '', 'errormessage' => 'No provided printer ID');
}
// Open the file which needs to be print
$handle = fopen($filepath, "rb");
if (!$handle) {
- return array('status' =>0, 'errorcode' =>'', 'errormessage'=>'Could not read the file.');
+ return array('status' => 0, 'errorcode' => '', 'errormessage' => 'Could not read the file.');
}
// Read file content
$contents = fread($handle, filesize($filepath));
diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php
index 54a844efc4d..65cafd09939 100644
--- a/htdocs/core/modules/printing/printipp.modules.php
+++ b/htdocs/core/modules/printing/printipp.modules.php
@@ -86,21 +86,6 @@ class printing_printipp extends PrintingDriver
*/
public $ssl;
- /**
- * @var string Error code (or message)
- */
- public $error = '';
-
- /**
- * @var string[] Error codes (or messages)
- */
- public $errors = array();
-
- /**
- * @var DoliDB Database handler.
- */
- public $db;
-
/**
* Constructor
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 63f966d0fb0..5fba8d46469 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2010-2012 Laurent Destailleur
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,7 +40,7 @@ class doc_generic_product_odt extends ModelePDFProduct
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php
index d3104f46da1..d773d36d1f6 100644
--- a/htdocs/core/modules/product/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php
@@ -61,7 +61,7 @@ class pdf_standard extends ModelePDFProduct
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php
index 308be664dcf..51d3943314c 100644
--- a/htdocs/core/modules/product/mod_codeproduct_elephant.php
+++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php
@@ -119,13 +119,17 @@ class mod_codeproduct_elephant extends ModeleProductCode
/**
* Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
+ * @param ?Translate $langs Object langs
* @param Product|string $objproduct Object product
- * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return string example
*/
- public function getExample($langs, $objproduct = '', $type = -1)
+ public function getExample($langs = null, $objproduct = '', $type = -1)
{
+ if (!$langs instanceof Translate) {
+ $langs = $GLOBALS['langs'];
+ '@phan-var-force Translate $langs';
+ }
$exampleproduct = $exampleservice = '';
if ($type == 0 || $type == -1) {
diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php
index 8dfab9d177d..81eba6df26c 100644
--- a/htdocs/core/modules/product/mod_codeproduct_leopard.php
+++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php
@@ -72,12 +72,12 @@ class mod_codeproduct_leopard extends ModeleProductCode
/**
* Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
- * @param Product $objproduct Object product
- * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
- * @return string Return string example
+ * @param ?Translate $langs Object langs
+ * @param Product|string $objproduct Object product
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @return string Return string example
*/
- public function getExample($langs, $objproduct = null, $type = -1)
+ public function getExample($langs = null, $objproduct = '', $type = -1)
{
return '';
}
diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php
index 09e12460e8c..249a19b73e1 100644
--- a/htdocs/core/modules/product/modules_product.class.php
+++ b/htdocs/core/modules/product/modules_product.class.php
@@ -200,4 +200,15 @@ abstract class ModeleProductCode extends CommonNumRefGenerator
// phpcs:enable
return 0;
}
+
+
+ /**
+ * Return an example of result returned by getNextValue
+ *
+ * @param ?Translate $langs Object langs
+ * @param Product|string $objproduct Object product
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @return string Return string example
+ */
+ abstract public function getExample($langs = null, $objproduct = '', $type = -1);
}
diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php
index c910326b2da..41031d83d28 100644
--- a/htdocs/core/modules/product_batch/mod_lot_advanced.php
+++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php
@@ -38,7 +38,7 @@ class mod_lot_advanced extends ModeleNumRefBatch
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -134,9 +134,9 @@ class mod_lot_advanced extends ModeleNumRefBatch
/**
* Return next free value
*
- * @param Societe $objsoc Object thirdparty
- * @param Productlot $object Object we need next value for
- * @return string|int Value if OK, 0 if KO
+ * @param Societe $objsoc Object thirdparty
+ * @param Productlot $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/product_batch/mod_lot_free.php b/htdocs/core/modules/product_batch/mod_lot_free.php
index 4a7de7a4499..2b238c9893f 100644
--- a/htdocs/core/modules/product_batch/mod_lot_free.php
+++ b/htdocs/core/modules/product_batch/mod_lot_free.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville
* Copyright (C) 2006-2009 Laurent Destailleur
* Copyright (C) 2023-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -80,11 +81,11 @@ class mod_lot_free extends ModeleNumRefBatch
}
/**
- * Return an example of result returned by getNextValue
+ * Return next free value
*
- * @param Societe $objsoc Object thirdparty
- * @param Productlot $object Object we need next value for
- * @return string Return next value
+ * @param Societe $objsoc Object thirdparty
+ * @param Productlot $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/product_batch/mod_lot_standard.php b/htdocs/core/modules/product_batch/mod_lot_standard.php
index c3e3aa36648..50412331855 100644
--- a/htdocs/core/modules/product_batch/mod_lot_standard.php
+++ b/htdocs/core/modules/product_batch/mod_lot_standard.php
@@ -34,7 +34,7 @@ class mod_lot_standard extends ModeleNumRefBatch
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -116,9 +116,9 @@ class mod_lot_standard extends ModeleNumRefBatch
/**
* Return next free value
*
- * @param Societe $objsoc Object thirdparty
+ * @param Societe $objsoc Object thirdparty
* @param Productlot $object Object we need next value for
- * @return string|-1 Value if OK, -1 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php
index a204337c47e..d8c53915883 100644
--- a/htdocs/core/modules/product_batch/mod_sn_advanced.php
+++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php
@@ -38,7 +38,7 @@ class mod_sn_advanced extends ModeleNumRefBatch
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -133,9 +133,9 @@ class mod_sn_advanced extends ModeleNumRefBatch
/**
* Return next free value
*
- * @param Societe $objsoc Object thirdparty
- * @param Productlot $object Object we need next value for
- * @return string|int Value if OK, 0 if KO
+ * @param Societe $objsoc Object thirdparty
+ * @param Productlot $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, <=0
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/product_batch/mod_sn_free.php b/htdocs/core/modules/product_batch/mod_sn_free.php
index 87d3e5e62cd..61ce112289a 100644
--- a/htdocs/core/modules/product_batch/mod_sn_free.php
+++ b/htdocs/core/modules/product_batch/mod_sn_free.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville
* Copyright (C) 2006-2009 Laurent Destailleur
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,7 +39,7 @@ class mod_sn_free extends ModeleNumRefBatch
* Therefore, the implementation must remain as open as possible.
*/
- // variables inherited from ModeleThirdPartyCode class
+ // variables inherited from ModeleNumRefBatch class
public $name = 'sn_free';
public $version = 'dolibarr';
@@ -86,11 +87,11 @@ class mod_sn_free extends ModeleNumRefBatch
}
/**
- * Return an example of result returned by getNextValue
+ * Return next free value
*
- * @param Societe $objsoc Object thirdparty
- * @param Productlot $object Object we need next value for
- * @return string Return next value
+ * @param Societe $objsoc Object thirdparty
+ * @param Productlot $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, <=0
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/product_batch/mod_sn_standard.php b/htdocs/core/modules/product_batch/mod_sn_standard.php
index 4354bb57328..5348aa206c2 100644
--- a/htdocs/core/modules/product_batch/mod_sn_standard.php
+++ b/htdocs/core/modules/product_batch/mod_sn_standard.php
@@ -34,7 +34,7 @@ class mod_sn_standard extends ModeleNumRefBatch
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -116,9 +116,9 @@ class mod_sn_standard extends ModeleNumRefBatch
/**
* Return next free value
*
- * @param Societe $objsoc Object thirdparty
+ * @param Societe $objsoc Object thirdparty
* @param Productlot $object Object we need next value for
- * @return string|int String if OK, <0 if KO
+ * @return string|int<-1,0> Value if OK, <=0
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/product_batch/modules_product_batch.class.php b/htdocs/core/modules/product_batch/modules_product_batch.class.php
index 0b9ed2b3b7c..6048716a911 100644
--- a/htdocs/core/modules/product_batch/modules_product_batch.class.php
+++ b/htdocs/core/modules/product_batch/modules_product_batch.class.php
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2010 Laurent Destailleur
* Copyright (C) 2004 Eric Seigne
* Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,14 +22,14 @@
/**
- * \class ModeleProductCode
+ * \class ModelePDFProductBatch
* \brief Parent class for product code generators
*/
/**
- * \file htdocs/core/modules/contract/modules_contract.php
- * \ingroup contract
- * \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering
+ * \file htdocs/core/modules/product_batch/modules_product_batch.class.php
+ * \ingroup product_batch
+ * \brief File with parent class for generating product batches to PDF and File of class to manage their numbering
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
@@ -80,5 +81,12 @@ abstract class ModelePDFProductBatch extends CommonDocGenerator
*/
abstract class ModeleNumRefBatch extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param Societe $objsoc Object thirdparty
+ * @param Productlot $object Object we need next value for
+ * @return string|int<-1,0> String if OK, <0 if KO
+ */
+ abstract public function getNextValue($objsoc, $object);
}
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 41e3a5247b3..a9fd662de5b 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -80,7 +80,7 @@ class doc_generic_project_odt extends ModelePDFProjects
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php
index b1c5d241488..eff1db04804 100644
--- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php
@@ -77,7 +77,7 @@ class pdf_baleine extends ModelePDFProjects
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
index 9e8b65b971c..d36cf3355ea 100644
--- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
@@ -78,7 +78,7 @@ class pdf_beluga extends ModelePDFProjects
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php
index 2a291ef25b1..ae78a9182a5 100644
--- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php
@@ -71,7 +71,7 @@ class pdf_timespent extends ModelePDFProjects
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php
index a411154425c..1d4df75aaf2 100644
--- a/htdocs/core/modules/project/mod_project_simple.php
+++ b/htdocs/core/modules/project/mod_project_simple.php
@@ -35,7 +35,7 @@ class mod_project_simple extends ModeleNumRefProjects
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -123,9 +123,9 @@ class mod_project_simple extends ModeleNumRefProjects
/**
* Return next value
*
- * @param Societe $objsoc Object third party
- * @param Project $project Object project
- * @return string|-1 Value if OK, -1 if KO
+ * @param Societe $objsoc Object third party
+ * @param Project $project Object project
+ * @return string|int<-1,0> Value if OK, 0 if KO
*/
public function getNextValue($objsoc, $project)
{
diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php
index 9d05daa85d9..93215ba2bf0 100644
--- a/htdocs/core/modules/project/mod_project_universal.php
+++ b/htdocs/core/modules/project/mod_project_universal.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,7 +39,7 @@ class mod_project_universal extends ModeleNumRefProjects
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -132,9 +133,9 @@ class mod_project_universal extends ModeleNumRefProjects
/**
* Return next value
*
- * @param Societe $objsoc Object third party
- * @param Project $project Object project
- * @return string|int Value if OK, 0 if KO
+ * @param Societe $objsoc Object third party
+ * @param Project $project Object project
+ * @return string|int<-1,0> Value if OK, 0 if KO
*/
public function getNextValue($objsoc, $project)
{
diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php
index 30ea90eefda..d9b1d9a1758 100644
--- a/htdocs/core/modules/project/modules_project.php
+++ b/htdocs/core/modules/project/modules_project.php
@@ -1,6 +1,7 @@
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -83,5 +84,12 @@ abstract class ModelePDFProjects extends CommonDocGenerator
*/
abstract class ModeleNumRefProjects extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next value
+ *
+ * @param Societe $objsoc Object third party
+ * @param Project $project Object project
+ * @return string|int<-1,0> Value if OK, 0 if KO
+ */
+ abstract public function getNextValue($objsoc, $project);
}
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index f1e55a9de6d..2fe4d3b9305 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -79,7 +79,7 @@ class doc_generic_task_odt extends ModelePDFTask
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php
index b523fefad8c..a7a0f3a5a85 100644
--- a/htdocs/core/modules/project/task/mod_task_simple.php
+++ b/htdocs/core/modules/project/task/mod_task_simple.php
@@ -35,7 +35,7 @@ class mod_task_simple extends ModeleNumRefTask
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -124,9 +124,9 @@ class mod_task_simple extends ModeleNumRefTask
/**
* Return next value
*
- * @param Societe|string $objsoc Object third party
- * @param Task|string $object Object Task
- * @return string|-1 Value if OK, -1 if KO
+ * @param Societe|string $objsoc Object third party
+ * @param Project|string $object Object Project
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php
index 33f1ee5ac7d..5aff9ed6114 100644
--- a/htdocs/core/modules/project/task/mod_task_universal.php
+++ b/htdocs/core/modules/project/task/mod_task_universal.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,7 +34,7 @@ class mod_task_universal extends ModeleNumRefTask
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -121,11 +122,11 @@ class mod_task_universal extends ModeleNumRefTask
/**
* Return next value
*
- * @param Societe|string $objsoc Object third party
- * @param Task|string $object Object task
- * @return string|int Value if OK, 0 if KO
+ * @param Societe|string $objsoc Object third party
+ * @param Project|string $object Object Project
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
- public function getNextValue($objsoc = '', $object = '')
+ public function getNextValue($objsoc, $object)
{
global $db, $conf;
diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php
index ce7fbf252dd..1fdba1e4d7b 100644
--- a/htdocs/core/modules/project/task/modules_task.php
+++ b/htdocs/core/modules/project/task/modules_task.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2010 Regis Houssin
* Copyright (C) 2010 Florian Henry
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -75,5 +76,12 @@ abstract class ModelePDFTask extends CommonDocGenerator
*/
abstract class ModeleNumRefTask extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next value
+ *
+ * @param Societe|string $objsoc Object third party
+ * @param Project|string $object Object Project
+ * @return string|int<-1,0> Value if OK, <=0 if KO
+ */
+ abstract public function getNextValue($objsoc, $object);
}
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index 043b0416588..f42656414af 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -3,6 +3,7 @@
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
class doc_generic_proposal_odt extends ModelePDFPropales
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 43bbc94dedb..a6b9a7c37a0 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -76,7 +76,7 @@ class pdf_azur extends ModelePDFPropales
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index eb41504c812..7d376717d8d 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -69,7 +69,7 @@ class pdf_cyan extends ModelePDFPropales
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php
index b601a7b1217..b6396ca96a0 100644
--- a/htdocs/core/modules/propale/mod_propale_marbre.php
+++ b/htdocs/core/modules/propale/mod_propale_marbre.php
@@ -35,7 +35,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -126,7 +126,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
*
* @param Societe $objsoc Object third party
* @param Propal $propal Object commercial proposal
- * @return string|-1 Next value, -1 if KO
+ * @return string|int<-1,0> Next value, <=0 if KO
*/
public function getNextValue($objsoc, $propal)
{
diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php
index 56a70eacf8e..8f3e6402b63 100644
--- a/htdocs/core/modules/propale/mod_propale_saphir.php
+++ b/htdocs/core/modules/propale/mod_propale_saphir.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2007 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,7 +37,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -129,9 +130,9 @@ class mod_propale_saphir extends ModeleNumRefPropales
/**
* Return next value
*
- * @param Societe $objsoc Object third party
- * @param Propal $propal Object commercial proposal
- * @return string|int Value if OK, 0 if KO
+ * @param Societe $objsoc Object third party
+ * @param Propal $propal Object commercial proposal
+ * @return string|int<-1,0> Next value, <=0 if KO
*/
public function getNextValue($objsoc, $propal)
{
diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php
index c40c664340f..e6eecffff44 100644
--- a/htdocs/core/modules/propale/modules_propale.php
+++ b/htdocs/core/modules/propale/modules_propale.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -97,5 +98,12 @@ abstract class ModelePDFPropales extends CommonDocGenerator
*/
abstract class ModeleNumRefPropales extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next value
+ *
+ * @param Societe $objsoc Object third party
+ * @param Propal $propal Object commercial proposal
+ * @return string|int<-1,0> Next value, <=0 if KO
+ */
+ abstract public function getNextValue($objsoc, $propal);
}
diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
index 212872111e1..d0ed471cfeb 100644
--- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
+++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
@@ -1,6 +1,7 @@
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
class doc_generic_reception_odt extends ModelePdfReception
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
index 6633309c3d9..66c05ed7a59 100644
--- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php
+++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
@@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
class pdf_squille extends ModelePdfReception
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php
index 10b12439776..1b0f9510e1f 100644
--- a/htdocs/core/modules/reception/mod_reception_beryl.php
+++ b/htdocs/core/modules/reception/mod_reception_beryl.php
@@ -99,9 +99,9 @@ class mod_reception_beryl extends ModelNumRefReception
/**
* Return next value
*
- * @param Societe $objsoc Third party object
- * @param Reception $reception Reception object
- * @return string|-1 Value if OK, -1 if KO
+ * @param Societe $objsoc Third party object
+ * @param ?Reception $reception Reception object
+ * @return string|int<-1,0> Value if OK, -1 if KO
*/
public function getNextValue($objsoc, $reception)
{
diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php
index 98ff78d3bf5..de514911410 100644
--- a/htdocs/core/modules/reception/mod_reception_moonstone.php
+++ b/htdocs/core/modules/reception/mod_reception_moonstone.php
@@ -1,6 +1,7 @@
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -98,9 +99,9 @@ class mod_reception_moonstone extends ModelNumRefReception
/**
* Return next value
*
- * @param Societe $objsoc Third party object
- * @param Reception|null $reception Reception object
- * @return string|int Value if OK, 0 if KO
+ * @param Societe $objsoc Third party object
+ * @param ?Reception $reception Reception object
+ * @return string|int<-1,0> Value if OK, -1 if KO
*/
public function getNextValue($objsoc, $reception)
{
diff --git a/htdocs/core/modules/reception/modules_reception.php b/htdocs/core/modules/reception/modules_reception.php
index b400f4f9e03..9324e5b73fb 100644
--- a/htdocs/core/modules/reception/modules_reception.php
+++ b/htdocs/core/modules/reception/modules_reception.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -74,5 +75,12 @@ abstract class ModelePdfReception extends CommonDocGenerator
*/
abstract class ModelNumRefReception extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next value
+ *
+ * @param Societe $objsoc Third party object
+ * @param ?Reception $reception Reception object
+ * @return string|int<-1,0> Value if OK, -1 if KO
+ */
+ abstract public function getNextValue($objsoc, $reception);
}
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index 0628ec59aa7..2e5e7ed21dd 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2010-2011 Laurent Destailleur
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
class doc_generic_odt extends ModeleThirdPartyDoc
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php
index 52180617a6e..566d7bb70f0 100644
--- a/htdocs/core/modules/societe/mod_codeclient_elephant.php
+++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php
@@ -160,13 +160,17 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
/**
* Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
+ * @param ?Translate $langs Object langs
* @param Societe|string $objsoc Object thirdparty
- * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return string example
*/
- public function getExample($langs, $objsoc = '', $type = -1)
+ public function getExample($langs = null, $objsoc = '', $type = -1)
{
+ if (!$langs instanceof Translate) {
+ $langs = $GLOBALS['langs'];
+ '@phan-var-force Translate $langs';
+ }
$examplecust = '';
$examplesup = '';
$errmsg = array(
diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php
index d684dfa2040..e7509a07e3b 100644
--- a/htdocs/core/modules/societe/mod_codeclient_leopard.php
+++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php
@@ -77,12 +77,12 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode
/**
* Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
+ * @param ?Translate $langs Object langs
* @param Societe|string $objsoc Object thirdparty
- * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return string example
*/
- public function getExample($langs, $objsoc = '', $type = -1)
+ public function getExample($langs = null, $objsoc = '', $type = -1)
{
return '';
}
diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php
index a9ba86c8c7e..5eb500d61c9 100644
--- a/htdocs/core/modules/societe/mod_codeclient_monkey.php
+++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php
@@ -76,12 +76,12 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
/**
* Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
+ * @param ?Translate $langs Object langs
* @param Societe|string $objsoc Object thirdparty
- * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return string example
*/
- public function getExample($langs, $objsoc = '', $type = -1)
+ public function getExample($langs = null, $objsoc = '', $type = -1)
{
return $this->prefixcustomer.'0901-00001 '.$this->prefixsupplier.'0901-00001';
}
diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
index 64b65be81e5..0161aff09d6 100644
--- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php
+++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
@@ -45,7 +45,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -130,12 +130,12 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
/**
* Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
+ * @param ?Translate $langs Object langs
* @param Societe|string $objsoc Object thirdparty
- * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return string example
*/
- public function getExample($langs, $objsoc = '', $type = -1)
+ public function getExample($langs = null, $objsoc = '', $type = -1)
{
$s = '';
$s .= $this->prefixcustomeraccountancycode.'CUSTCODE';
diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php
index 2466bed7522..28686db0ed6 100644
--- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php
+++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php
@@ -40,7 +40,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -159,16 +159,20 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
}
/**
- * Return an example of result returned by getNextValue
+ * Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
- * @param Societe|string $objsoc Object thirdparty
- * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
- * @return string Example
+ * @param ?Translate $langs Object langs
+ * @param Societe|string $objsoc Object thirdparty
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @return string Return string example
*/
- public function getExample($langs, $objsoc = '', $type = -1)
+ public function getExample($langs = null, $objsoc = '', $type = -1)
{
global $conf, $mysoc;
+ if (!$langs instanceof Translate) {
+ $langs = $GLOBALS['langs'];
+ '@phan-var-force Translate $langs';
+ }
$s = $langs->trans("ThirdPartyName").": ".$mysoc->name;
$s .= " \n";
diff --git a/htdocs/core/modules/societe/mod_codecompta_panicum.php b/htdocs/core/modules/societe/mod_codecompta_panicum.php
index b3d5f6fcfd4..f16bb7b7ea4 100644
--- a/htdocs/core/modules/societe/mod_codecompta_panicum.php
+++ b/htdocs/core/modules/societe/mod_codecompta_panicum.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville
* Copyright (C) 2010 Laurent Destailleur
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -43,7 +44,7 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -69,15 +70,16 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
return $langs->trans("ModuleCompanyCode".$this->name);
}
+
/**
- * Return an example of result returned by getNextValue
+ * Return an example of result returned by getNextValue
*
- * @param Translate $langs Object langs
- * @param Societe|string $objsoc Object thirdparty
- * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
- * @return string Example
+ * @param ?Translate $langs Object langs
+ * @param Societe|string $objsoc Object thirdparty
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @return string Return string example
*/
- public function getExample($langs, $objsoc = '', $type = -1)
+ public function getExample($langs = null, $objsoc = '', $type = -1)
{
return '';
}
diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php
index 4504e008e5f..f32e6257bb7 100644
--- a/htdocs/core/modules/societe/modules_societe.class.php
+++ b/htdocs/core/modules/societe/modules_societe.class.php
@@ -85,6 +85,17 @@ abstract class ModeleThirdPartyCode extends CommonNumRefGenerator
abstract public function __construct($db);
+ /**
+ * Return an example of result returned by getNextValue
+ *
+ * @param ?Translate $langs Object langs
+ * @param Societe|string $objsoc Object thirdparty
+ * @param int<-1,2> $type Type of third party (1:customer, 2:supplier, -1:autodetect)
+ * @return string Return string example
+ */
+ abstract public function getExample($langs = null, $objsoc = '', $type = -1);
+
+
/**
* Return next value available
*
diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
index d4d838f3475..03eebc4b048 100644
--- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
+++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2010-2012 Laurent Destailleur
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
class doc_generic_stock_odt extends ModelePDFStock
{
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
@@ -321,7 +322,7 @@ class doc_generic_stock_odt extends ModelePDFStock
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
- $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
+ $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@@ -379,7 +380,7 @@ class doc_generic_stock_odt extends ModelePDFStock
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
- $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
+ $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@@ -411,7 +412,7 @@ class doc_generic_stock_odt extends ModelePDFStock
$array_lines = $this->get_substitutionarray_each_var_object($supplierprice, $outputlangs);
complete_substitutions_array($array_lines, $outputlangs, $object, $supplierprice, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
- $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$array_lines, 'line'=>$supplierprice);
+ $parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$array_lines, 'line' => $supplierprice);
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($array_lines as $key => $val) {
try {
@@ -442,7 +443,7 @@ class doc_generic_stock_odt extends ModelePDFStock
}
// Call the beforeODTSave hook
- $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
+ $parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@@ -470,7 +471,7 @@ class doc_generic_stock_odt extends ModelePDFStock
$odfHandler = null; // Destroy object
- $this->result = array('fullpath'=>$file);
+ $this->result = array('fullpath' => $file);
return 1; // Success
} else {
diff --git a/htdocs/core/modules/stock/modules_stock.php b/htdocs/core/modules/stock/modules_stock.php
index cd5ad31db44..151ce445710 100644
--- a/htdocs/core/modules/stock/modules_stock.php
+++ b/htdocs/core/modules/stock/modules_stock.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,7 +45,7 @@ abstract class ModelePDFStock extends CommonDocGenerator
public $type;
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
index fd73c16962b..c575593aaf1 100644
--- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
+++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
@@ -62,7 +62,7 @@ class pdf_eagle extends ModelePDFStockTransfer
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
@@ -1116,6 +1116,7 @@ class pdf_eagle extends ModelePDFStockTransfer
$classname = ucfirst($origin);
$linkedobject = new $classname($this->db);
+ '@phan-var-force CommonObject $linkedobject';
$result = $linkedobject->fetch($origin_id);
if ($result >= 0) {
//$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects
diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
index d2340b2cf5a..f769c797973 100644
--- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
+++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
@@ -71,7 +71,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
@@ -150,6 +150,8 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
// phpcs:enable
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
+ '@phan-var-force StockTransfer $object';
+
if (!is_object($outputlangs)) {
$outputlangs = $langs;
}
@@ -158,6 +160,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
$outputlangs->charset_output = 'ISO-8859-1';
}
+
// Load translation files required by page
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch", "stocks", "stocktransfer@stocktransfer"));
@@ -835,6 +838,8 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
{
global $conf, $mysoc;
+ '@phan-var-force Commande|Propal|Facture $object'; // availability_code,... does not exist on Facture.
+
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetFont('', '', $default_font_size - 1);
@@ -906,7 +911,15 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1;
- } elseif ($object->availability_code || $object->availability) { // Show availability conditions
+ } elseif (property_exists($object, 'availability_code')
+ && property_exists($object, 'availability')
+ && (
+ $object->availability_code
+ || $object->availability
+ )
+ ) {
+ // Show availability conditions
+
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("AvailabilityPeriod").':';
@@ -1158,11 +1171,11 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
/**
* Show top header of page.
*
- * @param TCPDF $pdf Object PDF
- * @param Object $object Object to show
- * @param int $showaddress 0=no, 1=yes
- * @param Translate $outputlangs Object lang for output
- * @param string $titlekey Translation key to show as title of document
+ * @param TCPDF $pdf Object PDF
+ * @param Object $object Object to show
+ * @param int<0,1> $showaddress 0=no, 1=yes
+ * @param Translate $outputlangs Object lang for output
+ * @param string $titlekey Translation key to show as title of document
* @return float|int Return topshift value
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "StockTransferSheetProforma")
@@ -1170,6 +1183,8 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
// phpcs:enable
global $conf, $langs;
+ '@phan-var-force StockTransfer $object';
+
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));
@@ -1465,6 +1480,8 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{
// phpcs:enable
+ '@phan-var-force StockTransfer $object';
+
$showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
return pdf_pagefoot($pdf, $outputlangs, 'STOCKTRANSFER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
}
@@ -1474,7 +1491,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
/**
* Define Array Column Field
*
- * @param object $object common object
+ * @param CommonObject $object common object
* @param Translate $outputlangs langs
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php
index cb77d500fdd..62387787668 100644
--- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php
+++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php
@@ -5,6 +5,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2019-2024 Frédéric France
* Copyright (C) 2021 Gauthier VERDOL
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,7 +38,7 @@ class mod_stocktransfer_advanced extends ModeleNumRefStockTransfer
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -126,7 +127,7 @@ class mod_stocktransfer_advanced extends ModeleNumRefStockTransfer
* Return next free value
*
* @param StockTransfer $object Object we need next value for
- * @return string|0 Value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, 0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php
index 57e7f238fc2..2df9df5bbc5 100644
--- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php
+++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php
@@ -35,7 +35,7 @@ class mod_stocktransfer_standard extends ModeleNumRefStockTransfer
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -121,7 +121,7 @@ class mod_stocktransfer_standard extends ModeleNumRefStockTransfer
* Return next free value
*
* @param StockTransfer $object Object we need next value for
- * @return string|-1 Value if OK, -1 if KO
+ * @return string|int<-1,0> Value if OK, 0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/core/modules/stocktransfer/modules_stocktransfer.php b/htdocs/core/modules/stocktransfer/modules_stocktransfer.php
index c68ae5d3d7a..30ef2137333 100644
--- a/htdocs/core/modules/stocktransfer/modules_stocktransfer.php
+++ b/htdocs/core/modules/stocktransfer/modules_stocktransfer.php
@@ -7,6 +7,7 @@
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2014 Marcos García
* Copyright (C) 2021 Gauthier VERDOL
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -67,5 +68,11 @@ abstract class ModelePDFStockTransfer extends CommonDocGenerator
*/
abstract class ModeleNumRefStockTransfer extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next free value
+ *
+ * @param StockTransfer $object Object we need next value for
+ * @return string|int<-1,0> Value if OK, 0 if KO
+ */
+ abstract public function getNextValue($object);
}
diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
index eaf1004bba4..9d602601c39 100644
--- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
+++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
@@ -6,6 +6,7 @@
* Copyright (C) 2018-2019 Philippe Grand
* Copyright (C) 2018-2024 Frédéric France
* Copyright (C) 2019 Tim Otte
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,7 +49,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
public $issuer;
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
index 9870d32be17..c769cf44519 100644
--- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
@@ -66,7 +66,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php
index 68b728b839c..d56d50ab247 100644
--- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php
+++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php
@@ -37,7 +37,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -175,10 +175,10 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
/**
* Return next value
*
- * @param Societe $objsoc Object third party
+ * @param Societe $objsoc Object third party
* @param FactureFournisseur $object Object invoice
- * @param string $mode 'next' for next value or 'last' for last value
- * @return string|-1 Value if OK, -1 if KO
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @return string|int<-1,0> Value if OK, -1 if KO
*/
public function getNextValue($objsoc, $object, $mode = 'next')
{
diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
index 7f10f50c0f3..e8029ccd033 100644
--- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
+++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
@@ -6,6 +6,7 @@
* Copyright (C) 2013 Juanjo Menent
* Copyright (C) 2016-2021 Alexandre Spangaro
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,7 +40,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -150,10 +151,10 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
/**
* Return next value
*
- * @param Societe $objsoc Object third party
+ * @param Societe $objsoc Object third party
* @param FactureFournisseur $object Object invoice
- * @param string $mode 'next' for next value or 'last' for last value
- * @return string|int Value if OK, 0 if KO
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $object, $mode = 'next')
{
diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php
index dddd06061ff..daa9fa1c0f7 100644
--- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php
+++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php
@@ -3,6 +3,7 @@
* Copyright (C) 2012 Regis Houssin
* Copyright (C) 2013-2016 Philippe Grand
* Copyright (C) 2014 Marcos García
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -77,5 +78,13 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
*/
abstract class ModeleNumRefSuppliersInvoices extends CommonNumRefGenerator
{
- // No overload code
+ /**
+ * Return next value
+ *
+ * @param Societe $objsoc Object third party
+ * @param FactureFournisseur $object Object invoice
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @return string|int<-1,0> Value if OK, <=0 if KO
+ */
+ abstract public function getNextValue($objsoc, $object, $mode = 'next');
}
diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
index addb723887c..847f1cd1b60 100644
--- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
@@ -6,6 +6,7 @@
* Copyright (C) 2018-2019 Philippe Grand
* Copyright (C) 2018-2024 Frédéric France
* Copyright (C) 2019 Tim Otte
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,7 +49,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
public $issuer;
/**
- * @var string Dolibarr version of the loaded document
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
index 65022d0f41a..a0a576bd84f 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
@@ -70,7 +70,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
index 3a56120e895..1d93fbccd5a 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
@@ -69,7 +69,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr';
diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php
index 6eb57b73d82..2e5efa815f1 100644
--- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php
+++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php
@@ -35,7 +35,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -132,9 +132,9 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
/**
* Return next value
*
- * @param Societe|string $objsoc Object third party
+ * @param Societe|string $objsoc Object third party
* @param CommandeFournisseur $object Object
- * @return string Value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
index 2ddbb51428e..350e22302ea 100644
--- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
+++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
@@ -36,7 +36,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
{
/**
* Dolibarr version of the loaded document
- * @var string
+ * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
@@ -129,11 +129,11 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
}
/**
- * Return next value
+ * Return next value
*
- * @param Societe|string $objsoc Object third party
+ * @param Societe|string $objsoc Object third party
* @param CommandeFournisseur $object Object
- * @return string|int Value if OK, 0 if KO
+ * @return string|int<-1,0> Value if OK, <=0 if KO
*/
public function getNextValue($objsoc, $object)
{
diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php
index b5f78c0fce7..e58b00e36d1 100644
--- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php
+++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php
@@ -6,6 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2011-2016 Philippe Grand