Show
Ignore:
Timestamp:
14-10-10 12:23:32 (4 years ago)
Author:
business@…
Message:

added a showByToken action to the study controller

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/StudyController.groovy

    r536 r941  
    4747            // studies 
    4848            [studyList: [ studyInstance ], multipleStudies: false ] 
     49        } 
     50    } 
     51 
     52        def showByToken = { 
     53        def studyInstance = Study.findByCode(params.id) 
     54        if (!studyInstance) { 
     55            flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'study.label', default: 'Study'), params.id])}" 
     56            redirect(action: "list") 
     57        } 
     58        else { 
     59            redirect(action: "show", id: studyInstance.id) 
    4960        } 
    5061    }