Changeset 958 for trunk/grails-app
- Timestamp:
- Jul 1, 2011, 6:13:37 AM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryLocationDetailedController.groovy
r913 r958 3 3 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager']) 4 4 class InventoryLocationDetailedController extends BaseController { 5 6 def filterService 5 7 6 8 // the delete, save and update actions only accept POST requests … … 13 15 def list = { 14 16 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 15 [ inventoryLocationInstanceList: InventoryLocation.list( params ), inventoryLocationInstanceTotal: InventoryLocation.count() ] 17 def associatedPropertyMax = 1000 18 def associatedPropertyValues = [:] 19 def inventoryStoreNameQuery = 'select distinct a.name from InventoryStore a where a.isActive = ? order by a.name' 20 associatedPropertyValues.inventoryStoreList = InventoryStore.executeQuery(inventoryStoreNameQuery, [true], [max:associatedPropertyMax]) 21 22 if(!params.filter) { 23 return [inventoryLocationInstanceList: InventoryLocation.list(params), 24 inventoryLocationInstanceTotal: InventoryLocation.count(), 25 associatedPropertyValues: associatedPropertyValues, 26 filterParams: params] 27 } 28 29 // filterPane: 30 return[ inventoryLocationInstanceList: filterService.filter( params, InventoryLocation ), 31 inventoryLocationInstanceTotal: filterService.count( params, InventoryLocation ), 32 associatedPropertyValues: associatedPropertyValues, 33 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 34 params:params ] 16 35 } 17 36 … … 74 93 def version = params.version.toLong() 75 94 if(inventoryLocationInstance.version > version) { 76 95 77 96 inventoryLocationInstance.errors.rejectValue("version", "default.optimistic.locking.failure") 78 97 render(view:'edit',model:[inventoryLocationInstance:inventoryLocationInstance]) -
trunk/grails-app/views/inventoryLocationDetailed/list.gsp
r836 r958 6 6 <meta name="layout" content="main" /> 7 7 <title>InventoryLocation List</title> 8 <filterpane:includes /> 8 9 <nav:resources override="true"/> 9 10 </head> … … 13 14 </div> 14 15 <div class="body"> 15 <g:if test="${flash.message}"> 16 <div class="message">${flash.message}</div> 17 </g:if> 18 <div class="list"> 19 <table> 20 <thead> 16 <g:render template="/shared/messages" /> 17 18 <filterpane:currentCriteria domainBean="InventoryLocation" 19 action="list" 20 dateFormat="EEE, dd-MMM-yyyy" 21 removeImgDir="images" 22 removeImgFile="bullet_delete.png" 23 title="Search"/> 24 25 <div class="paginateButtons"> 26 Results: ${inventoryLocationInstanceList.size()} / ${inventoryLocationInstanceTotal} 27 <span class="searchButtons"> 28 <filterpane:filterButton text="Search" appliedText="Change Search" /> 29 </span> 30 </div> 31 32 <br /> 33 34 <g:if test="${inventoryLocationInstanceList.size() > 0}"> 35 <div class="list"> 36 <table> 37 <thead> 21 38 <tr> 22 23 <g:sortableColumn property="id" title="Id" />24 39 25 <g:sortableColumn property=" name" title="Name" />40 <g:sortableColumn property="id" title="Id" params="${filterParams}" /> 26 41 27 < th>Inventory Store</th>42 <g:sortableColumn property="name" title="Name" params="${filterParams}" /> 28 43 29 <g:sortableColumn property="isActive" title="Is Active" /> 44 <g:sortableColumn property="inventoryStore" title="Inventory Store" params="${filterParams}" /> 45 46 <g:sortableColumn property="isActive" title="Is Active" params="${filterParams}" /> 30 47 31 48 <th></th> 32 49 33 50 </tr> 34 </thead>35 <tbody>36 <g:each in="${inventoryLocationInstanceList}" status="i" var="inventoryLocationInstance">37 <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}">51 </thead> 52 <tbody> 53 <g:each in="${inventoryLocationInstanceList}" status="i" var="inventoryLocationInstance"> 54 <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}"> 38 55 39 40 <td onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'>41 ${fieldValue(bean:inventoryLocationInstance, field:'id')}42 </td>43 44 <td onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'>45 ${fieldValue(bean:inventoryLocationInstance, field:'name')}46 </td>47 48 <td onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'>49 ${fieldValue(bean:inventoryLocationInstance, field:'inventoryStore')}50 </td>51 52 <td onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'>53 ${fieldValue(bean:inventoryLocationInstance, field:'isActive')}54 </td>55 56 56 <td class="notClickable"> 57 <g:link action="show" id="${inventoryLocationInstance.id}"> 58 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" /> 59 </g:link> 60 </td> 61 62 </tr> 63 </g:each> 64 </tbody> 65 </table> 57 <td onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'> 58 ${fieldValue(bean:inventoryLocationInstance, field:'id')} 59 </td> 60 61 <td onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'> 62 ${fieldValue(bean:inventoryLocationInstance, field:'name')} 63 </td> 64 65 <td onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'> 66 ${fieldValue(bean:inventoryLocationInstance, field:'inventoryStore')} 67 </td> 68 69 <td onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'> 70 ${fieldValue(bean:inventoryLocationInstance, field:'isActive')} 71 </td> 72 73 <td class="notClickable"> 74 <g:link action="show" id="${inventoryLocationInstance.id}"> 75 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" /> 76 </g:link> 77 </td> 78 79 </tr> 80 </g:each> 81 </tbody> 82 </table> 83 </div> 84 </g:if> 85 86 <div class="paginateButtons"> 87 <g:paginate total="${inventoryLocationInstanceTotal}" params="${filterParams}" /> 66 88 </div> 67 <div class="paginateButtons"> 68 <g:paginate total="${inventoryLocationInstanceTotal}" /> 69 </div> 89 90 <filterpane:filterPane domainBean="InventoryLocation" 91 title="Search" 92 action="list" 93 class="overlayPane" 94 associatedProperties="inventoryStore.name" 95 filterPropertyValues="${['inventoryStore.name':[values: associatedPropertyValues.inventoryStoreList]]}" /> 70 96 </div> 71 97 </body>
Note: See TracChangeset
for help on using the changeset viewer.