diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 835da0a80d8..98e79fa0416 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -34,6 +34,8 @@
* $type, $text, $description, $line
*/
+/** var ObjectLine $line */
+
require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php';
// Protection to avoid direct call of template
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 5c24359c78b..09b2c1e6185 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -1035,6 +1035,10 @@ class FactureRec extends CommonInvoice
$this->error = $this->db->lasterror();
return -1;
}
+ } else {
+ $this->error = 'Recurring Invoice is suspended. adding lines not allowed.';
+
+ return -1;
}
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index ba6f35363b6..5e4f5490e61 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -802,18 +802,17 @@ class Form
/**
* Generate select HTML to choose massaction
*
- * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default.
- * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
- * @param int $alwaysvisible 1=select button always visible
- * @param string $name Name for massaction
- * @param string $cssclass CSS class used to check for select
- * @return string|void Select list
+ * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default.
+ * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
+ * @param int $alwaysvisible 1=select button always visible
+ * @param string $name Name for massaction
+ * @param string $cssclass CSS class used to check for select
+ * @return string|void Select list
*/
public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0, $name = 'massaction', $cssclass = 'checkforselect')
{
global $conf, $langs, $hookmanager;
-
$disabled = 0;
$ret = '
';
$ret .= '';
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index cce5cf7819d..596df87e583 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -782,7 +782,7 @@ class FormOther
*
* @param string $color String with hex (FFFFFF) or comma RGB ('255,255,255')
* @param string $textifnotdefined Text to show if color not defined
- * @return string HTML code for color thumb
+ * @return void
* @see selectColor()
*/
public static function showColor($color, $textifnotdefined = '')
@@ -1091,7 +1091,7 @@ class FormOther
* @param string $option Option
* @param string $morecss More CSS
* @param bool $addjscombo Add js combo
- * @return string
+ * @return void
* @deprecated
*/
public function select_year($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle maxwidth75imp', $addjscombo = false)
diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php
index 694292ef47a..edb688e78bb 100644
--- a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php
+++ b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php
@@ -127,6 +127,7 @@ function SendErrorNode($number, $text)
} else {
echo ' ';
}
+ return '';
}
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 afa3b56b4f5..d62a1eb6ada 100644
--- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
+++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
@@ -1181,7 +1181,7 @@ class pdf_standard_asset extends ModelePDFAsset
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index 1cf3864d333..b078993e718 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -706,6 +706,7 @@ class pdf_einstein extends ModelePDFCommandes
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
// phpcs:enable
+ return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index cb460cff14a..f0a70560499 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -927,6 +927,7 @@ class pdf_eratosthene extends ModelePDFCommandes
*/
protected function drawPaymentsTable(&$pdf, $object, $posy, $outputlangs)
{
+ return 0;
}
/**
@@ -1733,7 +1734,7 @@ class pdf_eratosthene extends ModelePDFCommandes
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
index 7ae6356aabc..c84c9b7e6a0 100644
--- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
@@ -933,7 +933,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index f6c648f2ff0..16d38e9efeb 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -1236,7 +1236,7 @@ class pdf_espadon extends ModelePdfExpedition
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
diff --git a/htdocs/core/modules/export/export_csviso.modules.php b/htdocs/core/modules/export/export_csviso.modules.php
index 6fd66aec769..4e12c32f66c 100644
--- a/htdocs/core/modules/export/export_csviso.modules.php
+++ b/htdocs/core/modules/export/export_csviso.modules.php
@@ -78,7 +78,7 @@ class ExportCsvIso extends ExportCsv
global $conf;
$conf->global->EXPORT_CSV_FORCE_CHARSET = 'ISO-8859-1';
- parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types);
+ return parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -96,6 +96,6 @@ class ExportCsvIso extends ExportCsv
global $conf;
$conf->global->EXPORT_CSV_FORCE_CHARSET = 'ISO-8859-1';
- parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types);
+ return parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types);
}
}
diff --git a/htdocs/core/modules/export/export_csvutf8.modules.php b/htdocs/core/modules/export/export_csvutf8.modules.php
index fc79bc79825..a98f3f5f7f8 100644
--- a/htdocs/core/modules/export/export_csvutf8.modules.php
+++ b/htdocs/core/modules/export/export_csvutf8.modules.php
@@ -76,7 +76,7 @@ class ExportCsvUtf8 extends ExportCsv
global $conf;
$conf->global->EXPORT_CSV_FORCE_CHARSET = 'UTF-8';
- parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types);
+ return parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -94,6 +94,6 @@ class ExportCsvUtf8 extends ExportCsv
global $conf;
$conf->global->EXPORT_CSV_FORCE_CHARSET = 'UTF-8';
- parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types);
+ return parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types);
}
}
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index e564ccf5a91..3e75ec686ee 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -2448,7 +2448,7 @@ class pdf_sponge extends ModelePDFFactures
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index 72576e2d2e6..10393084fbd 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -341,6 +341,7 @@ class ImportXlsx extends ModeleImports
// phpcs:enable
$this->workbook->disconnectWorksheets();
unset($this->workbook);
+ return 0;
}
diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
index e625d685727..7ddd983c907 100644
--- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
+++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
@@ -713,6 +713,7 @@ class pdf_vinci extends ModelePDFMo
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
// phpcs:enable
+ return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
@@ -1365,7 +1366,7 @@ class pdf_vinci extends ModelePDFMo
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index e9da62a42bb..7e745d2cc7a 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -903,6 +903,7 @@ class pdf_azur extends ModelePDFPropales
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
// phpcs:enable
+ return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index 56184668f20..e7fbdd1fc5f 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -1875,7 +1875,7 @@ class pdf_cyan extends ModelePDFPropales
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
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 41bbf8c32f9..123048bbb2d 100644
--- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
+++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
@@ -1448,7 +1448,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
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 92bd19f52f4..00d819a0156 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
@@ -870,6 +870,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
// phpcs:enable
+ return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
@@ -1497,7 +1498,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
- * @return null
+ * @return void
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
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 ba4dcd4c2ae..8c6c144f2e4 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
@@ -752,6 +752,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
// phpcs:enable
+ return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
index 5a2eaeddf47..0974a0df56f 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
@@ -739,6 +739,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
// phpcs:enable
+ return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index be0d27f83f4..b9288258626 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -1591,6 +1591,7 @@ class CommandeFournisseur extends CommonOrder
$result = $this->call_trigger('ORDER_SUPPLIER_CREATE', $user);
if ($result < 0) {
$this->db->rollback();
+
return -1;
}
// End call triggers
@@ -1601,12 +1602,18 @@ class CommandeFournisseur extends CommonOrder
} else {
$this->error = $this->db->lasterror();
$this->db->rollback();
+
return -2;
}
+ } else {
+ $this->error = 'Failed to get ID of inserted line';
+
+ return -1;
}
} else {
$this->error = $this->db->lasterror();
$this->db->rollback();
+
return -1;
}
}
diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php
index b0a975f7df9..6e7b5d60505 100644
--- a/htdocs/fourn/class/fournisseur.facture-rec.class.php
+++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php
@@ -847,29 +847,29 @@ class FactureFournisseurRec extends CommonInvoice
}
/**
- * Add a line to recursive supplier invoice
+ * Add a line to recursive supplier invoice
*
- * @param int $fk_product Product/Service ID predefined
- * @param string $ref Ref
- * @param string $label Label
- * @param string $desc Description de la ligne
- * @param double $pu_ht Unit price
- * @param double $pu_ttc Unit price with tax
- * @param double $qty Quantity
- * @param int $remise_percent Percentage discount of the line
- * @param double $txtva Taux de tva force, sinon -1
- * @param int $txlocaltax1 Local tax 1 rate (deprecated)
- * @param int $txlocaltax2 Local tax 2 rate (deprecated)
- * @param string $price_base_type HT or TTC
- * @param int $type Type of line (0=product, 1=service)
- * @param int $date_start Date start
- * @param int $date_end Date end
- * @param int $info_bits VAT npr or not ?
- * @param int $special_code Special code
- * @param int $rang Position of line
- * @param string $fk_unit Unit
- * @param int $pu_ht_devise Unit price in currency
- * @return int <0 if KO, Id of line if OK
+ * @param int $fk_product Product/Service ID predefined
+ * @param string $ref Ref
+ * @param string $label Label
+ * @param string $desc Description de la ligne
+ * @param double $pu_ht Unit price
+ * @param double $pu_ttc Unit price with tax
+ * @param double $qty Quantity
+ * @param int $remise_percent Percentage discount of the line
+ * @param double $txtva Taux de tva force, sinon -1
+ * @param int $txlocaltax1 Local tax 1 rate (deprecated)
+ * @param int $txlocaltax2 Local tax 2 rate (deprecated)
+ * @param string $price_base_type HT or TTC
+ * @param int $type Type of line (0=product, 1=service)
+ * @param int $date_start Date start
+ * @param int $date_end Date end
+ * @param int $info_bits VAT npr or not ?
+ * @param int $special_code Special code
+ * @param int $rang Position of line
+ * @param string $fk_unit Unit
+ * @param int $pu_ht_devise Unit price in currency
+ * @return int <0 if KO, Id of line if OK
* @throws Exception
*/
public function addline($fk_product, $ref, $label, $desc, $pu_ht, $pu_ttc, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $type = 0, $date_start = 0, $date_end = 0, $info_bits = 0, $special_code = 0, $rang = -1, $fk_unit = null, $pu_ht_devise = 0)
@@ -1031,6 +1031,10 @@ class FactureFournisseurRec extends CommonInvoice
return -1;
}
+ } else {
+ $this->error = 'Recurring Invoice is suspended. adding lines not allowed.';
+
+ return -1;
}
}
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 1d005da50ab..9d70d846050 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -3881,6 +3881,8 @@ class User extends CommonObject
} else {
dol_print_error($this->db);
}
+
+ return '';
}
/**