From 5dfb988cb17042971ef9f0cc0b3b6ecab78fd9ba Mon Sep 17 00:00:00 2001 From: atm-ph Date: Sat, 10 Jun 2017 13:34:28 +0200 Subject: [PATCH 1/5] Fix 6944 compatibility PHP7 and missing parameter to call delete function --- htdocs/fourn/class/paiementfourn.class.php | 2 +- htdocs/fourn/facture/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 12fccab91d8..03f3ecb0e21 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -533,7 +533,7 @@ class PaiementFourn extends Paiement * @param string $option Sur quoi pointe le lien * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$option='') + function getNomUrl($withpicto=0,$option='',$mode='withlistofinvoices') { global $langs; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0ec657ccdfe..813f23cdc88 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -218,7 +218,7 @@ if (empty($reshook)) { $object->fetch($id); $object->fetch_thirdparty(); - $result=$object->delete($id); + $result=$object->delete($user, $id); if ($result > 0) { header('Location: list.php'); From 6b4e22ec3cf1f75eef5c0923fafd9f942e2e9fcf Mon Sep 17 00:00:00 2001 From: atm-ph Date: Sat, 10 Jun 2017 16:07:56 +0200 Subject: [PATCH 2/5] Fix 6910 if conf PROJECT_USE_SEARCH_TO_SELECT is used we got BadFirstParameterForGETPOST --- htdocs/expedition/class/expedition.class.php | 1 + htdocs/projet/ajax/projects.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 06cddeace91..1a36f68a81a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -195,6 +195,7 @@ class Expedition extends CommonObject // Clean parameters $this->brouillon = 1; $this->tracking_number = dol_sanitizeFileName($this->tracking_number); + if (empty($this->fk_project)) $this->fk_project = 0; $this->user = $user; diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index 3140352bf60..ae4c412f6e3 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -61,7 +61,7 @@ $idprod = (! empty($match[0]) ? $match[0] : ''); if (! GETPOST($htmlname) && ! GETPOST($idprod)) return; // When used from jQuery, the search term is added as GET param "term". -$searchkey=(GETPOST($idprod)?GETPOST($idprod):(GETPOST($htmlname)?GETPOST($htmlname):'')); +$searchkey=(!empty($idprod) && GETPOST($idprod)?GETPOST($idprod):(GETPOST($htmlname)?GETPOST($htmlname):'')); $form = new FormProjets($db); $arrayresult=$form->select_projects_list($socid, '', $htmlname, 0, 0, 1, $discard_closed, 0, 0, 1, $searchkey); From 039130c6943f4ba3f47d74ca09481a262f9a7c58 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Sat, 10 Jun 2017 16:19:33 +0200 Subject: [PATCH 3/5] Fix travis --- htdocs/fourn/class/paiementfourn.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 03f3ecb0e21..25639bfd3f9 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -531,6 +531,7 @@ class PaiementFourn extends Paiement * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @param string $option Sur quoi pointe le lien + * @param string $mode 'withlistofinvoices'=Include list of invoices into tooltip * @return string Chaine avec URL */ function getNomUrl($withpicto=0,$option='',$mode='withlistofinvoices') From b19e0e3cae12cac65c5b9e06ee61e3c19796bcbd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Jun 2017 00:31:58 +0200 Subject: [PATCH 4/5] Create card.php --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 813f23cdc88..5471b3111f7 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -218,7 +218,7 @@ if (empty($reshook)) { $object->fetch($id); $object->fetch_thirdparty(); - $result=$object->delete($user, $id); + $result=$object->delete($user); if ($result > 0) { header('Location: list.php'); From 074c43920ad168c66931fcd08cc9b4fee1540440 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Jun 2017 00:35:03 +0200 Subject: [PATCH 5/5] Create projects.php --- htdocs/projet/ajax/projects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index ae4c412f6e3..991cae22aa3 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -61,7 +61,7 @@ $idprod = (! empty($match[0]) ? $match[0] : ''); if (! GETPOST($htmlname) && ! GETPOST($idprod)) return; // When used from jQuery, the search term is added as GET param "term". -$searchkey=(!empty($idprod) && GETPOST($idprod)?GETPOST($idprod):(GETPOST($htmlname)?GETPOST($htmlname):'')); +$searchkey=((!empty($idprod) && GETPOST($idprod))?GETPOST($idprod):(GETPOST($htmlname)?GETPOST($htmlname):'')); $form = new FormProjets($db); $arrayresult=$form->select_projects_list($socid, '', $htmlname, 0, 0, 1, $discard_closed, 0, 0, 1, $searchkey);