Fix: call class
Fix: error if origin not defined
This commit is contained in:
parent
3d0d2053bb
commit
bf7e5ab338
@ -417,7 +417,7 @@ class CommonObject
|
||||
// TODO uniformise code
|
||||
if ($object == 'shipping') $object = 'expedition';
|
||||
if ($object == 'delivery') $object = 'livraison';
|
||||
|
||||
|
||||
$class = ucfirst($object);
|
||||
$this->$object = new $class($this->db);
|
||||
$this->$object->fetch($this->origin_id);
|
||||
|
||||
@ -600,9 +600,12 @@ else
|
||||
print '<div class="error">'.$mesg.'</div>';
|
||||
}
|
||||
|
||||
$typeobject = $expedition->origin;
|
||||
$origin = $expedition->origin;
|
||||
$expedition->fetch_object();
|
||||
if (!empty($expedition->origin))
|
||||
{
|
||||
$typeobject = $expedition->origin;
|
||||
$origin = $expedition->origin;
|
||||
$expedition->fetch_object();
|
||||
}
|
||||
|
||||
if (strlen($expedition->tracking_number))
|
||||
{
|
||||
@ -958,7 +961,7 @@ else
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
if ($expedition->$origin->id)
|
||||
if (!empty($origin) && $expedition->$origin->id)
|
||||
{
|
||||
print '<br>';
|
||||
//show_list_sending_receive($expedition->origin,$expedition->origin_id," AND e.rowid <> ".$expedition->id);
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/livraison/livraison.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/livraison/modules_livraison.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user