Index: trunk/grails-app/controllers/TaskDetailedController.groovy
===================================================================
--- trunk/grails-app/controllers/TaskDetailedController.groovy	(revision 701)
+++ trunk/grails-app/controllers/TaskDetailedController.groovy	(revision 713)
@@ -61,4 +61,5 @@
         params.max = Math.min( params.max ? params.max.toInteger() : 100,  1000 )
 
+        // View main data.
         def taskInstanceList = []
         def taskInstanceTotal
@@ -68,10 +69,17 @@
         // Restore search unless a new search is being requested.
         if(!params.quickSearch && !filterParams) {
-            if(session.taskSearchQuickSearch)
-                params.quickSearch = session.taskSearchQuickSearch
-            else if(session.taskSearchFilterParams) {
+            if(session.taskSearchFilterParams) {
                 session.taskSearchFilterParams.each() { params[it.key] = it.value }
                 params.filter = session.taskSearchFilter
                 isFilterApplied = FilterUtils.isFilterApplied(params)
+            }
+        }
+        if(!params.quickSearch) {
+            if(session.taskSearchQuickSearch) {
+                params.quickSearch = session.taskSearchQuickSearch
+                params.person = Person.get(session.taskQuickSearchPersonId.toLong())
+                params.startDate = session.taskQuickSearchStartDate
+                params.endDate = session.taskQuickSearchEndDate
+                params.includeCompleted = session.taskQuickSearchIncludeCompleted
             }
         }
@@ -114,18 +122,24 @@
             session.taskSearchFilterParams = new LinkedHashMap(filterParams)
             session.taskSearchFilter = new LinkedHashMap(params.filter)
-            session.removeAttribute("taskSearchQuickSearch")
         }
         else {
             // Quick Search:
-            if(!params.quickSearch) params.quickSearch = "myTodays"
             def result = taskSearchService.getQuickSearch(params, RCU.getLocale(request))
             taskInstanceList = result.taskInstanceList
             taskInstanceTotal = result.taskInstanceList.totalCount
             params.message = result.message
-            filterParams.quickSearch = result.quickSearch
+            params.quickSearch = result.quickSearch
+            params.person = result.person
+            params.startDate = result.startDate
+            params.endDate = result.endDate
+            params.includeCompleted = result.includeCompleted
             // Remember search.
             session.removeAttribute("taskSearchFilterParams")
             session.removeAttribute("taskSearchFilter")
             session.taskSearchQuickSearch = result.quickSearch
+            session.taskQuickSearchPersonId = result.person.id
+            session.taskQuickSearchStartDate = result.startDate
+            session.taskQuickSearchEndDate = result.endDate
+            session.taskQuickSearchIncludeCompleted = result.includeCompleted
         }
 
@@ -181,5 +195,6 @@
                         filterParams: filterParams,
                         params: params,
-                        associatedPropertyValues: associatedPropertyValues ]
+                        associatedPropertyValues: associatedPropertyValues,
+                        quickSearchSelection: taskSearchService.quickSearchSelection]
 
     } // search
@@ -206,10 +221,17 @@
         // Restore search unless a new search is being requested.
         if(!params.quickSearch && !filterParams) {
-            if(session.taskSearchCalendarQuickSearch)
-                params.quickSearch = session.taskSearchCalendarQuickSearch
-            else if(session.taskSearchCalendarFilterParams) {
+            if(session.taskSearchCalendarFilterParams) {
                 session.taskSearchCalendarFilterParams.each() { params[it.key] = it.value }
                 params.filter = session.taskSearchCalendarFilter
                 isFilterApplied = FilterUtils.isFilterApplied(params)
+            }
+        }
+        if(!params.quickSearch) {
+            if(session.taskSearchCalendarQuickSearch) {
+                params.quickSearch = session.taskSearchCalendarQuickSearch
+                params.person = Person.get(session.taskCalendarQuickSearchPersonId.toLong())
+                params.startDate = session.taskCalendarQuickSearchStartDate
+                params.endDate = session.taskCalendarQuickSearchEndDate
+                params.includeCompleted = session.taskCalendarQuickSearchIncludeCompleted
             }
         }
@@ -250,5 +272,4 @@
             session.taskSearchCalendarFilterParams = new LinkedHashMap(filterParams)
             session.taskSearchCalendarFilter = new LinkedHashMap(params.filter)
-            session.removeAttribute("taskSearchCalendarQuickSearch")
         }
         else {
@@ -258,9 +279,17 @@
             taskInstanceTotal = result.taskInstanceList.totalCount
             params.message = result.message
-            filterParams.quickSearch = result.quickSearch
+            params.quickSearch = result.quickSearch
+            params.person = result.person
+            params.startDate = result.startDate
+            params.endDate = result.endDate
+            params.includeCompleted = result.includeCompleted
             // Remember search.
             session.removeAttribute("taskSearchCalendarFilterParams")
             session.removeAttribute("taskSearchCalendarFilter")
             session.taskSearchCalendarQuickSearch = result.quickSearch
+            session.taskCalendarQuickSearchPersonId = result.person.id
+            session.taskCalendarQuickSearchStartDate = result.startDate
+            session.taskCalendarQuickSearchEndDate = result.endDate
+            session.taskCalendarQuickSearchIncludeCompleted = result.includeCompleted
         }
 
@@ -329,5 +358,6 @@
                         nextMonth: calendarMonthControls.nextMonth,
                         previousYear: calendarMonthControls.previousYear,
-                        nextYear: calendarMonthControls.nextYear]
+                        nextYear: calendarMonthControls.nextYear,
+                        quickSearchSelection: taskSearchService.quickSearchSelection]
 
     } // searchCalendar
