Changeset 213 for trunk


Ignore:
Timestamp:
Dec 3, 2009, 11:44:05 PM (15 years ago)
Author:
gav
Message:

Finishing touches to recurring tasks.

Location:
trunk/grails-app
Files:
7 edited

Legend:

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

    r208 r213  
    7777    def create = {
    7878        if(!params.task?.id || !Task.exists(params.task?.id)) {
    79             flash.message = "Please select a task, then Create a Recurring Schedule for it."
     79            flash.message = "Please select a task, then create a recurring schedule for it."
    8080            redirect(controller:"taskDetailed", action:"search")
    8181            return
    8282        }
    83         def taskRecurringScheduleInstance = new TaskRecurringSchedule()
    84         taskRecurringScheduleInstance.properties = params
     83        def taskRecurringScheduleInstance = new TaskRecurringSchedule(params)
    8584        return [taskRecurringScheduleInstance: taskRecurringScheduleInstance]
    86     } // end create()
     85    }
    8786
    8887    def save = {
     
    9695            render(view:'create',model:[taskRecurringScheduleInstance: result.taskRecurringScheduleInstance])
    9796        }
    98     } // end save()
     97    }
    9998
    10099}
  • trunk/grails-app/i18n/messages.properties

    r207 r213  
    4747task.leadPerson.help=The primay contact person.
    4848
    49 taskRecurring.nextTargetStartDate.NotInTheFuture=Please select a start date that is not in the past, or use original date.
    50 taskRecurring.nextTargetStartDate=Next Target Start Date
    51 taskRecurring.nextTargetStartDate.help=The target start date for the next auto generated subTask.
     49taskRecurringSchedule.nextTargetStartDate.mayNotBePast=Please select a start date that is not in the past.
     50taskRecurringSchedule.nextTargetStartDate=Next Target Start Date
     51taskRecurringSchedule.nextTargetStartDate.help=The target start date for the next auto generated sub task.
     52taskRecurringSchedule.recurEvery=Recur Every
     53taskRecurringSchedule.recurEvery.help=How often this task should recur. Determines the period between sub task target start dates.
     54taskRecurringSchedule.taskDuration=Task Duration
     55taskRecurringSchedule.taskDuration.help=How long to allow for the task. Determines the target completion date of the sub tasks.
     56taskRecurringSchedule.generateAhead=Generate Ahead
     57taskRecurringSchedule.generateAhead.help=How far ahead of the next target start date to generate sub tasks. \
     58This allows work packs to be built and work load to be seen and planned. \
     59Only generate ahead as far as short term planning is done, since all generated sub task values will be set and therefore \
     60time consuming to change.
     61taskRecurringSchedule.enabled=Enabled
     62taskRecurringSchedule.enabled.help=On to enable automatic sub task generation. Off to stop automatic sub task generation.
    5263
    5364task.primaryAsset=Primary Asset
     
    7889default.paginate.prev=Previous
    7990default.paginate.next=Next
    80 default.optimistic.locking.failure=Another user has updated this item while you were editing.
     91default.optimistic.locking.failure=Another user has updated this item while you were editing, please check the updated values.
    8192
    8293# Rich UI plugin - Calendar
  • trunk/grails-app/services/TaskRecurringScheduleService.groovy

    r207 r213  
    7474
    7575            if(result.taskRecurringScheduleInstance.nextTargetStartDate < dateUtilService.getToday())
    76                 return fail("nextTargetStartDate", "taskRecurring.nextTargetStartDate.NotInTheFuture")
     76                return fail("nextTargetStartDate", "taskRecurringSchedule.nextTargetStartDate.mayNotBePast")
    7777
    7878            taskInstance.taskRecurringSchedule = result.taskRecurringScheduleInstance
     
    115115            }
    116116
    117             result.taskRecurringScheduleInstance.validate()
     117            result.taskRecurringScheduleInstance.properties = params
    118118
    119             Date originalDate = result.taskRecurringScheduleInstance.nextTargetStartDate
    120             result.taskRecurringScheduleInstance.properties = params
    121             Date newDate = result.taskRecurringScheduleInstance.nextTargetStartDate
    122 
    123             // If user changes nextTargetStartDate then ensure it is in the future, otherwise it's ok to keep the original date.
    124             if(originalDate.getTime() != newDate.getTime())
    125             {
    126                 if(newDate < dateUtilService.getToday())
    127                     return fail("nextTargetStartDate", "taskRecurring.nextTargetStartDate.NotInTheFuture")
    128             }
     119            if(result.taskRecurringScheduleInstance.nextTargetStartDate < dateUtilService.getToday())
     120                return fail("nextTargetStartDate", "taskRecurringSchedule.nextTargetStartDate.mayNotBePast")
    129121
    130122            result.taskRecurringScheduleInstance.setNextGenerationDate()
  • trunk/grails-app/views/taskDetailed/edit.gsp

    r204 r213  
    169169                <div class="buttons">
    170170                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
    171                     <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="show"/></span>
     171                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
    172172                    <span class="button"><g:actionSubmit class="trash" onclick="return confirm('Are you sure?');" value="Trash" /></span>
    173173                </div>
  • trunk/grails-app/views/taskDetailed/show.gsp

    r203 r213  
    648648                                    </g:else>
    649649                                    <span class="button"><g:actionSubmit action="listSubTasks" class="table" value="List" /></span>
    650                                     <span class="button"><g:actionSubmit action="createSubTask" class="add" value="Add" /></span>
     650                                    <span class="button"><g:actionSubmit action="createSubTask" class="add" value="Create" /></span>
    651651                                </g:form>
    652652                            </div>
     
    662662                                <g:form>
    663663                                    <g:hiddenField name="id" value="${taskInstance?.id}" />
    664                                     <span class="button"><g:actionSubmit action="createSubTask" class="add" value="Add" /></span>
     664                                    <span class="button"><g:actionSubmit action="createSubTask" class="add" value="Create" /></span>
    665665                                </g:form>
    666666                            </div>
  • trunk/grails-app/views/taskRecurringScheduleDetailed/create.gsp

    r211 r213  
    4242                                <td valign="top" class="value ${hasErrors(bean:taskRecurringScheduleInstance,field:'nextTargetStartDate','errors')}">
    4343                                    <richui:dateChooser name="nextTargetStartDate" format="dd-MM-yyyy" value="${taskRecurringScheduleInstance?.nextTargetStartDate}" />
     44                                    <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.nextTargetStartDate" />
    4445                                </td>
    4546                            </tr>   
     
    5354                                        id="recurEvery" name="recurEvery" value="${fieldValue(bean:taskRecurringScheduleInstance,field:'recurEvery')}" />
    5455                                    <g:select optionKey="id" from="${Period.list()}" name="recurPeriod.id" value="${taskRecurringScheduleInstance?.recurPeriod?.id}" ></g:select>
     56                                    <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.recurEvery" />
    5557                                </td>
    5658                            </tr>   
     
    5860                            <tr class="prop">
    5961                                <td valign="top" class="name">
    60                                     <label for="recurEvery">Task Duration:</label>
     62                                    <label for="taskDuration">Task Duration:</label>
    6163                                </td>
    6264                                <td valign="top" class="value" >
     
    6466                                        id="taskDuration" name="taskDuration" value="${fieldValue(bean:taskRecurringScheduleInstance,field:'taskDuration')}" />
    6567                                    <g:select optionKey="id" from="${Period.list()}" name="taskDurationPeriod.id" value="${taskRecurringScheduleInstance?.taskDurationPeriod?.id}" ></g:select>
     68                                    <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.taskDuration" />
    6669                                </td>
    6770                            </tr>   
     
    6972                            <tr class="prop">
    7073                                <td valign="top" class="name">
    71                                     <label for="recurEvery">Generate Ahead:</label>
     74                                    <label for="generateAhead">Generate Ahead:</label>
    7275                                </td>
    7376                                <td valign="top" class="value" >
     
    7578                                        id="generateAhead" name="generateAhead" value="${fieldValue(bean:taskRecurringScheduleInstance,field:'generateAhead')}" />
    7679                                        ${Period.get(1).encodeAsHTML()}
     80                                        <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.generateAhead" />
    7781                                </td>
    7882                            </tr>
     
    8488                                <td valign="top" class="value ${hasErrors(bean:taskRecurringScheduleInstance,field:'enabled','errors')}">
    8589                                    <g:checkBox name="enabled" value="${taskRecurringScheduleInstance?.enabled}" ></g:checkBox>
     90                                        <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.enabled" />
    8691                                </td>
    8792                            </tr>
  • trunk/grails-app/views/taskRecurringScheduleDetailed/edit.gsp

    r212 r213  
    4343                                <td valign="top" class="value ${hasErrors(bean:taskRecurringScheduleInstance,field:'nextTargetStartDate','errors')}">
    4444                                    <richui:dateChooser name="nextTargetStartDate" format="dd-MM-yyyy" value="${taskRecurringScheduleInstance?.nextTargetStartDate}" />
     45                                    <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.nextTargetStartDate" />
    4546                                </td>
    4647                            </tr>   
     
    5455                                        id="recurEvery" name="recurEvery" value="${fieldValue(bean:taskRecurringScheduleInstance,field:'recurEvery')}" />
    5556                                    <g:select optionKey="id" from="${Period.list()}" name="recurPeriod.id" value="${taskRecurringScheduleInstance?.recurPeriod?.id}" ></g:select>
     57                                    <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.recurEvery" />
    5658                                </td>
    5759                            </tr>   
     
    5961                            <tr class="prop">
    6062                                <td valign="top" class="name">
    61                                     <label for="recurEvery">Task Duration:</label>
     63                                    <label for="taskDuration">Task Duration:</label>
    6264                                </td>
    6365                                <td valign="top" class="value" >
     
    6567                                        id="taskDuration" name="taskDuration" value="${fieldValue(bean:taskRecurringScheduleInstance,field:'taskDuration')}" />
    6668                                    <g:select optionKey="id" from="${Period.list()}" name="taskDurationPeriod.id" value="${taskRecurringScheduleInstance?.taskDurationPeriod?.id}" ></g:select>
     69                                    <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.taskDuration" />
    6770                                </td>
    6871                            </tr>       
     
    7073                            <tr class="prop">
    7174                                <td valign="top" class="name">
    72                                     <label for="recurEvery">Generate Ahead:</label>
     75                                    <label for="generateAhead">Generate Ahead:</label>
    7376                                </td>
    7477                                <td valign="top" class="value" >
     
    7679                                        id="generateAhead" name="generateAhead" value="${fieldValue(bean:taskRecurringScheduleInstance,field:'generateAhead')}" />
    7780                                        ${Period.get(1).encodeAsHTML()}
     81                                        <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.generateAhead" />
    7882                                </td>
    7983                            </tr>
     
    8589                                <td valign="top" class="value ${hasErrors(bean:taskRecurringScheduleInstance,field:'enabled','errors')}">
    8690                                    <g:checkBox name="enabled" value="${taskRecurringScheduleInstance?.enabled}" ></g:checkBox>
     91                                        <g:helpBalloon class="helpballoon" code="taskRecurringSchedule.enabled" />
    8792                                </td>
    8893                            </tr>
Note: See TracChangeset for help on using the changeset viewer.