diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 8e24402e51e..1b310d4147c 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -59,6 +59,7 @@ class FormMail
var $withtoreadonly;
var $withtoccreadonly;
var $withtopicreadonly;
+ var $withfilereadonly;
var $withdeliveryreceipt;
var $withcancel;
@@ -94,6 +95,7 @@ class FormMail
$this->withtoccreadonly=0;
$this->witherrorstoreadonly=0;
$this->withtopicreadonly=0;
+ $this->withfilereadonly=0;
$this->withbodyreadonly=0;
$this->withdeliveryreceiptreadonly=0;
@@ -492,7 +494,7 @@ class FormMail
foreach($listofpaths as $key => $val)
{
$out.= img_mime($listofnames[$key]).' '.$listofnames[$key];
- $out.= ' ';
+ if (! $this->withfilereadonly) $out.= ' ';
$out.= '
';
}
}
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index bc47a8dd2fc..204679d3eae 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -56,6 +56,8 @@ class Expedition extends CommonObject
var $lines=array();
var $expedition_method_id; // TODO deprecated
var $shipping_method_id;
+ var $tracking_number;
+ var $tracking_url;
var $statut;
var $trueWeight;
@@ -350,7 +352,8 @@ class Expedition extends CommonObject
$this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed
$this->fk_delivery_address = $obj->fk_address;
$this->modelpdf = $obj->model_pdf;
- $this->expedition_method_id = $obj->fk_expedition_methode;
+ $this->expedition_method_id = $obj->fk_expedition_methode; // TODO deprecated
+ $this->shipping_method_id = $obj->fk_expedition_methode;
$this->tracking_number = $obj->tracking_number;
$this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility
$this->origin_id = $obj->origin_id;
@@ -375,6 +378,9 @@ class Expedition extends CommonObject
$file = $conf->expedition->dir_output . "/" .get_exdir($expedition->id,2) . "/" . $this->id.".pdf";
$this->pdf_filename = $file;
+
+ // Tracking url
+ $this->GetUrlTrackingStatus($obj->tracking_number);
/*
* Lines
@@ -1099,13 +1105,13 @@ class Expedition extends CommonObject
function GetUrlTrackingStatus($value='')
{
$code='';
-
+
if (! empty($this->expedition_method_id))
{
$sql = "SELECT em.code";
$sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as em";
$sql.= " WHERE em.rowid = ".$this->expedition_method_id;
-
+
$resql = $this->db->query($sql);
if ($resql)
{
@@ -1124,8 +1130,8 @@ class Expedition extends CommonObject
if (file_exists(DOL_DOCUMENT_ROOT."/includes/modules/expedition/methode_expedition_".strtolower($code).".modules.php") && ! empty($this->tracking_number))
{
require_once(DOL_DOCUMENT_ROOT."/includes/modules/expedition/methode_expedition_".strtolower($code).".modules.php");
- $obj = new $classname();
- $url = $obj->provider_url_status($this->tracking_number);
+ $shipmethod = new $classname();
+ $url = $shipmethod->provider_url_status($this->tracking_number);
}
if ($url)
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index a4a7bd01900..e219919ae1d 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -1097,7 +1097,6 @@ else
print '';
// Tracking Number
- $object->GetUrlTrackingStatus($object->tracking_number);
print '