Changeset 1490 for trunk/grails-app
- Timestamp:
- Feb 4, 2011, 10:55:05 AM (10 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/DatabaseUpgrade.groovy
r1430 r1490 32 32 changeStudyDescriptionToText(sql, db) // r1327 33 33 changeTemplateTextFieldSignatures(sql, db) // prevent Grails issue, see http://jira.codehaus.org/browse/GRAILS-6754 34 setAssayModuleDefaultValues(sql, db) // r1304 34 35 } 35 36 … … 129 130 } 130 131 } 132 133 /** 134 * The fields 'notify' and 'openInFrame' have been added to AssayModule. However, there 135 * seems to be no method to setting the default values of these fields in the database. They 136 * are set to NULL by default, so all existing fields have 'NULL' set. 137 * This method sets the default values 138 * @param sql 139 * @param db 140 */ 141 public static void setAssayModuleDefaultValues(sql, db) { 142 "performing database upgrade: assay_module default values for boolean fields".grom() 143 try { 144 sql.execute("UPDATE assay_module SET notify = 0 WHERE notify IS NULL") 145 } catch (Exception e) { 146 println "setAssayModuleDefaultValues notify field couldn't be set to default value: " + e.getMessage() 147 } 148 try { 149 sql.execute("UPDATE assay_module SET open_in_frame = 1 WHERE open_in_frame IS NULL") 150 } catch (Exception e) { 151 println "setAssayModuleDefaultValues openInFrame field couldn't be set to default value: " + e.getMessage() 152 println "Maybe gdt plugin is not updated yet after revision 109" 153 } 154 } 131 155 } -
trunk/grails-app/controllers/dbnp/studycapturing/AssayModuleController.groovy
r1456 r1490 15 15 package dbnp.studycapturing 16 16 17 import grails.plugins.springsecurity.Secured 18 19 @Secured(['ROLE_ADMIN']) 17 20 class AssayModuleController { 18 21 // Scaffold this class to circumvent not being able to add assays (0.4) -
trunk/grails-app/views/study/show_assays.gsp
r1453 r1490 32 32 <td>${assay.module.platform}</td> 33 33 <td> 34 <jumpbar:link frameSource="${assay.module.url}/assay/showByToken/${assay.giveUUID()}" pageTitle="Metabolomics Module"> 35 view 36 </jumpbar:link></td> 34 <g:if test="${assay.module.openInFrame == null || assay.module.openInFrame == Boolean.TRUE}"> 35 <jumpbar:link frameSource="${assay.module.url}/assay/showByToken/${assay.giveUUID()}" pageTitle="Metabolomics Module"> 36 view 37 </jumpbar:link> 38 </g:if> 39 <g:else> 40 <g:link url="${assay.module.url}/assay/showByToken/${assay.giveUUID()}">view</g:link> 41 </g:else> 42 </td> 37 43 <td> 38 44 <% sortedAssaySamples = assay.samples.sort( { a, b -> a.name <=> b.name } as Comparator ) %>
Note: See TracChangeset
for help on using the changeset viewer.