- Timestamp:
- Nov 2, 2010, 3:41:02 PM (12 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/nmc/PilotController.groovy
r1046 r1049 18 18 19 19 class PilotController { 20 21 def authenticationService 20 22 21 23 static allowedMethods = [save: "POST", update: "POST", delete: "POST"] … … 53 55 //For Pilot we do not ask for code, we generate it for the user 54 56 studyInstance.code = params?.title?.encodeAsMD5() 57 studyInstance.owner = authenticationService.getLoggedInUser() 55 58 56 59 def extraparams = new LinkedHashMap(); … … 68 71 assayInstance.externalAssayID = assayInstance?.name?.encodeAsMD5() 69 72 studyInstance.addToAssays(assayInstance) 70 assayInstance.save(flush: true) 71 73 assayInstance.save(flush: true) 74 72 75 //flash.message = "${message(code: 'default.created.message', args: [message(code: 'study.label', default: 'Study'), ( studyInstance.title ? studyInstance.title : "" ) + " " + ( studyInstance.code ? studyInstance.code : "" )])}" 73 76 … … 80 83 81 84 def show = { 85 82 86 def studyInstance = Study.get(params.id) 83 87 if (!studyInstance) { … … 86 90 } 87 91 else { 92 93 //add all samples to the assay when not there yet! 94 studyInstance.assays.each { assay -> 95 if (assay.samples.size() <= 0){ 96 studyInstance.samples.each { sample -> 97 log.info("ADD THE DIRTY WAY!!!") 98 assay.addToSamples(sample) 99 } 100 assay.save() 101 } 102 } 103 88 104 [studyInstance: studyInstance] 89 105 } -
trunk/grails-app/views/pilot/show.gsp
r1046 r1049 4 4 <head> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <meta name="layout" content="${layout}" /> 6 <meta name="layout" content="${layout}" /> 7 7 <g:set var="entityName" value="${message(code: 'study.label', default: 'Study')}" /> 8 8 <title><g:message code="default.show.label" args="[entityName]" /></title> … … 27 27 Click on this assay to continue with the pilot. 28 28 </g:if> 29 30 31 29 </p> 30 32 31 <table> 33 32 <tbody> … … 45 44 46 45 <g:if test="${studyInstance.samples.size() == 0}"> 47 <g:link controller="importer" action="simpleWizard">Import Samples</g:link> 46 <g:link controller="importer" action="index" params="[redirectTo: 'http://localhost:8080/gscf/pilot/show/'+studyInstance.id]">Import Samples</g:link> 48 47 </g:if> 49 48 … … 55 54 </tr> 56 55 57 <tr class="prop"> 58 <td valign="top" class="name">Assays</td> 59 60 <td valign="top" class="value"> 61 <g:each in="${studyInstance.assays.unique()}" var="assay"> 62 <g:link controller="assay" action="show" id="${assay.id}">${assay.name}</g:link><br /> 63 </g:each> 64 </td> 65 66 </tr> 67 56 <g:if test="${studyInstance.samples.size() > 0}"> 57 <tr class="prop"> 58 <td valign="top" class="name">Assays</td> 59 60 <td valign="top" class="value"> 61 <g:each in="${studyInstance.assays.unique()}" var="assay"> 62 <jumpbar:link 63 linkDest="${createLink(action:'show', id:studyInstance.id)}" 64 linkText='Go back to GSCF' 65 frameSource="${assay.module.url}/assay/showByToken?id=${assay.externalAssayID}&sessionToken=${session.id}" 66 pageTitle="Assay View in Module"> 67 ${assay.name} 68 </jumpbar:link><br /> 69 </g:each> 70 </td> 71 </tr> 72 </g:if> 73 68 74 </tbody> 69 75 </table>
Note: See TracChangeset
for help on using the changeset viewer.