From ade0e008e9c8c80c2db310eb6c0c82bb489dd5e1 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sat, 2 Jan 2021 17:42:33 +0100 Subject: [PATCH 1/5] Some debug on Shipments. Wrong object status on list paging. Parameter error on link contact. nbr Linked files not shown in tab badge. --- htdocs/core/lib/sendings.lib.php | 2 +- htdocs/expedition/contact.php | 2 +- htdocs/expedition/list.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index cf1d1793a88..0bb0db6afd1 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -81,7 +81,7 @@ function shipping_prepare_head($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->commande->dir_output."/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$object->id; diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index c6b10bd6967..ffdd395cffc 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -80,7 +80,7 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) { if ($result > 0 && $id > 0) { - $result = $objectsrc->add_contact(GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'), $_POST["type"], $_POST["source"]); + $result = $objectsrc->add_contact(GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'), $_POST["typecontact"], $_POST["source"]); } if ($result >= 0) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index eaae2438b55..4494db8c21d 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -340,7 +340,7 @@ if ($resql) if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category); if ($search_categ_cus > 0) $param .= '&search_categ_cus='.urlencode($search_categ_cus); - if ($search_status != '') $param .= '&viewstatut='.urlencode($search_status); + if ($search_status != '') $param .= '&search_status='.urlencode($search_status); if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; From 799927432c349653c566f45164c5fe9d347fb587 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 3 Jan 2021 10:53:48 +0100 Subject: [PATCH 2/5] regression for user type on shipment contact --- htdocs/expedition/contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index ffdd395cffc..09559a64a2c 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -80,7 +80,7 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) { if ($result > 0 && $id > 0) { - $result = $objectsrc->add_contact(GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'), $_POST["typecontact"], $_POST["source"]); + $result = $objectsrc->add_contact(GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'), GETPOST('type') ? GETPOST('type') : GETPOST('typecontact'), GETPOST('source')); } if ($result >= 0) From cbf6fe1f6282e69fe04dd550cae646af3cade65c Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 3 Jan 2021 11:42:11 +0100 Subject: [PATCH 3/5] Clean code --- htdocs/expedition/contact.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 09559a64a2c..c5d74a2f39d 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -80,7 +80,9 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) { if ($result > 0 && $id > 0) { - $result = $objectsrc->add_contact(GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'), GETPOST('type') ? GETPOST('type') : GETPOST('typecontact'), GETPOST('source')); + $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); + $result = $objectsrc->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } if ($result >= 0) From 50d2e2d16153345ac88e21892be2b50f0f1a7eb1 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 3 Jan 2021 12:21:20 +0100 Subject: [PATCH 4/5] Debug reception contacts and list --- htdocs/reception/contact.php | 9 +++------ htdocs/reception/list.php | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 908f7a441be..ad8811a4e1f 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -67,11 +67,6 @@ if ($id > 0 || !empty($ref)) $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); } - if ($typeobject == 'propal' && $object->$typeobject->id && !empty($conf->propal->enabled)) - { - $objectsrc = new Propal($db); - $objectsrc->fetch($object->$typeobject->id); - } } @@ -83,7 +78,9 @@ if ($action == 'addcontact' && $user->rights->reception->creer) { if ($result > 0 && $id > 0) { - $result = $objectsrc->add_contact(GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'), $_POST["type"], $_POST["source"]); + $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); + $result = $objectsrc->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } if ($result >= 0) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index ec08c7ba94a..30d31291a74 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -505,7 +505,7 @@ if ($resql) if ($search_town) $param .= "&search_town=".urlencode($search_town); if ($search_zip) $param .= "&search_zip=".urlencode($search_zip); if ($search_state) $param .= "&search_state=".urlencode($search_state); - if ($search_status) $param .= "&search_status=".urlencode($search_status); + if ($search_status != '') $param .= "&search_status=".urlencode($search_status); if ($search_country) $param .= "&search_country=".urlencode($search_country); if ($search_type_thirdparty) $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); if ($search_ref_supplier) $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); From 236ff2d4e47ceb37c683031caabb0eb5769f8839 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 3 Jan 2021 12:26:10 +0100 Subject: [PATCH 5/5] indent --- htdocs/expedition/contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index c5d74a2f39d..d15e267b285 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -80,7 +80,7 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) { if ($result > 0 && $id > 0) { - $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $objectsrc->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); }