Fix: If code bar generator module is removed, page still working.
This commit is contained in:
parent
fe25a4334c
commit
3c7142bbcc
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -159,23 +159,26 @@ if ($resql)
|
|||||||
if ($obj->coder && $obj->coder != -1)
|
if ($obj->coder && $obj->coder != -1)
|
||||||
{
|
{
|
||||||
// Chargement de la classe de codage
|
// Chargement de la classe de codage
|
||||||
require_once($dir.$obj->coder.".modules.php");
|
$result=include_once($dir.$obj->coder.".modules.php");
|
||||||
$classname = "mod".ucfirst($obj->coder);
|
if ($result)
|
||||||
$module = new $classname($db);
|
|
||||||
|
|
||||||
if ($module->encodingIsSupported($obj->encoding))
|
|
||||||
{
|
{
|
||||||
// Build barcode on disk
|
$classname = "mod".ucfirst($obj->coder);
|
||||||
$result=$module->writeBarCode($obj->example,$obj->encoding,'Y');
|
$module = new $classname($db);
|
||||||
|
|
||||||
// Output files with barcode generators
|
if ($module->encodingIsSupported($obj->encoding))
|
||||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding);
|
{
|
||||||
//print $url;
|
// Build barcode on disk
|
||||||
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
|
$result=$module->writeBarCode($obj->example,$obj->encoding,'Y');
|
||||||
}
|
|
||||||
else
|
// Output files with barcode generators
|
||||||
{
|
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding);
|
||||||
print $langs->trans("FormatNotSupportedByGenerator");
|
//print $url;
|
||||||
|
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("FormatNotSupportedByGenerator");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user