Changeset 978
- Timestamp:
- Oct 22, 2010, 12:19:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r976 r978 30 30 class WizardController { 31 31 def AuthenticationService 32 32 33 33 /** 34 34 * index method, redirect to the webflow … … 284 284 subjectPage(flow, flash, params) ? success() : error() 285 285 }.to "events" 286 on("quickSave") { 286 on("quickSave") { 287 287 // handle form data 288 288 subjectPage(flow, flash, params) ? success() : error() … … 372 372 // remove event from the flowscope 373 373 flow.remove('event') 374 374 375 375 success() 376 376 } else { … … 556 556 // ignore errors 557 557 flash.errors = [:] 558 558 559 559 succes() 560 560 }.to "samples" … … 671 671 on("deleteAssay") { 672 672 println params 673 673 674 674 // handle form data 675 675 assayPage(flow, flash, params) … … 801 801 // Make sure the owner of the study is set right 802 802 flow.study.owner = AuthenticationService.getLoggedInUser() 803 803 804 804 if (!flow.study.save(flush:true)) { 805 805 this.appendErrors(flow.study, flash.errors) … … 860 860 def study = (params.studyid) ? Study.findById( params.studyid ) : Study.findByTitle( params.study ) 861 861 862 // Check whether the user is allowed to edit this study. If it is not allowed 863 // the used should had never seen a link to this page, so he should never get 864 // here. That's why we just return false 865 if( !study.canWrite(AuthenticationService.getLoggedInUser()) ) { 866 return false; 867 } 868 869 flow.study = study 862 // Check whether the user is allowed to edit this study. If it is not allowed 863 // the used should had never seen a link to this page, so he should never get 864 // here. That's why we just return false 865 if (!study.canWrite(AuthenticationService.getLoggedInUser())) { 866 return false 867 } 868 869 flow.study = study 870 870 871 // set 'quicksave' variable 871 872 flow.quickSave = true … … 882 883 /** 883 884 * Handle the wizard study page 884 * 885 * 885 886 * @param Map LocalAttributeMap (the flow scope) 886 887 * @param Map localAttributeMap (the flash scope) … … 891 892 // remember the params in the flash scope 892 893 flash.values = params 893 894 894 895 // instantiate study of it is not yet present 895 896 if (!flow.study) flow.study = new Study() … … 928 929 handleUsers(flow, flash, params, 'writers') 929 930 930 931 if( params.get( "publicstudy" )) {932 flow.study.publicstudy = params.get( "publicstudy")933 931 // handle public checkbox 932 if (params.get("publicstudy")) { 933 flow.study.publicstudy = params.get("publicstudy") 934 } 934 935 935 936 // validate the study … … 1051 1052 * @param Map localAttributeMap (the flash scope) 1052 1053 * @param Map GrailsParameterMap (the flow parameters = form data) 1053 * @param String 'readers' or 'writers' 1054 * @param String 'readers' or 'writers' 1054 1055 * @return boolean 1055 1056 */ … … 1057 1058 def users = [] 1058 1059 1059 if( type == "readers") {1060 1061 } else if( type == "writers") {1062 1063 1060 if (type == "readers") { 1061 users = flow.study.readers ?: [] 1062 } else if (type == "writers") { 1063 users = flow.study.writers ?: [] 1064 } 1064 1065 1065 1066 // Check the ids of the contacts that should be attached … … 1094 1095 } 1095 1096 1096 if( type == "readers" ) { 1097 if( flow.study.readers ) 1098 flow.study.readers.clear() 1099 users.each { flow.study.addToReaders( it ) } 1100 } else if( type == "writers" ) { 1101 if( flow.study.writers ) 1102 flow.study.writers.clear() 1103 1104 users.each { flow.study.addToWriters( it ) } 1105 } 1106 1097 if (type == "readers") { 1098 if (flow.study.readers) 1099 flow.study.readers.clear() 1100 users.each { flow.study.addToReaders(it) } 1101 } else if (type == "writers") { 1102 if (flow.study.writers) 1103 flow.study.writers.clear() 1104 1105 users.each { flow.study.addToWriters(it) } 1106 } 1107 1107 } 1108 1108 1109 1109 /** 1110 1110 * Handle the wizard subject page … … 1189 1189 } 1190 1190 subjectName = tempSubjectName 1191 1191 1192 1192 // create a subject instance 1193 1193 def subject = new Subject( … … 1323 1323 } 1324 1324 } 1325 1325 1326 1326 eventGroup.removeFromSamplingEvents(event) 1327 1327 } else {
Note: See TracChangeset
for help on using the changeset viewer.