diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 1549a2603b6..5e44d9768ad 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2668,10 +2668,10 @@ function img_searchclear($titlealt = 'default', $other = '')
* @param string $text Text info
* @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
* @param int $nodiv No div
- * @param int $admin 1=Info for admin users. 0=Info for standard users (change only the look)
+ * @param string $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'xxx'=Other
* @return string String with info text
*/
-function info_admin($text, $infoonimgalt = 0, $nodiv=0, $admin=1)
+function info_admin($text, $infoonimgalt = 0, $nodiv=0, $admin='1')
{
global $conf, $langs;
@@ -2680,7 +2680,7 @@ function info_admin($text, $infoonimgalt = 0, $nodiv=0, $admin=1)
return img_picto($text, 'info', 'class="hideonsmartphone"');
}
- return ($nodiv?'':'
').img_picto($admin?$langs->trans('InfoAdmin'):$langs->trans('Note'), ($nodiv?'info':'info_black'), 'class="hideonsmartphone"').' '.$text.($nodiv?'':'
');
+ return ($nodiv?'':'').img_picto($admin?$langs->trans('InfoAdmin'):$langs->trans('Note'), ($nodiv?'info':'info_black'), 'class="hideonsmartphone"').' '.$text.($nodiv?'':'
');
}
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 39a8241b465..e27ca3e596a 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -17,7 +17,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('mailing|export|import|opensurvey', '$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read', '', 2, 90, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 110, __ENTITY__);
-insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/hrm.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
+insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
-- Home - Dashboard
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'Dashboard', 0, '', '', '', 2, 0, __ENTITY__);
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 41a556c6a30..a3f9c04a666 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -237,9 +237,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
$idsel='hrm';
if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode);
- if (empty($noout)) print_text_menu_entry($langs->trans("HRM"), $showmode, DOL_URL_ROOT.'/hrm/hrm.php?mainmenu=hrm&leftmenu=', $id, $idsel, $classname, $atarget);
+ if (empty($noout)) print_text_menu_entry($langs->trans("HRM"), $showmode, DOL_URL_ROOT.'/hrm/index.php?mainmenu=hrm&leftmenu=', $id, $idsel, $classname, $atarget);
if (empty($noout)) print_end_menu_entry($showmode);
- $menu->add('/hrm/hrm.php?mainmenu=hrm&leftmenu=', $langs->trans("HRM"), 0, $showmode, $atarget, "hrm", '');
+ $menu->add('/hrm/index.php?mainmenu=hrm&leftmenu=', $langs->trans("HRM"), 0, $showmode, $atarget, "hrm", '');
}
diff --git a/htdocs/hrm/hrm.php b/htdocs/hrm/index.php
similarity index 99%
rename from htdocs/hrm/hrm.php
rename to htdocs/hrm/index.php
index cc2366d7e4c..9f1ecaa6c5d 100644
--- a/htdocs/hrm/hrm.php
+++ b/htdocs/hrm/index.php
@@ -19,7 +19,7 @@
*/
/**
- * \file htdocs/hrm/hrm.php
+ * \file htdocs/hrm/index.php
* \ingroup hrm
* \brief Home page for HRM area.
*/
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index c8e5549ce3f..48de4bda8fc 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1603,3 +1603,4 @@ UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received i
ListOfAvailableAPIs=List of available APIs
activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is missing, so module "%1$s" may not work correclty. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise
CommandIsNotInsideAllowedCommands=The command you try to run is not inside list of allowed commands defined into parameter $dolibarr_main_restrict_os_commands into conf.php file.
+LandingPage=Landing page
\ No newline at end of file
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 4d254349a7d..f0ca0f17c31 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -32,6 +32,8 @@ $langs->load("products");
$langs->load("admin");
$langs->load("users");
$langs->load("languages");
+$langs->load("projects");
+$langs->load("members");
// Defini si peux lire/modifier permisssions
$canreaduser=($user->admin || $user->rights->user->user->lire);
@@ -91,6 +93,12 @@ if (empty($reshook)) {
if (!$_POST["cancel"]) {
$tabparam = array();
+ if (GETPOST("check_MAIN_LANDING_PAGE") == "on") {
+ $tabparam["MAIN_LANDING_PAGE"] = $_POST["MAIN_LANDING_PAGE"];
+ } else {
+ $tabparam["MAIN_LANDING_PAGE"] = '';
+ }
+
if (GETPOST("check_MAIN_LANG_DEFAULT") == "on") {
$tabparam["MAIN_LANG_DEFAULT"] = $_POST["main_lang_default"];
} else {
@@ -145,6 +153,17 @@ if (empty($reshook)) {
llxHeader();
+// List of possible landing pages
+$tmparray=array('index.php'=>'Dashboard');
+if (! empty($conf->societe->enabled)) $tmparray['societe/index.php?mainmenu=companies&leftmenu=']='ThirdPartiesArea';
+if (! empty($conf->projet->enabled)) $tmparray['projet/index.php?mainmenu=project&leftmenu=']='ProjectsArea';
+if (! empty($conf->holiday->enabled) || ! empty($conf->expensereport->enabled)) $tmparray['hrm/index.php?mainmenu=hrm&leftmenu=']='HRMArea'; // TODO Complete list with first level of menus
+if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) $tmparray['product/index.php?mainmenu=products&leftmenu=']='ProductsAndServicesArea';
+if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea';
+if (! empty($conf->compta->enabled) || ! empty($conf->accounting->enabled)) $tmparray['compta/index.php?mainmenu=compta&leftmenu=']='AccountancyTreasuryArea';
+if (! empty($conf->adherent->enabled)) $tmparray['adherents/index.php?mainmenu=members&leftmenu=']='MembersArea';
+if (! empty($conf->agenda->enabled)) $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu=']='Agenda';
+
$head = user_prepare_head($object);
$title = $langs->trans("User");
@@ -186,7 +205,10 @@ if ($action == 'edit')
jQuery(document).ready(function() {
function init_myfunc()
{
- if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); }
+ if (jQuery("#check_MAIN_LANDING_PAGE").prop("checked")) { jQuery("#MAIN_LANDING_PAGE").removeAttr(\'disabled\'); }
+ else { jQuery("#MAIN_LANDING_PAGE").attr(\'disabled\',\'disabled\'); }
+
+ if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); }
else { jQuery("#main_lang_default").attr(\'disabled\',\'disabled\'); }
if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
@@ -199,7 +221,8 @@ if ($action == 'edit')
else { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").attr(\'disabled\',\'disabled\'); }
}
init_myfunc();
- jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
+ jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); });
+ jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
@@ -215,6 +238,20 @@ if ($action == 'edit')
print '';
print ''.$langs->trans("Parameter").' '.$langs->trans("DefaultValue").' '.$langs->trans("PersonalValue").' ';
+ // Landing page
+ $var=!$var;
+ print ''.$langs->trans("LandingPage").' ';
+ print '';
+ print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE);
+ print ' ';
+ print ' conf->MAIN_LANDING_PAGE)?" checked":"");
+ print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
+ print '> '.$langs->trans("UsePersonalValue").' ';
+ print '';
+ print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1);
+ //print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
+ print ' ';
+
// Langue par defaut
$var=!$var;
print ''.$langs->trans("Language").' ';
@@ -267,6 +304,25 @@ else
print '