diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php
index 4a9c359f5c1..a069a0718c9 100644
--- a/htdocs/admin/agenda_other.php
+++ b/htdocs/admin/agenda_other.php
@@ -26,6 +26,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
+require_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
if (!$user->admin)
accessforbidden();
@@ -70,11 +71,20 @@ if (preg_match('/del_(.*)/',$action,$reg))
}
}
+if ($action == 'set')
+{
+ dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
+}
+
/**
* View
*/
+$formactions=new FormActions($db);
+
llxHeader();
$linkback=''.$langs->trans("BackToModuleList").'';
@@ -86,43 +96,71 @@ $head=agenda_prepare_head();
dol_fiche_head($head, 'other', $langs->trans("Agenda"), 0, 'action');
-print_titre($langs->trans("OtherOptions"));
+//print_titre($langs->trans("OtherOptions"));
$var=true;
+print '
';
+
dol_fiche_end();
print "
";
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index e7f277a116b..a50ee50dd14 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -81,7 +81,11 @@ $pid=GETPOST("projectid","int",3);
$status=GETPOST("status");
$type=GETPOST("type");
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
-$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
+$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':'');
+
+if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
+if ($status == '') $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
+if (empty($action)) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') {
$action='show_month'; $day='';
@@ -93,11 +97,6 @@ if (GETPOST('viewday') || $action == 'show_day') {
$action='show_day'; $day=($day?$day:date("d"));
} // View by day
-if (empty($action))
-{
- if (empty($conf->global->AGENDA_DEFAULT_VIEW)) $action='show_month';
- else $action=$conf->global->AGENDA_DEFAULT_VIEW;
-}
$langs->load("agenda");
$langs->load("other");
@@ -110,7 +109,8 @@ $hookmanager->initHooks(array('agenda'));
/*
* Actions
*/
-if (GETPOST("viewlist"))
+
+if (GETPOST("viewlist") || $action == 'show_list')
{
$param='';
foreach($_POST as $key => $val)
@@ -123,6 +123,19 @@ if (GETPOST("viewlist"))
exit;
}
+if (GETPOST("viewperuser") || $action == 'show_peruser')
+{
+ $param='';
+ foreach($_POST as $key => $val)
+ {
+ if ($key=='token') continue;
+ $param.='&'.$key.'='.urlencode($val);
+ }
+ //print $param;
+ header("Location: ".DOL_URL_ROOT.'/comm/action/peruser.php?'.$param);
+ exit;
+}
+
if ($action=='delete_action')
{
$event = new ActionComm($db);
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index 0c220a89194..15e75e85661 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -44,11 +44,9 @@ $status=GETPOST("status",'alpha');
$type=GETPOST('type');
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
-if (empty($action))
-{
- if (empty($conf->global->AGENDA_DEFAULT_VIEW)) $action='show_list';
- else $action=$conf->global->AGENDA_DEFAULT_VIEW;
-}
+if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
+if ($status == '') $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
+if (empty($action)) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_list':$conf->global->AGENDA_DEFAULT_VIEW);
$filter=GETPOST("filter",'',3);
$filtera = GETPOST("userasked","int",3)?GETPOST("userasked","int",3):GETPOST("filtera","int",3);
@@ -214,6 +212,7 @@ if ($resql)
if ($action == 'show_week') $tabactive='cardweek';
if ($action == 'show_day') $tabactive='cardday';
if ($action == 'show_list') $tabactive='cardlist';
+ if ($action == 'show_peruser') $tabactive='cardperuser';
$head = calendars_prepare_head($param);
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 81a7ea1f048..ed32fcc9f0d 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -120,7 +120,7 @@ class FormActions
{
//var_dump($selected);
if ($selected == 'done') $selected='100';
- print '