Fix: debug expedition method
This commit is contained in:
parent
95233fa068
commit
b5caeb84d6
@ -773,6 +773,28 @@ class Expedition extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Get id of default expedition method
|
||||
*/
|
||||
function GetIdOfDefault()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT em.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expedition_methode as em";
|
||||
$sql.= " WHERE em.code = '".strtoupper($conf->global->EXPEDITION_ADDON)."'";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
$this->default_method_id = $obj->rowid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Get tracking url status
|
||||
*/
|
||||
@ -786,9 +808,9 @@ class Expedition extends CommonObject
|
||||
if ($resql)
|
||||
{
|
||||
if ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
$code = $obj->code;
|
||||
}
|
||||
{
|
||||
$code = $obj->code;
|
||||
}
|
||||
}
|
||||
|
||||
if ($code) {
|
||||
@ -796,8 +818,17 @@ class Expedition extends CommonObject
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/expedition/methode_expedition_".strtolower($code).".modules.php");
|
||||
$obj = new $classe;
|
||||
$url = $obj->provider_url_status($this->tracking_number);
|
||||
$this->tracking_url = sprintf('<a target="_blank" href="%s">url</a>',$url,$url);
|
||||
} else {
|
||||
if ($url)
|
||||
{
|
||||
$this->tracking_url = sprintf('<a target="_blank" href="%s">url</a>',$url,$url);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->tracking_url = '';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->tracking_url = '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,7 +318,8 @@ if ($_GET["action"] == 'create')
|
||||
print "<tr><td>".$langs->trans("DeliveryMethod")."</td>";
|
||||
print '<td colspan="3">';
|
||||
$expe->fetch_delivery_methods();
|
||||
$html->select_array("expedition_method_id",$expe->meths,'',0,0,0,0,"",1);
|
||||
$expe->GetIdOfDefault();
|
||||
$html->select_array("expedition_method_id",$expe->meths,$expe->default_method_id,0,0,0,0,"",1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Tracking number
|
||||
@ -690,7 +691,11 @@ else
|
||||
|
||||
// Tracking Number
|
||||
print '<tr><td>'.$langs->trans("TrackingNumber").'</td>';
|
||||
print '<td>'.$expedition->tracking_number.'</td><td colspan="2">'.$expedition->tracking_url."</td>\n";
|
||||
print '<td>'.$expedition->tracking_number.'</td>';
|
||||
if ($expedition->tracking_url)
|
||||
{
|
||||
print '<td colspan="2">'.$expedition->tracking_url."</td>\n";
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
@ -34,6 +34,11 @@ Class methode_expedition_enl extends methode_expedition
|
||||
$this->code = "ENL";
|
||||
$this->description = $langs->trans("Enlevement");
|
||||
}
|
||||
|
||||
Function provider_url_status($tracking_number)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -35,6 +35,11 @@ Class methode_expedition_trans extends methode_expedition
|
||||
$this->name = "Transporteur";
|
||||
$this->description = $langs->trans("GenericTransport");
|
||||
}
|
||||
|
||||
Function provider_url_status($tracking_number)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user