Fix: uniformize code

This commit is contained in:
Regis Houssin 2011-06-19 19:47:09 +00:00
parent 412a01e146
commit 5cbd809f73
4 changed files with 15 additions and 7 deletions

View File

@ -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.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" id="removedfile" name="removedfile" />';
if (! $this->withfilereadonly) $out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" id="removedfile" name="removedfile" />';
$out.= '<br>';
}
}

View File

@ -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)

View File

@ -1097,7 +1097,6 @@ else
print '</tr>';
// Tracking Number
$object->GetUrlTrackingStatus($object->tracking_number);
print '<tr><td>'.$html->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,'id',$object->id,$user->rights->expedition->creer).'</td><td colspan="3">';
print $html->editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,'id',$object->id,$user->rights->expedition->creer,'string',$object->tracking_number);
print '</td></tr>';

View File

@ -59,6 +59,7 @@ LinkToTrackYourPackage=Lien pour suivi de votre colis
SendingMethodCATCH=Enlèvement par le client
SendingMethodTRANS=Transporteur
SendingMethodCOLSUI=Colissimo Suivi
SendingMethodLETTREMAX=Lettre Max
# ModelDocument
DocumentModelSirocco=Modèle de bon de réception/livraison simple