2
0
forked from Wavyzz/dolibarr

Fix: Avoid errors into rpm packages

This commit is contained in:
Laurent Destailleur
2011-08-03 01:03:45 +00:00
parent c8b0b59976
commit a56eb12528
234 changed files with 1459 additions and 1286 deletions

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
/**
* \file htdocs/lib/admin.lib.php
* \brief Library of admin functions
* \version $Id: admin.lib.php,v 1.98 2011/07/31 23:25:40 eldy Exp $
* \version $Id: admin.lib.php,v 1.99 2011/08/01 12:53:37 hregis Exp $
*/
@@ -467,7 +467,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
/**
* \brief Define head array for tabs of security setup pages
* \return Array of head
* \version $Id: admin.lib.php,v 1.98 2011/07/31 23:25:40 eldy Exp $
* \version $Id: admin.lib.php,v 1.99 2011/08/01 12:53:37 hregis Exp $
*/
function security_prepare_head()
{
@@ -615,16 +615,41 @@ function Activate($value,$withdeps=1)
// Activate module
if ($modName)
{
$file = $modName . ".class.php";
$modFile = $modName . ".class.php";
// Loop on each directory
$found=false;
foreach ($conf->file->dol_document_root as $dol_document_root)
foreach ($conf->file->dol_document_root as $type => $dirroot)
{
$dir = $dol_document_root."/includes/modules/";
$modulesdir[] = $dirroot."/includes/modules/";
if ($type == 'alt')
{
$handle=@opendir($dirroot);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
{
if (is_dir($dirroot . '/' . $file . '/includes/modules/'))
{
$modulesdir[] = $dirroot . '/' . $file . '/includes/modules/';
}
}
}
closedir($handle);
}
}
}
$found=@include_once($dir.$file);
if ($found) break;
foreach ($modulesdir as $dir)
{
if (file_exists($dir.$modFile))
{
$found=@include_once($dir.$modFile);
if ($found) break;
}
}
$objMod = new $modName($db);
@@ -700,20 +725,46 @@ function UnActivate($value,$requiredby=1)
$modName = $value;
$ret='';
$modulesdir=array();
// Desactivation du module
if ($modName)
{
$file = $modName . ".class.php";
$modFile = $modName . ".class.php";
// Loop on each directory
$found=false;
foreach ($conf->file->dol_document_root as $dol_document_root)
foreach ($conf->file->dol_document_root as $type => $dirroot)
{
$dir = $dol_document_root."/includes/modules/";
$modulesdir[] = $dirroot."/includes/modules/";
if ($type == 'alt')
{
$handle=@opendir($dirroot);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
{
if (is_dir($dirroot . '/' . $file . '/includes/modules/'))
{
$modulesdir[] = $dirroot . '/' . $file . '/includes/modules/';
}
}
}
closedir($handle);
}
}
}
$found=@include_once($dir.$file);
if ($found) break;
foreach ($modulesdir as $dir)
{
if (file_exists($dir.$modFile))
{
$found=@include_once($dir.$modFile);
if ($found) break;
}
}
if ($found)

View File

@@ -14,15 +14,14 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/lib/agenda.lib.php
* \brief Set of function for the agenda module
* \version $Id: agenda.lib.php,v 1.42 2011/07/22 06:51:30 simnandez Exp $
* \version $Id: agenda.lib.php,v 1.43 2011/07/31 23:25:33 eldy Exp $
*/

View File

@@ -13,15 +13,14 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/lib/ajax.lib.php
* \brief Page called by Ajax request for produts
* \version $Id: ajax.lib.php,v 1.59 2011/07/28 18:57:23 eldy Exp $
* \version $Id: ajax.lib.php,v 1.60 2011/07/31 23:25:18 eldy Exp $
*/

View File

@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
@@ -25,7 +24,7 @@
* \file htdocs/lib/pdf.lib.php
* \brief Set of functions used for PDF generation
* \ingroup core
* \version $Id: pdf.lib.php,v 1.98 2011/07/27 17:28:42 eldy Exp $
* \version $Id: pdf.lib.php,v 1.99 2011/07/31 23:25:42 eldy Exp $
*/