From b8d7825b6f0802db3ff13675136790b7f6b5e7df Mon Sep 17 00:00:00 2001 From: Erik van Berkum Date: Sun, 22 Dec 2024 16:02:36 +0900 Subject: [PATCH 1/3] Update ticket.class.php Solves issue #30890 Blank dashboard after upgrade 19.0.3 to 20.0.2 --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 9121d0ec032..e0da84aa3d9 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -3192,7 +3192,7 @@ class Ticket extends CommonObject while ($obj = $this->db->fetch_object($resql)) { $response->nbtodo++; if ($mode == 'opened') { - $datelimit = $this->db->jdate($obj->datec) + $delay_warning; + $datelimit = (int) $this->db->jdate($obj->datec) + (int) $delay_warning; if ($datelimit < $now) { //$response->nbtodolate++; } From b27f98ebb39ccd0c0969a9f8f3f7dd47247a7354 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 24 Dec 2024 00:27:15 +0100 Subject: [PATCH 2/3] Complete #32292 #32434 --- htdocs/core/class/html.form.class.php | 4 +++- htdocs/product/list.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 555778e7124..c8965d32c6a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5128,7 +5128,7 @@ class Form $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { if ($showempty) { - $return .= ''; + $return .= ''; } while ($res = $this->db->fetch_object($resql)) { @@ -5144,6 +5144,8 @@ class Form } } $return .= ''; + + $return .= ajax_combobox($htmlname); } return $return; } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 0f7d57db40c..030410ced4f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -583,6 +583,7 @@ if ($search_vatrate) { if (dol_strlen($canvas) > 0) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } + // Search for tag/category ($searchCategoryProductList is an array of ID) if (!empty($searchCategoryProductList)) { $searchCategoryProductSqlList = array(); @@ -641,9 +642,10 @@ if ($search_accountancy_code_buy_intra) { if ($search_accountancy_code_buy_export) { $sql .= natural_search($alias_product_perentity . '.accountancy_code_buy_export', clean_account($search_accountancy_code_buy_export)); } -if (getDolGlobalString('PRODUCT_USE_UNITS') && $search_units) { +if (getDolGlobalString('PRODUCT_USE_UNITS') && $search_units && $search_units != '-1') { $sql .= natural_search('cu.rowid', $search_units); } + // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks From 6c33f973d86a571df2ca3f60f7c6af98b403057c Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 24 Dec 2024 00:36:51 +0100 Subject: [PATCH 3/3] Fix warning --- htdocs/core/lib/invoice2.lib.php | 57 +++++++++++++++++--------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 98566c95d51..288a1f5a014 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -231,6 +231,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte while ($cpt < $num) { $obj = $db->fetch_object($resql); + $fac = null; if ($mode == 'invoice') { $fac = new Facture($db); } elseif ($mode == 'order') { @@ -241,37 +242,39 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte $fac = new Expedition($db); } - $result = $fac->fetch($obj->rowid); - if ($result > 0) { - $outputlangs = $langs; - if (!empty($newlangid)) { - if ($outputlangs->defaultlang != $newlangid) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlangid); + if ($fac) { + $result = $fac->fetch($obj->rowid); + if ($result > 0) { + $outputlangs = $langs; + if (!empty($newlangid)) { + if ($outputlangs->defaultlang != $newlangid) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlangid); + } } - } - $filename = $dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf'; - if ($regenerate || !dol_is_file($filename)) { - if ($usestdout) { - print "Build PDF for document ".$obj->ref." - Lang = ".$outputlangs->defaultlang."\n"; - } - $result = $fac->generateDocument($regenerate ? $regenerate : $fac->model_pdf, $outputlangs); - } else { - if ($usestdout) { - print "PDF for document ".$obj->ref." already exists\n"; + $filename = $dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf'; + if ($regenerate || !dol_is_file($filename)) { + if ($usestdout) { + print "Build PDF for document ".$obj->ref." - Lang = ".$outputlangs->defaultlang."\n"; + } + $result = $fac->generateDocument($regenerate ? $regenerate : $fac->model_pdf, $outputlangs); + } else { + if ($usestdout) { + print "PDF for document ".$obj->ref." already exists\n"; + } } + + // Add file into files array + $files[] = $filename; } - // Add file into files array - $files[] = $filename; - } - - if ($result <= 0) { - $error++; - if ($usestdout) { - print "Error: Failed to build PDF for document ".($fac->ref ? $fac->ref : ' id '.$obj->rowid)."\n"; - } else { - dol_syslog("Failed to build PDF for document ".($fac->ref ? $fac->ref : ' id '.$obj->rowid), LOG_ERR); + if ($result <= 0) { + $error++; + if ($usestdout) { + print "Error: Failed to build PDF for document ".($fac->ref ? $fac->ref : ' id '.$obj->rowid)."\n"; + } else { + dol_syslog("Failed to build PDF for document ".($fac->ref ? $fac->ref : ' id '.$obj->rowid), LOG_ERR); + } } }