diff --git a/ChangeLog b/ChangeLog index 683589961d3..07517ea3fde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -69,7 +69,7 @@ For developers: - New: Into POST forms, if you can add a parameter DOL_AUTOSET_COOKIE with a vlue that is list name, separated by a coma, of other POST parameters, Dolibarr will automatically save this parameters into user cookies. - +- New: Add hook addHomeSetup. WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index f234be227ea..e577f90b625 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -18,7 +18,7 @@ /** * \file htdocs/admin/index.php - * \brief Page d'accueil de l'espace administration/configuration + * \brief Home page of setup area */ require '../main.inc.php'; @@ -28,6 +28,9 @@ $langs->load("companies"); if (!$user->admin) accessforbidden(); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('homesetup')); + /* * View @@ -66,14 +69,11 @@ if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) print $langs->trans("SetupDescription1").' '; print $langs->trans("AreaForAdminOnly").' '; - - -//print "
"; -//print "
"; print $langs->trans("SetupDescription2")."

"; print '
'; -//print '
'; + +// Show info setup company if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit')); if (! empty($setupcompanynotcomplete)) @@ -85,7 +85,8 @@ if (! empty($setupcompanynotcomplete)) print '
'; print '
'; print '
'; -//print '
'; + +// Show info setup module print img_picto('','puce').' '.$langs->trans("SetupDescription4",DOL_URL_ROOT.'/admin/modules.php?mainmenu=home'); if (count($conf->modules) <= (empty($conf->global->MAIN_MINNB_MODULE)?1:$conf->global->MAIN_MINNB_MODULE)) // If only user module enabled { @@ -96,13 +97,19 @@ if (count($conf->modules) <= (empty($conf->global->MAIN_MINNB_MODULE)?1:$conf->g print '
'; print '
'; print '
'; -//print '
'; -print $langs->trans("SetupDescription5")."
"; -//print '
'; -print "
"; -// Show logo -print '
'; +// Add hook to add information +$reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +print $hookmanager->resPrint; +if (empty($reshook)) +{ + // Show into other + print $langs->trans("SetupDescription5")."
"; + print "
"; + + // Show logo + print '
'; +} llxFooter();