Fix warning

This commit is contained in:
Laurent Destailleur
2023-05-01 17:21:00 +02:00
parent 4f7f2b4e5a
commit 2d17e77ff7
24 changed files with 71 additions and 44 deletions

View File

@@ -34,6 +34,8 @@
* $type, $text, $description, $line * $type, $text, $description, $line
*/ */
/** var ObjectLine $line */
require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php';
// Protection to avoid direct call of template // Protection to avoid direct call of template

View File

@@ -1035,6 +1035,10 @@ class FactureRec extends CommonInvoice
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
} }
} else {
$this->error = 'Recurring Invoice is suspended. adding lines not allowed.';
return -1;
} }
} }

View File

@@ -813,7 +813,6 @@ class Form
{ {
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
$disabled = 0; $disabled = 0;
$ret = '<div class="centpercent center">'; $ret = '<div class="centpercent center">';
$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';

View File

@@ -782,7 +782,7 @@ class FormOther
* *
* @param string $color String with hex (FFFFFF) or comma RGB ('255,255,255') * @param string $color String with hex (FFFFFF) or comma RGB ('255,255,255')
* @param string $textifnotdefined Text to show if color not defined * @param string $textifnotdefined Text to show if color not defined
* @return string HTML code for color thumb * @return void
* @see selectColor() * @see selectColor()
*/ */
public static function showColor($color, $textifnotdefined = '') public static function showColor($color, $textifnotdefined = '')
@@ -1091,7 +1091,7 @@ class FormOther
* @param string $option Option * @param string $option Option
* @param string $morecss More CSS * @param string $morecss More CSS
* @param bool $addjscombo Add js combo * @param bool $addjscombo Add js combo
* @return string * @return void
* @deprecated * @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) 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)

View File

@@ -127,6 +127,7 @@ function SendErrorNode($number, $text)
} else { } else {
echo '<Error number="'.$number.'" />'; echo '<Error number="'.$number.'" />';
} }
return '';
} }

View File

@@ -1181,7 +1181,7 @@ class pdf_standard_asset extends ModelePDFAsset
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -706,6 +706,7 @@ class pdf_einstein extends ModelePDFCommandes
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{ {
// phpcs:enable // phpcs:enable
return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@@ -927,6 +927,7 @@ class pdf_eratosthene extends ModelePDFCommandes
*/ */
protected function drawPaymentsTable(&$pdf, $object, $posy, $outputlangs) 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 $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -933,7 +933,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -1236,7 +1236,7 @@ class pdf_espadon extends ModelePdfExpedition
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -78,7 +78,7 @@ class ExportCsvIso extends ExportCsv
global $conf; global $conf;
$conf->global->EXPORT_CSV_FORCE_CHARSET = 'ISO-8859-1'; $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 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -96,6 +96,6 @@ class ExportCsvIso extends ExportCsv
global $conf; global $conf;
$conf->global->EXPORT_CSV_FORCE_CHARSET = 'ISO-8859-1'; $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);
} }
} }

View File

@@ -76,7 +76,7 @@ class ExportCsvUtf8 extends ExportCsv
global $conf; global $conf;
$conf->global->EXPORT_CSV_FORCE_CHARSET = 'UTF-8'; $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 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -94,6 +94,6 @@ class ExportCsvUtf8 extends ExportCsv
global $conf; global $conf;
$conf->global->EXPORT_CSV_FORCE_CHARSET = 'UTF-8'; $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);
} }
} }

View File

@@ -2448,7 +2448,7 @@ class pdf_sponge extends ModelePDFFactures
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -341,6 +341,7 @@ class ImportXlsx extends ModeleImports
// phpcs:enable // phpcs:enable
$this->workbook->disconnectWorksheets(); $this->workbook->disconnectWorksheets();
unset($this->workbook); unset($this->workbook);
return 0;
} }

View File

@@ -713,6 +713,7 @@ class pdf_vinci extends ModelePDFMo
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{ {
// phpcs:enable // phpcs:enable
return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // 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 $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -903,6 +903,7 @@ class pdf_azur extends ModelePDFPropales
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{ {
// phpcs:enable // phpcs:enable
return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@@ -1875,7 +1875,7 @@ class pdf_cyan extends ModelePDFPropales
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -1448,7 +1448,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -870,6 +870,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{ {
// phpcs:enable // phpcs:enable
return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // 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 $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return void
*/ */
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {

View File

@@ -752,6 +752,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{ {
// phpcs:enable // phpcs:enable
return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@@ -739,6 +739,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs) protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{ {
// phpcs:enable // phpcs:enable
return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@@ -1591,6 +1591,7 @@ class CommandeFournisseur extends CommonOrder
$result = $this->call_trigger('ORDER_SUPPLIER_CREATE', $user); $result = $this->call_trigger('ORDER_SUPPLIER_CREATE', $user);
if ($result < 0) { if ($result < 0) {
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
// End call triggers // End call triggers
@@ -1601,12 +1602,18 @@ class CommandeFournisseur extends CommonOrder
} else { } else {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
} else {
$this->error = 'Failed to get ID of inserted line';
return -1;
} }
} else { } else {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
} }

View File

@@ -1031,6 +1031,10 @@ class FactureFournisseurRec extends CommonInvoice
return -1; return -1;
} }
} else {
$this->error = 'Recurring Invoice is suspended. adding lines not allowed.';
return -1;
} }
} }

View File

@@ -3881,6 +3881,8 @@ class User extends CommonObject
} else { } else {
dol_print_error($this->db); dol_print_error($this->db);
} }
return '';
} }
/** /**