Changeset 199 for trunk/grails-app/controllers
- Timestamp:
- Nov 28, 2009, 2:17:34 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 stacktrace.log1 *.log 2 2 *.war
-
- Property svn:ignore
-
trunk/grails-app/controllers/TaskRecurringScheduleDetailedController.groovy
r178 r199 31 31 if(taskRecurringScheduleInstance) { 32 32 try { 33 taskRecurringScheduleInstance.delete( )33 taskRecurringScheduleInstance.delete(flush: true) 34 34 flash.message = "Recurring Schedule ${params.id} deleted" 35 35 redirect(action:list) … … 73 73 } 74 74 75 Date originalDate = taskRecurringScheduleInstance. startDate75 Date originalDate = taskRecurringScheduleInstance.nextTargetStartDate 76 76 taskRecurringScheduleInstance.properties = params // Domain object is now 'dirty'. 77 Date newDate = taskRecurringScheduleInstance. startDate77 Date newDate = taskRecurringScheduleInstance.nextTargetStartDate 78 78 79 // If user changes startDate then ensure it is in the future, otherwise it's ok to keep the original date.79 // If user changes nextTargetStartDate then ensure it is in the future, otherwise it's ok to keep the original date. 80 80 if(originalDate.getTime() != newDate.getTime()) 81 81 { … … 83 83 { 84 84 status.setRollbackOnly() // Only allow the transaction to Rollback, preventing flush due to 'dirty'. 85 taskRecurringScheduleInstance.errors.rejectValue(" startDate", "taskRecurring.startDate.NotInTheFuture")85 taskRecurringScheduleInstance.errors.rejectValue("nextTargetStartDate", "taskRecurring.nextTargetStartDate.NotInTheFuture") 86 86 render(view:'edit',model:[taskRecurringScheduleInstance:taskRecurringScheduleInstance]) 87 87 return … … 89 89 } 90 90 91 taskRecurringScheduleInstance.nextTargetStartDate = taskRecurringScheduleInstance.startDate 92 taskRecurringScheduleInstance.setNextGenerationDate() 91 taskRecurringScheduleInstance.setNextGenerationDate() 93 92 taskRecurringScheduleInstance.setNextTargetCompletionDate() 94 93 95 if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save(flush: true)) 94 if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save(flush: true)) 96 95 { 97 96 flash.message = "Recurring Schedule ${params.id} updated" … … 121 120 catch(Exception e) { 122 121 flash.message = "Please select a task, then Create a Recurring Schedule for it" 123 redirect(controller:"taskDetailed", action:" list")122 redirect(controller:"taskDetailed", action:"search") 124 123 } 125 124 } // end create() … … 135 134 else { 136 135 137 if(taskRecurringScheduleInstance. startDate < dateUtilService.getToday()) {138 taskRecurringScheduleInstance.errors.rejectValue(" startDate", "taskRecurring.startDate.NotInTheFuture")136 if(taskRecurringScheduleInstance.nextTargetStartDate < dateUtilService.getToday()) { 137 taskRecurringScheduleInstance.errors.rejectValue("nextTargetStartDate", "taskRecurring.nextTargetStartDate.NotInTheFuture") 139 138 } 140 139
Note: See TracChangeset
for help on using the changeset viewer.