Changeset 380
- Timestamp:
- Feb 18, 2010, 3:42:40 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/Config.groovy
r377 r380 239 239 [order:91, controller:'inventoryLocationDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }] 240 240 ] 241 ], 242 [order:90, controller:'inventoryGroupDetailed', title:'inventoryGroup', action:'list', 243 subItems: [ 244 [order:10, controller:'inventoryGroupDetailed', title:'Inventory Group List', action:'list', isVisible: { true }], 245 [order:20, controller:'inventoryGroupDetailed', title:'Create', action:'create', isVisible: { true }], 246 [order:90, controller:'inventoryGroupDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }], 247 [order:91, controller:'inventoryGroupDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }] 248 ] 241 249 ] 242 250 ] -
trunk/grails-app/controllers/InventoryGroupDetailedController.groovy
r361 r380 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 class InventoryGroupController extends BaseAppAdminController { 4 3 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager']) 4 class InventoryGroupDetailedController extends BaseController { 5 6 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser']) 5 7 def index = { redirect(action:list,params:params) } 6 8 … … 8 10 static allowedMethods = [delete:'POST', save:'POST', update:'POST'] 9 11 12 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser']) 10 13 def list = { 11 14 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) … … 13 16 } 14 17 18 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser']) 15 19 def show = { 20 21 // In the case of an actionSubmit button, rewrite action name from 'index'. 22 if(params._action_Show) 23 params.action='show' 24 16 25 def inventoryGroupInstance = InventoryGroup.get( params.id ) 17 26 … … 43 52 44 53 def edit = { 54 55 // In the case of an actionSubmit button, rewrite action name from 'index'. 56 if(params._action_Edit) 57 params.action='edit' 58 45 59 def inventoryGroupInstance = InventoryGroup.get( params.id ) 46 60 -
trunk/grails-app/views/inventoryGroupDetailed/create.gsp
r178 r380 6 6 <meta name="layout" content="main" /> 7 7 <title>Create InventoryGroup</title> 8 <nav:resources override="true"/> 8 9 </head> 9 10 <body> 10 11 <div class="nav"> 11 < span class="menuButton"><g:link class="list" action="list">InventoryGroup List</g:link></span>12 <nav:renderSubItems group="navAlt"/> 12 13 </div> 13 14 <div class="body"> 14 <h1>Create InventoryGroup</h1>15 15 <g:if test="${flash.message}"> 16 16 <div class="message">${flash.message}</div> -
trunk/grails-app/views/inventoryGroupDetailed/edit.gsp
r178 r380 6 6 <meta name="layout" content="main" /> 7 7 <title>Edit InventoryGroup</title> 8 <nav:resources override="true"/> 8 9 </head> 9 10 <body> 10 11 <div class="nav"> 11 <span class="menuButton"><g:link class="list" action="list">InventoryGroup List</g:link></span> 12 <span class="menuButton"><g:link class="create" action="create">New InventoryGroup</g:link></span> 12 <nav:renderSubItems group="navAlt"/> 13 13 </div> 14 14 <div class="body"> 15 <h1>Edit InventoryGroup</h1>16 15 <g:if test="${flash.message}"> 17 16 <div class="message">${flash.message}</div> … … 49 48 <tr class="prop"> 50 49 <td valign="top" class="name"> 50 <label for="isActive">Is Active:</label> 51 </td> 52 <td valign="top" class="value ${hasErrors(bean:inventoryGroupInstance,field:'isActive','errors')}"> 53 <g:checkBox name="isActive" value="${inventoryGroupInstance?.isActive}" ></g:checkBox> 54 </td> 55 </tr> 56 57 <tr class="prop"> 58 <td valign="top" class="name"> 51 59 <label for="inventoryItems">Inventory Items:</label> 52 60 </td> … … 55 63 <ul> 56 64 <g:each var="i" in="${inventoryGroupInstance?.inventoryItems?}"> 57 <li><g:link controller="inventoryItem " action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>65 <li><g:link controller="inventoryItemDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li> 58 66 </g:each> 59 67 </ul> 60 <g:link controller="inventoryItem " params="['inventoryGroup.id':inventoryGroupInstance?.id]" action="create">Add InventoryItem</g:link>68 <g:link controller="inventoryItemDetailed" params="['inventoryGroup.id':inventoryGroupInstance?.id]" action="create">Add InventoryItem</g:link> 61 69 62 </td>63 </tr>64 65 <tr class="prop">66 <td valign="top" class="name">67 <label for="isActive">Is Active:</label>68 </td>69 <td valign="top" class="value ${hasErrors(bean:inventoryGroupInstance,field:'isActive','errors')}">70 <g:checkBox name="isActive" value="${inventoryGroupInstance?.isActive}" ></g:checkBox>71 70 </td> 72 71 </tr> … … 77 76 <div class="buttons"> 78 77 <span class="button"><g:actionSubmit class="save" value="Update" /></span> 78 <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span> 79 79 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 80 80 </div> -
trunk/grails-app/views/inventoryGroupDetailed/list.gsp
r178 r380 6 6 <meta name="layout" content="main" /> 7 7 <title>InventoryGroup List</title> 8 <nav:resources override="true"/> 8 9 </head> 9 10 <body> 10 11 <div class="nav"> 11 < span class="menuButton"><g:link class="create" action="create">New InventoryGroup</g:link></span>12 <nav:renderSubItems group="navAlt"/> 12 13 </div> 13 14 <div class="body"> 14 <h1>InventoryGroup List</h1>15 15 <g:if test="${flash.message}"> 16 16 <div class="message">${flash.message}</div> … … 21 21 <tr> 22 22 23 <g:sortableColumn property="id" title="Id" /> 24 25 <g:sortableColumn property="name" title="Name" /> 26 27 <g:sortableColumn property="description" title="Description" /> 28 29 <g:sortableColumn property="isActive" title="Is Active" /> 23 <g:sortableColumn property="id" title="Id" /> 24 25 <g:sortableColumn property="name" title="Name" /> 26 27 <g:sortableColumn property="description" title="Description" /> 28 29 <g:sortableColumn property="isActive" title="Is Active" /> 30 31 <th></th> 30 32 31 33 </tr> … … 33 35 <tbody> 34 36 <g:each in="${inventoryGroupInstanceList}" status="i" var="inventoryGroupInstance"> 35 <tr class="${(i % 2) == 0 ? ' odd' : 'even'}">37 <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/inventoryGroupDetailed/show/${inventoryGroupInstance.id}"'/> 36 38 37 <td> <g:link action="show" id="${inventoryGroupInstance.id}">${fieldValue(bean:inventoryGroupInstance, field:'id')}</g:link></td>39 <td>${fieldValue(bean:inventoryGroupInstance, field:'id')}</td> 38 40 39 41 <td>${fieldValue(bean:inventoryGroupInstance, field:'name')}</td> … … 42 44 43 45 <td>${fieldValue(bean:inventoryGroupInstance, field:'isActive')}</td> 46 47 <td> 48 <g:link action="show" id="${inventoryGroupInstance.id}"> 49 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" /> 50 </g:link> 51 </td> 44 52 45 53 </tr> -
trunk/grails-app/views/inventoryGroupDetailed/show.gsp
r178 r380 6 6 <meta name="layout" content="main" /> 7 7 <title>Show InventoryGroup</title> 8 <nav:resources override="true"/> 8 9 </head> 9 10 <body> 10 11 <div class="nav"> 11 <span class="menuButton"><g:link class="list" action="list">InventoryGroup List</g:link></span> 12 <span class="menuButton"><g:link class="create" action="create">New InventoryGroup</g:link></span> 12 <nav:renderSubItems group="navAlt"/> 13 13 </div> 14 14 <div class="body"> 15 <h1>Show InventoryGroup</h1>16 15 <g:if test="${flash.message}"> 17 16 <div class="message">${flash.message}</div> … … 42 41 43 42 </tr> 44 45 <tr class="prop">46 <td valign="top" class="name">Inventory Items:</td>47 48 <td valign="top" style="text-align:left;" class="value">49 <ul>50 <g:each var="i" in="${inventoryGroupInstance.inventoryItems}">51 <li><g:link controller="inventoryItem" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>52 </g:each>53 </ul>54 </td>55 43 56 44 </tr> … … 62 50 63 51 </tr> 52 53 <tr class="prop"> 54 <td valign="top" class="name">Inventory Items:</td> 55 56 <td valign="top" style="text-align:left;" class="value"> 57 <ul> 58 <g:each var="i" in="${inventoryGroupInstance.inventoryItems}"> 59 <li><g:link controller="inventoryItemDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li> 60 </g:each> 61 </ul> 62 </td> 64 63 65 64 </tbody>
Note: See TracChangeset
for help on using the changeset viewer.