Changeset 1092
- Timestamp:
- Nov 5, 2010, 9:02:01 PM (12 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/nmc/PilotController.groovy
r1049 r1092 39 39 def index = { 40 40 41 session.pilot = true 42 43 def user = authenticationService.getLoggedInUser() 44 def max = Math.min(params.max ? params.int('max') : 10, 100) 45 46 def c = Study.createCriteria() 47 48 def studies 49 if( user == null ) { 50 //login and return here... 51 redirect(controller:"login", action:"auth") 52 return false 53 54 } else { 55 studies = c.list { 56 maxResults(max) 57 or { 58 eq( "owner", user ) 59 writers { 60 eq( "id", user.id ) 61 } 62 and { 63 readers { 64 eq( "id", user.id ) 65 } 66 eq( "published", true ) 67 } 68 } 69 } 70 } 71 41 72 def studyInstance = new Study() 42 73 studyInstance.properties = params 43 74 44 [studyInstanceList: Study.list(params), studyInstance: studyInstance]75 [studyInstanceList: studies, studyInstance: studyInstance] 45 76 } 46 77 -
trunk/grails-app/views/common/_topnav.gsp
r1036 r1092 60 60 </li> 61 61 </g:if> 62 <g:if test="${session.pilot == true}"> 63 <li><g:link controller="pilot" action="index">Pilot</g:link></li> 64 </g:if> 62 65 </ul> 63 66 <!-- /TOPNAV //-->
Note: See TracChangeset
for help on using the changeset viewer.