Changeset 474


Ignore:
Timestamp:
Mar 31, 2010, 1:42:00 PM (14 years ago)
Author:
gav
Message:

Scroll month feature to task search calendar.
Add reasoning, asset and sub item columns on procedure tab of task show view.

Location:
trunk/grails-app
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/TaskDetailedController.groovy

    r473 r474  
    122122    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
    123123    def searchCalendar = {
    124         params.max = 30
     124
     125        if(session.taskSearchParamsMax)
     126            params.max = session.taskSearchParamsMax
     127
     128        // Protect filterPane.
     129        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
     130
     131        // Set the month to show.
     132        def showMonth = new Date()
     133        if(session.taskSearchCalendarShowMonth)
     134            showMonth = session.taskSearchCalendarShowMonth
     135
     136        if(params.nextMonth)
     137            showMonth = dateUtilService.getNextMonth(showMonth)
     138        else if(params.previousMonth)
     139            showMonth = dateUtilService.getPreviousMonth(showMonth)
     140        session.taskSearchCalendarShowMonth = showMonth
    125141
    126142        // Quick Search:
     
    155171                params.quickSearch = "searchTodays"
    156172            }
    157             return[taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceList.totalCount, filterParams: params]
     173            return[taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceList.totalCount, showMonth: showMonth, filterParams: params]
    158174        }
    159175        // filterPane:
     
    163179            taskInstanceTotal: taskInstanceTotal,
    164180            filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params),
     181            showMonth: showMonth,
    165182            params:params ]
    166183    }
  • trunk/grails-app/services/DateUtilService.groovy

    r214 r474  
    7777
    7878    /**
     79    * Get the date one month in the future.
     80    * @param date The Date object to start with.
     81    * @returns A Date object one month in the future.
     82    */
     83    public static Date getNextMonth(Date date) {
     84        use(TimeCategory) {
     85            date + 1.months
     86        }
     87    }
     88
     89    /**
     90    * Get the date one month ago.
     91    * @param date The Date object to start with.
     92    * @returns A Date object one month ago.
     93    */
     94    public static Date getPreviousMonth(Date date) {
     95        use(TimeCategory) {
     96            date - 1.months
     97        }
     98    }
     99
     100    /**
    79101    * Make a date object from supplied year, month, day values.
    80102    * The Calendar.getInstance() or Calendar.instance factory returns a new calendar instance, usually
  • trunk/grails-app/views/taskDetailed/searchCalendar.gsp

    r467 r474  
    4040                </span>
    4141            </div>
     42
     43            <br />
     44            <g:link action="searchCalendar" params="[previousMonth:'true']">
     45                < Previous
     46            </g:link>
     47            <span style="font-size: 17px; font-weight: bold;">
     48                <g:formatDate date="${showMonth}" format="MMMM"/>
     49            </span>
     50            <g:link action="searchCalendar" params="[nextMonth:'true']">
     51                Next >
     52            </g:link>
     53            <br />
     54            <br />
     55
    4256            <g:if test="${taskInstanceList.size() > 0}">
    4357                <richui:calendarMonthView items="${taskInstanceList}"
    4458                                                                        createLink="true"
    4559                                                                        constraintDateFields="['targetStartDate']"
    46                                                                         month="${new Date()}"
     60                                                                        month="${showMonth}"
    4761                                                                        controller="taskDetailed"
    4862                                                                        action="show"
  • trunk/grails-app/views/taskDetailed/show.gsp

    r445 r474  
    503503                                            <th>Step</th>
    504504                                            <th>Description</th>
     505                                            <th>Reasoning</th>
     506                                            <th>Asset</th>
     507                                            <th>Sub Item</th>
    505508                                        </tr>
    506509                                    </thead>
     
    515518                                                <td  valign="top" style="text-align:left;" class="value">
    516519                                                    ${maintenanceAction?.description}
     520                                                </td>
     521
     522                                                <td  valign="top" style="text-align:left;" class="value">
     523                                                    ${maintenanceAction?.reasoning}
     524                                                </td>
     525
     526                                                <td  valign="top" style="text-align:left;" class="value">
     527                                                    ${maintenanceAction?.asset}
     528                                                </td>
     529
     530                                                <td  valign="top" style="text-align:left;" class="value">
     531                                                    ${maintenanceAction?.assetSubItem}
    517532                                                </td>
    518533
Note: See TracChangeset for help on using the changeset viewer.