Changeset 336
- Timestamp:
- Feb 9, 2010, 2:54:30 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AssetSubItemDetailedController.groovy
r298 r336 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 import org.codehaus.groovy.grails.commons.ConfigurationHolder 2 3 3 4 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager']) 4 5 class AssetSubItemDetailedController extends BaseController { 5 6 7 def filterService 8 def exportService 6 9 def assetSubItemService 7 10 … … 11 14 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser']) 12 15 def index = { redirect(controller: "assetDetailed", params:params) } 16 17 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser']) 18 def search = { 19 20 if(session.assetSearchParamsMax) 21 params.max = session.assetSearchParamsMax 22 23 params.max = Math.min( params.max ? params.max.toInteger() : 10, 1000) 24 25 def assetSubItemInstanceList = [] 26 def assetSubItemInstanceTotal 27 def filterParams = [:] 28 29 // Quick Search: 30 if(!params.filter) { 31 assetSubItemInstanceList = AssetSubItem.list( params ) 32 assetSubItemInstanceTotal = AssetSubItem.count() 33 filterParams.quickSearch = params.quickSearch 34 } 35 else { 36 // filterPane: 37 assetSubItemInstanceList = filterService.filter( params, AssetSubItem ) 38 assetSubItemInstanceTotal = filterService.count( params, AssetSubItem ) 39 filterParams = com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params) 40 } 41 42 // export plugin: 43 if(params?.format && params.format != "html") { 44 45 def dateFmt = { date -> 46 formatDate(format: "EEE, dd-MMM-yyyy", date: date) 47 } 48 49 String title = "AssetSubItem List." 50 51 response.contentType = ConfigurationHolder.config.grails.mime.types[params.format] 52 response.setHeader("Content-disposition", "attachment; filename=assets.${params.extension}") 53 List fields = ["name", 54 "description"] 55 Map labels = ["name": "AssetSubItem", 56 "description": "Description"] 57 58 Map formatters = [:] 59 Map parameters = [title: title, separator: ","] 60 61 exportService.export(params.format, 62 response.outputStream, 63 assetSubItemInstanceList.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }, 64 fields, 65 labels, 66 formatters, 67 parameters) 68 } 69 70 // Add some basic params to filterParams. 71 filterParams.max = params.max 72 filterParams.offset = params.offset?.toInteger() ?: 0 73 filterParams.sort = params.sort ?: "id" 74 filterParams.order = params.order ?: "desc" 75 76 return[ assetSubItemInstanceList: assetSubItemInstanceList, 77 assetSubItemInstanceTotal: assetSubItemInstanceTotal, 78 filterParams: filterParams ] 79 80 } // end search() 13 81 14 82 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser']) -
trunk/grails-app/views/assetSubItemDetailed/create.gsp
r330 r336 9 9 <body> 10 10 <div class="nav"> 11 < h1>Create Sub Item</h1>11 <span class="menuButton"><g:link class="list" action="search">Sub Item Search</g:link></span> 12 12 </div> 13 13 <div class="body"> 14 <h1>Create Sub Item</h1> 14 15 <g:render template="/shared/messages" /> 15 16 <g:hasErrors bean="${assetSubItemInstance}"> -
trunk/grails-app/views/assetSubItemDetailed/edit.gsp
r330 r336 9 9 <body> 10 10 <div class="nav"> 11 < h1>Edit Sub Item</h1>11 <span class="menuButton"><g:link class="list" action="search">Sub Item Search</g:link></span> 12 12 </div> 13 13 <div class="body"> 14 <h1>Edit Sub Item</h1> 14 15 <g:render template="/shared/messages" /> 15 16 <g:hasErrors bean="${assetSubItemInstance}"> -
trunk/grails-app/views/assetSubItemDetailed/show.gsp
r330 r336 9 9 <body> 10 10 <div class="nav"> 11 <h1>Show Sub Item</h1> 11 <span class="menuButton"><g:link class="list" action="search">Sub Item Search</g:link></span> 12 <span class="menuButton"><g:link class="create" action="create">New Sub Item</g:link></span> 12 13 </div> 13 14 <div class="body"> 15 <h1>Show Sub Item</h1> 14 16 <g:render template="/shared/messages" /> 15 17 <div class="dialog">
Note: See TracChangeset
for help on using the changeset viewer.