dolibarr  7.0.0-beta
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
25 require '../main.inc.php';
26 
27 $langs->load("admin");
28 $langs->load("companies");
29 
30 if (!$user->admin) accessforbidden();
31 
32 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
33 $hookmanager->initHooks(array('homesetup'));
34 
35 
36 /*
37  * View
38  */
39 
40 $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
41 llxHeader('',$langs->trans("Setup"),$wikihelp);
42 
43 $form = new Form($db);
44 
45 
46 print load_fiche_titre($langs->trans("SetupArea"),'','title_setup.png');
47 
48 
49 if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
50 {
51  $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i','<br>',$conf->global->MAIN_MOTD_SETUPPAGE);
52  if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
53  {
54  $i=0;
55  while (preg_match('/__\(([a-zA-Z|@]+)\)__/i',$conf->global->MAIN_MOTD_SETUPPAGE,$reg) && $i < 100)
56  {
57  $tmp=explode('|',$reg[1]);
58  if (! empty($tmp[1])) $langs->load($tmp[1]);
59  $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/__\('.preg_quote($reg[1]).'\)__/i',$langs->trans($tmp[0]),$conf->global->MAIN_MOTD_SETUPPAGE);
60  $i++;
61  }
62 
63  print "\n<!-- Start of welcome text for setup page -->\n";
64  print '<table width="100%" class="notopnoleftnoright"><tr><td>';
65  print dol_htmlentitiesbr($conf->global->MAIN_MOTD_SETUPPAGE);
66  print '</td></tr></table><br>';
67  print "\n<!-- End of welcome text for setup page -->\n";
68  }
69 }
70 
71 print $langs->trans("SetupDescription1").' ';
72 print $langs->trans("AreaForAdminOnly").' ';
73 print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."<br><br>";
74 
75 print '<br>';
76 
77 // Show info setup company
78 if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
79 print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
80 if (! empty($setupcompanynotcomplete))
81 {
82  $langs->load("errors");
83  $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"');
84  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>';
85 }
86 print '<br>';
87 print '<br>';
88 print '<br>';
89 
90 // Show info setup module
91 print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules"));
92 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
93 {
94  $langs->load("errors");
95  $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"');
96  print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
97 }
98 print '<br>';
99 print '<br>';
100 print '<br>';
101 print '<br>';
102 
103 // Add hook to add information
104 $parameters=array();
105 $reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
106 print $hookmanager->resPrint;
107 if (empty($reshook))
108 {
109  // Show into other
110  print $langs->trans("SetupDescription5")."<br>";
111  print "<br>";
112 
113  // Show logo
114  print '<div class="center"><div class="logo_setup"></div></div>';
115 }
116 
117 
118 llxFooter();
119 
120 $db->close();
llxFooter()
Footer empty.
Definition: index.php:43
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)
if(empty($reshook)) $form
View.
Definition: perms.php:103
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage generation of HTML components Only common components must be here.
img_warning($titlealt= 'default', $moreatt= '')
Show warning logo.
llxHeader()
Header empty.
Definition: index.php:37
if(GETPOST('button_removefilter_x','alpha')||GETPOST('button_removefilter.x','alpha')||GETPOST('button_removefilter','alpha')) if($action=="save"&&empty($cancel)) if(preg_match('/set_(.*)/', $action, $reg)) if(preg_match('/del_(.*)/', $action, $reg) $wikihelp)
View.
Definition: agenda.php:143
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
print
Draft customers invoices.
Definition: index.php:91
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...