From 37dcfe4a46a51626c6d5f093711e1cfdbb319f55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 16:00:23 +0200 Subject: [PATCH 1/7] FIX button to pay still visible when amount null used --- htdocs/public/payment/newpayment.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 179e31d83cf..acd0f5e4740 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -284,10 +284,18 @@ if ($action == 'dopayment') $desc=GETPOST("desc",'alpha'); $mesg=''; - if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); + if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) + { + $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); + $action = ''; + } //elseif (empty($EMAIL)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); //elseif (! isValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL); - elseif (! $origfulltag) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode")); + elseif (! $origfulltag) + { + $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode")); + $action = ''; + } //var_dump($_POST); if (empty($mesg)) From bf81b755f9fe84dd50468dd7593d65cbc2ac2420 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 16:21:13 +0200 Subject: [PATCH 2/7] Fix state code for payment from indonesia --- htdocs/public/payment/newpayment.php | 8 ++++++++ htdocs/public/paypal/newpayment.php | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index acd0f5e4740..5c9ade4893d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -271,6 +271,7 @@ if ($action == 'dopayment') $PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT'); $PAYPAL_PAYMENT_TYPE='Sale'; + // Vars that are used as global var later in print_paypal_redirect() $origfulltag=GETPOST("fulltag",'alpha'); $shipToName=GETPOST("shipToName"); $shipToStreet=GETPOST("shipToStreet"); @@ -283,6 +284,12 @@ if ($action == 'dopayment') $email=GETPOST("email"); $desc=GETPOST("desc",'alpha'); + // Special case for Paypal-Indonesia + if ($shipToCountryCode == 'ID' && ! preg_match('/\-/', $shipToState)) + { + $shipToState = 'ID-'.$shipToState; + } + $mesg=''; if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) { @@ -1280,6 +1287,7 @@ if ($source == 'membersubscription') $phoneNum=$member->phone; if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) { + print ''; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index b1ecfa43803..b409ab3b14f 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -195,7 +195,8 @@ if (GETPOST('action','aZ09') == 'dopayment') $PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT'); $PAYPAL_PAYMENT_TYPE='Sale'; - $origfulltag=GETPOST("fulltag",'alpha'); + // Vars that are used as global var later in print_paypal_redirect() + $origfulltag=GETPOST("fulltag",'alpha'); $shipToName=GETPOST("shipToName"); $shipToStreet=GETPOST("shipToStreet"); $shipToCity=GETPOST("shipToCity"); @@ -207,7 +208,13 @@ if (GETPOST('action','aZ09') == 'dopayment') $email=GETPOST("email"); $desc=GETPOST("desc"); - $mesg=''; + // Special case for Paypal-Indonesia + if ($shipToCountryCode == 'ID' && ! preg_match('/\-/', $shipToState)) + { + $shipToState = 'ID-'.$shipToState; + } + + $mesg=''; if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); //elseif (empty($EMAIL)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); //elseif (! isValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL); From 091fb81368aadacbf98cd729cf2c3859574f4c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 26 May 2018 09:49:13 +0200 Subject: [PATCH 3/7] Update list.php --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9fbac4b7977..c0cd1b49ce9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -407,7 +407,7 @@ if ($resql) if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); 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_state != '') $param .= '&search_state='.urlencode($search_state); if ($search_country != '') $param .= '&search_country='.urlencode($search_country); if ($search_type_thirdparty != '') $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category); From d032b6ecfb2df6ca63ce755445a632d65fc2baff Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 26 May 2018 09:51:56 +0200 Subject: [PATCH 4/7] Fix error in list.php --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9fbac4b7977..c0cd1b49ce9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -407,7 +407,7 @@ if ($resql) if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); 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_state != '') $param .= '&search_state='.urlencode($search_state); if ($search_country != '') $param .= '&search_country='.urlencode($search_country); if ($search_type_thirdparty != '') $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category); From ea9e833ab8d4b7c09f3782552952b492d910e822 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Mon, 28 May 2018 15:03:24 +0200 Subject: [PATCH 5/7] FIX: missing parenthesis --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9fbac4b7977..c0cd1b49ce9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -407,7 +407,7 @@ if ($resql) if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); 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_state != '') $param .= '&search_state='.urlencode($search_state); if ($search_country != '') $param .= '&search_country='.urlencode($search_country); if ($search_type_thirdparty != '') $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category); From 7eea70ebc8086fa7f5fad0eb342662812b0010b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 May 2018 10:13:34 +0200 Subject: [PATCH 6/7] FIX #8858 #8860 Backport better compatibility fix --- htdocs/core/class/commonobject.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1b888efc8ca..b84d31ddae3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5810,7 +5810,12 @@ abstract class CommonObject // Convert date into timestamp format (value in memory must be a timestamp) if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]); + $datenotinstring = $this->array_options['options_' . $key]; + if (! is_numeric($this->array_options['options_' . $key])) // For backward compatibility + { + $datenotinstring = $this->db->jdate($datenotinstring); + } + $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$datenotinstring; } // Convert float submited string into real php numeric (value in memory must be a php numeric) if (in_array($extrafields->attribute_type[$key],array('price','double'))) From 95e3c5a4b15b4e3c646100f59a896ba0aa76956b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 May 2018 12:13:58 +0200 Subject: [PATCH 7/7] Backport fix of file list check generation --- build/generate_filelist_xml.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index e6336e30e97..5f54c95d7e0 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -17,7 +17,7 @@ */ /** - * \file build/generate_filecheck_xml.php + * \file build/generate_filelist_xml.php * \ingroup dev * \brief This script create a xml checksum file */ @@ -45,7 +45,7 @@ $includeconstants=array(); if (empty($argv[1])) { - print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; + print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; exit -1; } @@ -68,11 +68,20 @@ while ($i < $argc) $i++; } +// If release is auto, we take current version +$tmpver=explode('-', $release, 2); +if ($tmpver[0] == 'auto') +{ + $release=DOL_VERSION; + if ($tmpver[1]) $release.='-'.$tmpver[1]; +} + if (empty($includecustom)) { - if (DOL_VERSION != $release) + $tmpver=explode('-', $release, 2); + if (DOL_VERSION != $tmpver[0]) { - print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n"; + print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n"; print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; exit -1; }