Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/commande/list.php
	htdocs/public/payment/newpayment.php
	htdocs/public/paypal/newpayment.php
This commit is contained in:
Laurent Destailleur 2018-05-29 12:47:42 +02:00
commit 57664c5a26

View File

@ -269,6 +269,7 @@ if ($action == 'dopayment')
$PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT'); $PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT');
$PAYPAL_PAYMENT_TYPE='Sale'; $PAYPAL_PAYMENT_TYPE='Sale';
// Vars that are used as global var later in print_paypal_redirect()
$origfulltag=GETPOST("fulltag",'alpha'); $origfulltag=GETPOST("fulltag",'alpha');
$shipToName=GETPOST("shipToName",'alpha'); $shipToName=GETPOST("shipToName",'alpha');
$shipToStreet=GETPOST("shipToStreet",'alpha'); $shipToStreet=GETPOST("shipToStreet",'alpha');
@ -282,18 +283,24 @@ if ($action == 'dopayment')
$desc=GETPOST("desc",'alpha'); $desc=GETPOST("desc",'alpha');
$thirdparty_id=GETPOST('thirdparty_id', 'int'); $thirdparty_id=GETPOST('thirdparty_id', 'int');
// Special case for Paypal-Indonesia
if ($shipToCountryCode == 'ID' && ! preg_match('/\-/', $shipToState))
{
$shipToState = 'ID-'.$shipToState;
}
$mesg=''; $mesg='';
if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE))
{ {
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount"));
$action=''; $action = '';
} }
//elseif (empty($EMAIL)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); //elseif (empty($EMAIL)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail"));
//elseif (! isValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL); //elseif (! isValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL);
elseif (! $origfulltag) elseif (! $origfulltag)
{ {
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode")); $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode"));
$action=''; $action = '';
} }
//var_dump($_POST); //var_dump($_POST);
@ -1363,6 +1370,7 @@ if ($source == 'membersubscription')
$phoneNum=$member->phone; $phoneNum=$member->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{ {
print '<!-- Shipping address information -->';
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n"; print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
print '<input type="hidden" name="shipToStreet" value="'.$shipToStreet.'">'."\n"; print '<input type="hidden" name="shipToStreet" value="'.$shipToStreet.'">'."\n";
print '<input type="hidden" name="shipToCity" value="'.$shipToCity.'">'."\n"; print '<input type="hidden" name="shipToCity" value="'.$shipToCity.'">'."\n";