Changeset 136 for trunk/grails-app/controllers
- Timestamp:
- May 15, 2009, 4:09:30 PM (16 years ago)
- Location:
- trunk/grails-app/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/PersonController.groovy
r97 r136 39 39 /** 40 40 * Person delete action. Before removing an existing person, 41 * he should be removed from those authorities which he isinvolved.41 * they should be removed from those authorities which they are involved. 42 42 */ 43 43 def delete = { -
trunk/grails-app/controllers/TaskRecurringScheduleDetailedController.groovy
r135 r136 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 import org.codehaus.groovy.runtime.TimeCategory 2 3 3 4 class TaskRecurringScheduleDetailedController extends BaseController { … … 66 67 } 67 68 } 68 taskRecurringScheduleInstance.properties = params 69 // taskRecurringScheduleInstance.properties = params 70 setUpdateProperties() 71 69 72 if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save()) { 70 73 flash.message = "TaskRecurringSchedule ${params.id} updated" … … 104 107 else { 105 108 106 taskRecurringScheduleInstance.nextDueDate = new Date()107 108 // taskRecurringScheduleInstance.nextDueDate = calculateNextDueDate(new Date())109 110 109 if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save()) { 111 110 … … 127 126 128 127 } 129 130 // private Date calculateNextDueDate(nextDue) { 131 // // def now = new Date() 132 // // def calculatedDays = new Integer() 133 // // def nextDue = new Date() 134 // 135 // // switch (period) { 136 // // case "Day(s)": 137 // // calculatedDays = period 138 // // nextDue = now + calculatedDays 139 // // case "Week(s)": 140 // // calculatedDays = period * 7 141 // // nextDue = now + calculatedDays 142 // // // default: 143 // // } 144 // nextDue = nextDue + 1 145 // return nextDue 146 // } 147 128 129 private setUpdateProperties() { 130 def originalStartDate = taskRecurringScheduleInstance.startDate 131 132 if(taskRecurringScheduleInstance.startDate == params.startDate) { 133 taskRecurringScheduleInstance.properties = params 134 } 135 else { 136 taskRecurringScheduleInstance.properties = params 137 taskRecurringScheduleInstance.nextTargetStartDate = params.startDate 138 } 139 140 } 141 142 /* 143 private Date calculateNextDueDate(recurEvery, period, startDate) { 144 def nextDue = new Date() 145 146 switch (period) { 147 case "Day(s)": 148 use(TimeCategory) { 149 nextDue = startDate + recurEvery.days 150 } 151 return nextDue 152 case "Week(s)": 153 use(TimeCategory) { 154 nextDue = startDate + recurEvery.weeks 155 } 156 return nextDue 157 case "Month(s)": 158 use(TimeCategory) { 159 nextDue = startDate + recurEvery.months 160 } 161 return nextDue 162 case "Year(s)": 163 use(TimeCategory) { 164 nextDue = startDate + recurEvery.years 165 } 166 return nextDue 167 default: 168 return nextDue 169 } 170 171 }*/ 148 172 }
Note: See TracChangeset
for help on using the changeset viewer.