27require
'../main.inc.php';
38$langs->loadLangs(array(
'admin',
'companies'));
47$hookmanager->initHooks(array(
'homesetup'));
54$wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
55llxHeader(
'', $langs->trans(
"Setup"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-index');
62 $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace(
'/<br(\s[\sa-zA-Z_="]*)?\/?>/i',
'<br>',
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'));
66 while (preg_match(
'/__\(([a-zA-Z|@]+)\)__/i',
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'), $reg) && $i < 100) {
67 $tmp = explode(
'|', $reg[1]);
68 if (!empty($tmp[1])) {
69 $langs->load($tmp[1]);
71 $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace(
'/__\('.preg_quote($reg[1],
'/').
'\)__/i', $langs->trans($tmp[0]),
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'));
75 print
"\n<!-- Start of welcome text for setup page -->\n";
76 print
'<table class="centpercent notopnoleftnoright"><tr><td>';
78 print
'</td></tr></table><br>';
79 print
"\n<!-- End of welcome text for setup page -->\n";
83print
'<span class="opacitymedium hideonsmartphone">';
84print $langs->trans(
"SetupDescription1").
'<br>';
87 $setupcompanynotcomplete = 1;
89 $setupcompanynotcomplete = 0;
92if ($setupcompanynotcomplete) {
93 print $langs->trans(
"SetupDescription2", $langs->transnoentities(
"MenuCompanySetup"), $langs->transnoentities(
"Modules"));
102$constkey =
'MAIN_INFO_SETUP_FOR_COUNTRY_'.$mysoc->country_code;
105 $langs->load(
"errors");
106 $warnpicto =
img_warning(
'',
'style="padding-right: 6px;"');
107 print
'<div class="warning noshadow">'.$warnpicto.$langs->trans(
getDolGlobalString($constkey)).
'</div>';
116print
'<section class="setupsection setupcompany cursorpointer">';
118print
img_picto(
'',
'company',
'class="paddingright valignmiddle double"');
120print
'<a class="nounderlineimp fontsize-1-1" href="'.DOL_URL_ROOT.
'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ?
'' :
'&action=edit&token='.newToken()).
'">'.$langs->transnoentities(
"Setup").
' - '.$langs->transnoentities(
"MenuCompanySetup").
'</a>';
122print $langs->trans(
"SetupDescription3b");
123if (!empty($setupcompanynotcomplete)) {
124 $langs->load(
"errors");
125 $warnpicto =
img_warning($langs->trans(
"WarningMandatorySetupNotComplete"),
'style="padding-right: 10px;"');
126 print
'<br><div class="warning marginrightonly"><a class="warning" href="'.DOL_URL_ROOT.
'/admin/company.php?mainmenu=home&action=edit&token='.newToken().
'">'.$warnpicto.$langs->trans(
"WarningMandatorySetupNotComplete").
'</a></div>';
138print
'<section class="setupsection setupmodules cursorpointer">';
141$nbmodulesnotautoenabled = count(
$conf->modules);
142$listofmodulesautoenabled = array(
'user',
'agenda',
'fckeditor',
'export',
'import');
143foreach ($listofmodulesautoenabled as $moduleautoenable) {
144 if (in_array($moduleautoenable,
$conf->modules)) {
145 $nbmodulesnotautoenabled--;
150print
img_picto(
'',
'cog',
'class="paddingright valignmiddle double"');
152print
'<a class="nounderlineimp fontsize-1-1" href="'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home">'.$langs->transnoentities(
"Setup").
' - '.$langs->transnoentities(
"Modules").
'</a>';
153print
'<br><br>'.$langs->trans(
"SetupDescription4b");
154if ($nbmodulesnotautoenabled <
getDolGlobalInt(
'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) {
155 $langs->load(
"errors");
156 $warnpicto =
img_warning($langs->trans(
"WarningEnableYourModulesApplications"),
'style="padding-right: 10px;"');
157 print
'<br><div class="warning marginrightonly"><a class="warning" href="'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans(
"WarningEnableYourModulesApplications").
'</a></div>';
168$arrayofeinvoiceneed = array(
169 'FR' => array(
'module' => array(
'einvoice',
'pdpconnectfr'),
'search' =>
'e-invoice'),
170 'ES' => array(
'search' =>
'veri factu'),
171 'BE' => array(
'search' =>
'peppol'),
172 'PL' => array(
'module' => array(
'ksef'),
'search' =>
'ksef')
177if (
$mysoc->country_code && in_array(
$mysoc->country_code, array_keys($arrayofeinvoiceneed))) {
178 $einvoiceneed = $arrayofeinvoiceneed[
$mysoc->country_code];
180 if (!empty($einvoiceneed[
'module'])) {
181 foreach ($einvoiceneed[
'module'] as $module) {
183 $modulefound = $module;
189 $urleinvoice = DOL_URL_ROOT.
'/admin/modules.php?mode=marketplace&search_keyword='.urlencode($einvoiceneed[
'search']);
191 $urleinvoice = DOL_URL_ROOT.
'/admin/modules.php?search_keyword='.urlencode($modulefound);
194 print
'<section class="setupsection setupeinvoice cursorpointer">';
196 print
img_picto(
'',
'bill',
'class="paddingright valignmiddle double"');
198 print
'<a class="nounderlineimp fontsize-1-1" href="'.$urleinvoice.
'">'.$langs->transnoentities(
"EInvoice").
'</a>';
200 print
'<br><br>'.$langs->trans(
"AnEInvoiceModuleHasBeenEnabled",
$mysoc->country_code);
202 print
'<br><br>'.$langs->trans(
"SetupDescriptionEInvoice",
$mysoc->country_code);
213 $(document).ready(function(){
214 $(".setupcompany").click(function() {
215 event.preventDefault();
216 console.log("we click on setupcompany");
217 window.location.href = "'.DOL_URL_ROOT.
'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ?
'' :
'&action=edit').
'";
219 $(".setupmodules").click(function() {
220 event.preventDefault();
221 console.log("we click on setupmodules");
222 window.location.href = "'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home";
224 $(".setupeinvoice").click(function() {
225 event.preventDefault();
226 console.log("we click on setupeinvoice");
227 window.location.href = "'.$urleinvoice.
'";
233$parameters = array();
235$reshook = $hookmanager->executeHooks(
'addHomeSetup', $parameters, $object, $action);
236print $hookmanager->resPrint;
237if (empty($reshook)) {
240 print
'<br class="hideonsmartphone">';
243 print
'<div class="center"><div class="logo_setup"></div></div>';
if(! $sortfield) if(! $sortorder) $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.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.