diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 73ac189adee..77e1144d354 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -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 = '';
- $lienfin='';
+ $linkstart = '';
+ $linkend='';
$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;
}
diff --git a/htdocs/paypal/ajaxtransaction.php b/htdocs/paypal/ajaxtransaction.php
index a8cb138172b..4fff6d27568 100644
--- a/htdocs/paypal/ajaxtransaction.php
+++ b/htdocs/paypal/ajaxtransaction.php
@@ -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)
diff --git a/htdocs/paypal/transaction.php b/htdocs/paypal/transaction.php
index 9fe5612afd7..d1e37cfbf69 100644
--- a/htdocs/paypal/transaction.php
+++ b/htdocs/paypal/transaction.php
@@ -131,8 +131,12 @@ llxHeader();
element: 'order',
transaction_id: id_value
},
- function(elementid) {
+ function(elementurl) {
+ if ($.jnotify) {
+ $.jnotify("trans('PleaseBePatient'); ?>", 500);
+ }
$( "div #paypal-details" ).dialog( "close" );
+ location.href=elementurl;
});
},
'transnoentities('Cancel'); ?>': function() {