Ignore:
Timestamp:
Apr 6, 2011, 1:28:11 PM (10 years ago)
Author:
robert@…
Message:

Removed mass sample editing (to prevent the edit tags screen opening very slowly). Also added the possibility to add an excel file which matches sequence files to samples (when uploading) (#13). Finally added some 'return false' to onClick events, when dialogs were opened, to prevent the browser from scrolling to the top.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/nl/tno/massSequencing/AssaySampleController.groovy

    r42 r44  
    2323                [assaySample: assaySample, entityType: params.entityType]
    2424        }
     25       
     26       
     27        /**
     28         * Shows a form to edit the specified assaySample in dialog mode
     29         */
     30        def editForm = {
     31                // load assaySample with id specified by param.id
     32                AssaySample assaySample = AssaySample.get( params.id as long );
     33
     34                if( !assaySample ) {
     35                        render "Sample not found";
     36                        return
     37                }
     38               
     39                if (!assaySample.assay.study.canWrite( session.user ) ) {
     40                        flash.error = "You don't have the right authorizaton to access sample " + assaySample.sample.name
     41                        redirect(controller: params.parent ?: "run" )
     42                        return null
     43                }
     44
     45                [parent: params.parent ?: "run", parentId: params.parentId ?: assaySample.run?.id, assaySample: assaySample]
     46        }
     47       
     48        def update = {
     49                // load assaySample with id specified by param.id
     50                AssaySample assaySample = AssaySample.get( params.id as long );
     51
     52                if( !assaySample) {
     53                        redirect(controller: params.parent ?: "run", action: 'list')
     54                        return
     55                }
     56
     57                assaySample.properties = params.sample
     58
     59                if( assaySample.save() ) {
     60                        flash.message = "Sample succesfully saved";
     61                } else {
     62                        flash.error = "Sample could not be saved: " + assaySample.getErrors();
     63                }
     64
     65                redirect( controller: params.parent ?: "run", action: 'show', id: params.parentId ?: assaySample.run?.id )
     66        }
    2567}
Note: See TracChangeset for help on using the changeset viewer.