Changeset 798
- Timestamp:
- Feb 8, 2011, 11:00:27 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 deleted
- 14 edited
- 11 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/application.properties
r612 r798 1 1 #Grails Metadata file 2 # Wed Jun 02 11:20:51 EST 20102 #Thu Jan 27 17:24:52 EST 2011 3 3 app.grails.version=1.2.2 4 4 app.name=gnuMims -
trunk/grails-app/controllers/TaskProcedureDetailedController.groovy
r403 r798 5 5 6 6 def filterService 7 def assetService 8 def taskProcedureService 7 9 8 10 def index = { redirect(action:list,params:params) } … … 40 42 41 43 if(!taskProcedureInstance) { 42 flash.message = "TaskProcedure not found with id ${params.id}" 43 redirect(action:list) 44 } 45 else { return [ taskProcedureInstance : taskProcedureInstance ] } 44 flash.errorMessage = "TaskProcedure not found with id ${params.id}" 45 redirect(controller:'taskDetailed', action:'search') 46 return 47 } 48 49 redirect(controller:'taskDetailed', 50 action:'show', 51 id:taskProcedureInstance.linkedTask?.id, 52 params:[showTab:"showProcedureTab"]) 46 53 } 47 54 … … 49 56 def taskProcedureInstance = TaskProcedure.get( params.id ) 50 57 if(taskProcedureInstance) { 58 def taskInstance = taskProcedureInstance.linkedTask 51 59 try { 60 taskProcedureInstance.tasks.each { 61 it.taskProcedure = null 62 } 52 63 taskProcedureInstance.delete(flush:true) 53 64 flash.message = "TaskProcedure ${params.id} deleted" 54 redirect(action:list) 65 redirect(controller:'taskDetailed', 66 action:'show', 67 id:taskInstance.id, 68 params:[showTab:"showProcedureTab"]) 55 69 } 56 70 catch(org.springframework.dao.DataIntegrityViolationException e) { 57 flash.message = "TaskProcedure ${params.id} could not be deleted" 58 redirect(action:show,id:params.id) 71 flash.errorMessage = "TaskProcedure ${params.id} could not be deleted" 72 redirect(controller:'taskDetailed', 73 action:'show', 74 id:taskInstance.id, 75 params:[showTab:"showProcedureTab"]) 59 76 } 60 77 } 61 78 else { 62 flash. message = "TaskProcedure not found with id ${params.id}"79 flash.errorMessage = "TaskProcedure not found with id ${params.id}" 63 80 redirect(action:list) 64 81 } … … 74 91 75 92 if(!taskProcedureInstance) { 76 flash. message = "TaskProcedure not found with id ${params.id}"93 flash.errorMessage = "TaskProcedure not found with id ${params.id}" 77 94 redirect(action:list) 78 95 } 79 96 else { 80 return [ taskProcedureInstance : taskProcedureInstance ] 97 def assemblies = assetService.getAssemblies(taskProcedureInstance.linkedTask.primaryAsset) 98 return [ taskProcedureInstance : taskProcedureInstance, 99 assemblies: assemblies ] 81 100 } 82 101 } 83 102 84 103 def update = { 85 def taskProcedureInstance = TaskProcedure.get( params.id ) 86 if(taskProcedureInstance) { 87 if(params.version) { 88 def version = params.version.toLong() 89 if(taskProcedureInstance.version > version) { 90 91 taskProcedureInstance.errors.rejectValue("version", "default.optimistic.locking.failure") 92 render(view:'edit',model:[taskProcedureInstance:taskProcedureInstance]) 93 return 94 } 95 } 96 taskProcedureInstance.properties = params 97 if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save(flush: true)) { 98 flash.message = "TaskProcedure ${params.id} updated" 99 redirect(action:show,id:taskProcedureInstance.id) 100 } 101 else { 102 render(view:'edit',model:[taskProcedureInstance:taskProcedureInstance]) 103 } 104 } 105 else { 106 flash.message = "TaskProcedure not found with id ${params.id}" 104 def result = taskProcedureService.update(params) 105 106 if(!result.error) { 107 flash.message = g.message(code: "default.update.success", args: ["TaskProcedure", params.id]) 108 redirect(controller:'taskDetailed', 109 action:'show', 110 id:result.taskProcedureInstance.linkedTask.id, 111 params:[showTab:"showProcedureTab"]) 112 return 113 } 114 115 if(result.error.code == "default.not.found") { 116 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 107 117 redirect(action:list) 108 } 118 return 119 } 120 121 if(result.error.code == "default.optimistic.locking.failure") { 122 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 123 redirect(controller:'taskDetailed', 124 action:'show', 125 id:result.taskProcedureInstance.linkedTask.id, 126 params:[showTab:"showProcedureTab"]) 127 return 128 } 129 130 def assemblies = assetService.getAssemblies(result.taskProcedureInstance.linkedTask.primaryAsset) 131 render(view:'edit', model:[taskProcedureInstance: result.taskProcedureInstance, 132 assemblies: assemblies]) 109 133 } 110 134 111 135 def create = { 112 if(params.taskInstance?.id) { 113 def taskInstance = Task.get(params.taskInstance.id) 114 115 def taskProcedureInstance = new TaskProcedure() 116 taskProcedureInstance.properties = params 117 return ['taskProcedureInstance':taskProcedureInstance, 118 taskInstance: taskInstance] 119 } else { 120 flash.message = "Please select or create a task, then go to the Procedure tab." 136 137 if(!params.taskInstance?.id) { 138 flash.errorMessage = "Please select or create a task, then go to the Procedure tab." 121 139 redirect(controller:"taskDetailed", action:"search") 122 } 140 return 141 } 142 143 params.linkedTask = Task.get(params.taskInstance.id) 144 145 // Task already has a taskProcedure. 146 if(params.linkedTask.taskProcedure) { 147 flash.errorMessage = g.message(code: 'default.optimistic.locking.failure') 148 redirect(controller:'taskDetailed', 149 action:'show', 150 id:params.linkedTask.id, 151 params:[showTab:"showProcedureTab"]) 152 return 153 } 154 155 // Task does not have a primaryAsset. 156 if(!params.linkedTask?.primaryAsset) { 157 flash.errorMessage = "Please set a Primary Asset first, then go to the Procedure tab." 158 redirect(controller:"taskDetailed", action:"show", id:params.linkedTask?.id) 159 return 160 } 161 162 def taskProcedureInstance = new TaskProcedure() 163 taskProcedureInstance.properties = params 164 165 // Populate a couple of maintenanceActions for the first assembly. 166 def assemblies = assetService.getAssemblies(params.linkedTask.primaryAsset) 167 if(assemblies) { 168 def assembly = assemblies[0] 169 def ma = taskProcedureInstance.maintenanceActionLazyList.get(0) 170 ma.assetSubItem = assembly 171 ma.procedureStepNumber = 10 172 ma = taskProcedureInstance.maintenanceActionLazyList.get(1) 173 ma.assetSubItem = assembly 174 ma.procedureStepNumber = 20 175 } 176 177 return ['taskProcedureInstance':taskProcedureInstance, 'assemblies': assemblies] 123 178 } 124 179 125 180 def save = { 126 def taskProcedureInstance = new TaskProcedure(params) 127 def taskInstance = Task.get(params.taskInstance.id) 128 129 if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save(flush: true)) { 130 taskProcedureInstance.addToTasks(taskInstance) 131 flash.message = "TaskProcedure ${taskProcedureInstance.id} created." 132 redirect(action:show,id:taskProcedureInstance.id) 133 } 134 else { 135 render(view:'create',model:[taskProcedureInstance:taskProcedureInstance, taskInstance: taskInstance]) 136 } 137 } 181 def result = taskProcedureService.save(params) 182 183 if(!result.error) { 184 flash.message = g.message(code: "default.create.success", args: ["TaskProcedure", result.taskProcedureInstance.id]) 185 redirect(controller:'taskDetailed', 186 action:'show', 187 id:result.taskProcedureInstance.linkedTask.id, 188 params:[showTab:"showProcedureTab"]) 189 return 190 } 191 192 if(result.error.code == "default.optimistic.locking.failure") { 193 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 194 redirect(controller:'taskDetailed', 195 action:'show', 196 id:result.taskProcedureInstance.linkedTask.id, 197 params:[showTab:"showProcedureTab"]) 198 return 199 } 200 201 def assemblies = assetService.getAssemblies(result.taskProcedureInstance.linkedTask.primaryAsset) 202 render(view:'create', model:[taskProcedureInstance: result.taskProcedureInstance, 203 assemblies: assemblies]) 204 } 205 138 206 } -
trunk/grails-app/domain/MaintenanceAction.groovy
r268 r798 8 8 9 9 String description 10 String reasoning= ""10 String pageRef = "" 11 11 Integer procedureStepNumber 12 boolean isActive = true 12 13 Boolean toBeDeleted 14 Boolean isNew 15 static transients = [ 'toBeDeleted', 'isNew' ] 13 16 14 17 // static hasMany = [] 15 18 16 // static belongsTo = []19 static belongsTo = [TaskProcedure] 17 20 18 21 static constraints = { … … 22 25 maintenancePolicy(nullable:true) 23 26 procedureStepNumber(nullable:true) 24 description() 25 reasoning() 26 isActive() 27 description(blank:false,maxSize:100) 28 pageRef(maxSize:100) 27 29 } 28 30 -
trunk/grails-app/domain/TaskProcedure.groovy
r131 r798 1 import org.apache.commons.collections.list.LazyList 2 import org.apache.commons.collections.FactoryUtils 3 1 4 class TaskProcedure { 2 5 3 String name 4 String description = "" 5 Boolean isActive = true 6 Task linkedTask 7 Person createdBy 8 Person lastUpdatedBy 9 Date dateCreated = new Date() // autoTimestamp 10 Date lastUpdated = new Date() // autoTimestamp 6 11 7 static hasMany = [tasks: Task, maintenanceActions: MaintenanceAction] 12 def getDescription() { linkedTask.description } 13 def getAsset() { linkedTask.primaryAsset } 14 15 List maintenanceActions = new ArrayList() 16 List documentReferences = new ArrayList() 17 18 static hasMany = [tasks: Task, 19 maintenanceActions: MaintenanceAction, 20 documentReferences: DocumentReference] 21 22 def getMaintenanceActionLazyList() { 23 return LazyList.decorate(maintenanceActions, FactoryUtils.instantiateFactory(MaintenanceAction.class)) 24 } 25 26 def getDocumentReferenceLazyList() { 27 return LazyList.decorate(documentReferences, FactoryUtils.instantiateFactory(DocumentReference.class)) 28 } 29 30 static mappedBy = [tasks:"taskProcedure"] 31 32 static mapping = { 33 maintenanceActions cascade:"all-delete-orphan" 34 documentReferences cascade:"all-delete-orphan" 35 } 8 36 9 37 // static belongsTo = [] 10 38 11 39 static constraints = { 12 name(maxSize:75,unique:true,blank:false)13 description(maxSize:100)14 40 } 15 41 16 42 String toString() { 17 "${this. name}"43 "${this.id}" 18 44 } 19 45 } -
trunk/grails-app/services/AssetService.groovy
r689 r798 22 22 } 23 23 } 24 } 25 26 /** 27 * Determines and returns a list of assemblies for an asset. 28 * This is purely a 'load from database' type method since a new hibernateSession is used. 29 * @params Asset to get the subItems for. 30 * @returns A list of the assemblies. 31 */ 32 def getAssemblies(asset) { 33 def assemblies = [] 34 if(!(asset instanceof Asset)) 35 return assemblies 36 // Database efficiency: 37 // The asset is configured to batch fetch assetSubItems which 38 // in turn are configured to batch fetch subItems. 39 Asset.withNewSession { 40 Asset.get(asset.id).assetSubItems.each { 41 assemblies.addAll(it.subItems) 42 } 43 } 44 assemblies.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 45 return assemblies 24 46 } 25 47 -
trunk/grails-app/services/CreateDataService.groovy
r751 r798 3 3 /** 4 4 * Provides a data service to create base and demo data. 5 * Beware that most, if not all, basedata is referenced by "Id" throughout the program.5 * Beware that most, if not all, BASE data is referenced by "Id" throughout the program. 6 6 * This allows changing the text of the 'name' property to something of the same meaning. 7 7 * But be sure to maintain the correct Id during creation, indicated by #1, #2 etc. 8 * Task.list()[0] is used to allow integration testing with DEMO data, where Id's may change due to create-delete. 8 9 */ 9 10 class CreateDataService { … … 846 847 //Task #1 847 848 p = [taskGroup:TaskGroup.findByName("Engineering Activites"), 848 taskPriority:TaskPriority.get( 2),849 taskPriority:TaskPriority.get(1), 849 850 taskType:TaskType.get(1), 850 851 leadPerson:Person.get(2), … … 1097 1098 //TaskProcedure 1098 1099 def taskProcedureInstance 1099 1100 taskProcedureInstance = new TaskProcedure(name: "Daily check") 1100 def taskInstance 1101 def person = Person.get(3) 1102 1103 taskInstance = Task.list()[6] 1104 taskProcedureInstance = new TaskProcedure(linkedTask: taskInstance, 1105 createdBy: person, 1106 lastUpdatedBy: person) 1101 1107 saveAndTest(taskProcedureInstance) 1102 taskProcedureInstance.addToTasks(Task.list()[0]) 1103 1104 taskProcedureInstance = new TaskProcedure(name: "100hr Service") 1108 taskProcedureInstance.addToTasks(taskInstance) 1109 1110 taskInstance = Task.list()[4] 1111 taskProcedureInstance = new TaskProcedure(linkedTask: taskInstance, 1112 createdBy: person, 1113 lastUpdatedBy: person) 1105 1114 saveAndTest(taskProcedureInstance) 1106 taskProcedureInstance.addToTasks( Task.list()[6])1115 taskProcedureInstance.addToTasks(taskInstance) 1107 1116 } 1108 1117 … … 1111 1120 //MaintenanceAction 1112 1121 def maintenanceActionInstance 1122 def taskProcedure = TaskProcedure.get(1) 1123 def assetSubItem = AssetSubItem.get(6) 1113 1124 1114 1125 //MaintenanceAction #1 1115 1126 maintenanceActionInstance = new MaintenanceAction(description: "Check all E-stops, activate E-stops S1-S12 and ensure machine cannot run", 1116 1127 procedureStepNumber: 10, 1117 maintenancePolicy: MaintenancePolicy.get(1),1118 taskProcedure: TaskProcedure.get(1))1119 saveAndTest(maintenanceActionInstance)1128 assetSubItem: assetSubItem, 1129 taskProcedure: taskProcedure) 1130 taskProcedure.addToMaintenanceActions(maintenanceActionInstance) 1120 1131 1121 1132 //MaintenanceAction #2 1122 1133 maintenanceActionInstance = new MaintenanceAction(description: "Do more pushups", 1123 1134 procedureStepNumber: 20, 1124 maintenancePolicy: MaintenancePolicy.get(1),1125 taskProcedure: TaskProcedure.get(1))1126 saveAndTest(maintenanceActionInstance)1135 assetSubItem: assetSubItem, 1136 taskProcedure: taskProcedure) 1137 taskProcedure.addToMaintenanceActions(maintenanceActionInstance) 1127 1138 1128 1139 //MaintenanceAction #3 1129 1140 maintenanceActionInstance = new MaintenanceAction(description: "Ok just one more pushup", 1130 1141 procedureStepNumber: 30, 1131 maintenancePolicy: MaintenancePolicy.get(1), 1132 taskProcedure: TaskProcedure.get(1)) 1133 saveAndTest(maintenanceActionInstance) 1142 assetSubItem: assetSubItem, 1143 taskProcedure: taskProcedure) 1144 taskProcedure.addToMaintenanceActions(maintenanceActionInstance) 1145 1146 saveAndTest(taskProcedure) 1134 1147 } 1135 1148 … … 1475 1488 section: Section.get(1)) 1476 1489 saveAndTest(assetInstance1) 1477 // assetInstance.addToMaintenanceActions(MaintenanceAction.get(1))1478 1490 1479 1491 //Asset #2 -
trunk/grails-app/taglib/CustomTagLib.groovy
r672 r798 1 //import org.apache.commons.validator.UrlValidator 2 import org.codehaus.groovy.grails.validation.routines.UrlValidator 3 import org.codehaus.groovy.grails.validation.routines.RegexValidator 1 4 2 5 /** … … 238 241 } // jasperButtons 239 242 243 /** 244 * Easily create a link from a hopeful url string. 245 * If the supplied url is not considered a valid url the string is simply displayed. 246 * 247 * Fields: 248 * url - String url to use. 249 * body - If no body is supplied in the GSP then url.encodeAsHTML() is displayed. 250 * 251 * Example: 252 * <!-- 253 * <custom:easyUrl url="${docRef.location}" /> 254 * --> 255 */ 256 def easyUrl = {attrs, body -> 257 258 def url = attrs.url 259 260 def html 261 262 body = body() 263 if(!body) 264 body = url.encodeAsHTML() 265 266 html = "${body}" 267 268 if(isURLValid(url)) { 269 html = """ 270 <a href="${url}"> 271 ${html} 272 </a> 273 """ 274 } 275 276 out << html 277 } 278 279 /** 280 * Determine if a supplied string is considered a url or not. 281 * The scheme/protocol can be adjusted, file:// has been excluded here. 282 * A domainValidator regex is used to allow localhost domain. 283 * A Grails branched version of commons.validator is used, this should 284 * be compatible with the apache 1.4 version release. 285 * See: http://jira.codehaus.org/browse/GRAILS-1692 for more on Grails url validation. 286 */ 287 private Boolean isURLValid(url) { 288 289 def schemes = ["http","https", "ftp"] as String[] 290 def domainValidator = new RegexValidator("localhost(:(\\d{1,5}))?") 291 def validator = new UrlValidator(schemes, domainValidator, UrlValidator.ALLOW_2_SLASHES) 292 return validator.isValid(url) 293 294 } 295 240 296 } // end class -
trunk/grails-app/views/layouts/main.gsp
r711 r798 5 5 <link rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" /> 6 6 <link rel="shortcut icon" href="${resource(dir:'images',file:'gnuMimsIcon.ico')}" type="image/x-icon" /> 7 <g:javascript library="jquery" /> 7 8 <g:javascript library="prototype/prototype" /> 8 9 <g:javascript library="prototype/effects" /> -
trunk/grails-app/views/taskDetailed/show.gsp
r736 r798 513 513 <tr class="prop"> 514 514 <td valign="top" class="name">Procedure Id:</td> 515 516 <td valign="top" class="value">${fieldValue(bean:taskProcedureInstance, field:'id')}</td> 517 518 </tr> 519 520 <tr class="prop"> 521 <td valign="top" class="name">Name:</td> 522 523 <td valign="top" class="value">${fieldValue(bean:taskProcedureInstance, field:'name')}</td> 524 525 </tr> 526 527 <tr class="prop"> 528 <td valign="top" class="name">Description:</td> 529 530 <td valign="top" class="value">${fieldValue(bean:taskProcedureInstance, field:'description')}</td> 531 532 </tr> 533 534 <tr class="prop"> 535 <td valign="top" class="name">Is Active:</td> 536 537 <td valign="top" class="value">${fieldValue(bean:taskProcedureInstance, field:'isActive')}</td> 538 515 <td valign="top" class="value"> 516 ${fieldValue(bean:taskProcedureInstance, field:'id')} 517 </td> 518 </tr> 519 520 <tr class="prop"> 521 <td valign="top" class="name">Linked Task:</td> 522 <td valign="top" class="value"> 523 <g:link controller="taskDetailed" 524 action="show" 525 id="${taskProcedureInstance.linkedTask.id}"> 526 ${taskProcedureInstance.linkedTask.encodeAsHTML()} 527 </g:link> 528 </td> 529 </tr> 530 531 <tr class="prop"> 532 <td valign="top" class="name">Linked Asset:</td> 533 <td valign="top" class="value"> 534 <g:render template="/shared/assetTreeCompact" model="['assetInstance': taskProcedureInstance.linkedTask.primaryAsset]" /> 535 </td> 536 </tr> 537 538 <tr class="prop"> 539 <td valign="top" class="name">Version:</td> 540 <td valign="top" class="value"> 541 ${fieldValue(bean:taskProcedureInstance, field:'version')} 542 </td> 543 </tr> 544 545 <tr class="prop"> 546 <td valign="top" class="name">Last Updated:</td> 547 <td valign="top" class="value"> 548 <g:formatDate date="${taskProcedureInstance.lastUpdated}" 549 format="EEE, dd-MMM-yyyy"/> 550 </td> 539 551 </tr> 540 552 … … 549 561 </div> 550 562 563 <br /> 564 565 <g:if test="${taskProcedureInstance.documentReferences}"> 566 <div class="list"> 567 <table> 568 <thead> 569 <tr> 570 <th>Document Reference</th> 571 <th>Location</th> 572 </tr> 573 </thead> 574 <tbody> 575 <g:each in="${taskProcedureInstance.documentReferences}" status="i" var="docRef"> 576 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 577 578 <td valign="top" class="name"> 579 ${fieldValue(bean:docRef, field:'name')} 580 </td> 581 582 <td valign="top" style="text-align:left;" class="value"> 583 <custom:easyUrl url="${docRef.location}" /> 584 </td> 585 586 </tr> 587 </g:each> 588 589 </tbody> 590 </table> 591 </div> 592 </g:if> 593 594 <br /> 595 551 596 <div class="list"> 552 597 <table> … … 554 599 <tr> 555 600 <th>Step</th> 601 <th>Assembly</th> 556 602 <th>Description</th> 557 <th>Reasoning</th> 558 <th>Asset</th> 559 <th>Sub Item</th> 603 <th>Page Ref</th> 604 <th>Condition</th> 560 605 </tr> 561 606 </thead> … … 569 614 570 615 <td valign="top" style="text-align:left;" class="value"> 616 <g:if test="${maintenanceAction.assetSubItem}"> 617 ${maintenanceAction.assetSubItem.parentItem?.encodeAsHTML()} 618 -- 619 ${maintenanceAction.assetSubItem.encodeAsHTML()} 620 </g:if> 621 </td> 622 623 <td valign="top" style="text-align:left;" class="value"> 571 624 ${fieldValue(bean:maintenanceAction, field:'description')} 572 625 </td> 573 626 574 627 <td valign="top" style="text-align:left;" class="value"> 575 ${fieldValue(bean:maintenanceAction, field:' reasoning')}628 ${fieldValue(bean:maintenanceAction, field:'pageRef')} 576 629 </td> 577 630 578 631 <td valign="top" style="text-align:left;" class="value"> 579 ${fieldValue(bean:maintenanceAction, field:'asset')}580 </td>581 582 <td valign="top" style="text-align:left;" class="value">583 ${fieldValue(bean:maintenanceAction, field:'assetSubItem')}584 632 </td> 585 633 -
trunk/grails-app/views/taskProcedureDetailed/create.gsp
r173 r798 7 7 <title>Create TaskProcedure</title> 8 8 <nav:resources override="true"/> 9 <g:javascript src="dynamicOneToMany.js" /> 9 10 </head> 10 11 <body> … … 13 14 </div> 14 15 <div class="body"> 15 <g:if test="${flash.message}"> 16 <div class="message">${flash.message}</div> 17 </g:if> 16 <g:render template="/shared/messages" /> 17 18 18 <g:hasErrors bean="${taskProcedureInstance}"> 19 <div class="errors">20 <g:renderErrors bean="${taskProcedureInstance}" as="list" />21 </div>19 <div class="errors"> 20 <g:renderErrors bean="${taskProcedureInstance}" as="list" /> 21 </div> 22 22 </g:hasErrors> 23 23 24 <g:form action="save" method="post" > 24 <input type="hidden" name="taskInstance.id" value="${taskInstance?.id}" />25 <input type="hidden" name="linkedTask.id" value="${taskProcedureInstance.linkedTask.id}" /> 25 26 26 <div class="dialog"> 27 <table> 28 <tbody> 27 <g:render template="taskProcedure" model="['taskProcedureInstance': taskProcedureInstance]" /> 29 28 30 <tr class="prop">31 <td valign="top" class="name">32 <label for="name">Name:</label>33 </td>34 <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'name','errors')}">35 <input type="text" class="description" maxlength="75" id="name" name="name" value="${fieldValue(bean:taskProcedureInstance,field:'name')}"/>36 </td>37 </tr>38 39 <tr class="prop">40 <td valign="top" class="name">41 <label for="description">Description:</label>42 </td>43 <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'description','errors')}">44 <input type="text" class="description" maxlength="100" id="description" name="description" value="${fieldValue(bean:taskProcedureInstance,field:'description')}"/>45 </td>46 </tr>47 48 <tr class="prop">49 <td valign="top" class="name">50 <label for="isActive">Is Active:</label>51 </td>52 <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'isActive','errors')}">53 <g:checkBox name="isActive" value="${taskProcedureInstance?.isActive}" ></g:checkBox>54 </td>55 </tr>56 57 <g:if test="${taskInstance}">58 <tr class="prop">59 <td valign="top" class="name">60 <label for="taskInstance">Linking with Task:</label>61 </td>62 <td valign="top" name="taskInstance" class="value">63 ${taskInstance}64 </td>65 </tr>66 </g:if>67 68 </tbody>69 </table>70 </div>71 29 <div class="buttons"> 72 30 <span class="button"><input class="save" type="submit" value="Create" /></span> … … 74 32 </g:form> 75 33 </div> 34 <table style="display:none;"> 35 <g:render template="documentReference" model="['docRef': null, 36 'i': '_clone']" /> 37 </table> 38 <table style="display:none;"> 39 <g:render template="maintenanceAction" model="['tp': null, 40 'ma': null, 41 'i': '_clone', 42 'assemblies': assemblies]" /> 43 </table> 76 44 </body> 77 45 </html> -
trunk/grails-app/views/taskProcedureDetailed/edit.gsp
r410 r798 7 7 <title>Edit TaskProcedure</title> 8 8 <nav:resources override="true"/> 9 <g:javascript src="dynamicOneToMany.js" /> 9 10 </head> 10 11 <body> … … 13 14 </div> 14 15 <div class="body"> 15 <g:if test="${flash.message}"> 16 <div class="message">${flash.message}</div> 17 </g:if> 16 <g:render template="/shared/messages" /> 17 18 18 <g:hasErrors bean="${taskProcedureInstance}"> 19 <div class="errors">20 <g:renderErrors bean="${taskProcedureInstance}" as="list" />21 </div>19 <div class="errors"> 20 <g:renderErrors bean="${taskProcedureInstance}" as="list" /> 21 </div> 22 22 </g:hasErrors> 23 23 24 <g:form method="post" > 24 25 <input type="hidden" name="id" value="${taskProcedureInstance?.id}" /> 25 26 <input type="hidden" name="version" value="${taskProcedureInstance?.version}" /> 26 <div class="dialog">27 <table>28 <tbody>29 30 <tr class="prop">31 <td valign="top" class="name">32 <label for="name">Name:</label>33 </td>34 <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'name','errors')}">35 <input type="text" class="description" maxlength="75" id="name" name="name" value="${fieldValue(bean:taskProcedureInstance,field:'name')}"/>36 </td>37 </tr>38 39 <tr class="prop">40 <td valign="top" class="name">41 <label for="description">Description:</label>42 </td>43 <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'description','errors')}">44 <input type="text" class="description" maxlength="100" id="description" name="description" value="${fieldValue(bean:taskProcedureInstance,field:'description')}"/>45 </td>46 </tr>47 48 <tr class="prop">49 <td valign="top" class="name">50 <label for="isActive">Is Active:</label>51 </td>52 <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'isActive','errors')}">53 <g:checkBox name="isActive" value="${taskProcedureInstance?.isActive}" ></g:checkBox>54 </td>55 </tr>56 57 <tr class="prop">58 <td valign="top" class="name">59 <label for="maintenanceActions">Maintenance Actions:</label>60 </td>61 <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'maintenanceActions','errors')}">62 63 <ul>64 <g:each var="m" in="${taskProcedureInstance?.maintenanceActions?}">65 <li><g:link controller="maintenanceActionDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>66 </g:each>67 </ul>68 <g:link controller="maintenanceActionDetailed" params="['taskProcedure.id':taskProcedureInstance?.id]" action="create">+Add MaintenanceAction</g:link>69 27 70 </td> 71 </tr> 72 73 <tr class="prop"> 74 <td valign="top" class="name"> 75 <label for="tasks">Tasks:</label> 76 </td> 77 <td valign="top" class="value ${hasErrors(bean:taskProcedureInstance,field:'tasks','errors')}"> 78 79 <ul> 80 <g:each var="t" in="${taskProcedureInstance?.tasks?}"> 81 <li><g:link controller="taskDetailed" action="show" id="${t.id}">${t?.encodeAsHTML()}</g:link></li> 82 </g:each> 83 </ul> 84 <g:link controller="taskDetailed" params="['taskProcedure.id':taskProcedureInstance?.id]" action="create">+Add Task</g:link> 28 <g:render template="taskProcedure" model="['taskProcedureInstance': taskProcedureInstance]" /> 85 29 86 </td>87 </tr>88 89 </tbody>90 </table>91 </div>92 30 <div class="buttons"> 93 31 <span class="button"><g:actionSubmit class="save" value="Update" /></span> 32 <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span> 94 33 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 95 34 </div> 96 35 </g:form> 97 36 </div> 37 <table style="display:none;"> 38 <g:render template="documentReference" model="['docRef': null, 39 'i': '_clone']" /> 40 </table> 41 <table style="display:none;"> 42 <g:render template="maintenanceAction" model="['tp': null, 43 'ma': null, 44 'i': '_clone', 45 'assemblies': assemblies]" /> 46 </table> 98 47 </body> 99 48 </html> -
trunk/grails-app/views/taskProcedureDetailed/list.gsp
r467 r798 37 37 <thead> 38 38 <tr> 39 39 40 40 <g:sortableColumn property="id" title="Id" params="${filterParams}" /> 41 42 <g:sortableColumn property="name" title="Name" params="${filterParams}" /> 43 44 <g:sortableColumn property="description" title="Description" params="${filterParams}" /> 45 46 <g:sortableColumn property="isActive" title="Is Active" params="${filterParams}" /> 41 <th>Description</th> 42 <th>Asset</th> 47 43 48 44 <th></th> 49 45 50 46 </tr> 51 47 </thead> … … 53 49 <g:each in="${taskProcedureInstanceList}" status="i" var="taskProcedureInstance"> 54 50 <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/taskProcedureDetailed/show/${taskProcedureInstance.id}"'/> 55 51 56 52 <td>${fieldValue(bean:taskProcedureInstance, field:'id')}</td> 57 58 <td>${fieldValue(bean:taskProcedureInstance, field:'name')}</td> 59 60 <td>${fieldValue(bean:taskProcedureInstance, field:'description')}</td> 61 62 <td>${fieldValue(bean:taskProcedureInstance, field:'isActive')}</td> 63 53 54 <td>${taskProcedureInstance.description.encodeAsHTML()}</td> 55 56 <td>${taskProcedureInstance.asset?.encodeAsHTML()}</td> 57 64 58 <td> 65 59 <g:link action="show" id="${taskProcedureInstance.id}"> … … 67 61 </g:link> 68 62 </td> 69 63 70 64 </tr> 71 65 </g:each> … … 83 77 action="list" 84 78 class="overlayPane" 85 excludeProperties="" /> 79 additionalProperties="id" 80 excludeProperties="" 81 associatedProperties="linkedTask.description" /> 86 82 </div> 87 83 </body> -
trunk/web-app/css/main.css
r729 r798 690 690 div.static_tree { 691 691 } 692 div.static_tree_compact { 693 height:10em; 694 width:100%; 695 overflow:auto; 696 } 692 697 div.static_tree ul { 693 698 list-style-type: none; -
trunk/web-app/js/jsUtil.js
r714 r798 119 119 } 120 120 } 121 122 function openWindow(url) { 123 window.open(url); 124 }
Note: See TracChangeset
for help on using the changeset viewer.