Changeset 665
- Timestamp:
- Jul 19, 2010, 6:44:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r664 r665 677 677 flow.samples[ incrementor ] = [ 678 678 sample: new Sample( 679 parent: flow.study, 679 680 parentSubject: subject, 680 681 parentEvent: event, … … 732 733 on("regenerate") { 733 734 println ".removing 'samples' and 'sampleTemplates' from the flowscope, triggering regeneration of the samples..." 735 flow.samples.each() { 736 flow.study.removeFromSamples( it.sample ) 737 } 734 738 flow.remove('samples') 735 739 flow.remove('sampleTemplates') 740 println flow.study.samples 736 741 success() 737 742 }.to "samples" … … 808 813 // persist data to the database 809 814 try { 810 println ".saving wizard data..."811 812 // add events to study813 /*814 println ".add events to study"815 flow.events.each() { event ->816 if (event instanceof SamplingEvent) {817 // only add this sampling event if it is not yet818 // linked to this study819 if (!flow.study.samplingEvents.find { e -> (e == event) }) {820 flow.study.addToSamplingEvents( event.value )821 }822 } else {823 // only add it if it does not yet exist824 if (!flow.study.events.find { e -> (e == event) }) {825 flow.study.addToEvents( event.value )826 }827 }828 }829 830 // add subjects to study831 println ".add subjects to study"832 flow.subjects.each() { subjectId, subject ->833 // add subject to study if it is not yet in this study834 if (!flow.study.subjects.find { s -> (s == subject) }) {835 flow.study.addToSubjects(subject)836 }837 }838 839 // add eventGroups to study840 println ".add eventGroups to study"841 flow.eventGroups.each() { eventGroup ->842 // only add the eventGroup if it is not yet linked843 if (!flow.study.eventGroups.find { e -> (e == eventGroup) }) {844 flow.study.addToEventGroups(eventGroup)845 }846 }847 */848 849 815 // save study 850 816 println ".saving study" 851 if (!flow.study.save( flush:true)) {817 if (!flow.study.save()) { 852 818 this.appendErrors(flow.study, flash.errors) 853 819 throw new Exception('error saving study')
Note: See TracChangeset
for help on using the changeset viewer.