Changeset 440 for trunk/grails-app
- Timestamp:
- Mar 16, 2010, 11:33:22 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/Config.groovy
r433 r440 104 104 warn "grails.app.controller" 105 105 info "grails.app.service.AssetCsvService" 106 info "grails.app.service.PersonCsvService" 106 107 info "grails.app.service.InventoryCsvService" 107 108 break … … 306 307 [order:91, controller:'productionReferenceDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }] 307 308 ] 309 ], 310 [order:170, controller:'costCodeDetailed', title:'costCode', action:'list', 311 subItems: [ 312 [order:10, controller:'costCodeDetailed', title:'Cost Code List', action:'list', isVisible: { true }], 313 [order:20, controller:'costCodeDetailed', title:'Create', action:'create', isVisible: { true }], 314 [order:90, controller:'costCodeDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }], 315 [order:91, controller:'costCodeDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }] 316 ] 308 317 ] 309 318 ] -
trunk/grails-app/controllers/PersonController.groovy
r403 r440 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 import org.codehaus.groovy.grails.commons.ConfigurationHolder 2 3 3 4 @Secured(['ROLE_Manager','ROLE_AppAdmin']) 4 5 class PersonController extends BaseAppAdminController { 5 6 7 def filterService 8 def personCsvService 6 9 def authenticateService 7 def filterService8 10 9 11 // the delete, save and update actions only accept POST requests … … 12 14 def index = { 13 15 redirect action: list, params: params 16 } 17 18 /** 19 * Disaply the import view. 20 */ 21 def importPersons = { 22 } 23 24 /** 25 * Handle the import save. 26 */ 27 def importPersonsSave = { 28 def result = personCsvService.importPersons(request) 29 30 if(!result.error) { 31 response.contentType = ConfigurationHolder.config.grails.mime.types["text"] 32 response.setHeader("Content-disposition", "attachment; filename=LoginNamesAndPasswords.txt") 33 render result.loginNamesAndPasswords 34 return 35 } 36 37 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 38 redirect(action: importPersons) 39 } 40 41 /** 42 * Export a csv template. 43 * NOTE: IE has a 'validating' bug in dev mode that causes the export to take a long time! 44 * This does not appear to be a problem once deployed to Tomcat. 45 */ 46 def exportPersonsTemplate = { 47 response.contentType = ConfigurationHolder.config.grails.mime.types["csv"] 48 response.setHeader("Content-disposition", "attachment; filename=personsTemplate.csv") 49 def s = personCsvService.buildPersonsTemplate() 50 render s 14 51 } 15 52 -
trunk/grails-app/i18n/messages.properties
r437 r440 7 7 inventory.import.success=Inventory imported. 8 8 inventory.import.failure=Could not create inventory from supplied file, failed on line {0}, see {1}. 9 10 inventoryItemPurchase.import.success=Inventory item purchases imported. 11 inventoryItemPurchase.import.failure=Could not create inventory item purchases from supplied file, failed on line {0}, see {1}. 12 13 person.import.success=Person list imported. 14 person.import.failure=Could not create persons from supplied file, failed on line {0}, see {1}. 9 15 10 16 asset.copy.subItem.create.failure=Could not complete operation, as sub item failed to save. … … 138 144 inventoryMovement.still.associated=Could not complete operation as inventory movements are still associated with this item. 139 145 146 inventoryItemPurchase.invoiceNumber.required=An invoice number must be supplied to approve payment. 147 inventoryItemPurchase.delete.failure.received.exists=Could not delete, items have been received. 148 inventoryItemPurchase.delete.failure.payment.approved=Could not delete, payment has been approved. 149 140 150 assignedGroup.task.not.found=Please select a task and then ''Add Assigned Group''. 141 151 assignedPerson.task.not.found=Please select a task and then ''Add Assigned Person''. -
trunk/grails-app/views/person/list.gsp
r399 r440 29 29 Results:${personTotal} 30 30 </div> 31 32 <jsUtil:toggleControl toggleId="options" 33 imageId="optionsImg" 34 closedImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_right.png')}" 35 openImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_down.png')}" 36 text="${g.message(code: 'default.options.text')}" 37 /> 38 39 <div id="options" style="display:none;"> 40 <g:form method="post" > 41 <g:hiddenField name="params" value="${filterParams}" /> 42 <div class="dialog"> 43 <table> 44 <tbody> 45 46 <tr class="prop"> 47 <td valign="top" class="name"> 48 <label for="max">Persons:</label> 49 </td> 50 <td valign="top" class="value"> 51 <g:link action="exportPersonsTemplate"> 52 Template 53 </g:link> 54 / 55 <g:link action="importPersons"> 56 Import 57 </g:link> 58 </td> 59 </tr> 60 61 </tbody> 62 </table> 63 </div> 64 </g:form> 65 </div> 66 67 <br /> 31 68 32 69 <div class="list">
Note: See TracChangeset
for help on using the changeset viewer.