Qual: Mutualize link to paypal

This commit is contained in:
Laurent Destailleur 2011-11-30 19:42:08 +01:00
parent 2803c1cbfd
commit 70ab87c210
3 changed files with 33 additions and 10 deletions

View File

@ -713,9 +713,16 @@ if ($rowid)
{ {
dol_print_error($db); dol_print_error($db);
} }
// Link for paypal payment
if ($conf->paypal->enabled)
{
include_once(DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php');
print showPaypalPaymentUrl('membersubscription',$adh->ref);
} }
}
/* /*
* Add new subscription form * Add new subscription form

View File

@ -2938,15 +2938,8 @@ else
// Link for paypal payment // Link for paypal payment
if ($conf->paypal->enabled) if ($conf->paypal->enabled)
{ {
$langs->load("paypal");
$langs->load("paybox");
$servicename='PayPal';
include_once(DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php');
print showPaypalPaymentUrl('invoice',$object->ref);
print '<br>';
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>';
$url=getPaypalPaymentUrl(0,'invoice',$object->ref);
print '<input type="text" id="paypalurl" value="'.$url.'" size="60"><br>';
} }
print '</td><td valign="top" width="50%">'; print '</td><td valign="top" width="50%">';

View File

@ -165,6 +165,29 @@ function paypaladmin_prepare_head()
} }
/**
* Return string with full Url
*
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
* @param string $ref Ref of object
* @return string Url string
*/
function showPaypalPaymentUrl($type,$ref)
{
global $conf, $langs;
$langs->load("paypal");
$langs->load("paybox");
$servicename='PayPal';
$out='<br><br>';
$out.=img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>';
$url=getPaypalPaymentUrl(0,$type,$ref);
$out.='<input type="text" id="paypalurl" value="'.$url.'" size="60"><br>';
return $out;
}
/** /**
* Return string with full Url * Return string with full Url
* *