2004-10-19 20:58:50 +02:00
|
|
|
<?php
|
2015-08-31 17:42:08 +02:00
|
|
|
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
2016-02-16 12:54:42 +01:00
|
|
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
2015-08-31 17:42:08 +02:00
|
|
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
|
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
|
|
|
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
|
|
|
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
|
|
|
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
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
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-03-11 17:18:54 +01:00
|
|
|
* (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
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
2015-08-31 17:42:08 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.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
|
|
|
|
2016-05-22 16:12:42 +02:00
|
|
|
$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):0;
|
2012-10-09 09:34:12 +02:00
|
|
|
$action=GETPOST('action','alpha');
|
2012-10-20 09:33:39 +02:00
|
|
|
$value=GETPOST('value', 'alpha');
|
2015-11-13 03:35:55 +01:00
|
|
|
$page_y=GETPOST('page_y','int');
|
2016-03-14 19:40:52 +01:00
|
|
|
$search_keyword=GETPOST('search_keyword','alpha');
|
|
|
|
|
$search_status=GETPOST('search_status','alpha');
|
|
|
|
|
$search_nature=GETPOST('search_nature','alpha');
|
2016-04-06 13:27:46 +02:00
|
|
|
$search_version=GETPOST('search_version','alpha');
|
2006-03-31 21:30:08 +02:00
|
|
|
|
2012-10-09 09:34:12 +02:00
|
|
|
if (! $user->admin)
|
|
|
|
|
accessforbidden();
|
2004-10-23 00:42:10 +02:00
|
|
|
|
2012-09-12 20:33:50 +02:00
|
|
|
$specialtostring=array(0=>'common', 1=>'interfaces', 2=>'other', 3=>'functional', 4=>'marketplace');
|
|
|
|
|
|
2015-10-07 07:57:09 +02:00
|
|
|
$familyinfo=array(
|
|
|
|
|
'hr'=>array('position'=>'001', 'label'=>$langs->trans("ModuleFamilyHr")),
|
|
|
|
|
'crm'=>array('position'=>'006', 'label'=>$langs->trans("ModuleFamilyCrm")),
|
2016-02-19 19:20:21 +01:00
|
|
|
'srm'=>array('position'=>'007', 'label'=>$langs->trans("ModuleFamilySrm")),
|
|
|
|
|
'financial'=>array('position'=>'009', 'label'=>$langs->trans("ModuleFamilyFinancial")),
|
2015-10-07 07:57:09 +02:00
|
|
|
'products'=>array('position'=>'012', 'label'=>$langs->trans("ModuleFamilyProducts")),
|
|
|
|
|
'projects'=>array('position'=>'015', 'label'=>$langs->trans("ModuleFamilyProjects")),
|
|
|
|
|
'ecm'=>array('position'=>'018', 'label'=>$langs->trans("ModuleFamilyECM")),
|
|
|
|
|
'technic'=>array('position'=>'021', 'label'=>$langs->trans("ModuleFamilyTechnic")),
|
|
|
|
|
'portal'=>array('position'=>'040', 'label'=>$langs->trans("ModuleFamilyPortal")),
|
|
|
|
|
'interface'=>array('position'=>'050', 'label'=>$langs->trans("ModuleFamilyInterface")),
|
|
|
|
|
'base'=>array('position'=>'060', 'label'=>$langs->trans("ModuleFamilyBase")),
|
|
|
|
|
'other'=>array('position'=>'100', 'label'=>$langs->trans("ModuleFamilyOther")),
|
|
|
|
|
);
|
|
|
|
|
|
2016-03-14 19:40:52 +01:00
|
|
|
$param='';
|
|
|
|
|
if ($search_keyword) $param.='&search_keyword='.urlencode($search_keyword);
|
2016-04-06 13:27:46 +02:00
|
|
|
if ($search_status) $param.='&search_status='.urlencode($search_status);
|
|
|
|
|
if ($search_nature) $param.='&search_nature='.urlencode($search_nature);
|
|
|
|
|
if ($search_version) $param.='&search_version='.urlencode($search_version);
|
2016-03-14 19:40:52 +01:00
|
|
|
|
2015-10-07 07:57:09 +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
|
|
|
|
2016-09-30 18:26:32 +02:00
|
|
|
|
|
|
|
|
if (GETPOST('buttonreset'))
|
|
|
|
|
{
|
|
|
|
|
$search_keyword='';
|
|
|
|
|
$search_status='';
|
|
|
|
|
$search_nature='';
|
|
|
|
|
$search_version='';
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-24 11:06:05 +01:00
|
|
|
if ($action == 'set' && $user->admin)
|
2003-03-11 17:18:54 +01:00
|
|
|
{
|
2016-09-30 18:26:32 +02:00
|
|
|
$resarray = activateModule($value);
|
|
|
|
|
if (! empty($resarray['errors'])) setEventMessages('', $resarray['errors'], 'errors');
|
2016-06-04 13:25:39 +02:00
|
|
|
else
|
|
|
|
|
{
|
2016-09-30 18:26:32 +02:00
|
|
|
//var_dump($resarray);exit;
|
|
|
|
|
if ($resarray['nbperms'] > 0)
|
|
|
|
|
{
|
|
|
|
|
$msg = $langs->trans('ModuleEnabledAdminMustCheckRights');
|
|
|
|
|
setEventMessages($msg, null, 'warnings');
|
|
|
|
|
}
|
2016-06-04 13:25:39 +02:00
|
|
|
}
|
2016-03-14 19:40:52 +01:00
|
|
|
header("Location: modules.php?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
|
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-10-09 09:34:12 +02:00
|
|
|
$result=unActivateModule($value);
|
2015-10-29 13:58:16 +01:00
|
|
|
if ($result) setEventMessages($result, null, 'errors');
|
2016-03-14 19:40:52 +01:00
|
|
|
header("Location: modules.php?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
|
2006-03-23 00:44:46 +01:00
|
|
|
exit;
|
2004-02-28 00:11:26 +01:00
|
|
|
}
|
|
|
|
|
|
2016-03-14 19:40:52 +01:00
|
|
|
|
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
|
|
|
|
2013-09-06 12:10:09 +02:00
|
|
|
$form = new Form($db);
|
|
|
|
|
|
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
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers"));
|
2006-08-12 17:32:57 +02:00
|
|
|
|
2012-01-26 23:05:59 +01:00
|
|
|
// Search modules dirs
|
2015-08-31 17:42:08 +02:00
|
|
|
$modulesdir = dolGetModulesDirs();
|
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>";
|
2012-07-30 21:43:40 +02:00
|
|
|
dol_syslog("Scan directory ".$dir." for module descriptor files (modXXX.class.php)");
|
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>";
|
2015-10-29 13:58:16 +01:00
|
|
|
setEventMessages($mesg, null, 'warnings');
|
2012-10-09 09:34:12 +02:00
|
|
|
dol_syslog($mesg, LOG_ERR);
|
2012-05-08 15:00:46 +02:00
|
|
|
continue;
|
2012-03-15 15:47:01 +01:00
|
|
|
}
|
2012-05-08 15:00:46 +02:00
|
|
|
|
2011-11-02 14:15:14 +01:00
|
|
|
try
|
2008-12-02 15:16:18 +01:00
|
|
|
{
|
2012-08-23 02:04:35 +02:00
|
|
|
$res=include_once $dir.$file;
|
2013-12-08 02:32:04 +01:00
|
|
|
if (class_exists($modName))
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$objMod = new $modName($db);
|
|
|
|
|
$modNameLoaded[$modName]=$dir;
|
|
|
|
|
|
2016-02-19 19:11:31 +01:00
|
|
|
if (! $objMod->numero > 0 && $modName != 'modUser')
|
2013-12-08 02:32:04 +01:00
|
|
|
{
|
2016-01-10 13:00:48 +01:00
|
|
|
dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR);
|
2013-12-08 02:32:04 +01:00
|
|
|
}
|
2015-10-07 07:57:09 +02:00
|
|
|
$j = $objMod->numero;
|
2016-01-10 13:00:48 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$modulequalified=1;
|
2013-12-08 02:32:04 +01:00
|
|
|
|
|
|
|
|
// 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)));
|
2016-04-06 16:45:22 +02:00
|
|
|
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
|
|
|
|
|
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
|
|
|
|
|
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0;
|
|
|
|
|
|
|
|
|
|
// We discard modules according to property disabled
|
|
|
|
|
if (! empty($objMod->hidden)) $modulequalified=0;
|
|
|
|
|
|
|
|
|
|
if ($modulequalified > 0)
|
2016-04-06 13:27:46 +02:00
|
|
|
{
|
2016-04-06 16:45:22 +02:00
|
|
|
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
|
|
|
|
$external=($objMod->isCoreOrExternalModule() == 'external');
|
|
|
|
|
if ($external)
|
|
|
|
|
{
|
|
|
|
|
if ($publisher)
|
|
|
|
|
{
|
|
|
|
|
$arrayofnatures['external_'.$publisher]=$langs->trans("External").' - '.$publisher;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$arrayofnatures['external_']=$langs->trans("External").' - '.$langs->trans("UnknownPublishers");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ksort($arrayofnatures);
|
2016-04-06 13:27:46 +02:00
|
|
|
}
|
2017-01-15 16:07:04 +01:00
|
|
|
|
2013-12-08 02:32:04 +01:00
|
|
|
// Define array $categ with categ with at least one qualified module
|
2016-04-06 16:45:22 +02:00
|
|
|
if ($modulequalified > 0)
|
2013-12-08 02:32:04 +01:00
|
|
|
{
|
|
|
|
|
$modules[$i] = $objMod;
|
|
|
|
|
$filename[$i]= $modName;
|
2016-01-10 13:00:48 +01:00
|
|
|
|
2015-10-07 07:57:09 +02:00
|
|
|
$special = $objMod->special;
|
2016-01-10 13:00:48 +01:00
|
|
|
|
|
|
|
|
// Gives the possibility to the module, to provide his own family info and position of this family
|
|
|
|
|
if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
|
|
|
|
|
$familyinfo = array_merge($familyinfo, $objMod->familyinfo);
|
|
|
|
|
$familykey = key($objMod->familyinfo);
|
|
|
|
|
} else {
|
|
|
|
|
$familykey = $objMod->family;
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-17 00:58:12 +01:00
|
|
|
$moduleposition = ($objMod->module_position?$objMod->module_position:'500');
|
|
|
|
|
if ($moduleposition == 500 && ($objMod->isCoreOrExternalModule() == 'external'))
|
|
|
|
|
{
|
|
|
|
|
$moduleposition = 800;
|
|
|
|
|
}
|
2016-01-10 13:00:48 +01:00
|
|
|
|
2015-10-07 07:57:09 +02:00
|
|
|
if ($special == 1) $familykey='interface';
|
2016-01-10 13:00:48 +01:00
|
|
|
|
2015-11-17 00:58:12 +01:00
|
|
|
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
|
2013-12-08 02:32:04 +01:00
|
|
|
$dirmod[$i] = $dir;
|
2016-04-07 11:50:45 +02:00
|
|
|
//print $i.'-'.$dirmod[$i].'<br>';
|
2013-12-08 02:32:04 +01:00
|
|
|
// Set categ[$i]
|
2015-10-07 07:57:09 +02:00
|
|
|
$specialstring = isset($specialtostring[$special])?$specialtostring[$special]:'unknown';
|
|
|
|
|
if ($objMod->version == 'development' || $objMod->version == 'experimental') $specialstring='expdev';
|
|
|
|
|
if (isset($categ[$specialstring])) $categ[$specialstring]++; // Array of all different modules categories
|
|
|
|
|
else $categ[$specialstring]=1;
|
2013-12-08 02:32:04 +01:00
|
|
|
$j++;
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
else dol_syslog("Module ".get_class($objMod)." not qualified");
|
|
|
|
|
}
|
|
|
|
|
catch(Exception $e)
|
|
|
|
|
{
|
|
|
|
|
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
|
|
|
|
}
|
|
|
|
|
}
|
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
|
|
|
|
2012-07-22 01:03:19 +02:00
|
|
|
$nbofactivatedmodules=count($conf->modules);
|
2016-02-16 12:54:42 +01:00
|
|
|
$moreinfo=$langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1), count($modules));
|
2013-04-20 12:55:31 +02:00
|
|
|
if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule"));
|
2015-04-18 19:47:09 +02:00
|
|
|
print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'title_setup');
|
2013-03-12 15:56:47 +01:00
|
|
|
|
2013-03-30 14:27:13 +01:00
|
|
|
// Start to show page
|
|
|
|
|
if (empty($mode)) $mode='common';
|
|
|
|
|
if ($mode==='common') print $langs->trans("ModulesDesc")."<br>\n";
|
|
|
|
|
if ($mode==='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."<br>\n";
|
|
|
|
|
if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."<br>\n";
|
2013-03-12 15:56:47 +01:00
|
|
|
|
2013-04-20 12:55:31 +02:00
|
|
|
|
2007-04-10 20:54:34 +02:00
|
|
|
$h = 0;
|
|
|
|
|
|
2012-09-12 20:33:50 +02:00
|
|
|
$categidx='common'; // Main
|
2016-11-27 14:21:23 +01:00
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
|
|
|
|
$head[$h][1] = $langs->trans("AvailableModules");
|
|
|
|
|
$head[$h][2] = 'common';
|
|
|
|
|
$h++;
|
2007-04-10 20:54:34 +02:00
|
|
|
|
2012-09-15 09:02:20 +02:00
|
|
|
$categidx='marketplace';
|
|
|
|
|
$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
|
|
|
|
2013-01-10 08:27:12 +01:00
|
|
|
print "<br>\n";
|
2013-01-02 18:43:59 +01:00
|
|
|
|
|
|
|
|
|
2012-10-24 22:50:19 +02:00
|
|
|
$var=true;
|
2004-06-26 19:43:07 +02:00
|
|
|
|
2012-09-12 20:33:50 +02:00
|
|
|
if ($mode != 'marketplace')
|
2010-09-01 01:36:52 +02:00
|
|
|
{
|
2016-11-27 14:21:23 +01:00
|
|
|
|
2016-03-14 19:40:52 +01:00
|
|
|
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
|
|
|
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
|
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
|
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
|
|
|
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-11-27 14:21:23 +01:00
|
|
|
dol_fiche_head($head, $mode, '');
|
|
|
|
|
|
2016-03-14 19:40:52 +01:00
|
|
|
$moreforfilter = '';
|
|
|
|
|
$moreforfilter.='<div class="divsearchfield">';
|
|
|
|
|
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
|
|
|
|
$moreforfilter.= '</div>';
|
|
|
|
|
$moreforfilter.='<div class="divsearchfield">';
|
2017-01-15 16:07:04 +01:00
|
|
|
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1);
|
2016-03-14 19:40:52 +01:00
|
|
|
$moreforfilter.= '</div>';
|
2016-04-06 13:27:46 +02:00
|
|
|
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
|
|
|
|
{
|
|
|
|
|
$array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable"));
|
|
|
|
|
if ($conf->global->MAIN_FEATURES_LEVEL < 0) $array_version['deprecated']=$langs->trans("Deprecated");
|
|
|
|
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) $array_version['experimental']=$langs->trans("Experimental");
|
|
|
|
|
if ($conf->global->MAIN_FEATURES_LEVEL > 1) $array_version['development']=$langs->trans("Development");
|
|
|
|
|
$moreforfilter.='<div class="divsearchfield">';
|
|
|
|
|
$moreforfilter.= $langs->trans('Version') . ': '.$form->selectarray('search_version', $array_version, $search_version, 1);
|
|
|
|
|
$moreforfilter.= '</div>';
|
|
|
|
|
}
|
2016-04-07 11:50:45 +02:00
|
|
|
$moreforfilter.='<div class="divsearchfield">';
|
|
|
|
|
$moreforfilter.= $langs->trans('Status') . ': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1);
|
|
|
|
|
$moreforfilter.= '</div>';
|
2016-03-14 19:40:52 +01:00
|
|
|
$moreforfilter.=' ';
|
|
|
|
|
$moreforfilter.='<div class="divsearchfield">';
|
|
|
|
|
$moreforfilter.='<input type="submit" name="buttonsubmit" class="button" value="'.dol_escape_htmltag($langs->trans("Refresh")).'">';
|
|
|
|
|
$moreforfilter.=' ';
|
|
|
|
|
$moreforfilter.='<input type="submit" name="buttonreset" class="button" value="'.dol_escape_htmltag($langs->trans("Reset")).'">';
|
|
|
|
|
$moreforfilter.= '</div>';
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-03-14 19:40:52 +01:00
|
|
|
if (! empty($moreforfilter))
|
|
|
|
|
{
|
|
|
|
|
//print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
|
|
|
|
print $moreforfilter;
|
|
|
|
|
$parameters=array();
|
|
|
|
|
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
|
|
|
|
print $hookmanager->resPrint;
|
|
|
|
|
//print '</div>';
|
2016-11-20 22:59:13 +01:00
|
|
|
}
|
2016-11-27 14:21:23 +01:00
|
|
|
|
|
|
|
|
//dol_fiche_end();
|
|
|
|
|
|
|
|
|
|
print '<div class="clearboth"></div><br>';
|
|
|
|
|
//print '<br><br><br><br>';
|
|
|
|
|
|
|
|
|
|
$moreforfilter='';
|
|
|
|
|
|
2012-09-12 20:33:50 +02:00
|
|
|
// Show list of modules
|
2016-11-27 14:21:23 +01:00
|
|
|
print '<div class="div-table-responsive">';
|
|
|
|
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'" summary="list_of_modules" id="list_of_modules" >'."\n";
|
2016-03-14 19:40:52 +01:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$oldfamily='';
|
|
|
|
|
|
|
|
|
|
foreach ($orders as $key => $value)
|
2008-09-30 01:34:56 +02:00
|
|
|
{
|
2010-09-01 01:36:52 +02:00
|
|
|
$tab=explode('_',$value);
|
2015-11-17 00:58:12 +01:00
|
|
|
$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
|
2009-01-21 14:20:26 +01:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$modName = $filename[$key];
|
|
|
|
|
$objMod = $modules[$key];
|
2016-04-07 11:50:45 +02:00
|
|
|
$dirofmodule = $dirmod[$key];
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2015-10-07 07:57:09 +02:00
|
|
|
$special = $objMod->special;
|
2016-01-10 13:00:48 +01:00
|
|
|
|
2012-09-12 20:33:50 +02:00
|
|
|
//print $objMod->name." - ".$key." - ".$objMod->special.' - '.$objMod->version."<br>";
|
2015-10-07 07:57:09 +02:00
|
|
|
//if (($mode != (isset($specialtostring[$special])?$specialtostring[$special]:'unknown') && $mode != 'expdev')
|
|
|
|
|
if (($special >= 4 && $mode != 'expdev')
|
2012-09-12 20:33:50 +02:00
|
|
|
|| ($mode == 'expdev' && $objMod->version != 'development' && $objMod->version != 'experimental')) continue; // Discard if not for current tab
|
|
|
|
|
|
2010-12-19 00:49:40 +01:00
|
|
|
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
|
|
|
}
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-03-14 19:40:52 +01:00
|
|
|
// Check filters
|
|
|
|
|
$modulename=$objMod->getName();
|
|
|
|
|
$moduledesc=$objMod->getDesc();
|
|
|
|
|
$moduledesclong=$objMod->getDescLong();
|
|
|
|
|
$moduleauthor=$objMod->getPublisher();
|
2016-04-06 16:45:22 +02:00
|
|
|
|
|
|
|
|
// We discard showing according to filters
|
2016-03-14 19:40:52 +01:00
|
|
|
if ($search_keyword)
|
|
|
|
|
{
|
|
|
|
|
$qualified=0;
|
2017-01-15 16:07:04 +01:00
|
|
|
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
2016-03-14 19:40:52 +01:00
|
|
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
|
|
|
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
|
|
|
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
|
|
|
|
) $qualified=1;
|
|
|
|
|
if (! $qualified) continue;
|
|
|
|
|
}
|
|
|
|
|
if ($search_status)
|
|
|
|
|
{
|
|
|
|
|
if ($search_status == 'active' && empty($conf->global->$const_name)) continue;
|
|
|
|
|
if ($search_status == 'disabled' && ! empty($conf->global->$const_name)) continue;
|
|
|
|
|
}
|
|
|
|
|
if ($search_nature)
|
|
|
|
|
{
|
2016-04-06 16:45:22 +02:00
|
|
|
if (preg_match('/^external/',$search_nature) && $objMod->isCoreOrExternalModule() != 'external') continue;
|
|
|
|
|
if (preg_match('/^external_(.*)$/',$search_nature, $reg))
|
|
|
|
|
{
|
|
|
|
|
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
|
|
|
|
|
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
2017-01-15 16:07:04 +01:00
|
|
|
if ($reg[1] && dol_escape_htmltag($reg[1]) != $publisher) continue;
|
2016-04-06 16:45:22 +02:00
|
|
|
if (! $reg[1] && ! empty($publisher)) continue;
|
|
|
|
|
}
|
|
|
|
|
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
|
|
|
|
}
|
|
|
|
|
if ($search_version)
|
|
|
|
|
{
|
|
|
|
|
if (($objMod->version == 'development' || $objMod->version == 'experimental' || preg_match('/deprecated/', $objMod->version)) && $search_version == 'stable') continue;
|
|
|
|
|
if ($objMod->version != 'development' && ($search_version == 'development')) continue;
|
|
|
|
|
if ($objMod->version != 'experimental' && ($search_version == 'experimental')) continue;
|
|
|
|
|
if (! preg_match('/deprecated/', $objMod->version) && ($search_version == 'deprecated')) continue;
|
2016-03-14 19:40:52 +01:00
|
|
|
}
|
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
|
2015-10-07 07:57:09 +02:00
|
|
|
//print "<tr><td>xx".$oldfamily."-".$familykey."-".$atleastoneforfamily."<br></td><tr>";
|
|
|
|
|
//if ($oldfamily && $familykey!=$oldfamily && $atleastoneforfamily) {
|
|
|
|
|
if ($familykey!=$oldfamily)
|
2013-10-25 18:01:45 +02:00
|
|
|
{
|
|
|
|
|
print '<tr class="liste_titre">'."\n";
|
2016-07-23 13:37:17 +02:00
|
|
|
print '<td colspan="5">';
|
2015-10-07 07:57:09 +02:00
|
|
|
$familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
|
2008-09-29 23:29:18 +02:00
|
|
|
print $familytext;
|
2013-10-25 18:01:45 +02:00
|
|
|
print "</td>\n";
|
2016-07-23 13:37:17 +02:00
|
|
|
print '<td colspan="2" align="right">'.$langs->trans("SetupShort").'</td>'."\n";
|
2013-10-25 18:01:45 +02:00
|
|
|
print "</tr>\n";
|
2010-09-01 01:36:52 +02:00
|
|
|
$atleastoneforfamily=0;
|
2015-10-07 07:57:09 +02:00
|
|
|
//print "<tr><td>yy".$oldfamily."-".$familykey."-".$atleastoneforfamily."<br></td><tr>";
|
2005-08-13 22:15:35 +02:00
|
|
|
}
|
2009-02-11 21:44:00 +01:00
|
|
|
|
2013-10-25 18:01:45 +02:00
|
|
|
$atleastoneforfamily++;
|
2005-08-13 22:15:35 +02:00
|
|
|
|
2015-10-07 07:57:09 +02:00
|
|
|
if ($familykey!=$oldfamily)
|
2013-10-25 18:01:45 +02:00
|
|
|
{
|
2015-10-07 07:57:09 +02:00
|
|
|
$familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
|
|
|
|
|
$oldfamily=$familykey;
|
2013-10-25 18:01:45 +02:00
|
|
|
}
|
2010-09-01 01:36:52 +02:00
|
|
|
|
2013-10-25 18:01:45 +02:00
|
|
|
$var=!$var;
|
2010-09-01 01:36:52 +02:00
|
|
|
|
2013-10-25 18:01:45 +02:00
|
|
|
//print "\n<!-- Module ".$objMod->numero." ".$objMod->getName()." found into ".$dirmod[$key]." -->\n";
|
|
|
|
|
print '<tr '.$bc[$var].">\n";
|
2005-10-22 15:48:19 +02:00
|
|
|
|
2013-10-25 18:01:45 +02:00
|
|
|
// Picto
|
|
|
|
|
print ' <td valign="top" width="14" align="center">';
|
|
|
|
|
$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);
|
|
|
|
|
if (! empty($objMod->picto))
|
|
|
|
|
{
|
|
|
|
|
if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1);
|
|
|
|
|
else print img_object($alttext,$objMod->picto,' width="14px"');
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print img_object($alttext,'generic');
|
|
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Name
|
2017-01-22 12:13:32 +01:00
|
|
|
print '<td class="tdtop">'.$objMod->getName();
|
2013-10-25 18:01:45 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
|
|
|
|
|
// Desc
|
2017-01-22 12:13:32 +01:00
|
|
|
print '<td class="tdtop">';
|
2013-10-25 18:01:45 +02:00
|
|
|
print nl2br($objMod->getDesc());
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
// Help
|
2016-04-07 20:01:52 +02:00
|
|
|
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
2016-04-06 16:45:22 +02:00
|
|
|
$text='';
|
2017-01-16 00:48:37 +01:00
|
|
|
|
2017-02-04 14:17:55 +01:00
|
|
|
//if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
|
|
|
|
//else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
|
|
|
|
$text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
|
|
|
|
|
2016-04-07 11:50:45 +02:00
|
|
|
$textexternal='';
|
2017-01-16 00:48:37 +01:00
|
|
|
$imginfo="info";
|
2013-10-28 01:37:04 +01:00
|
|
|
if ($objMod->isCoreOrExternalModule() == 'external')
|
|
|
|
|
{
|
2016-12-10 19:35:58 +01:00
|
|
|
$imginfo="info_black";
|
2016-04-07 11:50:45 +02:00
|
|
|
$textexternal.='<br><strong>'.$langs->trans("Origin").':</strong> '.$langs->trans("ExternalModule",$dirofmodule);
|
|
|
|
|
if ($objMod->editor_name != 'dolibarr') $textexternal.='<br><strong>'.$langs->trans("Publisher").':</strong> '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name);
|
|
|
|
|
if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='<br><strong>'.$langs->trans("Url").':</strong> '.$objMod->editor_url;
|
|
|
|
|
$text.=$textexternal;
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$text.='<br><strong>'.$langs->trans("Origin").':</strong> '.$langs->trans("Core").'<br>';
|
|
|
|
|
}
|
2016-10-02 10:41:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("LastActivationDate").':</strong> ';
|
|
|
|
|
if (! empty($conf->global->$const_name)) $text.=dol_print_date($objMod->getLastActivationDate(), 'dayhour');
|
|
|
|
|
else $text.=$langs->trans("Disabled");
|
|
|
|
|
$text.='<br>';
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddRemoveTabs").':</strong> ';
|
|
|
|
|
if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs))
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($objMod->tabs as $val)
|
|
|
|
|
{
|
|
|
|
|
$tmp=explode(':',$val,3);
|
|
|
|
|
$text.=($i?', ':'').$tmp[0].':'.$tmp[1];
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddDictionaries").':</strong> ';
|
|
|
|
|
if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib']))
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($objMod->dictionaries['tablib'] as $val)
|
|
|
|
|
{
|
|
|
|
|
$text.=($i?', ':'').$val;
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddBoxes").':</strong> ';
|
|
|
|
|
if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes))
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($objMod->boxes as $val)
|
|
|
|
|
{
|
|
|
|
|
$text.=($i?', ':'').($val['file']?$val['file']:$val[0]);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
|
|
|
|
|
|
|
|
|
$text.='<br><strong>'.$langs->trans("AddModels").':</strong> ';
|
|
|
|
|
if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models'])
|
|
|
|
|
{
|
|
|
|
|
$text.=$langs->trans("Yes");
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddSubstitutions").':</strong> ';
|
|
|
|
|
if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions'])
|
|
|
|
|
{
|
|
|
|
|
$text.=$langs->trans("Yes");
|
2013-10-28 01:37:04 +01:00
|
|
|
}
|
2016-04-06 16:45:22 +02:00
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddSheduledJobs").':</strong> ';
|
|
|
|
|
if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs))
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($objMod->cronjobs as $val)
|
|
|
|
|
{
|
|
|
|
|
$text.=($i?', ':'').($val['label']);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddTriggers").':</strong> ';
|
|
|
|
|
if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers'])
|
|
|
|
|
{
|
|
|
|
|
$text.=$langs->trans("Yes");
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddHooks").':</strong> ';
|
|
|
|
|
if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks']))
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($objMod->module_parts['hooks'] as $val)
|
|
|
|
|
{
|
|
|
|
|
$text.=($i?', ':'').($val);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
|
|
|
|
|
|
|
|
|
$text.='<br><strong>'.$langs->trans("AddPermissions").':</strong> ';
|
|
|
|
|
if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights))
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($objMod->rights as $val)
|
|
|
|
|
{
|
|
|
|
|
$text.=($i?', ':'').($val[1]);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddMenus").':</strong> ';
|
2016-09-30 13:02:13 +02:00
|
|
|
if (isset($objMod->menu) && ! empty($objMod->menu)) // objMod can be an array or just an int 1
|
2016-04-06 16:45:22 +02:00
|
|
|
{
|
|
|
|
|
$text.=$langs->trans("Yes");
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddExportProfiles").':</strong> ';
|
|
|
|
|
if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label))
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($objMod->export_label as $val)
|
|
|
|
|
{
|
|
|
|
|
$text.=($i?', ':'').($val);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddImportProfiles").':</strong> ';
|
|
|
|
|
if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label))
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($objMod->import_label as $val)
|
|
|
|
|
{
|
|
|
|
|
$text.=($i?', ':'').($val);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else $text.=$langs->trans("No");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-04-06 16:45:22 +02:00
|
|
|
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
|
|
|
|
$text.=$langs->trans("DetectionNotPossible");
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2017-01-15 16:07:04 +01:00
|
|
|
|
2016-12-10 19:35:58 +01:00
|
|
|
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
2016-04-07 11:50:45 +02:00
|
|
|
|
2016-10-02 10:41:22 +02:00
|
|
|
print '</td>';
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-10-02 10:41:22 +02:00
|
|
|
// Version
|
|
|
|
|
print '<td align="center" valign="top" class="nowrap">';
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2016-10-02 10:41:22 +02:00
|
|
|
// Picto warning
|
2016-04-07 20:01:52 +02:00
|
|
|
$version=$objMod->getVersion(0);
|
|
|
|
|
$versiontrans=$objMod->getVersion(1);
|
2016-10-02 10:41:22 +02:00
|
|
|
if (preg_match('/development/i', $version)) print img_warning($langs->trans("Development"), 'style="float: left"');
|
|
|
|
|
if (preg_match('/experimental/i', $version)) print img_warning($langs->trans("Experimental"), 'style="float: left"');
|
|
|
|
|
if (preg_match('/deprecated/i', $version)) print img_warning($langs->trans("Deprecated"), 'style="float: left"');
|
2016-11-20 22:59:13 +01:00
|
|
|
|
|
|
|
|
|
2016-04-07 20:01:52 +02:00
|
|
|
print $versiontrans;
|
2016-11-20 22:59:13 +01:00
|
|
|
|
2013-10-25 18:01:45 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
|
|
|
|
|
// Activate/Disable and Setup (2 columns)
|
2014-05-03 02:15:33 +02:00
|
|
|
if (! empty($conf->global->$const_name)) // If module is activated
|
2013-10-25 18:01:45 +02:00
|
|
|
{
|
|
|
|
|
$disableSetup = 0;
|
|
|
|
|
|
|
|
|
|
print '<td align="center" valign="middle">';
|
2014-05-03 02:15:33 +02:00
|
|
|
if (! empty($objMod->disabled))
|
|
|
|
|
{
|
|
|
|
|
print $langs->trans("Disabled");
|
|
|
|
|
}
|
|
|
|
|
else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
2013-10-25 18:01:45 +02:00
|
|
|
{
|
|
|
|
|
print $langs->trans("Required");
|
|
|
|
|
if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-03-14 19:40:52 +01:00
|
|
|
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value=' . $modName . '&mode=' . $mode . $param . '">';
|
2013-10-25 18:01:45 +02:00
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
2014-05-03 02:15:33 +02:00
|
|
|
print '</a>';
|
2013-10-25 18:01:45 +02:00
|
|
|
}
|
2014-05-03 02:15:33 +02:00
|
|
|
print '</td>'."\n";
|
2013-10-25 18:01:45 +02:00
|
|
|
|
2015-11-17 00:58:12 +01:00
|
|
|
// Config link
|
2013-10-25 18:01:45 +02:00
|
|
|
if (! empty($objMod->config_page_url) && !$disableSetup)
|
|
|
|
|
{
|
|
|
|
|
if (is_array($objMod->config_page_url))
|
|
|
|
|
{
|
2016-03-30 16:07:48 +02:00
|
|
|
print '<td class="tdsetuppicto" align="right" valign="top">';
|
2013-10-25 18:01:45 +02:00
|
|
|
$i=0;
|
|
|
|
|
foreach ($objMod->config_page_url as $page)
|
|
|
|
|
{
|
|
|
|
|
$urlpage=$page;
|
|
|
|
|
if ($i++)
|
|
|
|
|
{
|
2016-03-30 16:07:48 +02:00
|
|
|
print '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page),"setup").'</a>';
|
2013-10-25 18:01:45 +02:00
|
|
|
// print '<a href="'.$page.'">'.ucfirst($page).'</a> ';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs))
|
|
|
|
|
{
|
2016-04-07 11:50:45 +02:00
|
|
|
print '<a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a>';
|
2013-10-25 18:01:45 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-04-07 11:50:45 +02:00
|
|
|
print '<a href="'.$urlpage.'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a>';
|
2013-10-25 18:01:45 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
|
|
|
|
|
{
|
2016-04-07 11:50:45 +02:00
|
|
|
print '<td class="tdsetuppicto" align="right" valign="middle"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
|
2013-10-25 18:01:45 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-04-07 11:50:45 +02:00
|
|
|
print '<td class="tdsetuppicto" align="right" valign="middle"><a href="'.$objMod->config_page_url.'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
|
2013-10-25 18:01:45 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-04-07 11:50:45 +02:00
|
|
|
print '<td class="tdsetuppicto" align="right" valign="middle">'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
2013-10-25 18:01:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2014-05-03 02:15:33 +02:00
|
|
|
else // Module not activated
|
2013-10-28 01:37:04 +01:00
|
|
|
{
|
2013-10-25 18:01:45 +02:00
|
|
|
print '<td align="center" valign="middle">';
|
2014-05-03 02:15:33 +02:00
|
|
|
if (! empty($objMod->always_enabled))
|
2013-10-25 18:01:45 +02:00
|
|
|
{
|
|
|
|
|
// Ne devrait pas arriver.
|
|
|
|
|
}
|
2014-05-03 02:15:33 +02:00
|
|
|
else if (! empty($objMod->disabled))
|
|
|
|
|
{
|
|
|
|
|
print $langs->trans("Disabled");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Module non actif
|
2016-03-14 19:40:52 +01:00
|
|
|
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value=' . $modName . '&mode=' . $mode . $param . '">';
|
2014-05-03 02:15:33 +02:00
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
|
|
|
|
print "</a>\n";
|
|
|
|
|
}
|
2015-08-28 20:17:36 +02:00
|
|
|
print "</td>\n";
|
2016-04-07 11:50:45 +02:00
|
|
|
print '<td class="tdsetuppicto" align="right" valign="middle">'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
2013-10-25 18:01:45 +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";
|
2016-11-27 14:21:23 +01:00
|
|
|
print '</div>';
|
2004-10-23 00:42:10 +02:00
|
|
|
}
|
2010-09-01 01:36:52 +02:00
|
|
|
else
|
|
|
|
|
{
|
2016-11-27 14:21:23 +01:00
|
|
|
dol_fiche_head($head, $mode, '');
|
|
|
|
|
|
2010-09-01 01:36:52 +02:00
|
|
|
// 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";
|
2016-03-14 19:40:52 +01:00
|
|
|
$url='https://www.dolistore.com';
|
2016-11-27 14:21:23 +01:00
|
|
|
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
|
2010-09-01 01:36:52 +02:00
|
|
|
print '<td>'.$langs->trans("DoliStoreDesc").'</td>';
|
2015-01-04 14:51:16 +01:00
|
|
|
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
|
2010-09-01 01:36:52 +02:00
|
|
|
print '</tr>';
|
|
|
|
|
|
2014-12-11 14:43:14 +01:00
|
|
|
$var=!$var;
|
|
|
|
|
print "<tr ".$bc[$var].">\n";
|
2016-03-14 19:40:52 +01:00
|
|
|
$url='https://partners.dolibarr.org';
|
2016-11-27 14:21:23 +01:00
|
|
|
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolibarr_preferred_partner_int.png"></a></td>';
|
2014-12-11 14:43:14 +01:00
|
|
|
print '<td>'.$langs->trans("DoliPartnersDesc").'</td>';
|
2015-01-04 14:51:16 +01:00
|
|
|
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
|
2014-12-11 14:43:14 +01:00
|
|
|
print '</tr>';
|
2010-09-01 01:36:52 +02:00
|
|
|
|
|
|
|
|
print "</table>\n";
|
|
|
|
|
|
2016-11-27 14:21:23 +01:00
|
|
|
//dol_fiche_end();
|
|
|
|
|
}
|
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
|
|
|
|
2013-03-30 14:27:13 +01:00
|
|
|
// Show warning about external users
|
2014-11-28 19:49:42 +01:00
|
|
|
if ($mode != 'marketplace') print info_admin(showModulesExludedForExternal($modules))."\n";
|
2013-02-01 17:34:19 +01:00
|
|
|
|
|
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2012-02-05 19:37:52 +01:00
|
|
|
|
|
|
|
|
$db->close();
|