Changeset 510
- Timestamp:
- Jun 2, 2010, 4:38:09 PM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r509 r510 497 497 println ".saving wizard data..." 498 498 499 // save events500 println ". saving events"499 // add events to study 500 println ".add events to study" 501 501 flow.events.each() { event -> 502 if (!event.save(flush:true)) {503 this.appendErrors(event, flash.errors)504 throw new Exception('error saving event')505 }506 507 // add to study508 502 if (event instanceof SamplingEvent) { 509 503 flow.study.addToSamplingEvents(event) … … 511 505 flow.study.addToEvents(event) 512 506 } 513 514 println ".saved event ["+event+"] of type ["+event.getClass()+"] (id: "+event.id+")"515 507 } 516 508 517 // save subjects518 println ". saving subjects"509 // add subjects to study 510 println ".add subjects to study" 519 511 flow.subjects.each() { subjectId, subject -> 520 if (!subject.save(flush:true)) {521 this.appendErrors(subject.value, flash.errors)522 throw new Exception('error saving subject')523 }524 525 // add this subject to the study526 512 flow.study.addToSubjects(subject) 527 528 println ".saved subject "+subject+" (id: "+subject.id+")"529 513 } 530 514 531 // save eventGroups532 println ". saving eventGroups"515 // add eventGroups to study 516 println ".add eventGroups to study" 533 517 flow.eventGroups.each() { eventGroup -> 534 if (!eventGroup.save(flush:true)) {535 this.appendErrors(eventGroup, flash.errors)536 throw new Exception('error saving eventGroup')537 }538 539 // add to study540 518 flow.study.addToEventGroups(eventGroup) 541 542 println ".saved eventGroup ["+eventGroup+"] (id: "+eventGroup.id+")"543 519 } 544 520 -
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r506 r510 21 21 * @return List 22 22 */ 23 23 static List<TemplateField> giveDomainFields() { return Study.domainFields } 24 24 25 26 27 28 29 30 31 32 33 34 25 static final List<TemplateField> domainFields = 26 [ 27 new TemplateField( 28 name: 'title', 29 type: TemplateFieldType.STRING), 30 new TemplateField( 31 name: 'startDate', 32 type: TemplateFieldType.DATE, 33 comment: 'Fill out the official start date or date of first action') 34 ] 35 35 36 36 static hasMany = [ … … 81 81 } 82 82 83 84 83 /** 85 84 * Return the unique Event templates that are used in this study -
trunk/grails-app/views/wizard/pages/_events.gsp
r455 r510 67 67 <g:each var="eventTemplate" in="${eventTemplates}"> 68 68 <g:set var="showHeader" value="${true}" /> 69 <h1>${eventTemplate.getValue().name} template</h1>69 <h1>${eventTemplate.getValue().name}</h1> 70 70 <div class="table"> 71 71 <g:each var="eventId" in="${eventTemplate.getValue().events}">
Note: See TracChangeset
for help on using the changeset viewer.