diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php
index 842c8d01470..8215bdbe0b1 100644
--- a/htdocs/admin/agenda_other.php
+++ b/htdocs/admin/agenda_other.php
@@ -356,7 +356,7 @@ print '
'."\n";
print '| '.$langs->trans("AGENDA_DEFAULT_VIEW").' | '."\n";
print ' | '."\n";
print ''."\n";
-$tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
+$tmplist=array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
print ' |
'."\n";
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 178e4bfb6d7..7e27c0d924c 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -101,11 +101,15 @@ else
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
-if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
-if ($action == 'default')
+
+$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
+$defaultview = (empty($user->conf->AGENDA_DEFAULT_VIEW) ? $defaultview : $user->conf->AGENDA_DEFAULT_VIEW);
+if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=$defaultview;
+if ($action == 'default') // When action is default, we want a calendar view and not the list
{
- $action = ((! empty($conf->global->AGENDA_DEFAULT_VIEW) && $conf->global->AGENDA_DEFAULT_VIEW!='show_list') ? $conf->global->AGENDA_DEFAULT_VIEW : 'show_month');
+ $action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
}
+
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') {
$action='show_month'; $day='';
} // View by month
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 6cb418ff641..563ff54c490 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -110,6 +110,12 @@ if (empty($reshook)) {
$tabparam["MAIN_SIZE_LISTE_LIMIT"] = '';
}
+ if (GETPOST("check_AGENDA_DEFAULT_VIEW") == "on") {
+ $tabparam["AGENDA_DEFAULT_VIEW"] = $_POST["AGENDA_DEFAULT_VIEW"];
+ } else {
+ $tabparam["AGENDA_DEFAULT_VIEW"] = '';
+ }
+
if (GETPOST("check_MAIN_THEME") == "on") {
$tabparam["MAIN_THEME"] = $_POST["main_theme"];
} else {
@@ -223,6 +229,9 @@ if ($action == 'edit')
if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
else { jQuery("#main_size_liste_limit").attr(\'disabled\',\'disabled\'); }
+ if (jQuery("#check_AGENDA_DEFAULT_VIEW").prop("checked")) { jQuery("#AGENDA_DEFAULT_VIEW").removeAttr(\'disabled\'); }
+ else { jQuery("#AGENDA_DEFAULT_VIEW").attr(\'disabled\',\'disabled\'); }
+
if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
@@ -231,8 +240,9 @@ if ($action == 'edit')
}
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_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
+ jQuery("#check_AGENDA_DEFAULT_VIEW").click(function() { init_myfunc(); });
jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
@@ -251,7 +261,7 @@ if ($action == 'edit')
print '';
print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE);
print ' | ';
- print 'conf->MAIN_LANDING_PAGE)?" checked":"");
+ print ' | conf->MAIN_LANDING_PAGE)?" checked":"");
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").' | ';
print '';
@@ -259,28 +269,40 @@ if ($action == 'edit')
//print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
print ' | ';
- // Langue par defaut
+ // Language by default
print '| '.$langs->trans("Language").' | ';
print '';
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
print $s?$s.' ':'';
print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
print ' | ';
- print 'conf->MAIN_LANG_DEFAULT)?" checked":"");
+ print ' | conf->MAIN_LANG_DEFAULT)?" checked":"");
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").' | ';
print '';
print $formadmin->select_language((! empty($object->conf->MAIN_LANG_DEFAULT)?$object->conf->MAIN_LANG_DEFAULT:''),'main_lang_default',1,null,0,0,(! empty($dolibarr_main_demo)));
print ' |
';
- // Taille max des listes
+ // Max size of lists
print '| '.$langs->trans("MaxSizeList").' | ';
print ''.$conf->global->MAIN_SIZE_LISTE_LIMIT.' | ';
- print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"");
+ print ' | conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"");
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").' | ';
print ' |
';
+ // AGENDA_DEFAULT_VIEW
+ print ''."\n";
+ print '| '.$langs->trans("AGENDA_DEFAULT_VIEW").' | '."\n";
+ print ' | '."\n";
+ print 'conf->AGENDA_DEFAULT_VIEW)?" checked":"");
+ print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
+ print '> '.$langs->trans("UsePersonalValue").' | ';
+ print ''."\n";
+ $tmplist=array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
+ print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '');
+ print ' |
'."\n";
+
print '
';
// Theme
@@ -308,12 +330,11 @@ else
print '| '.$langs->trans("Parameter").' | '.$langs->trans("DefaultValue").' | | '.$langs->trans("PersonalValue").' |
';
// Landing page
-
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 ' | conf->MAIN_LANDING_PAGE)?" checked":"");
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").' | ';
print '';
@@ -326,26 +347,35 @@ else
print ' |
';
// Language
-
print '| '.$langs->trans("Language").' | ';
print '';
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
print ($s?$s.' ':'');
print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
print ' | ';
- print 'conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
+ print 'conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
print '';
$s=(isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : '');
print ($s?$s.' ':'');
print (isset($object->conf->MAIN_LANG_DEFAULT) && $object->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):(! empty($object->conf->MAIN_LANG_DEFAULT)?$langs->trans("Language_".$object->conf->MAIN_LANG_DEFAULT):''));
print ' |
';
-
+ // Max size for lists
print '| '.$langs->trans("MaxSizeList").' | ';
print ''.(! empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?$conf->global->MAIN_SIZE_LISTE_LIMIT:' ').' | ';
- print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
+ print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
print '' . (! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?$object->conf->MAIN_SIZE_LISTE_LIMIT:' ') . ' |
';
+ // AGENDA_DEFAULT_VIEW
+ print ''."\n";
+ print '| '.$langs->trans("AGENDA_DEFAULT_VIEW").' | '."\n";
+ print ' | '."\n";
+ print 'conf->AGENDA_DEFAULT_VIEW)?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
+ print ''."\n";
+ $tmplist=array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
+ if (! empty($object->conf->AGENDA_DEFAULT_VIEW)) print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
+ print ' |
'."\n";
+
print '
';