27require
'../main.inc.php';
38$langs->loadLangs(array(
'admin',
'companies'));
47$hookmanager->initHooks(array(
'homesetup'));
56$wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
57llxHeader(
'', $langs->trans(
"Setup"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-index');
64 $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace(
'/<br(\s[\sa-zA-Z_="]*)?\/?>/i',
'<br>',
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'));
68 while (preg_match(
'/__\(([a-zA-Z|@]+)\)__/i',
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'), $reg) && $i < 100) {
69 $tmp = explode(
'|', $reg[1]);
70 if (!empty($tmp[1])) {
71 $langs->load($tmp[1]);
73 $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace(
'/__\('.preg_quote($reg[1]).
'\)__/i', $langs->trans($tmp[0]),
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'));
77 print
"\n<!-- Start of welcome text for setup page -->\n";
78 print
'<table class="centpercent notopnoleftnoright"><tr><td>';
80 print
'</td></tr></table><br>';
81 print
"\n<!-- End of welcome text for setup page -->\n";
85print
'<span class="opacitymedium hideonsmartphone">';
86print $langs->trans(
"SetupDescription1").
' ';
87print $langs->trans(
"AreaForAdminOnly").
' ';
88print $langs->trans(
"SetupDescription2", $langs->transnoentities(
"MenuCompanySetup"), $langs->transnoentities(
"Modules"));
94$constkey =
'MAIN_INFO_SETUP_FOR_COUNTRY_'.$mysoc->country_code;
97 $langs->load(
"errors");
98 $warnpicto =
img_warning(
'',
'style="padding-right: 6px;"');
99 print
'<div class="warning">'.$warnpicto.$langs->trans(
getDolGlobalString($constkey)).
'</div>';
109 $setupcompanynotcomplete = 1;
112print
'<section class="setupsection setupcompany cursorpointer">';
114print
img_picto(
'',
'company',
'class="paddingright valignmiddle double"');
116print
'<a class="nounderlineimp" href="'.DOL_URL_ROOT.
'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ?
'' :
'&action=edit&token='.newToken()).
'">'.$langs->transnoentities(
"Setup").
' - '.$langs->transnoentities(
"MenuCompanySetup").
'</a>';
118print $langs->trans(
"SetupDescription3b");
119if (!empty($setupcompanynotcomplete)) {
120 $langs->load(
"errors");
121 $warnpicto =
img_warning($langs->trans(
"WarningMandatorySetupNotComplete"),
'style="padding-right: 6px;"');
122 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>';
134print
'<section class="setupsection setupmodules cursorpointer">';
137$nbmodulesnotautoenabled = count(
$conf->modules);
138$listofmodulesautoenabled = array(
'user',
'agenda',
'fckeditor',
'export',
'import');
139foreach ($listofmodulesautoenabled as $moduleautoenable) {
140 if (in_array($moduleautoenable,
$conf->modules)) {
141 $nbmodulesnotautoenabled--;
146print
img_picto(
'',
'cog',
'class="paddingright valignmiddle double"');
148print
'<a class="nounderlineimp" href="'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home">'.$langs->transnoentities(
"Setup").
' - '.$langs->transnoentities(
"Modules").
'</a>';
149print
'<br><br>'.$langs->trans(
"SetupDescription4b");
150if ($nbmodulesnotautoenabled <
getDolGlobalInt(
'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) {
151 $langs->load(
"errors");
152 $warnpicto =
img_warning($langs->trans(
"WarningEnableYourModulesApplications"),
'style="padding-right: 6px;"');
153 print
'<br><div class="warning"><a href="'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans(
"WarningEnableYourModulesApplications").
'</a></div>';
164 $(document).ready(function(){
165 $(".setupcompany").click(function() {
166 event.preventDefault();
167 console.log("we click on setupcompany");
168 window.location.href = "'.DOL_URL_ROOT.
'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ?
'' :
'&action=edit').
'";
170 $(".setupmodules").click(function() {
171 event.preventDefault();
172 console.log("we click on setupmodules");
173 window.location.href = "'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home";
179$parameters = array();
181$reshook = $hookmanager->executeHooks(
'addHomeSetup', $parameters, $object, $action);
182print $hookmanager->resPrint;
183if (empty($reshook)) {
186 print
'<br class="hideonsmartphone">';
189 print
'<div class="center"><div class="logo_setup"></div></div>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.