28require
'../main.inc.php';
39$langs->loadLangs(array(
'admin',
'bills',
'companies'));
48$hookmanager->initHooks(array(
'homesetup'));
55$wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
56llxHeader(
'', $langs->trans(
"Setup"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-index');
63 $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace(
'/<br(\s[\sa-zA-Z_="]*)?\/?>/i',
'<br>',
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'));
67 while (preg_match(
'/__\(([a-zA-Z|@]+)\)__/i',
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'), $reg) && $i < 100) {
68 $tmp = explode(
'|', $reg[1]);
69 if (!empty($tmp[1])) {
70 $langs->load($tmp[1]);
72 $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace(
'/__\('.preg_quote($reg[1],
'/').
'\)__/i', $langs->trans($tmp[0]),
getDolGlobalString(
'MAIN_MOTD_SETUPPAGE'));
76 print
"\n<!-- Start of welcome text for setup page -->\n";
77 print
'<table class="centpercent notopnoleftnoright"><tr><td>';
79 print
'</td></tr></table><br>';
80 print
"\n<!-- End of welcome text for setup page -->\n";
84print
'<span class="opacitymedium hideonsmartphone">';
85print $langs->trans(
"SetupDescription1").
'<br>';
88 $setupcompanynotcomplete = 1;
90 $setupcompanynotcomplete = 0;
93if ($setupcompanynotcomplete) {
94 print $langs->trans(
"SetupDescription2", $langs->transnoentities(
"MenuCompanySetup"), $langs->transnoentities(
"Modules"));
103$constkey =
'MAIN_INFO_SETUP_FOR_COUNTRY_'.$mysoc->country_code;
106 $langs->load(
"errors");
107 $warnpicto = img_warning(
'',
'style="padding-right: 6px;"');
108 print
'<div class="warning noshadow">'.$warnpicto.$langs->trans(
getDolGlobalString($constkey)).
'</div>';
117print
'<section class="setupsection setupcompany cursorpointer">';
119print img_picto(
'',
'company',
'class="paddingright valignmiddle double"');
121print
'<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>';
123print $langs->trans(
"SetupDescription3b");
124if (!empty($setupcompanynotcomplete)) {
125 $langs->load(
"errors");
126 $warnpicto = img_warning($langs->trans(
"WarningMandatorySetupNotComplete"),
'style="padding-right: 10px;"');
127 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>';
139print
'<section class="setupsection setupmodules cursorpointer">';
142$nbmodulesnotautoenabled = count(
$conf->modules);
143$listofmodulesautoenabled = array(
'user',
'agenda',
'fckeditor',
'export',
'import');
144foreach ($listofmodulesautoenabled as $moduleautoenable) {
145 if (in_array($moduleautoenable,
$conf->modules)) {
146 $nbmodulesnotautoenabled--;
151print img_picto(
'',
'cog',
'class="paddingright valignmiddle double"');
153print
'<a class="nounderlineimp fontsize-1-1" href="'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home">'.$langs->transnoentities(
"Setup").
' - '.$langs->transnoentities(
"Modules").
'</a>';
154print
'<br><br>'.$langs->trans(
"SetupDescription4b");
155if ($nbmodulesnotautoenabled <
getDolGlobalInt(
'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) {
156 $langs->load(
"errors");
157 $warnpicto = img_warning($langs->trans(
"WarningEnableYourModulesApplications"),
'style="padding-right: 10px;"');
158 print
'<br><div class="warning marginrightonly"><a class="warning" href="'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans(
"WarningEnableYourModulesApplications").
'</a></div>';
172$arrayofeinvoiceneed = array(
173 'FR' => array(
'module' => array(
'einvoice',
'pdpconnectfr'),
'search' =>
'e-invoice'),
174 'ES' => array(
'search' =>
'verifactu'),
175 'BE' => array(
'search' =>
'peppol'),
176 'PL' => array(
'module' => array(
'ksef'),
'search' =>
'ksef'),
178 'issue' => array(
'label' =>
'EInvoiceIssueCustomerInvoices',
'search' =>
'einvoice-issue-de'),
179 'receive' => array(
'label' =>
'EInvoiceReceiveSupplierInvoices',
'search' =>
'einvoice-receive-de')
185if (
$mysoc->country_code && in_array(
$mysoc->country_code, array_keys($arrayofeinvoiceneed))) {
186 $einvoiceneeds = $arrayofeinvoiceneed[
$mysoc->country_code];
187 if (isset($einvoiceneeds[
'search'])) {
188 $einvoiceneeds = array($einvoiceneeds);
191 foreach ($einvoiceneeds as $direction => $einvoiceneed) {
192 $modules = empty($einvoiceneed[
'module']) ? array() : $einvoiceneed[
'module'];
193 foreach (empty(
$conf->modules_parts[
'einvoice']) ? array() :
$conf->modules_parts[
'einvoice'] as
$module => $declared) {
194 '@phan-var-force array<string,string[]>|string $declared';
195 if (is_array($declared) && !empty($declared[
$mysoc->country_code]) && (is_int($direction) || in_array($direction, (array) $declared[
$mysoc->country_code]))) {
200 foreach ($modules as
$module) {
207 $url = DOL_URL_ROOT.
'/admin/modules.php?mode=marketplace&search_keyword='.urlencode($einvoiceneed[
'search']);
209 $url = DOL_URL_ROOT.
'/admin/modules.php?search_keyword='.urlencode($modulefound);
211 if (!$modulefound || !$urleinvoice) {
214 $einvoicetext .=
'<br><br>'.(empty($einvoiceneed[
'label']) ?
'' : $langs->trans($einvoiceneed[
'label']).
': ');
216 $einvoicetext .= $langs->trans(
"AnEInvoiceModuleHasBeenEnabled",
$mysoc->country_code);
218 $einvoicetext .= $langs->trans(
"SetupDescriptionEInvoice",
$mysoc->country_code);
222 print
'<section class="setupsection setupeinvoice cursorpointer">';
224 print img_picto(
'',
'bill',
'class="paddingright valignmiddle double"');
226 print
'<a class="nounderlineimp fontsize-1-1" href="'.$urleinvoice.
'">'.$langs->transnoentities(
"EInvoice").
'</a>';
237 $(document).ready(function(){
238 $(".setupcompany").click(function() {
239 event.preventDefault();
240 console.log("we click on setupcompany");
241 window.location.href = "'.DOL_URL_ROOT.
'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ?
'' :
'&action=edit').
'";
243 $(".setupmodules").click(function() {
244 event.preventDefault();
245 console.log("we click on setupmodules");
246 window.location.href = "'.DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home";
248 $(".setupeinvoice").click(function() {
249 event.preventDefault();
250 console.log("we click on setupeinvoice");
251 window.location.href = "'.$urleinvoice.
'";
257$parameters = array();
259$reshook = $hookmanager->executeHooks(
'addHomeSetup', $parameters, $object, $action);
260print $hookmanager->resPrint;
261if (empty($reshook)) {
264 print
'<br class="hideonsmartphone">';
267 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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(! $sortfield) if(! $sortorder) $module
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.