From 049174b76f02424cbbd7fa985a09ead6a788c2dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Mar 2015 01:53:02 +0100 Subject: [PATCH] Fix bugs reported by https://scrutinizer-ci.com/g/Dolibarr/dolibarr/ --- htdocs/admin/fichinter.php | 2 +- htdocs/admin/security_file.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/core/class/commonobject.class.php | 24 ++++++++++++------------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 8965b225cfb..8e06e946dee 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -221,7 +221,7 @@ else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') { $val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on'),'bool',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on' ? 1 : 0),'bool',0,'',$conf->entity); if (! $res > 0) $error++; diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 4c0dd435634..d99db6ed638 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -208,7 +208,7 @@ $formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestF // List of document $filearray=dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1); -$formfile->list_of_documents($filearray, '', 'admin_temp', ''); +$formfile->list_of_documents($filearray, null, 'admin_temp', ''); llxFooter(); $db->close(); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 6c520105c36..49466c7fcb0 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -91,7 +91,7 @@ llxHeader(); if ($object->id) { - $head=contract_prepare_head($object, $user); + $head=contract_prepare_head($object); dol_fiche_head($head, 'documents', $langs->trans("Contract"), 0, 'contract'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3c5bb73d93e..8ad8ecd2331 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -888,7 +888,7 @@ abstract class CommonObject if (! $this->table_element) { - dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined", LOG_ERR); + dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined"); return -1; } @@ -2389,8 +2389,8 @@ abstract class CommonObject return 1; } } - - + + /** * Return incoterms informations * @@ -2409,13 +2409,13 @@ abstract class CommonObject $res = $this->db->fetch_object($result); $out .= $res->code; } - } - + } + $out .= ' - '.$this->location_incoterms; - + return $out; } - + /** * Return incoterms informations for pdf display * @@ -2430,12 +2430,12 @@ abstract class CommonObject $res = $this->db->fetch_object($resql); return 'Incoterm : '.$res->code.' - '.$this->location_incoterms; } - else + else { - return false; + return false; } } - + /** * Define incoterms values of current object * @@ -2457,14 +2457,14 @@ abstract class CommonObject { $this->fk_incoterms = $id_incoterm; $this->location_incoterms = $location; - + $sql = 'SELECT libelle FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms; $res = $this->db->query($sql); if ($res) { $obj = $this->db->fetch_object($res); $this->libelle_incoterms = $obj->libelle; - } + } return 1; } else