2004-10-19 20:58:50 +02:00
|
|
|
<?php
|
2007-04-10 13:47:27 +02:00
|
|
|
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2005-01-09 01:26:43 +01:00
|
|
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
2010-09-04 18:16:15 +02:00
|
|
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
2008-01-30 01:15:59 +01:00
|
|
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
2011-08-01 14:25:14 +02:00
|
|
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
2011-08-04 23:07:33 +02:00
|
|
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
2003-03-11 17:18:54 +01:00
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-08-01 00:21:57 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-03-11 17:18:54 +01:00
|
|
|
*/
|
2009-01-21 14:20:26 +01:00
|
|
|
|
2005-04-07 00:36:44 +02:00
|
|
|
/**
|
2008-09-11 00:07:38 +02:00
|
|
|
* \file htdocs/admin/modules.php
|
2010-11-13 19:57:10 +01:00
|
|
|
* \brief Page to activate/disable all modules
|
2008-09-11 00:07:38 +02:00
|
|
|
*/
|
2004-08-29 14:01:58 +02:00
|
|
|
|
2010-03-01 10:20:41 +01:00
|
|
|
require("../main.inc.php");
|
2011-10-24 11:25:54 +02:00
|
|
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
|
2003-03-11 17:18:54 +01:00
|
|
|
|
2009-08-24 14:05:41 +02:00
|
|
|
$langs->load("errors");
|
2010-04-28 16:36:45 +02:00
|
|
|
$langs->load("admin");
|
2009-08-24 14:05:41 +02:00
|
|
|
|
2011-02-14 19:18:41 +01:00
|
|
|
$mode=isset($_GET["mode"])?GETPOST("mode"):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
|
2011-02-12 07:37:50 +01:00
|
|
|
$mesg=GETPOST("mesg");
|
2012-02-24 11:06:05 +01:00
|
|
|
$action=GETPOST('action');
|
2006-03-31 21:30:08 +02:00
|
|
|
|
2011-12-02 23:23:07 +01:00
|
|
|
if (!$user->admin) accessforbidden();
|
2004-10-23 00:42:10 +02:00
|
|
|
|
2006-03-31 21:30:08 +02:00
|
|
|
|
2005-10-18 23:29:45 +02:00
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
2003-03-11 17:18:54 +01:00
|
|
|
|
2012-02-24 11:06:05 +01:00
|
|
|
if ($action == 'set' && $user->admin)
|
2003-03-11 17:18:54 +01:00
|
|
|
{
|
2012-02-15 13:55:00 +01:00
|
|
|
$result=activateModule($_GET["value"]);
|
2005-10-18 23:29:45 +02:00
|
|
|
$mesg='';
|
|
|
|
|
if ($result) $mesg=$result;
|
2006-03-31 21:30:08 +02:00
|
|
|
Header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg));
|
2006-03-23 00:44:46 +01:00
|
|
|
exit;
|
2003-09-10 18:50:53 +02:00
|
|
|
}
|
|
|
|
|
|
2012-02-24 11:06:05 +01:00
|
|
|
if ($action == 'reset' && $user->admin)
|
2004-02-28 00:11:26 +01:00
|
|
|
{
|
2012-02-15 13:55:00 +01:00
|
|
|
$result=unActivateModule($_GET["value"]);
|
2005-10-18 23:29:45 +02:00
|
|
|
$mesg='';
|
|
|
|
|
if ($result) $mesg=$result;
|
2006-03-31 21:30:08 +02:00
|
|
|
Header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg));
|
2006-03-23 00:44:46 +01:00
|
|
|
exit;
|
2004-02-28 00:11:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-10-18 23:29:45 +02:00
|
|
|
/*
|
2010-09-04 18:16:15 +02:00
|
|
|
* View
|
2005-10-18 23:29:45 +02:00
|
|
|
*/
|
2010-09-04 18:16:15 +02:00
|
|
|
|
2008-10-01 21:10:17 +02:00
|
|
|
$_SESSION["mode"]=$mode;
|
2007-04-10 13:47:27 +02:00
|
|
|
|
2010-05-26 13:28:10 +02:00
|
|
|
$help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
|
|
|
|
|
llxHeader('',$langs->trans("Setup"),$help_url);
|
2004-11-22 10:57:37 +01:00
|
|
|
|
2006-08-12 17:32:57 +02:00
|
|
|
print_fiche_titre($langs->trans("ModulesSetup"),'','setup');
|
|
|
|
|
|
|
|
|
|
|
2012-01-26 23:05:59 +01:00
|
|
|
// Search modules dirs
|
2011-08-01 14:25:14 +02:00
|
|
|
$modulesdir = array();
|
|
|
|
|
foreach ($conf->file->dol_document_root as $type => $dirroot)
|
2003-11-13 16:09:12 +01:00
|
|
|
{
|
2011-12-08 23:05:06 +01:00
|
|
|
$modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/';
|
2011-11-02 14:15:14 +01:00
|
|
|
|
2011-12-08 23:05:06 +01:00
|
|
|
$handle=@opendir($dirroot);
|
|
|
|
|
if (is_resource($handle))
|
|
|
|
|
{
|
|
|
|
|
while (($file = readdir($handle))!==false)
|
2011-08-01 14:25:14 +02:00
|
|
|
{
|
2011-12-08 23:05:06 +01:00
|
|
|
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
|
|
|
|
|
{
|
|
|
|
|
if (is_dir($dirroot . '/' . $file . '/core/modules/'))
|
|
|
|
|
{
|
|
|
|
|
$modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/';
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-08-01 14:25:14 +02:00
|
|
|
}
|
2011-12-08 23:05:06 +01:00
|
|
|
closedir($handle);
|
|
|
|
|
}
|
2011-08-01 14:25:14 +02:00
|
|
|
}
|
2011-11-02 14:15:14 +01:00
|
|
|
//var_dump($modulesdir);
|
2004-10-23 00:42:10 +02:00
|
|
|
|
2012-01-26 23:05:59 +01:00
|
|
|
|
|
|
|
|
$filename = array();
|
|
|
|
|
$modules = array();
|
|
|
|
|
$orders = array();
|
|
|
|
|
$categ = array();
|
|
|
|
|
$dirmod = array();
|
|
|
|
|
$i = 0; // is a sequencer of modules found
|
|
|
|
|
$j = 0; // j is module number. Automatically affected if module number not defined.
|
2012-03-15 15:47:01 +01:00
|
|
|
$modNameLoaded=array();
|
2012-01-26 23:05:59 +01:00
|
|
|
|
2011-08-01 14:25:14 +02:00
|
|
|
foreach ($modulesdir as $dir)
|
|
|
|
|
{
|
2008-12-02 15:16:18 +01:00
|
|
|
// Load modules attributes in arrays (name, numero, orders) from dir directory
|
2010-12-14 23:31:59 +01:00
|
|
|
//print $dir."\n<br>";
|
2010-11-13 19:57:10 +01:00
|
|
|
dol_syslog("Scan directory ".$dir." for modules");
|
2009-03-03 19:25:48 +01:00
|
|
|
$handle=@opendir($dir);
|
2010-12-15 19:15:08 +01:00
|
|
|
if (is_resource($handle))
|
2008-03-10 00:14:08 +01:00
|
|
|
{
|
2008-12-02 15:16:18 +01:00
|
|
|
while (($file = readdir($handle))!==false)
|
|
|
|
|
{
|
|
|
|
|
//print "$i ".$file."\n<br>";
|
2010-08-24 16:42:18 +02:00
|
|
|
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
2008-12-02 15:16:18 +01:00
|
|
|
{
|
2010-08-24 16:42:18 +02:00
|
|
|
$modName = substr($file, 0, dol_strlen($file) - 10);
|
2009-01-21 14:20:26 +01:00
|
|
|
|
2008-12-02 15:16:18 +01:00
|
|
|
if ($modName)
|
|
|
|
|
{
|
2012-03-15 16:01:56 +01:00
|
|
|
if (! empty($modNameLoaded[$modName]))
|
2012-03-15 15:47:01 +01:00
|
|
|
{
|
|
|
|
|
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
|
|
|
|
|
dol_syslog($mesg, LOG_ERR);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-02 14:15:14 +01:00
|
|
|
try
|
2008-12-02 15:16:18 +01:00
|
|
|
{
|
2011-11-02 14:15:14 +01:00
|
|
|
$res=include_once($dir.$file);
|
|
|
|
|
$objMod = new $modName($db);
|
2012-03-15 15:47:01 +01:00
|
|
|
$modNameLoaded[$modName]=$dir;
|
2011-11-02 14:15:14 +01:00
|
|
|
|
|
|
|
|
if ($objMod->numero > 0)
|
|
|
|
|
{
|
|
|
|
|
$j = $objMod->numero;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$j = 1000 + $i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$modulequalified=1;
|
|
|
|
|
|
|
|
|
|
// We discard modules according to features level (PS: if module is activated we always show it)
|
|
|
|
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
|
|
|
|
if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0;
|
|
|
|
|
if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0;
|
|
|
|
|
|
|
|
|
|
if ($modulequalified)
|
|
|
|
|
{
|
|
|
|
|
$modules[$i] = $objMod;
|
|
|
|
|
$filename[$i]= $modName;
|
|
|
|
|
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
|
|
|
|
|
//print "x".$modName." ".$orders[$i]."\n<br>";
|
|
|
|
|
if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories
|
|
|
|
|
else $categ[$objMod->special]=1;
|
2011-12-28 19:41:43 +01:00
|
|
|
$dirmod[$i] = $dir;
|
2011-11-02 14:15:14 +01:00
|
|
|
$j++;
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
else dol_syslog("Module ".get_class($objMod)." not qualified");
|
2008-12-02 15:16:18 +01:00
|
|
|
}
|
2011-11-02 14:15:14 +01:00
|
|
|
catch(Exception $e)
|
2008-12-02 15:16:18 +01:00
|
|
|
{
|
2011-11-02 14:15:14 +01:00
|
|
|
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
2008-12-02 15:16:18 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
closedir($handle);
|
2008-03-10 00:14:08 +01:00
|
|
|
}
|
2009-03-03 19:25:48 +01:00
|
|
|
else
|
|
|
|
|
{
|
2009-04-30 00:11:08 +02:00
|
|
|
dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING);
|
2009-03-03 19:25:48 +01:00
|
|
|
}
|
2008-04-19 22:48:59 +02:00
|
|
|
}
|
2007-04-10 20:54:34 +02:00
|
|
|
|
2008-03-10 00:14:08 +01:00
|
|
|
asort($orders);
|
2008-09-29 23:29:18 +02:00
|
|
|
//var_dump($orders);
|
2010-12-19 00:49:40 +01:00
|
|
|
//var_dump($categ);
|
|
|
|
|
//var_dump($modules);
|
2008-04-19 22:48:59 +02:00
|
|
|
|
2007-04-10 20:54:34 +02:00
|
|
|
// Affichage debut page
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
if ($mode==0) { $tagmode = 'common'; print $langs->trans("ModulesDesc")."<br>\n"; }
|
|
|
|
|
if ($mode==2) { $tagmode = 'other'; print $langs->trans("ModulesSpecialDesc")."<br>\n"; }
|
|
|
|
|
if ($mode==1) { $tagmode = 'interfaces'; print $langs->trans("ModulesInterfaceDesc")."<br>\n"; }
|
|
|
|
|
if ($mode==3) { $tagmode = 'functional'; print $langs->trans("ModulesJobDesc")."<br>\n"; }
|
|
|
|
|
if ($mode==4) { $tagmode = 'marketplace'; print $langs->trans("ModulesMarketPlaceDesc")."<br>\n"; }
|
2007-04-10 20:54:34 +02:00
|
|
|
print "<br>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$h = 0;
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$categidx=0; // Main
|
2009-01-21 14:20:26 +01:00
|
|
|
if (! empty($categ[$categidx]))
|
2007-04-10 20:54:34 +02:00
|
|
|
{
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
|
|
|
|
$head[$h][1] = $langs->trans("ModulesCommon");
|
|
|
|
|
$head[$h][2] = 'common';
|
|
|
|
|
$h++;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$categidx=2; // Other
|
2009-01-21 14:20:26 +01:00
|
|
|
if (! empty($categ[$categidx]))
|
2007-04-10 20:54:34 +02:00
|
|
|
{
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
2009-02-11 16:09:59 +01:00
|
|
|
$head[$h][1] = $langs->trans("ModulesOther");
|
|
|
|
|
$head[$h][2] = 'other';
|
2007-04-10 20:54:34 +02:00
|
|
|
$h++;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$categidx=1; // Interfaces
|
2009-01-21 14:20:26 +01:00
|
|
|
if (! empty($categ[$categidx]))
|
2007-04-10 20:54:34 +02:00
|
|
|
{
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
2009-02-11 16:09:59 +01:00
|
|
|
$head[$h][1] = $langs->trans("ModulesInterfaces");
|
|
|
|
|
$head[$h][2] = 'interfaces';
|
2007-04-10 20:54:34 +02:00
|
|
|
$h++;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$categidx=3; // Not used
|
2009-01-21 14:20:26 +01:00
|
|
|
if (! empty($categ[$categidx]))
|
2007-04-10 20:54:34 +02:00
|
|
|
{
|
2007-12-16 16:23:11 +01:00
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
2009-02-11 16:09:59 +01:00
|
|
|
$head[$h][1] = $langs->trans("ModulesSpecial");
|
2007-04-10 20:54:34 +02:00
|
|
|
$head[$h][2] = 'functional';
|
|
|
|
|
$h++;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$categidx=4;
|
|
|
|
|
//if (! empty($categ[$categidx]))
|
|
|
|
|
//{
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
|
|
|
|
$head[$h][1] = $langs->trans("ModulesMarketPlaces");
|
|
|
|
|
$head[$h][2] = 'marketplace';
|
|
|
|
|
$h++;
|
|
|
|
|
//}
|
2007-04-10 20:54:34 +02:00
|
|
|
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
dol_fiche_head($head, $tagmode, $langs->trans("Modules"));
|
2007-04-10 20:54:34 +02:00
|
|
|
|
2004-06-26 19:43:07 +02:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
2005-08-13 22:15:35 +02:00
|
|
|
|
2004-10-07 09:26:16 +02:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
if ($mode != 4)
|
|
|
|
|
{
|
|
|
|
|
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
|
|
|
|
//print "<tr class=\"liste_titre\">\n";
|
|
|
|
|
print '<tr class="liste_total">'."\n";
|
|
|
|
|
//print " <td>".$langs->trans("Family")."</td>\n";
|
|
|
|
|
print " <td colspan=\"2\">".$langs->trans("Module")."</td>\n";
|
|
|
|
|
print " <td>".$langs->trans("Description")."</td>\n";
|
|
|
|
|
print " <td align=\"center\">".$langs->trans("Version")."</td>\n";
|
|
|
|
|
//print " <td align=\"center\">".$langs->trans("DbVersion")."</td>\n";
|
|
|
|
|
print " <td align=\"center\">".$langs->trans("Status")."</td>\n";
|
|
|
|
|
print " <td align=\"right\">".$langs->trans("SetupShort")."</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Affichage liste modules
|
|
|
|
|
|
|
|
|
|
$var=true;
|
|
|
|
|
$oldfamily='';
|
|
|
|
|
|
|
|
|
|
$familylib=array(
|
|
|
|
|
'base'=>$langs->trans("ModuleFamilyBase"),
|
|
|
|
|
'crm'=>$langs->trans("ModuleFamilyCrm"),
|
|
|
|
|
'products'=>$langs->trans("ModuleFamilyProducts"),
|
|
|
|
|
'hr'=>$langs->trans("ModuleFamilyHr"),
|
|
|
|
|
'projects'=>$langs->trans("ModuleFamilyProjects"),
|
|
|
|
|
'financial'=>$langs->trans("ModuleFamilyFinancial"),
|
|
|
|
|
'ecm'=>$langs->trans("ModuleFamilyECM"),
|
|
|
|
|
'technic'=>$langs->trans("ModuleFamilyTechnic"),
|
|
|
|
|
'other'=>$langs->trans("ModuleFamilyOther")
|
|
|
|
|
);
|
2011-01-14 22:30:19 +01:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
foreach ($orders as $key => $value)
|
2008-09-30 01:34:56 +02:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
$tab=explode('_',$value);
|
|
|
|
|
$family=$tab[0]; $numero=$tab[1];
|
2009-01-21 14:20:26 +01:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$modName = $filename[$key];
|
|
|
|
|
$objMod = $modules[$key];
|
2010-12-19 00:49:40 +01:00
|
|
|
//var_dump($objMod);
|
2011-01-14 22:30:19 +01:00
|
|
|
|
2010-12-19 00:49:40 +01:00
|
|
|
if ($objMod->special != $mode) continue; // Discard if not for tab
|
|
|
|
|
if (! $objMod->getName())
|
|
|
|
|
{
|
|
|
|
|
dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING);
|
2011-01-14 22:30:19 +01:00
|
|
|
continue;
|
2010-12-19 00:49:40 +01:00
|
|
|
}
|
2011-01-14 22:30:19 +01:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
2005-08-13 22:15:35 +02:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
// Load all lang files of module
|
|
|
|
|
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
2005-08-13 22:15:35 +02:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
foreach($objMod->langfiles as $domain)
|
|
|
|
|
{
|
|
|
|
|
$langs->load($domain);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Print a separator if we change family
|
|
|
|
|
//print "<tr><td>xx".$oldfamily."-".$family."-".$atleastoneforfamily."<br></td><tr>";
|
|
|
|
|
//if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) {
|
|
|
|
|
if ($family!=$oldfamily) {
|
2010-11-05 09:40:21 +01:00
|
|
|
print '<tr class="liste_titre">'."\n <td colspan=\"6\">";
|
2008-09-29 23:29:18 +02:00
|
|
|
$familytext=empty($familylib[$family])?$family:$familylib[$family];
|
|
|
|
|
print $familytext;
|
2010-09-01 01:36:52 +02:00
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$atleastoneforfamily=0;
|
|
|
|
|
//print "<tr><td>yy".$oldfamily."-".$family."-".$atleastoneforfamily."<br></td><tr>";
|
2005-08-13 22:15:35 +02:00
|
|
|
}
|
2009-02-11 21:44:00 +01:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
if ($objMod->special == $mode)
|
2009-02-11 21:44:00 +01:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
$atleastoneforfamily++;
|
2004-10-23 00:42:10 +02:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
if ($family!=$oldfamily)
|
|
|
|
|
{
|
|
|
|
|
$familytext=empty($familylib[$family])?$family:$familylib[$family];
|
|
|
|
|
//print $familytext;
|
|
|
|
|
$oldfamily=$family;
|
|
|
|
|
}
|
2011-11-02 14:15:14 +01:00
|
|
|
|
2011-09-14 23:50:18 +02:00
|
|
|
$var=!$var;
|
2011-12-28 19:41:43 +01:00
|
|
|
|
|
|
|
|
//print "\n<!-- Module ".$objMod->numero." ".$objMod->getName()." found into ".$dirmod[$key]." -->\n";
|
2011-09-14 23:50:18 +02:00
|
|
|
print '<tr height="18" '.$bc[$var].">\n";
|
2010-05-26 13:28:10 +02:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
// Picto
|
|
|
|
|
print ' <td valign="top" width="14" align="center">';
|
2010-09-04 18:16:15 +02:00
|
|
|
$alttext='';
|
|
|
|
|
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
|
|
|
|
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
|
2010-09-01 01:36:52 +02:00
|
|
|
if (! empty($objMod->picto))
|
2009-10-30 10:42:50 +01:00
|
|
|
{
|
2011-01-14 22:30:19 +01:00
|
|
|
if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1);
|
|
|
|
|
else print img_object($alttext,$objMod->picto,' width="14px"');
|
2009-10-30 10:42:50 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-09-04 18:16:15 +02:00
|
|
|
print img_object($alttext,'generic');
|
2009-10-30 10:42:50 +01:00
|
|
|
}
|
2010-09-01 01:36:52 +02:00
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Name
|
|
|
|
|
print '<td valign="top">'.$objMod->getName();
|
|
|
|
|
print "</td>\n";
|
2005-08-13 22:15:35 +02:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
// Desc
|
|
|
|
|
print "<td valign=\"top\">";
|
|
|
|
|
print nl2br($objMod->getDesc());
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
|
|
|
|
|
// Version
|
|
|
|
|
print "<td align=\"center\" valign=\"top\" nowrap=\"nowrap\">";
|
|
|
|
|
print $objMod->getVersion();
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
|
|
|
|
|
// Activate/Disable and Setup (2 columns)
|
|
|
|
|
if (! empty($conf->global->$const_name))
|
2004-10-23 00:42:10 +02:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
$disableSetup = 0;
|
|
|
|
|
|
|
|
|
|
print "<td align=\"center\" valign=\"top\">";
|
|
|
|
|
|
|
|
|
|
// Module actif
|
|
|
|
|
if (! empty($objMod->always_enabled) || (($conf->global->MAIN_MODULE_MULTICOMPANY && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
|
|
|
|
{
|
|
|
|
|
print $langs->trans("Required");
|
|
|
|
|
if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) $disableSetup++;
|
|
|
|
|
print '</td>'."\n";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<a href="modules.php?id='.$objMod->numero.'&action=reset&value=' . $modName . '&mode=' . $mode . '">';
|
2011-08-04 23:07:33 +02:00
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
2010-09-01 01:36:52 +02:00
|
|
|
print '</a></td>'."\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (! empty($objMod->config_page_url) && !$disableSetup)
|
2006-03-23 00:44:46 +01:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
if (is_array($objMod->config_page_url))
|
2005-07-09 15:57:18 +02:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
print ' <td align="right" valign="top">';
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach ($objMod->config_page_url as $page)
|
2005-07-09 15:57:18 +02:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
$urlpage=$page;
|
|
|
|
|
if ($i++)
|
|
|
|
|
{
|
|
|
|
|
print '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page),"setup").'</a> ';
|
|
|
|
|
// print '<a href="'.$page.'">'.ucfirst($page).'</a> ';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs))
|
|
|
|
|
{
|
2010-12-20 13:36:31 +01:00
|
|
|
print '<a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a> ';
|
2010-09-01 01:36:52 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<a href="'.$urlpage.'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a> ';
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-07-09 15:57:18 +02:00
|
|
|
}
|
2010-09-01 01:36:52 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
|
|
|
|
|
{
|
2010-12-20 13:36:31 +01:00
|
|
|
print '<td align="right" valign="top"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a></td>';
|
2010-09-01 01:36:52 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<td align="right" valign="top"><a href="'.$objMod->config_page_url.'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a></td>';
|
2005-07-09 15:57:18 +02:00
|
|
|
}
|
2010-03-26 12:35:38 +01:00
|
|
|
}
|
2005-07-09 15:57:18 +02:00
|
|
|
else
|
|
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
print "<td> </td>";
|
2005-07-09 15:57:18 +02:00
|
|
|
}
|
2010-09-01 01:36:52 +02:00
|
|
|
|
2004-10-23 00:42:10 +02:00
|
|
|
}
|
|
|
|
|
else
|
2005-07-09 15:57:18 +02:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
print "<td align=\"center\" valign=\"top\">";
|
2005-08-13 22:15:35 +02:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
if (! empty($objMod->always_enabled))
|
|
|
|
|
{
|
|
|
|
|
// Ne devrait pas arriver.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Module non actif
|
|
|
|
|
print '<a href="modules.php?id='.$objMod->numero.'&action=set&value=' . $modName . '&mode=' . $mode . '">';
|
2011-08-04 23:07:33 +02:00
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
2010-09-01 01:36:52 +02:00
|
|
|
print "</a></td>\n <td> </td>\n";
|
2005-10-22 15:48:19 +02:00
|
|
|
}
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
print "</tr>\n";
|
2005-08-13 22:15:35 +02:00
|
|
|
}
|
|
|
|
|
|
2004-10-07 09:26:16 +02:00
|
|
|
}
|
2010-09-01 01:36:52 +02:00
|
|
|
print "</table>\n";
|
2004-10-23 00:42:10 +02:00
|
|
|
}
|
2010-09-01 01:36:52 +02:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Marketplace
|
|
|
|
|
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
|
|
|
|
print "<tr class=\"liste_titre\">\n";
|
|
|
|
|
//print '<td>'.$langs->trans("Logo").'</td>';
|
|
|
|
|
print '<td colspan="2">'.$langs->trans("WebSiteDesc").'</td>';
|
|
|
|
|
print '<td>'.$langs->trans("URL").'</td>';
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
$var=!$var;
|
|
|
|
|
print "<tr ".$bc[$var].">\n";
|
|
|
|
|
$url='http://www.dolistore.com';
|
2012-03-10 13:52:08 +01:00
|
|
|
print '<td align="left"><a href="'.$url.'" target="_blank"><img border="0" width="180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
|
2010-09-01 01:36:52 +02:00
|
|
|
print '<td>'.$langs->trans("DoliStoreDesc").'</td>';
|
|
|
|
|
print '<td><a href="'.$url.'" target="_blank">'.$url.'</a></td>';
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "</table>\n";
|
|
|
|
|
}
|
|
|
|
|
|
2004-10-23 00:42:10 +02:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
dol_fiche_end();
|
2005-10-14 23:05:13 +02:00
|
|
|
|
|
|
|
|
// Pour eviter bug mise en page IE
|
|
|
|
|
print '<div class="tabsAction">';
|
|
|
|
|
print '</div>';
|
|
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2012-02-05 19:37:52 +01:00
|
|
|
|
|
|
|
|
$db->close();
|
2003-03-11 17:18:54 +01:00
|
|
|
?>
|