Changeset 421
- Timestamp:
- Mar 2, 2010, 9:12:24 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AssetDetailedController.groovy
r414 r421 63 63 def result = assetCsvService.importAssetTree(request) 64 64 65 if(!result.error) 65 if(!result.error) { 66 66 flash.message = g.message(code: "asset.tree.import.success") 67 else 68 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 69 67 redirect(action:search) 68 return 69 } 70 71 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 70 72 redirect(action: importAssetTree) 71 73 } -
trunk/grails-app/i18n/messages.properties
r418 r421 3 3 4 4 asset.tree.import.success=Asset tree imported. 5 asset.tree.import.failure=Could not create asset tree from supplied file, failed on line {0} .5 asset.tree.import.failure=Could not create asset tree from supplied file, failed on line {0}, see {1}. 6 6 7 7 inventory.import.success=Inventory imported. 8 inventory.import.failure=Could not create inventory from supplied file, failed on line {0} .8 inventory.import.failure=Could not create inventory from supplied file, failed on line {0}, see {1}. 9 9 10 10 asset.copy.method.required=Please select a copy method for sub items. -
trunk/grails-app/services/AssetCsvService.groovy
r414 r421 10 10 11 11 boolean transactional = false 12 13 def g = new org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib() 12 14 13 15 /** … … 22 24 def kByteMultiplier = 1000 23 25 def fileMaxSize = 500 * kByteMultiplier 26 def logFileLink = g.link(controller: "appCore", action: "appLog") {"log"} 24 27 25 28 def multiPartFile = request.getFile('file') … … 155 158 if(!siteInstance.save()) { 156 159 log.error "Failed to create site on line: " + column.name + "(" + lineNumber + ")" 157 return fail(code: "asset.tree.import.failure", args: [lineNumber ])160 return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink]) 158 161 } 159 162 } … … 174 177 if(!departmentInstance.save()) { 175 178 log.error "Failed to create department on line: " + column.name + "(" + lineNumber + ")" 176 return fail(code: "asset.tree.import.failure", args: [lineNumber ])179 return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink]) 177 180 } 178 181 } … … 194 197 if(!sectionInstance.save()) { 195 198 log.error "Failed to create section on line: " + column.name + "(" + lineNumber + ")" 196 return fail(code: "asset.tree.import.failure", args: [lineNumber ])199 return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink]) 197 200 } 198 201 } … … 213 216 if(!assetInstance.save()) { 214 217 log.error "Failed to create asset on line: " + column.name + "(" + lineNumber + ")" 215 return fail(code: "asset.tree.import.failure", args: [lineNumber ])218 return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink]) 216 219 } 217 220 } … … 231 234 if(!assetInstance.save()) { 232 235 log.error "Failed to create assetSubItem on line: " + column.name + "(" + lineNumber + ")" 233 return fail(code: "asset.tree.import.failure", args: [lineNumber ])236 return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink]) 234 237 } 235 238 } … … 250 253 if(!assetSubItemInstance.save()) { 251 254 log.error "Failed to create assetSubItem on line: " + column.name + "(" + lineNumber + ")" 252 return fail(code: "asset.tree.import.failure", args: [lineNumber ])255 return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink]) 253 256 } 254 257 }
Note: See TracChangeset
for help on using the changeset viewer.