Works on paypal module
This commit is contained in:
parent
a807c5b391
commit
cc1646f3fd
@ -2469,24 +2469,27 @@ class Commande extends CommonObject
|
||||
* @param option Where point the link
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option=0)
|
||||
function getNomUrl($withpicto=0,$option=0,$short=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$result='';
|
||||
|
||||
$urlOption = '/commande/fiche.php';
|
||||
if ($conf->expedition->enabled && ($option == 1 || $option == 2)) $urlOption = '/expedition/shipment.php';
|
||||
$file = '/commande/fiche.php';
|
||||
if ($conf->expedition->enabled && ($option == 1 || $option == 2)) $file = '/expedition/shipment.php';
|
||||
|
||||
$url = DOL_URL_ROOT.$file.'?id='.$this->id;
|
||||
if ($short) return $url;
|
||||
|
||||
$lien = '<a href="'.DOL_URL_ROOT.$urlOption.'?id='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
$linkstart = '<a href="'.$url.'">';
|
||||
$linkend='</a>';
|
||||
|
||||
$picto='order';
|
||||
$label=$langs->trans("ShowOrder").': '.$this->ref;
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
|
||||
if ($withpicto) $result.=($linkstart.img_object($label,$picto).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
$result.=$lien.$this->ref.$lienfin;
|
||||
$result.=$linkstart.$this->ref.$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ if (isset($_GET['action']) && ! empty($_GET['action']) && isset($_GET['transacti
|
||||
{
|
||||
$product = new Product($db);
|
||||
$ret = $product->fetch('',$_SESSION[$_GET['transaction_id']]["L_NUMBER".$i]);
|
||||
echo 'ref='.$_SESSION[$_GET['transaction_id']]["L_NUMBER".$i].' ret='.$ret."\n";
|
||||
|
||||
if ($ret > 0)
|
||||
{
|
||||
$product_type=($product->product_type?$product->product_type:0);
|
||||
@ -205,11 +205,13 @@ if (isset($_GET['action']) && ! empty($_GET['action']) && isset($_GET['transacti
|
||||
}
|
||||
|
||||
// Insert default contacts
|
||||
/*
|
||||
if ($contact->id > 0)
|
||||
{
|
||||
$result=$object->add_contact($contact->id,'CUSTOMER','external');
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -227,7 +229,7 @@ if (isset($_GET['action']) && ! empty($_GET['action']) && isset($_GET['transacti
|
||||
}
|
||||
|
||||
// Return element id
|
||||
echo $object_id;
|
||||
echo $object->getNomUrl(0,0,1);
|
||||
|
||||
/*
|
||||
foreach ($_SESSION[$_GET['transaction_id']] as $key => $value)
|
||||
|
||||
@ -131,8 +131,12 @@ llxHeader();
|
||||
element: 'order',
|
||||
transaction_id: id_value
|
||||
},
|
||||
function(elementid) {
|
||||
function(elementurl) {
|
||||
if ($.jnotify) {
|
||||
$.jnotify("<?php echo $langs->trans('PleaseBePatient'); ?>", 500);
|
||||
}
|
||||
$( "div #paypal-details" ).dialog( "close" );
|
||||
location.href=elementurl;
|
||||
});
|
||||
},
|
||||
'<?php echo $langs->transnoentities('Cancel'); ?>': function() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user