Changeset 162 for trunk/grails-app
- Timestamp:
- Oct 22, 2009, 8:26:09 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 7 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/SystemSectionController.groovy
r118 r162 27 27 if(systemSectionInstance) { 28 28 try { 29 systemSectionInstance.delete( )29 systemSectionInstance.delete(flush:true) 30 30 flash.message = "SystemSection ${params.id} deleted" 31 31 redirect(action:list) … … 77 77 else { 78 78 flash.message = "SystemSection not found with id ${params.id}" 79 redirect(action: edit,id:params.id)79 redirect(action:list) 80 80 } 81 81 } -
trunk/grails-app/controllers/SystemSectionDetailedController.groovy
r124 r162 27 27 if(systemSectionInstance) { 28 28 try { 29 systemSectionInstance.delete( )29 systemSectionInstance.delete(flush:true) 30 30 flash.message = "SystemSection ${params.id} deleted" 31 31 redirect(action:list) … … 77 77 else { 78 78 flash.message = "SystemSection not found with id ${params.id}" 79 redirect(action: edit,id:params.id)79 redirect(action:list) 80 80 } 81 81 } -
trunk/grails-app/domain/SystemSection.groovy
r121 r162 1 1 class SystemSection { 2 2 3 3 Site site 4 Department department 4 5 5 6 String name 6 7 String description = "" 8 String costCode = "" 7 9 boolean isActive = true 8 10 -
trunk/grails-app/services/CreateDataService.groovy
r149 r162 59 59 createDemoPersons() 60 60 createDemoSites() 61 createDemoDepartments() 61 62 // Tasks 62 63 createDemoTaskGroups() /// @todo: Perhaps this should be BaseData? … … 240 241 siteInstance = new Site(name: "Jasper Street Depot") 241 242 saveAndTest(siteInstance) 243 244 siteInstance = new Site(name: "River Press") 245 saveAndTest(siteInstance) 246 } 247 248 def createDemoDepartments() { 249 250 //Department 251 def departmentInstance 252 253 //Department #1 254 departmentInstance = new Department(name: "Print Centre", 255 site: Site.get(1)) 256 saveAndTest(departmentInstance) 257 258 //Department #2 259 departmentInstance = new Department(name: "Pulp Mill 2", 260 site: Site.get(2)) 261 saveAndTest(departmentInstance) 242 262 } 243 263 … … 784 804 //SystemSection #1 785 805 systemSectionInstance = new SystemSection(name: "Press Section", 786 site: Site.get(1)) 806 site: Site.get(1), 807 department: Department.get(1)) 787 808 saveAndTest(systemSectionInstance) 788 809 789 810 //SystemSection #2 790 811 systemSectionInstance = new SystemSection(name: "RO System", 791 site: Site.get(2)) 812 site: Site.get(2), 813 department: Department.get(2)) 792 814 saveAndTest(systemSectionInstance) 793 815 794 816 //SystemSection #3 795 817 systemSectionInstance = new SystemSection(name: "Auxilliray Section", 796 site: Site.get(1)) 818 site: Site.get(1), 819 department: Department.get(1)) 797 820 saveAndTest(systemSectionInstance) 798 821 } -
trunk/grails-app/views/systemSection/create.gsp
r151 r162 26 26 <table> 27 27 <tbody> 28 29 <tr class="prop"> 30 <td valign="top" class="name"> 31 <label for="costCode">Cost Code:</label> 32 </td> 33 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}"> 34 <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/> 35 </td> 36 </tr> 37 38 <tr class="prop"> 39 <td valign="top" class="name"> 40 <label for="department">Department:</label> 41 </td> 42 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}"> 43 <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select> 44 </td> 45 </tr> 28 46 29 47 <tr class="prop"> -
trunk/grails-app/views/systemSection/edit.gsp
r151 r162 43 43 <g:link controller="asset" params="['systemSection.id':systemSectionInstance?.id]" action="create">Add Asset</g:link> 44 44 45 </td> 46 </tr> 47 48 <tr class="prop"> 49 <td valign="top" class="name"> 50 <label for="costCode">Cost Code:</label> 51 </td> 52 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}"> 53 <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/> 54 </td> 55 </tr> 56 57 <tr class="prop"> 58 <td valign="top" class="name"> 59 <label for="department">Department:</label> 60 </td> 61 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}"> 62 <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select> 45 63 </td> 46 64 </tr> -
trunk/grails-app/views/systemSection/list.gsp
r151 r162 24 24 <g:sortableColumn property="id" title="Id" /> 25 25 26 <g:sortableColumn property="costCode" title="Cost Code" /> 27 28 <th>Department</th> 29 26 30 <g:sortableColumn property="description" title="Description" /> 27 31 … … 30 34 <g:sortableColumn property="name" title="Name" /> 31 35 32 <th>Site</th>33 34 36 </tr> 35 37 </thead> … … 40 42 <td><g:link action="show" id="${systemSectionInstance.id}">${fieldValue(bean:systemSectionInstance, field:'id')}</g:link></td> 41 43 44 <td>${fieldValue(bean:systemSectionInstance, field:'costCode')}</td> 45 46 <td>${fieldValue(bean:systemSectionInstance, field:'department')}</td> 47 42 48 <td>${fieldValue(bean:systemSectionInstance, field:'description')}</td> 43 49 … … 45 51 46 52 <td>${fieldValue(bean:systemSectionInstance, field:'name')}</td> 47 48 <td>${fieldValue(bean:systemSectionInstance, field:'site')}</td>49 53 50 54 </tr> -
trunk/grails-app/views/systemSection/show.gsp
r151 r162 40 40 </ul> 41 41 </td> 42 43 </tr> 44 45 <tr class="prop"> 46 <td valign="top" class="name">Cost Code:</td> 47 48 <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'costCode')}</td> 49 50 </tr> 51 52 <tr class="prop"> 53 <td valign="top" class="name">Department:</td> 54 55 <td valign="top" class="value"><g:link controller="department" action="show" id="${systemSectionInstance?.department?.id}">${systemSectionInstance?.department?.encodeAsHTML()}</g:link></td> 42 56 43 57 </tr> -
trunk/grails-app/views/systemSectionDetailed/create.gsp
r151 r162 29 29 <tr class="prop"> 30 30 <td valign="top" class="name"> 31 <label for="name">Name:</label> 32 </td> 33 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}"> 34 <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/> 35 </td> 36 </tr> 37 38 <tr class="prop"> 39 <td valign="top" class="name"> 31 40 <label for="description">Description:</label> 32 41 </td> … … 34 43 <input type="text" id="description" name="description" value="${fieldValue(bean:systemSectionInstance,field:'description')}"/> 35 44 </td> 36 </tr> 45 </tr> 37 46 38 47 <tr class="prop"> 39 48 <td valign="top" class="name"> 40 <label for=" isActive">Is Active:</label>49 <label for="costCode">Cost Code:</label> 41 50 </td> 42 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:' isActive','errors')}">43 < g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox>51 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}"> 52 <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/> 44 53 </td> 45 54 </tr> … … 47 56 <tr class="prop"> 48 57 <td valign="top" class="name"> 49 <label for=" name">Name:</label>58 <label for="department">Department:</label> 50 59 </td> 51 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:' name','errors')}">52 < input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/>60 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}"> 61 <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select> 53 62 </td> 54 63 </tr> … … 63 72 </tr> 64 73 74 <tr class="prop"> 75 <td valign="top" class="name"> 76 <label for="isActive">Is Active:</label> 77 </td> 78 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}"> 79 <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox> 80 </td> 81 </tr> 82 65 83 </tbody> 66 84 </table> -
trunk/grails-app/views/systemSectionDetailed/edit.gsp
r151 r162 32 32 <tr class="prop"> 33 33 <td valign="top" class="name"> 34 <label for="name">Name:</label> 35 </td> 36 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}"> 37 <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/> 38 </td> 39 </tr> 40 41 <tr class="prop"> 42 <td valign="top" class="name"> 43 <label for="description">Description:</label> 44 </td> 45 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'description','errors')}"> 46 <input type="text" id="description" name="description" value="${fieldValue(bean:systemSectionInstance,field:'description')}"/> 47 </td> 48 </tr> 49 50 <tr class="prop"> 51 <td valign="top" class="name"> 52 <label for="costCode">Cost Code:</label> 53 </td> 54 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}"> 55 <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/> 56 </td> 57 </tr> 58 59 <tr class="prop"> 60 <td valign="top" class="name"> 61 <label for="department">Department:</label> 62 </td> 63 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}"> 64 <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select> 65 </td> 66 </tr> 67 68 <tr class="prop"> 69 <td valign="top" class="name"> 70 <label for="site">Site:</label> 71 </td> 72 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'site','errors')}"> 73 <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${systemSectionInstance?.site?.id}" ></g:select> 74 </td> 75 </tr> 76 77 <tr class="prop"> 78 <td valign="top" class="name"> 79 <label for="isActive">Is Active:</label> 80 </td> 81 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}"> 82 <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox> 83 </td> 84 </tr> 85 86 <tr class="prop"> 87 <td valign="top" class="name"> 34 88 <label for="assets">Assets:</label> 35 89 </td> … … 43 97 <g:link controller="assetDetailed" params="['systemSection.id':systemSectionInstance?.id]" action="create">Add Asset</g:link> 44 98 45 </td>46 </tr>47 48 <tr class="prop">49 <td valign="top" class="name">50 <label for="description">Description:</label>51 </td>52 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'description','errors')}">53 <input type="text" id="description" name="description" value="${fieldValue(bean:systemSectionInstance,field:'description')}"/>54 </td>55 </tr>56 57 <tr class="prop">58 <td valign="top" class="name">59 <label for="isActive">Is Active:</label>60 </td>61 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}">62 <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox>63 99 </td> 64 100 </tr> … … 80 116 </tr> 81 117 82 <tr class="prop">83 <td valign="top" class="name">84 <label for="name">Name:</label>85 </td>86 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}">87 <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/>88 </td>89 </tr>90 91 <tr class="prop">92 <td valign="top" class="name">93 <label for="site">Site:</label>94 </td>95 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'site','errors')}">96 <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${systemSectionInstance?.site?.id}" ></g:select>97 </td>98 </tr>99 100 118 </tbody> 101 119 </table> -
trunk/grails-app/views/systemSectionDetailed/show.gsp
r151 r162 31 31 32 32 <tr class="prop"> 33 <td valign="top" class="name"> Assets:</td>33 <td valign="top" class="name">Name:</td> 34 34 35 <td valign="top" style="text-align:left;" class="value"> 36 <ul> 37 <g:each var="a" in="${systemSectionInstance.assets}"> 38 <li><g:link controller="assetDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li> 39 </g:each> 40 </ul> 41 </td> 35 <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'name')}</td> 42 36 43 37 </tr> … … 51 45 52 46 <tr class="prop"> 47 <td valign="top" class="name">Cost Code:</td> 48 49 <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'costCode')}</td> 50 51 </tr> 52 53 <tr class="prop"> 54 <td valign="top" class="name">Department:</td> 55 56 <td valign="top" class="value"><g:link controller="department" action="show" id="${systemSectionInstance?.department?.id}">${systemSectionInstance?.department?.encodeAsHTML()}</g:link></td> 57 58 </tr> 59 60 <tr class="prop"> 61 <td valign="top" class="name">Site:</td> 62 63 <td valign="top" class="value"><g:link controller="site" action="show" id="${systemSectionInstance?.site?.id}">${systemSectionInstance?.site?.encodeAsHTML()}</g:link></td> 64 65 </tr> 66 67 <tr class="prop"> 53 68 <td valign="top" class="name">Is Active:</td> 54 69 55 70 <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'isActive')}</td> 71 72 </tr> 73 74 <tr class="prop"> 75 <td valign="top" class="name">Assets:</td> 76 77 <td valign="top" style="text-align:left;" class="value"> 78 <ul> 79 <g:each var="a" in="${systemSectionInstance.assets}"> 80 <li><g:link controller="assetDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li> 81 </g:each> 82 </ul> 83 </td> 56 84 57 85 </tr> … … 70 98 </tr> 71 99 72 <tr class="prop">73 <td valign="top" class="name">Name:</td>74 75 <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'name')}</td>76 77 </tr>78 79 <tr class="prop">80 <td valign="top" class="name">Site:</td>81 82 <td valign="top" class="value"><g:link controller="site" action="show" id="${systemSectionInstance?.site?.id}">${systemSectionInstance?.site?.encodeAsHTML()}</g:link></td>83 84 </tr>85 86 100 </tbody> 87 101 </table>
Note: See TracChangeset
for help on using the changeset viewer.