mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-23 09:51:33 +01:00
New: possibility to use includes/modules in external modules dir
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
* \file htdocs/admin/perms.php
|
* \file htdocs/admin/perms.php
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief Page d'administration/configuration des permissions par defaut
|
* \brief Page d'administration/configuration des permissions par defaut
|
||||||
* \version $Id: perms.php,v 1.42 2011/07/31 22:23:26 eldy Exp $
|
* \version $Id: perms.php,v 1.43 2011/08/01 12:53:37 hregis Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@@ -76,10 +76,34 @@ $db->begin();
|
|||||||
|
|
||||||
// Charge les modules soumis a permissions
|
// Charge les modules soumis a permissions
|
||||||
$modules = array();
|
$modules = array();
|
||||||
foreach ($conf->file->dol_document_root as $dirroot)
|
$modulesdir = array();
|
||||||
{
|
|
||||||
$dir = $dirroot . "/includes/modules/";
|
|
||||||
|
|
||||||
|
foreach ($conf->file->dol_document_root as $type => $dirroot)
|
||||||
|
{
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($modulesdir as $dir)
|
||||||
|
{
|
||||||
// Load modules attributes in arrays (name, numero, orders) from dir directory
|
// Load modules attributes in arrays (name, numero, orders) from dir directory
|
||||||
//print $dir."\n<br>";
|
//print $dir."\n<br>";
|
||||||
$handle=@opendir($dir);
|
$handle=@opendir($dir);
|
||||||
@@ -194,5 +218,5 @@ print '</div>';
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date: 2011/07/31 22:23:26 $ - $Revision: 1.42 $');
|
llxFooter('$Date: 2011/08/01 12:53:37 $ - $Revision: 1.43 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ PHPServerOffsetWithGreenwich=Offset amb Greenwich (segons)
|
|||||||
ClientOffsetWithGreenwich=Offset client/navegador amb Greenwich (segons)
|
ClientOffsetWithGreenwich=Offset client/navegador amb Greenwich (segons)
|
||||||
DaylingSavingTime=Horari d'estiu (usuari)
|
DaylingSavingTime=Horari d'estiu (usuari)
|
||||||
CurrentHour=Hora PHP (servidor)
|
CurrentHour=Hora PHP (servidor)
|
||||||
CompanyTZ=Zona Horària empresa (casa mare)
|
CompanyTZ=Zona Horària empresa (seu central)
|
||||||
CompanyHour=Hora empresa (casa mare)
|
CompanyHour=Hora empresa (seu central)
|
||||||
CurrentSessionTimeOut=Time out sessió actual
|
CurrentSessionTimeOut=Time out sessió actual
|
||||||
OSEnv=Entorn SO
|
OSEnv=Entorn SO
|
||||||
Box=Panell
|
Box=Panell
|
||||||
@@ -1246,9 +1246,9 @@ ClickToDialDesc=Aquest mòdul permet afegir una icona després del número de te
|
|||||||
CashDesk=TPV
|
CashDesk=TPV
|
||||||
CashDeskSetup=Mòdul de configuració Terminal Punt de Venda
|
CashDeskSetup=Mòdul de configuració Terminal Punt de Venda
|
||||||
CashDeskThirdPartyForSell=Tercer genéric a utilitzar per a les vendes
|
CashDeskThirdPartyForSell=Tercer genéric a utilitzar per a les vendes
|
||||||
CashDeskBankAccountForSell=Compte a utilitzar per als cobraments en efectiu (caixa)
|
CashDeskBankAccountForSell=Compte per defecte a utilitzar per als cobraments en efectiu (caixa)
|
||||||
CashDeskBankAccountForCheque=Compte a utilitzar per als cobraments amb xecs
|
CashDeskBankAccountForCheque=Compte per defecte a utilitzar per als cobraments amb xecs
|
||||||
CashDeskBankAccountForCB=Compte a utilitzar per als cobraments amb targeta de crèdit
|
CashDeskBankAccountForCB=Compte per defecte a utilitzar per als cobraments amb targeta de crèdit
|
||||||
CashDeskIdWareHouse=Magatzem a ultilitzar per a les vendes
|
CashDeskIdWareHouse=Magatzem a ultilitzar per a les vendes
|
||||||
##### Bookmark #####
|
##### Bookmark #####
|
||||||
BookmarkSetup=Configuració del mòdul Bookmark
|
BookmarkSetup=Configuració del mòdul Bookmark
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ PHPServerOffsetWithGreenwich=Offset servidor con Greenwich (segundos)
|
|||||||
ClientOffsetWithGreenwich=Offset cliente/navegador con Greenwich (segundos)
|
ClientOffsetWithGreenwich=Offset cliente/navegador con Greenwich (segundos)
|
||||||
DaylingSavingTime=Horario de verano (usuario)
|
DaylingSavingTime=Horario de verano (usuario)
|
||||||
CurrentHour=Hora PHP (servidor)
|
CurrentHour=Hora PHP (servidor)
|
||||||
CompanyTZ=Zona Horaria empresa (casa madre)
|
CompanyTZ=Zona Horaria empresa (sede central)
|
||||||
CompanyHour=Hora empresa (casa madre)
|
CompanyHour=Hora empresa (sede central)
|
||||||
CurrentSessionTimeOut=Time out sesión actual
|
CurrentSessionTimeOut=Time out sesión actual
|
||||||
OSEnv=Entorno SO
|
OSEnv=Entorno SO
|
||||||
Box=Panel
|
Box=Panel
|
||||||
@@ -1246,9 +1246,9 @@ ClickToDialDesc=Este módulo permite agregar un icono después del número de te
|
|||||||
CashDesk=TPV
|
CashDesk=TPV
|
||||||
CashDeskSetup=Configuración del módulo Terminal Punto de Venta
|
CashDeskSetup=Configuración del módulo Terminal Punto de Venta
|
||||||
CashDeskThirdPartyForSell=Tercero genérico a usar para la venta
|
CashDeskThirdPartyForSell=Tercero genérico a usar para la venta
|
||||||
CashDeskBankAccountForSell=Cuenta a utilizar para los cobros en efectivo (caja)
|
CashDeskBankAccountForSell=Cuenta por defecto a utilizar para los cobros en efectivo (caja)
|
||||||
CashDeskBankAccountForCheque=Cuenta a utilizar para los cobros con cheques
|
CashDeskBankAccountForCheque=Cuenta por defecto a utilizar para los cobros con cheques
|
||||||
CashDeskBankAccountForCB=Cuenta a utilizar para los cobros con tarjeta de crédito
|
CashDeskBankAccountForCB=Cuenta por defecto a utilizar para los cobros con tarjeta de crédito
|
||||||
CashDeskIdWareHouse=Almacén a utilizar para las ventas
|
CashDeskIdWareHouse=Almacén a utilizar para las ventas
|
||||||
##### Bookmark #####
|
##### Bookmark #####
|
||||||
BookmarkSetup=Configuración del módulo Marcadores
|
BookmarkSetup=Configuración del módulo Marcadores
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/lib/admin.lib.php
|
* \file htdocs/lib/admin.lib.php
|
||||||
* \brief Library of admin functions
|
* \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
|
* \brief Define head array for tabs of security setup pages
|
||||||
* \return Array of head
|
* \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()
|
function security_prepare_head()
|
||||||
{
|
{
|
||||||
@@ -615,16 +615,41 @@ function Activate($value,$withdeps=1)
|
|||||||
// Activate module
|
// Activate module
|
||||||
if ($modName)
|
if ($modName)
|
||||||
{
|
{
|
||||||
$file = $modName . ".class.php";
|
$modFile = $modName . ".class.php";
|
||||||
|
|
||||||
// Loop on each directory
|
// Loop on each directory
|
||||||
$found=false;
|
$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/";
|
||||||
|
|
||||||
$found=@include_once($dir.$file);
|
if ($type == 'alt')
|
||||||
if ($found) break;
|
{
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($modulesdir as $dir)
|
||||||
|
{
|
||||||
|
if (file_exists($dir.$modFile))
|
||||||
|
{
|
||||||
|
$found=@include_once($dir.$modFile);
|
||||||
|
if ($found) break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$objMod = new $modName($db);
|
$objMod = new $modName($db);
|
||||||
@@ -700,20 +725,46 @@ function UnActivate($value,$requiredby=1)
|
|||||||
$modName = $value;
|
$modName = $value;
|
||||||
|
|
||||||
$ret='';
|
$ret='';
|
||||||
|
$modulesdir=array();
|
||||||
|
|
||||||
// Desactivation du module
|
// Desactivation du module
|
||||||
if ($modName)
|
if ($modName)
|
||||||
{
|
{
|
||||||
$file = $modName . ".class.php";
|
$modFile = $modName . ".class.php";
|
||||||
|
|
||||||
// Loop on each directory
|
// Loop on each directory
|
||||||
$found=false;
|
$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/";
|
||||||
|
|
||||||
$found=@include_once($dir.$file);
|
if ($type == 'alt')
|
||||||
if ($found) break;
|
{
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($modulesdir as $dir)
|
||||||
|
{
|
||||||
|
if (file_exists($dir.$modFile))
|
||||||
|
{
|
||||||
|
$found=@include_once($dir.$modFile);
|
||||||
|
if ($found) break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($found)
|
if ($found)
|
||||||
|
|||||||
@@ -16,14 +16,13 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/theme/bureau2crea/style.css.php
|
* \file htdocs/theme/bureau2crea/style.css.php
|
||||||
* \brief Fichier de style CSS du theme bureau2crea
|
* \brief Fichier de style CSS du theme bureau2crea
|
||||||
* \version $Id: style.css.php,v 1.40 2011/07/21 09:05:33 simnandez Exp $
|
* \version $Id: style.css.php,v 1.41 2011/07/31 23:19:57 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||||
|
|||||||
Reference in New Issue
Block a user