Changeset 370 for trunk/grails-app/domain
- Timestamp:
- Apr 22, 2010, 9:31:50 AM (13 years ago)
- Location:
- trunk/grails-app/domain/dbnp/studycapturing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/studycapturing/Event.groovy
r359 r370 88 88 89 89 def String toString() { 90 return eventDescription ? eventDescription.name: ""90 return fieldExists( 'Description' ) ? getFieldValue( 'Description') : "" 91 91 } 92 92 -
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r359 r370 60 60 } 61 61 62 /** 63 * Return the unique Event templates that are used in this study 64 */ 65 def Set<Template> giveEventTemplates() { 66 TemplateEntity.giveTemplates(events); 67 } 62 68 69 /** 70 * Return the unique SamplingEvent templates that are used in this study 71 */ 72 def Set<Template> giveSamplingEventTemplates() { 73 TemplateEntity.giveTemplates(events); 74 } 75 63 76 /** 64 77 * Returns the template of all subjects in the study -
trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy
r359 r370 263 263 264 264 /** 265 * Check whether a given template field exists or not 266 * @param fieldName The name of the template field 267 * @return true if the given field exists and false otherwise 268 */ 269 def fieldExists(String fieldName) { 270 TemplateFieldType fieldType = template.getFieldType(fieldName) 271 272 // If the field is found, a TemplateFieldType is returned 273 // otherwise null 274 if (fieldType) { 275 return true 276 } else { 277 return false 278 } 279 } 280 281 /** 265 282 * Set a template/entity field value 266 283 * @param fieldName The name of the template or entity field
Note: See TracChangeset
for help on using the changeset viewer.