Fix: If code bar generator module is removed, page still working.

This commit is contained in:
Laurent Destailleur 2009-03-25 20:25:57 +00:00
parent fe25a4334c
commit 3c7142bbcc

View File

@ -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,7 +159,9 @@ 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");
if ($result)
{
$classname = "mod".ucfirst($obj->coder); $classname = "mod".ucfirst($obj->coder);
$module = new $classname($db); $module = new $classname($db);
@ -178,6 +180,7 @@ if ($resql)
print $langs->trans("FormatNotSupportedByGenerator"); print $langs->trans("FormatNotSupportedByGenerator");
} }
} }
}
else else
{ {
print $langs->trans("ChooseABarCode"); print $langs->trans("ChooseABarCode");