dolibarr/htdocs/admin/index.php

119 lines
4.2 KiB
PHP
Raw Normal View History

<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
2012-03-10 13:52:08 +01:00
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
2003-01-18 18:15:23 +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 3 of the License, or
2003-01-18 18:15:23 +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-01-18 18:15:23 +01:00
*/
/**
* \file htdocs/admin/index.php
2013-08-05 10:10:44 +02:00
* \brief Home page of setup area
*/
require '../main.inc.php';
2003-01-18 18:15:23 +01:00
$langs->load("admin");
$langs->load("companies");
2012-03-10 13:52:08 +01:00
if (!$user->admin) accessforbidden();
2013-08-05 10:10:44 +02:00
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('homesetup'));
/*
2009-01-21 14:20:26 +01:00
* View
*/
2009-05-18 01:54:07 +02:00
$wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
2010-05-26 13:42:29 +02:00
llxHeader('',$langs->trans("Setup"),$wikihelp);
2004-07-21 11:08:44 +02:00
$form = new Form($db);
print_fiche_titre($langs->trans("SetupArea"),'','setup');
if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
{
$conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i','<br>',$conf->global->MAIN_MOTD_SETUPPAGE);
if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
{
$i=0;
while (preg_match('/__\(([a-zA-Z|@]+)\)__/i',$conf->global->MAIN_MOTD_SETUPPAGE,$reg) && $i < 100)
{
$tmp=explode('|',$reg[1]);
if (! empty($tmp[1])) $langs->load($tmp[1]);
$conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/__\('.preg_quote($reg[1]).'\)__/i',$langs->trans($tmp[0]),$conf->global->MAIN_MOTD_SETUPPAGE);
$i++;
}
print "\n<!-- Start of welcome text for setup page -->\n";
print '<table width="100%" class="notopnoleftnoright"><tr><td>';
print dol_htmlentitiesbr($conf->global->MAIN_MOTD_SETUPPAGE);
print '</td></tr></table><br>';
print "\n<!-- End of welcome text for setup page -->\n";
}
}
print $langs->trans("SetupDescription1").' ';
2009-09-07 03:06:05 +02:00
print $langs->trans("AreaForAdminOnly").' ';
print $langs->trans("SetupDescription2")."<br><br>";
print '<br>';
2013-08-05 10:10:44 +02:00
// Show info setup company
2013-02-25 17:56:41 +01:00
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
2013-01-14 15:18:15 +01:00
print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'));
if (! empty($setupcompanynotcomplete))
2012-10-18 10:36:53 +02:00
{
$langs->load("errors");
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
2013-01-20 15:37:33 +01:00
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit').'">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
}
print '<br>';
print '<br>';
2009-08-20 03:39:54 +02:00
print '<br>';
2013-08-05 10:10:44 +02:00
// Show info setup module
print img_picto('','puce').' '.$langs->trans("SetupDescription4",DOL_URL_ROOT.'/admin/modules.php?mainmenu=home');
2014-02-02 19:00:56 +01:00
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
{
$langs->load("errors");
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
2013-01-20 15:37:33 +01:00
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
}
print '<br>';
print '<br>';
2009-08-20 03:39:54 +02:00
print '<br>';
2014-02-02 19:00:56 +01:00
print '<br>';
2013-08-05 10:10:44 +02:00
// Add hook to add information
$reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
print $hookmanager->resPrint;
if (empty($reshook))
{
// Show into other
print $langs->trans("SetupDescription5")."<br>";
print "<br>";
// Show logo
print '<center><div class="logo_setup"></div></center>';
}
2003-01-18 18:15:23 +01:00
2009-08-24 21:29:52 +02:00
llxFooter();
2013-01-10 18:50:07 +01:00
$db->close();