mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-23 01:41:31 +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
|
||||
* \ingroup core
|
||||
* \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");
|
||||
@@ -76,10 +76,34 @@ $db->begin();
|
||||
|
||||
// Charge les modules soumis a permissions
|
||||
$modules = array();
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
{
|
||||
$dir = $dirroot . "/includes/modules/";
|
||||
$modulesdir = array();
|
||||
|
||||
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
|
||||
//print $dir."\n<br>";
|
||||
$handle=@opendir($dir);
|
||||
@@ -194,5 +218,5 @@ print '</div>';
|
||||
|
||||
$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)
|
||||
DaylingSavingTime=Horari d'estiu (usuari)
|
||||
CurrentHour=Hora PHP (servidor)
|
||||
CompanyTZ=Zona Horària empresa (casa mare)
|
||||
CompanyHour=Hora empresa (casa mare)
|
||||
CompanyTZ=Zona Horària empresa (seu central)
|
||||
CompanyHour=Hora empresa (seu central)
|
||||
CurrentSessionTimeOut=Time out sessió actual
|
||||
OSEnv=Entorn SO
|
||||
Box=Panell
|
||||
@@ -1246,9 +1246,9 @@ ClickToDialDesc=Aquest mòdul permet afegir una icona després del número de te
|
||||
CashDesk=TPV
|
||||
CashDeskSetup=Mòdul de configuració Terminal Punt de Venda
|
||||
CashDeskThirdPartyForSell=Tercer genéric a utilitzar per a les vendes
|
||||
CashDeskBankAccountForSell=Compte a utilitzar per als cobraments en efectiu (caixa)
|
||||
CashDeskBankAccountForCheque=Compte a utilitzar per als cobraments amb xecs
|
||||
CashDeskBankAccountForCB=Compte a utilitzar per als cobraments amb targeta de crèdit
|
||||
CashDeskBankAccountForSell=Compte per defecte a utilitzar per als cobraments en efectiu (caixa)
|
||||
CashDeskBankAccountForCheque=Compte per defecte a utilitzar per als cobraments amb xecs
|
||||
CashDeskBankAccountForCB=Compte per defecte a utilitzar per als cobraments amb targeta de crèdit
|
||||
CashDeskIdWareHouse=Magatzem a ultilitzar per a les vendes
|
||||
##### Bookmark #####
|
||||
BookmarkSetup=Configuració del mòdul Bookmark
|
||||
|
||||
@@ -109,8 +109,8 @@ PHPServerOffsetWithGreenwich=Offset servidor con Greenwich (segundos)
|
||||
ClientOffsetWithGreenwich=Offset cliente/navegador con Greenwich (segundos)
|
||||
DaylingSavingTime=Horario de verano (usuario)
|
||||
CurrentHour=Hora PHP (servidor)
|
||||
CompanyTZ=Zona Horaria empresa (casa madre)
|
||||
CompanyHour=Hora empresa (casa madre)
|
||||
CompanyTZ=Zona Horaria empresa (sede central)
|
||||
CompanyHour=Hora empresa (sede central)
|
||||
CurrentSessionTimeOut=Time out sesión actual
|
||||
OSEnv=Entorno SO
|
||||
Box=Panel
|
||||
@@ -1246,9 +1246,9 @@ ClickToDialDesc=Este módulo permite agregar un icono después del número de te
|
||||
CashDesk=TPV
|
||||
CashDeskSetup=Configuración del módulo Terminal Punto de Venta
|
||||
CashDeskThirdPartyForSell=Tercero genérico a usar para la venta
|
||||
CashDeskBankAccountForSell=Cuenta a utilizar para los cobros en efectivo (caja)
|
||||
CashDeskBankAccountForCheque=Cuenta a utilizar para los cobros con cheques
|
||||
CashDeskBankAccountForCB=Cuenta a utilizar para los cobros con tarjeta de crédito
|
||||
CashDeskBankAccountForSell=Cuenta por defecto a utilizar para los cobros en efectivo (caja)
|
||||
CashDeskBankAccountForCheque=Cuenta por defecto a utilizar para los cobros con cheques
|
||||
CashDeskBankAccountForCB=Cuenta por defecto a utilizar para los cobros con tarjeta de crédito
|
||||
CashDeskIdWareHouse=Almacén a utilizar para las ventas
|
||||
##### Bookmark #####
|
||||
BookmarkSetup=Configuración del módulo Marcadores
|
||||
|
||||
@@ -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,17 +615,42 @@ 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/";
|
||||
|
||||
$found=@include_once($dir.$file);
|
||||
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)
|
||||
{
|
||||
if (file_exists($dir.$modFile))
|
||||
{
|
||||
$found=@include_once($dir.$modFile);
|
||||
if ($found) break;
|
||||
}
|
||||
}
|
||||
|
||||
$objMod = new $modName($db);
|
||||
|
||||
@@ -700,21 +725,47 @@ 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/";
|
||||
|
||||
$found=@include_once($dir.$file);
|
||||
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)
|
||||
{
|
||||
if (file_exists($dir.$modFile))
|
||||
{
|
||||
$found=@include_once($dir.$modFile);
|
||||
if ($found) break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($found)
|
||||
{
|
||||
|
||||
@@ -16,14 +16,13 @@
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/theme/bureau2crea/style.css.php
|
||||
* \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
|
||||
|
||||
Reference in New Issue
Block a user