From 4e1380f4ebd96d1bf18e86dc2ddba469e2f2c1fa Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:19:25 +0200 Subject: [PATCH 1/5] scrutinizer on imports/import.php: action builddoc never existed on import --- htdocs/imports/import.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 2c85007c086..4b08662d886 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -198,15 +198,15 @@ if ($action=='downfield' || $action=='upfield') } } */ -if ($action == 'builddoc') { - // Build import file - $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database); - if ($result < 0) { - setEventMessages($objimport->error, $objimport->errors, 'errors'); - } else { - setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); - } -} +// if ($action == 'builddoc') { +// // Build import file +// $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database); +// if ($result < 0) { +// setEventMessages($objimport->error, $objimport->errors, 'errors'); +// } else { +// setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); +// } +// } if ($action == 'deleteprof') { if (GETPOST("id", 'int')) { From 09eede8cde5dd513b42d1c22ecd88559e7fedcbc Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:42:47 +0200 Subject: [PATCH 2/5] scrutinizer on expensereport/class/expensereport_ik.class.php: method fetchLine was not defined --- .../expensereport/class/expensereport_ik.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 0d374f1c722..14f6908377e 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -126,6 +126,19 @@ class ExpenseReportIk extends CommonObject return $result; } + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + $this->lines = array(); + + $result = $this->fetchLinesCommon(); + return $result; + } + /** * Update object into database From 54a211509be0423132d460120379671351dde3d8 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:51:25 +0200 Subject: [PATCH 3/5] scrutinizer on delivery/class/delivery.class.php: attribute $linked_object does not exist but $linked_objects does --- htdocs/delivery/class/delivery.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 55f6293a9d2..ad1a3b9934a 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -973,7 +973,7 @@ class Delivery extends CommonObject $sqlSourceLine .= ", p.ref, p.label"; $sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st"; $sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid"; - $sqlSourceLine .= " WHERE fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']); + $sqlSourceLine .= " WHERE fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']); $resultSourceLine = $this->db->query($sqlSourceLine); if ($resultSourceLine) { @@ -986,12 +986,12 @@ class Delivery extends CommonObject // Get lines of sources alread delivered $sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty"; $sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,"; - $sql .= " ".MAIN_DB_PREFIX.$this->linked_object[0]['type']." as c"; - $sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd"; + $sql .= " ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']." as c"; + $sql .= ", ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']."det as cd"; $sql .= " WHERE ld.fk_delivery = l.rowid"; $sql .= " AND ld.fk_origin_line = cd.rowid"; - $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = c.rowid"; - $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']); + $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = c.rowid"; + $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']); $sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid); $sql .= " GROUP BY ld.fk_origin_line"; From 22ab13975f186a35387f2f3c953a94147d2f6813 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:57:23 +0200 Subject: [PATCH 4/5] scrutinizer on expensereport/class/expensereport_rule.class.php: method fetchLine wasn't defined --- .../class/expensereport_rule.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 02bf8b8ce5c..d695359229d 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -171,6 +171,19 @@ class ExpenseReportRule extends CommonObject } + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + $this->lines = array(); + + $result = $this->fetchLinesCommon(); + return $result; + } + /** * Update object into database * From cea9a4c4cc51a4deb8877776b1384bb1d4eb0d34 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 13 Sep 2022 20:34:40 +0200 Subject: [PATCH 5/5] cocorrection on expensereport/class/expensereport_ik.class.php: table_element_line doest not exist on class, so removed the call of fetchLine --- .../class/expensereport_ik.class.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 14f6908377e..503fa92b108 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -120,24 +120,10 @@ class ExpenseReportIk extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); - } + return $result; } - /** - * Load object lines in memory from the database - * - * @return int <0 if KO, 0 if not found, >0 if OK - */ - public function fetchLines() - { - $this->lines = array(); - - $result = $this->fetchLinesCommon(); - return $result; - } /**