Works on paypal module

This commit is contained in:
Regis Houssin 2011-05-21 08:33:36 +00:00
parent a807c5b391
commit cc1646f3fd
3 changed files with 19 additions and 10 deletions

View File

@ -2469,24 +2469,27 @@ class Commande extends CommonObject
* @param option Where point the link * @param option Where point the link
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto=0,$option=0) function getNomUrl($withpicto=0,$option=0,$short=0)
{ {
global $conf, $langs; global $conf, $langs;
$result=''; $result='';
$urlOption = '/commande/fiche.php'; $file = '/commande/fiche.php';
if ($conf->expedition->enabled && ($option == 1 || $option == 2)) $urlOption = '/expedition/shipment.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.'">'; $linkstart = '<a href="'.$url.'">';
$lienfin='</a>'; $linkend='</a>';
$picto='order'; $picto='order';
$label=$langs->trans("ShowOrder").': '.$this->ref; $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.=' '; if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.$this->ref.$lienfin; $result.=$linkstart.$this->ref.$linkend;
return $result; return $result;
} }

View File

@ -170,7 +170,7 @@ if (isset($_GET['action']) && ! empty($_GET['action']) && isset($_GET['transacti
{ {
$product = new Product($db); $product = new Product($db);
$ret = $product->fetch('',$_SESSION[$_GET['transaction_id']]["L_NUMBER".$i]); $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) if ($ret > 0)
{ {
$product_type=($product->product_type?$product->product_type: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 // Insert default contacts
/*
if ($contact->id > 0) if ($contact->id > 0)
{ {
$result=$object->add_contact($contact->id,'CUSTOMER','external'); $result=$object->add_contact($contact->id,'CUSTOMER','external');
if ($result < 0) $error++; if ($result < 0) $error++;
} }
*/
} }
else else
{ {
@ -227,7 +229,7 @@ if (isset($_GET['action']) && ! empty($_GET['action']) && isset($_GET['transacti
} }
// Return element id // Return element id
echo $object_id; echo $object->getNomUrl(0,0,1);
/* /*
foreach ($_SESSION[$_GET['transaction_id']] as $key => $value) foreach ($_SESSION[$_GET['transaction_id']] as $key => $value)

View File

@ -131,8 +131,12 @@ llxHeader();
element: 'order', element: 'order',
transaction_id: id_value transaction_id: id_value
}, },
function(elementid) { function(elementurl) {
if ($.jnotify) {
$.jnotify("<?php echo $langs->trans('PleaseBePatient'); ?>", 500);
}
$( "div #paypal-details" ).dialog( "close" ); $( "div #paypal-details" ).dialog( "close" );
location.href=elementurl;
}); });
}, },
'<?php echo $langs->transnoentities('Cancel'); ?>': function() { '<?php echo $langs->transnoentities('Cancel'); ?>': function() {