FIX Avoid errors on debian

This commit is contained in:
Laurent Destailleur 2016-10-22 16:51:54 +02:00
parent 1c59721294
commit ffcfe30529
3 changed files with 54 additions and 46 deletions

View File

@ -64,24 +64,27 @@ class ExportExcel extends ModeleExports
$this->picto='mime/xls'; // Picto
$this->version='1.30'; // Driver version
// If driver use an external library, put its name here
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->label_lib='PhpWriteExcel';
$this->version_lib='unknown';
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
$this->label_lib='PhpExcel';
$this->version_lib='1.8.0'; // No way to get info from library
}
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
if (empty($this->disabled))
{
// If driver use an external library, put its name here
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->label_lib='PhpWriteExcel';
$this->version_lib='unknown';
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
$this->label_lib='PhpExcel';
$this->version_lib='1.8.0'; // No way to get info from library
}
}
$this->row=0;
}

View File

@ -64,25 +64,28 @@ class ExportExcel2007 extends ExportExcel
$this->picto='mime/xls'; // Picto
$this->version='1.30'; // Driver version
// If driver use an external library, put its name here
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
if (empty($this->disabled))
{
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->label_lib='PhpWriteExcel';
$this->version_lib='unknown';
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
$this->label_lib='PhpExcel';
$this->version_lib='1.8.0'; // No way to get info from library
// If driver use an external library, put its name here
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->label_lib='PhpWriteExcel';
$this->version_lib='unknown';
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
$this->label_lib='PhpExcel';
$this->version_lib='1.8.0'; // No way to get info from library
}
}
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
$this->row=0;
}

View File

@ -65,22 +65,24 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
$moduleid=$reg[1];
// Loading Class
$file = $dir."/export_".$moduleid.".modules.php";
$file = $dir."export_".$moduleid.".modules.php";
$classname = "Export".ucfirst($moduleid);
require_once $file;
$module = new $classname($db);
// Picto
$this->picto[$module->id]=$module->picto;
// Driver properties
$this->driverlabel[$module->id]=$module->getDriverLabel().(empty($module->disabled)?'':' __(Disabled)__'); // '__(Disabled)__' is a key
$this->driverdesc[$module->id]=$module->getDriverDesc();
$this->driverversion[$module->id]=$module->getDriverVersion();
// If use an external lib
$this->liblabel[$module->id]=$module->getLibLabel();
$this->libversion[$module->id]=$module->getLibVersion();
if (class_exists($classname))
{
$module = new $classname($db);
// Picto
$this->picto[$module->id]=$module->picto;
// Driver properties
$this->driverlabel[$module->id]=$module->getDriverLabel().(empty($module->disabled)?'':' __(Disabled)__'); // '__(Disabled)__' is a key
$this->driverdesc[$module->id]=$module->getDriverDesc();
$this->driverversion[$module->id]=$module->getDriverVersion();
// If use an external lib
$this->liblabel[$module->id]=$module->getLibLabel();
$this->libversion[$module->id]=$module->getLibVersion();
}
$i++;
}
}