dolibarr  13.0.2
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 <https://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 $form = new Form($db);
41 
42 $wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
43 llxHeader('', $langs->trans("Setup"), $wikihelp);
44 
45 
46 print load_fiche_titre($langs->trans("SetupArea"), '', 'tools');
47 
48 if (!empty($conf->global->MAIN_MOTD_SETUPPAGE))
49 {
50  $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', '<br>', $conf->global->MAIN_MOTD_SETUPPAGE);
51  if (!empty($conf->global->MAIN_MOTD_SETUPPAGE))
52  {
53  $i = 0;
54  while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100)
55  {
56  $tmp = explode('|', $reg[1]);
57  if (!empty($tmp[1])) $langs->load($tmp[1]);
58  $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/__\('.preg_quote($reg[1]).'\)__/i', $langs->trans($tmp[0]), $conf->global->MAIN_MOTD_SETUPPAGE);
59  $i++;
60  }
61 
62  print "\n<!-- Start of welcome text for setup page -->\n";
63  print '<table width="100%" class="notopnoleftnoright"><tr><td>';
64  print dol_htmlentitiesbr($conf->global->MAIN_MOTD_SETUPPAGE);
65  print '</td></tr></table><br>';
66  print "\n<!-- End of welcome text for setup page -->\n";
67  }
68 }
69 
70 print '<span class="opacitymedium hideonsmartphone">';
71 print $langs->trans("SetupDescription1").' ';
72 print $langs->trans("AreaForAdminOnly").' ';
73 print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"));
74 print "<br><br>";
75 print '</span>';
76 
77 print '<br>';
78 
79 // Show info setup company
80 if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete = 1;
81 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"));
82 if (!empty($setupcompanynotcomplete))
83 {
84  $langs->load("errors");
85  $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"');
86  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>';
87 }
88 print '<br>';
89 print '<br>';
90 print '<br>';
91 
92 // Show info setup module
93 print img_picto('', 'puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules"));
94 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
95 {
96  $langs->load("errors");
97  $warnpicto = img_warning($langs->trans("WarningEnableYourModulesApplications"), 'style="padding-right: 6px;"');
98  print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans("WarningEnableYourModulesApplications").'</a></div>';
99 }
100 print '<br>';
101 print '<br>';
102 print '<br>';
103 print '<br>';
104 
105 // Add hook to add information
106 $parameters = array();
107 $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
108 print $hookmanager->resPrint;
109 if (empty($reshook))
110 {
111  // Show into other
112  print '<span class="opacitymedium">'.$langs->trans("SetupDescription5")."</span><br>";
113  print "<br>";
114 
115  // Show logo
116  print '<div class="center"><div class="logo_setup"></div></div>';
117 }
118 
119 // End of page
120 llxFooter();
121 $db->close();
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_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
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
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage generation of HTML components Only common components must be here.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print
Draft customers invoices.
Definition: index.php:89
llxFooter()
Empty footer.
Definition: wrapper.php:59