dolibarr  9.0.0
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 // Load translation files required by the page
28 $langs->loadLangs(array('admin', '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 
93 /*
94 $nbofactivatedmodules=count($conf->modules);
95 $moreinfo=$langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1), count($modules));
96 if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule"));
97 print '<br>'.$moreinfo;
98 */
99 
100 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
101 {
102  $langs->load("errors");
103  $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"');
104  print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
105 }
106 print '<br>';
107 print '<br>';
108 print '<br>';
109 print '<br>';
110 
111 // Add hook to add information
112 $parameters=array();
113 $reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
114 print $hookmanager->resPrint;
115 if (empty($reshook))
116 {
117  // Show into other
118  print $langs->trans("SetupDescription5")."<br>";
119  print "<br>";
120 
121  // Show logo
122  print '<div class="center"><div class="logo_setup"></div></div>';
123 }
124 
125 // End of page
126 llxFooter();
127 $db->close();
llxFooter()
Footer empty.
Definition: index.php:44
img_warning($titlealt='default', $moreatt='')
Show warning logo.
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
print
Draft customers invoices.
Definition: index.php:91
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.
llxHeader()
Header empty.
Definition: index.php:36
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...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it&#39;s its name (generic function)
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $wikihelp
View.
Definition: agenda.php:120