Ignore:
Timestamp:
Oct 14, 2010, 12:23:32 PM (6 years ago)
Author:
business@…
Message:

added a showByToken action to the study controller

File:
1 edited

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    }
Note: See TracChangeset for help on using the changeset viewer.