26 require
'../main.inc.php';
29 $langs->loadLangs(array(
'admin',
'companies'));
38 $hookmanager->initHooks(array(
'homesetup'));
47 $wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
54 if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) {
55 $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace(
'/<br(\s[\sa-zA-Z_="]*)?\/?>/i',
'<br>', $conf->global->MAIN_MOTD_SETUPPAGE);
56 if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) {
59 while (preg_match(
'/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100) {
60 $tmp = explode(
'|', $reg[1]);
61 if (!empty($tmp[1])) {
62 $langs->load($tmp[1]);
64 $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace(
'/__\('.preg_quote($reg[1]).
'\)__/i', $langs->trans($tmp[0]), $conf->global->MAIN_MOTD_SETUPPAGE);
68 print
"\n<!-- Start of welcome text for setup page -->\n";
69 print
'<table width="100%" class="notopnoleftnoright"><tr><td>';
71 print
'</td></tr></table><br>';
72 print
"\n<!-- End of welcome text for setup page -->\n";
76 print
'<span class="opacitymedium hideonsmartphone">';
77 print $langs->trans(
"SetupDescription1").
' ';
78 print $langs->trans(
"AreaForAdminOnly").
' ';
79 print $langs->trans(
"SetupDescription2", $langs->transnoentities(
"MenuCompanySetup"), $langs->transnoentities(
"Modules"));
86 if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY) || !empty($conf->global->MAIN_INFO_SOCIETE_SETUP_TODO_WARNING)) {
87 $setupcompanynotcomplete = 1;
90 print
'<section class="setupsection">';
92 print
img_picto(
'',
'company',
'class="paddingright valignmiddle double"').
' '.$langs->trans(
"SetupDescriptionLink", DOL_URL_ROOT.
'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ?
'' :
'&action=edit&token='.
newToken()), $langs->transnoentities(
"Setup"), $langs->transnoentities(
"MenuCompanySetup"));
94 print $langs->trans(
"SetupDescription3b");
95 if (!empty($setupcompanynotcomplete)) {
96 $langs->load(
"errors");
97 $warnpicto =
img_warning($langs->trans(
"WarningMandatorySetupNotComplete"),
'style="padding-right: 6px;"');
98 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>';
106 print
'<section class="setupsection">';
108 $nbmodulesnotautoenabled = count($conf->modules);
109 if (in_array(
'fckeditor', $conf->modules)) $nbmodulesnotautoenabled--;
110 if (in_array(
'export', $conf->modules)) $nbmodulesnotautoenabled--;
111 if (in_array(
'import', $conf->modules)) $nbmodulesnotautoenabled--;
114 print
img_picto(
'',
'cog',
'class="paddingright valignmiddle double"').
' '.$langs->trans(
"SetupDescriptionLink", DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home', $langs->transnoentities(
"Setup"), $langs->transnoentities(
"Modules"));
115 print
'<br><br>'.$langs->trans(
"SetupDescription4b");
116 if ($nbmodulesnotautoenabled <=
getDolGlobalInt(
'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) {
117 $langs->load(
"errors");
118 $warnpicto =
img_warning($langs->trans(
"WarningEnableYourModulesApplications"),
'style="padding-right: 6px;"');
119 print
'<br><div class="warning"><a href="'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans(
"WarningEnableYourModulesApplications").
'</a></div>';
129 $parameters = array();
130 $object =
new stdClass();
131 $reshook = $hookmanager->executeHooks(
'addHomeSetup', $parameters, $object, $action);
132 print $hookmanager->resPrint;
133 if (empty($reshook)) {
136 print
'<br class="hideonsmartphone">';
139 print
'<div class="center"><div class="logo_setup"></div></div>';