- Timestamp:
- Nov 10, 2009, 1:26:53 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 26 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/SecurityConfig.groovy
r147 r182 46 46 '/login/**': ['IS_AUTHENTICATED_ANONYMOUSLY'], 47 47 '/logout*': ['IS_AUTHENTICATED_FULLY'], 48 '/logout/**': ['IS_AUTHENTICATED_FULLY'] 48 '/logout/**': ['IS_AUTHENTICATED_FULLY'], 49 '/image*': ['IS_AUTHENTICATED_FULLY'], 50 '/image/**': ['IS_AUTHENTICATED_FULLY'] 49 51 ] 50 52 -
trunk/grails-app/conf/UrlMappings.groovy
r75 r182 1 1 class UrlMappings { 2 2 static mappings = { 3 "/$controller/$action?/$id?"{ 4 constraints { 5 // apply constraints here 6 } 7 } 8 "/"(view:"/index") 9 "500"(view:'/error') 10 } 3 "/$controller/$action?/$id?"{ 4 constraints { 5 // apply constraints here 6 } 7 } 8 9 "/image/$id/$size?/$filename?" { 10 constraints { 11 size(matches: /\d+/) 12 } 13 controller = 'pictureDetailed' 14 action = 'view' 15 } 16 17 "/"(view:"/index") 18 "500"(view:'/error') 19 } 11 20 } -
trunk/grails-app/controllers/AssignedPersonDetailedController.groovy
r178 r182 85 85 if(!params.task?.id) { 86 86 flash.message = "Please select a task and then 'Add Assigned Person'" 87 redirect(controller: "taskDetailed", action: list)87 redirect(controller: "taskDetailed", action: search) 88 88 } 89 89 else { -
trunk/grails-app/domain/InventoryItem.groovy
r175 r182 5 5 InventoryLocation inventoryLocation 6 6 Period averageDeliveryPeriod 7 Picture picture 7 8 String name 8 9 String description = "" … … 17 18 boolean enableReorder = true 18 19 20 static mapping = { 21 picture cascade: 'all-delete-orphan', lazy: true, inverse: true 22 } 23 19 24 static hasMany = [alternateItems: InventoryItem, 20 25 spareFor: Asset, … … 26 31 27 32 static constraints = { 33 picture(nullable:true) 28 34 name(unique:true, blank:false, maxSize:50) 29 35 description() … … 45 51 String toString() {"${this.name}"} 46 52 } 47 -
trunk/grails-app/services/CreateDataService.groovy
r181 r182 9 9 boolean transactional = false 10 10 11 def authenticateService11 def personService 12 12 def taskService 13 13 … … 151 151 //Person 152 152 def passClearText = "pass" 153 def passwordEncoded = authenticateService.encodePassword(passClearText)153 def passwordEncoded = personService.encodePassword(passClearText) 154 154 def personInstance 155 155 … … 168 168 //Person 169 169 def passClearText = "pass" 170 def passwordEncoded = authenticateService.encodePassword(passClearText)170 def passwordEncoded = personService.encodePassword(passClearText) 171 171 def personInstance 172 172 … … 200 200 //Person 201 201 def passClearText = "pass" 202 def passwordEncoded = authenticateService.encodePassword(passClearText)202 def passwordEncoded = personService.encodePassword(passClearText) 203 203 def personInstance 204 204 -
trunk/grails-app/services/TaskService.groovy
r181 r182 4 4 5 5 def dateUtilService 6 def authenticateService6 def personService 7 7 8 8 def create(params) { … … 14 14 result.taskInstance = taskInstance 15 15 16 // Get person in a safe way to avoid a null userDomain during bootstrap.17 def userDomain = authenticateService.userDomain()18 def person = userDomain ? Person.get(userDomain.id) : Person.get(1)19 20 16 if(taskInstance.save()) { 21 def taskModification = new TaskModification(person: person,17 def taskModification = new TaskModification(person: personService.currentUser(), 22 18 taskModificationType: TaskModificationType.get(1), 23 19 task: taskInstance) … … 64 60 65 61 if(result.taskInstance.save()) { 66 def taskModification = new TaskModification(person: Person.get(authenticateService.userDomain().id),62 def taskModification = new TaskModification(person:personService.currentUser(), 67 63 taskModificationType: TaskModificationType.get(3), 68 64 task: result.taskInstance) … … 107 103 108 104 if(result.taskInstance.save()) { 109 def taskModification = new TaskModification(person: Person.get(authenticateService.userDomain().id),105 def taskModification = new TaskModification(person:personService.currentUser(), 110 106 taskModificationType: TaskModificationType.get(4), 111 107 task: result.taskInstance) … … 150 146 151 147 if(result.taskInstance.save()) { 152 def taskModification = new TaskModification(person: Person.get(authenticateService.userDomain().id),148 def taskModification = new TaskModification(person:personService.currentUser(), 153 149 taskModificationType: TaskModificationType.get(5), 154 150 task: result.taskInstance) … … 193 189 194 190 if(result.taskInstance.save()) { 195 def taskModification = new TaskModification(person: Person.get(authenticateService.userDomain().id),191 def taskModification = new TaskModification(person:personService.currentUser(), 196 192 taskModificationType: TaskModificationType.get(6), 197 193 task: result.taskInstance) … … 236 232 237 233 if(result.taskInstance.save()) { 238 def taskModification = new TaskModification(person: Person.get(authenticateService.userDomain().id),234 def taskModification = new TaskModification(person:personService.currentUser(), 239 235 taskModificationType: TaskModificationType.get(7), 240 236 task: result.taskInstance) … … 279 275 280 276 if(result.taskInstance.save()) { 281 def taskModification = new TaskModification(person: Person.get(authenticateService.userDomain().id),277 def taskModification = new TaskModification(person:personService.currentUser(), 282 278 taskModificationType: TaskModificationType.get(8), 283 279 task: result.taskInstance) … … 322 318 323 319 if(result.taskInstance.save()) { 324 def taskModification = new TaskModification(person: Person.get(authenticateService.userDomain().id),320 def taskModification = new TaskModification(person:personService.currentUser(), 325 321 taskModificationType: TaskModificationType.get(9), 326 322 task: result.taskInstance) -
trunk/grails-app/views/assetDetailed/list.gsp
r151 r182 51 51 <td> 52 52 <g:link action="show" id="${assetInstance.id}"> 53 <img src="${resource(dir:'images/skin',file:'database_ table.png')}" alt="Show" />53 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" /> 54 54 </g:link> 55 55 </td> -
trunk/grails-app/views/assetDetailed/search.gsp
r156 r182 64 64 <td> 65 65 <g:link action="show" id="${assetInstance.id}"> 66 <img src="${resource(dir:'images/skin',file:'database_ table.png')}" alt="Show" />66 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" /> 67 67 </g:link> 68 68 </td> -
trunk/grails-app/views/inventoryItemDetailed/create.gsp
r175 r182 43 43 </td> 44 44 </tr> 45 45 46 46 <tr class="prop"> 47 47 <td valign="top" class="name"> 48 <label for=" unitsInStock">In Stock:</label>48 <label for="inventoryLocation">Inventory Location:</label> 49 49 </td> 50 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'unitsInStock','errors')}"> 51 <input type="text" id="unitsInStock" name="unitsInStock" value="${fieldValue(bean:inventoryItemInstance,field:'unitsInStock')}" /> 52 <g:select optionKey="id" from="${UnitOfMeasure.list()}" name="unitOfMeasure.id" value="${inventoryItemInstance?.unitOfMeasure?.id}" ></g:select> 50 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}"> 51 <g:select optionKey="id" from="${InventoryLocation.list()}" name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}" ></g:select> 53 52 </td> 54 53 </tr> … … 60 59 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'reorderPoint','errors')}"> 61 60 <input type="text" id="reorderPoint" name="reorderPoint" value="${fieldValue(bean:inventoryItemInstance,field:'reorderPoint')}" /> 61 <g:select optionKey="id" from="${UnitOfMeasure.list()}" name="unitOfMeasure.id" value="${inventoryItemInstance?.unitOfMeasure?.id}" ></g:select> 62 62 </td> 63 63 </tr> … … 71 71 </td> 72 72 </tr> 73 74 <tr class="prop">75 <td valign="top" class="name">76 <label for="recommendedReorderPoint">Recommended Reorder Point:</label>77 </td>78 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'recommendedReorderPoint','errors')}">79 <input type="text" id="recommendedReorderPoint" name="recommendedReorderPoint" value="${fieldValue(bean:inventoryItemInstance,field:'recommendedReorderPoint')}" />80 </td>81 </tr>82 83 <tr class="prop">84 <td valign="top" class="name">85 <label for="isActive">Active:</label>86 </td>87 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isActive','errors')}">88 <g:checkBox name="isActive" value="${inventoryItemInstance?.isActive}" ></g:checkBox>89 </td>90 </tr>91 92 <tr class="prop">93 <td valign="top" class="name">94 <label for="isObsolete">Obsolete:</label>95 </td>96 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isObsolete','errors')}">97 <g:checkBox name="isObsolete" value="${inventoryItemInstance?.isObsolete}" ></g:checkBox>98 </td>99 </tr>100 73 101 74 <tr class="prop"> … … 171 144 </tr> 172 145 173 <tr class="prop">174 <td valign="top" class="name">175 <label for="inventoryLocation">Inventory Location:</label>176 </td>177 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}">178 <g:select optionKey="id" from="${InventoryLocation.list()}" name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}" ></g:select>179 </td>180 </tr>181 182 146 </tbody> 183 147 </table> -
trunk/grails-app/views/inventoryItemDetailed/edit.gsp
r175 r182 7 7 <title>Edit InventoryItem</title> 8 8 <nav:resources override="true"/> 9 <g:render template="/shared/pictureHead" /> 9 10 </head> 10 11 <body> … … 27 28 <table> 28 29 <tbody> 30 31 <tr class="prop"> 32 <td valign="top" class="name">Picture:</td> 33 <td valign="top" class="value"> 34 <g:if test="${inventoryItemInstance.picture}" > 35 <span class='gallery'> 36 <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" /> 37 </span> 38 <br /> 39 <g:link controller="pictureDetailed" action="edit" id="${inventoryItemInstance.picture.id}" > 40 Edit Picture 41 </g:link> 42 </g:if> 43 </td> 44 </tr> 29 45 30 46 <tr class="prop"> … … 50 66 <label for="unitsInStock">Units In Stock:</label> 51 67 </td> 52 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'unitsInStock','errors')}"> 53 <input type="text" id="unitsInStock" name="unitsInStock" value="${fieldValue(bean:inventoryItemInstance,field:'unitsInStock')}" /> 54 <g:select optionKey="id" from="${UnitOfMeasure.list()}" name="unitOfMeasure.id" value="${inventoryItemInstance?.unitOfMeasure?.id}" ></g:select> 68 <td valign="top" class="value"> 69 ${inventoryItemInstance.unitsInStock} ${inventoryItemInstance.unitOfMeasure} 55 70 </td> 56 71 </tr> -
trunk/grails-app/views/inventoryItemDetailed/list.gsp
r175 r182 52 52 <td> 53 53 <g:link action="show" id="${inventoryItemInstance.id}"> 54 <img src="${resource(dir:'images/skin',file:'database_ table.png')}" alt="Show" />54 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" /> 55 55 </g:link> 56 56 </td> -
trunk/grails-app/views/inventoryItemDetailed/search.gsp
r178 r182 7 7 <title>InventoryItem Search</title> 8 8 <nav:resources override="true"/> 9 <g:render template="/shared/pictureHead" /> 9 10 <filterpane:includes /> 10 11 </head> … … 33 34 <thead> 34 35 <tr> 35 36 <g:sortableColumn property="id" title="Id" params="${filterParams}" />36 37 <th>Picture</th> 37 38 38 39 <g:sortableColumn property="name" title="Name" params="${filterParams}" /> … … 50 51 <tbody> 51 52 <g:each in="${inventoryItemInstanceList}" status="i" var="inventoryItemInstance"> 52 <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"'/> 53 <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" /> 54 55 <td class='gallery'> 56 <g:if test="${inventoryItemInstance.picture}" > 57 <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" 58 size="${Image.Small}" 59 lightboxSize="${Image.Large}" 60 target="_blank" 61 title="Show Original" /> 62 </g:if> 63 </td> 53 64 54 <td>${fieldValue(bean:inventoryItemInstance, field:'id')}</td> 65 <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' > 66 ${fieldValue(bean:inventoryItemInstance, field:'name')} 67 </td> 55 68 56 <td>${fieldValue(bean:inventoryItemInstance, field:'name')}</td> 69 <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' > 70 ${fieldValue(bean:inventoryItemInstance, field:'description')} 71 </td> 57 72 58 <td>${fieldValue(bean:inventoryItemInstance, field:'description')}</td> 73 <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' > 74 ${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')} 75 </td> 59 76 60 <td >${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')}</td>61 62 < td>${fieldValue(bean:inventoryItemInstance, field:'unitOfMeasure')}</td>77 <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' > 78 ${fieldValue(bean:inventoryItemInstance, field:'unitOfMeasure')} 79 </td> 63 80 64 81 <td> 65 82 <g:link action="show" id="${inventoryItemInstance.id}"> 66 <img src="${resource(dir:'images/skin',file:'database_ table.png')}" alt="Show" />83 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" /> 67 84 </g:link> 68 85 </td> -
trunk/grails-app/views/inventoryItemDetailed/show.gsp
r175 r182 7 7 <title>Show InventoryItem</title> 8 8 <nav:resources override="true"/> 9 <g:render template="/shared/pictureHead" /> 9 10 </head> 10 11 <body> … … 19 20 <table> 20 21 <tbody> 21 22 23 <tr class="prop"> 24 <td valign="top" class="name">Picture:</td> 25 <td valign="top" class="value"> 26 <g:if test="${inventoryItemInstance.picture}" > 27 <span class='gallery'><wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" /></span> 28 </g:if> 29 <g:else> 30 <g:link controller="pictureDetailed" 31 params="['inventoryItem.id':inventoryItemInstance?.id]" 32 action="create"> 33 Add Picture 34 </g:link> 35 </g:else> 36 </td> 37 </tr> 22 38 23 39 <tr class="prop"> … … 43 59 44 60 <tr class="prop"> 45 <td valign="top" class="name">Units In Stock:</td> 46 47 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')}</td> 48 49 </tr> 50 51 <tr class="prop"> 52 <td valign="top" class="name">Unit Of Measure:</td> 53 54 <td valign="top" class="value">${inventoryItemInstance?.unitOfMeasure?.encodeAsHTML()}</td> 55 56 </tr> 57 61 <td valign="top" class="name">Location:</td> 62 63 <td valign="top" class="value"> 64 <g:link controller="inventoryLocationDetailed" action="show" id="${inventoryItemInstance?.inventoryLocation?.id}"> 65 ${inventoryItemInstance?.inventoryLocation?.encodeAsHTML()} 66 </g:link> 67 in ${inventoryItemInstance?.inventoryLocation?.inventoryStore.encodeAsHTML()} 68 </td> 69 70 </tr> 71 72 <tr class="prop"> 73 <td valign="top" class="name">In Stock:</td> 74 75 <td valign="top" class="value"> 76 ${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')} ${inventoryItemInstance?.unitOfMeasure?.encodeAsHTML()} 77 </td> 78 79 </tr> 58 80 59 81 <tr class="prop"> … … 184 206 </ul> 185 207 </td> 186 187 </tr>188 189 <tr class="prop">190 <td valign="top" class="name">Inventory Location:</td>191 192 <td valign="top" class="value"><g:link controller="inventoryLocationDetailed" action="show" id="${inventoryItemInstance?.inventoryLocation?.id}">${inventoryItemInstance?.inventoryLocation?.encodeAsHTML()}</g:link></td>193 208 194 209 </tr> -
trunk/grails-app/views/layouts/main.gsp
r151 r182 9 9 <nav:resources override="true"/> 10 10 <g:javascript library="application" /> 11 <g:javascript library="prototype/effects" /> 11 12 </head> 12 13
Note: See TracChangeset
for help on using the changeset viewer.