Index: /trunk/grails-app/controllers/DepartmentController.groovy
===================================================================
--- /trunk/grails-app/controllers/DepartmentController.groovy	(revision 162)
+++ /trunk/grails-app/controllers/DepartmentController.groovy	(revision 162)
@@ -0,0 +1,99 @@
+import org.codehaus.groovy.grails.plugins.springsecurity.Secured
+
+class DepartmentController extends BaseAppAdminController {
+    
+    def index = { redirect(action:list,params:params) }
+
+    // the delete, save and update actions only accept POST requests
+    static allowedMethods = [delete:'POST', save:'POST', update:'POST']
+
+    def list = {
+        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
+        [ departmentInstanceList: Department.list( params ), departmentInstanceTotal: Department.count() ]
+    }
+
+    def show = {
+        def departmentInstance = Department.get( params.id )
+
+        if(!departmentInstance) {
+            flash.message = "Department not found with id ${params.id}"
+            redirect(action:list)
+        }
+        else { return [ departmentInstance : departmentInstance ] }
+    }
+
+    def delete = {
+        def departmentInstance = Department.get( params.id )
+        if(departmentInstance) {
+            try {
+                departmentInstance.delete(flush:true)
+                flash.message = "Department ${params.id} deleted"
+                redirect(action:list)
+            }
+            catch(org.springframework.dao.DataIntegrityViolationException e) {
+                flash.message = "Department ${params.id} could not be deleted"
+                redirect(action:show,id:params.id)
+            }
+        }
+        else {
+            flash.message = "Department not found with id ${params.id}"
+            redirect(action:list)
+        }
+    }
+
+    def edit = {
+        def departmentInstance = Department.get( params.id )
+
+        if(!departmentInstance) {
+            flash.message = "Department not found with id ${params.id}"
+            redirect(action:list)
+        }
+        else {
+            return [ departmentInstance : departmentInstance ]
+        }
+    }
+
+    def update = {
+        def departmentInstance = Department.get( params.id )
+        if(departmentInstance) {
+            if(params.version) {
+                def version = params.version.toLong()
+                if(departmentInstance.version > version) {
+                    
+                    departmentInstance.errors.rejectValue("version", "department.optimistic.locking.failure", "Another user has updated this Department while you were editing.")
+                    render(view:'edit',model:[departmentInstance:departmentInstance])
+                    return
+                }
+            }
+            departmentInstance.properties = params
+            if(!departmentInstance.hasErrors() && departmentInstance.save()) {
+                flash.message = "Department ${params.id} updated"
+                redirect(action:show,id:departmentInstance.id)
+            }
+            else {
+                render(view:'edit',model:[departmentInstance:departmentInstance])
+            }
+        }
+        else {
+            flash.message = "Department not found with id ${params.id}"
+            redirect(action:list)
+        }
+    }
+
+    def create = {
+        def departmentInstance = new Department()
+        departmentInstance.properties = params
+        return ['departmentInstance':departmentInstance]
+    }
+
+    def save = {
+        def departmentInstance = new Department(params)
+        if(!departmentInstance.hasErrors() && departmentInstance.save()) {
+            flash.message = "Department ${departmentInstance.id} created"
+            redirect(action:show,id:departmentInstance.id)
+        }
+        else {
+            render(view:'create',model:[departmentInstance:departmentInstance])
+        }
+    }
+}
Index: /trunk/grails-app/controllers/SystemSectionController.groovy
===================================================================
--- /trunk/grails-app/controllers/SystemSectionController.groovy	(revision 161)
+++ /trunk/grails-app/controllers/SystemSectionController.groovy	(revision 162)
@@ -27,5 +27,5 @@
         if(systemSectionInstance) {
             try {
-                systemSectionInstance.delete()
+                systemSectionInstance.delete(flush:true)
                 flash.message = "SystemSection ${params.id} deleted"
                 redirect(action:list)
@@ -77,5 +77,5 @@
         else {
             flash.message = "SystemSection not found with id ${params.id}"
-            redirect(action:edit,id:params.id)
+            redirect(action:list)
         }
     }
Index: /trunk/grails-app/controllers/SystemSectionDetailedController.groovy
===================================================================
--- /trunk/grails-app/controllers/SystemSectionDetailedController.groovy	(revision 161)
+++ /trunk/grails-app/controllers/SystemSectionDetailedController.groovy	(revision 162)
@@ -27,5 +27,5 @@
         if(systemSectionInstance) {
             try {
-                systemSectionInstance.delete()
+                systemSectionInstance.delete(flush:true)
                 flash.message = "SystemSection ${params.id} deleted"
                 redirect(action:list)
@@ -77,5 +77,5 @@
         else {
             flash.message = "SystemSection not found with id ${params.id}"
-            redirect(action:edit,id:params.id)
+            redirect(action:list)
         }
     }
Index: /trunk/grails-app/domain/Department.groovy
===================================================================
--- /trunk/grails-app/domain/Department.groovy	(revision 162)
+++ /trunk/grails-app/domain/Department.groovy	(revision 162)
@@ -0,0 +1,20 @@
+class Department {
+
+    String name
+    String description = ""
+    String costCode = ""
+    boolean isActive = true
+
+    static hasMany = [systemSections: SystemSection]
+
+//     static belongsTo = []
+
+//     static constraints = {
+// 
+//     }
+
+    String toString() {
+        "${this.name}"
+    }
+}
+
Index: /trunk/grails-app/domain/SystemSection.groovy
===================================================================
--- /trunk/grails-app/domain/SystemSection.groovy	(revision 161)
+++ /trunk/grails-app/domain/SystemSection.groovy	(revision 162)
@@ -1,8 +1,10 @@
 class SystemSection {
-    
+
     Site site
+    Department department
 
     String name
     String description = ""
+    String costCode = ""
     boolean isActive = true
 
Index: /trunk/grails-app/services/CreateDataService.groovy
===================================================================
--- /trunk/grails-app/services/CreateDataService.groovy	(revision 161)
+++ /trunk/grails-app/services/CreateDataService.groovy	(revision 162)
@@ -59,4 +59,5 @@
         createDemoPersons()
         createDemoSites()
+        createDemoDepartments()
         // Tasks
         createDemoTaskGroups() /// @todo: Perhaps this should be BaseData?
@@ -240,4 +241,23 @@
         siteInstance = new Site(name: "Jasper Street Depot")
         saveAndTest(siteInstance)
+
+        siteInstance = new Site(name: "River Press")
+        saveAndTest(siteInstance)
+    }
+
+    def createDemoDepartments() {
+
+        //Department
+        def departmentInstance
+
+        //Department #1
+        departmentInstance = new Department(name: "Print Centre",
+                                                                                    site: Site.get(1))
+        saveAndTest(departmentInstance)
+
+        //Department #2
+        departmentInstance = new Department(name: "Pulp Mill 2",
+                                                                                    site: Site.get(2))
+        saveAndTest(departmentInstance)
     }
 
@@ -784,15 +804,18 @@
         //SystemSection #1
         systemSectionInstance = new SystemSection(name: "Press Section",
-                                                                                    site: Site.get(1))
+                                                                                    site: Site.get(1),
+                                                                                    department: Department.get(1))
         saveAndTest(systemSectionInstance)
 
         //SystemSection #2
         systemSectionInstance = new SystemSection(name: "RO System",
-                                                                                    site: Site.get(2))
+                                                                                    site: Site.get(2),
+                                                                                    department: Department.get(2))
         saveAndTest(systemSectionInstance)
 
         //SystemSection #3
         systemSectionInstance = new SystemSection(name: "Auxilliray Section",
-                                                                                    site: Site.get(1))
+                                                                                    site: Site.get(1),
+                                                                                    department: Department.get(1))
         saveAndTest(systemSectionInstance)
     }
Index: /trunk/grails-app/views/department/create.gsp
===================================================================
--- /trunk/grails-app/views/department/create.gsp	(revision 162)
+++ /trunk/grails-app/views/department/create.gsp	(revision 162)
@@ -0,0 +1,74 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Create Department</title>         
+    </head>
+    <body>
+        <div class="nav">
+            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
+            <span class="menuButton"><g:link class="list" action="list">Department List</g:link></span>
+        </div>
+        <div class="body">
+            <h1>Create Department</h1>
+            <g:if test="${flash.message}">
+            <div class="message">${flash.message}</div>
+            </g:if>
+            <g:hasErrors bean="${departmentInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${departmentInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:form action="save" method="post" >
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'costCode','errors')}">
+                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:departmentInstance,field:'costCode')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="description">Description:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'description','errors')}">
+                                    <input type="text" id="description" name="description" value="${fieldValue(bean:departmentInstance,field:'description')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="isActive">Is Active:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'isActive','errors')}">
+                                    <g:checkBox name="isActive" value="${departmentInstance?.isActive}" ></g:checkBox>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="name">Name:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'name','errors')}">
+                                    <input type="text" id="name" name="name" value="${fieldValue(bean:departmentInstance,field:'name')}"/>
+                                </td>
+                            </tr> 
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><input class="save" type="submit" value="Create" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: /trunk/grails-app/views/department/edit.gsp
===================================================================
--- /trunk/grails-app/views/department/edit.gsp	(revision 162)
+++ /trunk/grails-app/views/department/edit.gsp	(revision 162)
@@ -0,0 +1,94 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Edit Department</title>
+    </head>
+    <body>
+        <div class="nav">
+            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
+            <span class="menuButton"><g:link class="list" action="list">Department List</g:link></span>
+            <span class="menuButton"><g:link class="create" action="create">New Department</g:link></span>
+        </div>
+        <div class="body">
+            <h1>Edit Department</h1>
+            <g:if test="${flash.message}">
+            <div class="message">${flash.message}</div>
+            </g:if>
+            <g:hasErrors bean="${departmentInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${departmentInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:form method="post" >
+                <input type="hidden" name="id" value="${departmentInstance?.id}" />
+                <input type="hidden" name="version" value="${departmentInstance?.version}" />
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'costCode','errors')}">
+                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:departmentInstance,field:'costCode')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="description">Description:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'description','errors')}">
+                                    <input type="text" id="description" name="description" value="${fieldValue(bean:departmentInstance,field:'description')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="isActive">Is Active:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'isActive','errors')}">
+                                    <g:checkBox name="isActive" value="${departmentInstance?.isActive}" ></g:checkBox>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="name">Name:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'name','errors')}">
+                                    <input type="text" id="name" name="name" value="${fieldValue(bean:departmentInstance,field:'name')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="systemSections">System Sections:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'systemSections','errors')}">
+                                    
+<ul>
+<g:each var="s" in="${departmentInstance?.systemSections?}">
+    <li><g:link controller="systemSection" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
+</g:each>
+</ul>
+<g:link controller="systemSection" params="['department.id':departmentInstance?.id]" action="create">Add SystemSection</g:link>
+
+                                </td>
+                            </tr> 
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
+                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: /trunk/grails-app/views/department/list.gsp
===================================================================
--- /trunk/grails-app/views/department/list.gsp	(revision 162)
+++ /trunk/grails-app/views/department/list.gsp	(revision 162)
@@ -0,0 +1,60 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Department List</title>
+    </head>
+    <body>
+        <div class="nav">
+            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
+            <span class="menuButton"><g:link class="create" action="create">New Department</g:link></span>
+        </div>
+        <div class="body">
+            <h1>Department List</h1>
+            <g:if test="${flash.message}">
+            <div class="message">${flash.message}</div>
+            </g:if>
+            <div class="list">
+                <table>
+                    <thead>
+                        <tr>
+                        
+                   	        <g:sortableColumn property="id" title="Id" />
+                        
+                   	        <g:sortableColumn property="costCode" title="Cost Code" />
+                        
+                   	        <g:sortableColumn property="description" title="Description" />
+                        
+                   	        <g:sortableColumn property="isActive" title="Is Active" />
+                        
+                   	        <g:sortableColumn property="name" title="Name" />
+                        
+                        </tr>
+                    </thead>
+                    <tbody>
+                    <g:each in="${departmentInstanceList}" status="i" var="departmentInstance">
+                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
+                        
+                            <td><g:link action="show" id="${departmentInstance.id}">${fieldValue(bean:departmentInstance, field:'id')}</g:link></td>
+                        
+                            <td>${fieldValue(bean:departmentInstance, field:'costCode')}</td>
+                        
+                            <td>${fieldValue(bean:departmentInstance, field:'description')}</td>
+                        
+                            <td>${fieldValue(bean:departmentInstance, field:'isActive')}</td>
+                        
+                            <td>${fieldValue(bean:departmentInstance, field:'name')}</td>
+                        
+                        </tr>
+                    </g:each>
+                    </tbody>
+                </table>
+            </div>
+            <div class="paginateButtons">
+                <g:paginate total="${departmentInstanceTotal}" />
+            </div>
+        </div>
+    </body>
+</html>
Index: /trunk/grails-app/views/department/show.gsp
===================================================================
--- /trunk/grails-app/views/department/show.gsp	(revision 162)
+++ /trunk/grails-app/views/department/show.gsp	(revision 162)
@@ -0,0 +1,85 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Show Department</title>
+    </head>
+    <body>
+        <div class="nav">
+            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
+            <span class="menuButton"><g:link class="list" action="list">Department List</g:link></span>
+            <span class="menuButton"><g:link class="create" action="create">New Department</g:link></span>
+        </div>
+        <div class="body">
+            <h1>Show Department</h1>
+            <g:if test="${flash.message}">
+            <div class="message">${flash.message}</div>
+            </g:if>
+            <div class="dialog">
+                <table>
+                    <tbody>
+
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Id:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:departmentInstance, field:'id')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Cost Code:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:departmentInstance, field:'costCode')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Description:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:departmentInstance, field:'description')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Is Active:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:departmentInstance, field:'isActive')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Name:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:departmentInstance, field:'name')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">System Sections:</td>
+                            
+                            <td  valign="top" style="text-align:left;" class="value">
+                                <ul>
+                                <g:each var="s" in="${departmentInstance.systemSections}">
+                                    <li><g:link controller="systemSection" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
+                                </g:each>
+                                </ul>
+                            </td>
+                            
+                        </tr>
+                    
+                    </tbody>
+                </table>
+            </div>
+            <div class="buttons">
+                <g:form>
+                    <input type="hidden" name="id" value="${departmentInstance?.id}" />
+                    <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
+                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
+                </g:form>
+            </div>
+        </div>
+    </body>
+</html>
Index: /trunk/grails-app/views/systemSection/create.gsp
===================================================================
--- /trunk/grails-app/views/systemSection/create.gsp	(revision 161)
+++ /trunk/grails-app/views/systemSection/create.gsp	(revision 162)
@@ -26,4 +26,22 @@
                     <table>
                         <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}">
+                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="department">Department:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}">
+                                    <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select>
+                                </td>
+                            </tr> 
                         
                             <tr class="prop">
Index: /trunk/grails-app/views/systemSection/edit.gsp
===================================================================
--- /trunk/grails-app/views/systemSection/edit.gsp	(revision 161)
+++ /trunk/grails-app/views/systemSection/edit.gsp	(revision 162)
@@ -43,4 +43,22 @@
 <g:link controller="asset" params="['systemSection.id':systemSectionInstance?.id]" action="create">Add Asset</g:link>
 
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}">
+                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="department">Department:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}">
+                                    <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select>
                                 </td>
                             </tr> 
Index: /trunk/grails-app/views/systemSection/list.gsp
===================================================================
--- /trunk/grails-app/views/systemSection/list.gsp	(revision 161)
+++ /trunk/grails-app/views/systemSection/list.gsp	(revision 162)
@@ -24,4 +24,8 @@
                    	        <g:sortableColumn property="id" title="Id" />
                         
+                   	        <g:sortableColumn property="costCode" title="Cost Code" />
+                        
+                   	        <th>Department</th>
+                   	    
                    	        <g:sortableColumn property="description" title="Description" />
                         
@@ -30,6 +34,4 @@
                    	        <g:sortableColumn property="name" title="Name" />
                         
-                   	        <th>Site</th>
-                   	    
                         </tr>
                     </thead>
@@ -40,4 +42,8 @@
                             <td><g:link action="show" id="${systemSectionInstance.id}">${fieldValue(bean:systemSectionInstance, field:'id')}</g:link></td>
                         
+                            <td>${fieldValue(bean:systemSectionInstance, field:'costCode')}</td>
+                        
+                            <td>${fieldValue(bean:systemSectionInstance, field:'department')}</td>
+                        
                             <td>${fieldValue(bean:systemSectionInstance, field:'description')}</td>
                         
@@ -45,6 +51,4 @@
                         
                             <td>${fieldValue(bean:systemSectionInstance, field:'name')}</td>
-                        
-                            <td>${fieldValue(bean:systemSectionInstance, field:'site')}</td>
                         
                         </tr>
Index: /trunk/grails-app/views/systemSection/show.gsp
===================================================================
--- /trunk/grails-app/views/systemSection/show.gsp	(revision 161)
+++ /trunk/grails-app/views/systemSection/show.gsp	(revision 162)
@@ -40,4 +40,18 @@
                                 </ul>
                             </td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Cost Code:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'costCode')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Department:</td>
+                            
+                            <td valign="top" class="value"><g:link controller="department" action="show" id="${systemSectionInstance?.department?.id}">${systemSectionInstance?.department?.encodeAsHTML()}</g:link></td>
                             
                         </tr>
Index: /trunk/grails-app/views/systemSectionDetailed/create.gsp
===================================================================
--- /trunk/grails-app/views/systemSectionDetailed/create.gsp	(revision 161)
+++ /trunk/grails-app/views/systemSectionDetailed/create.gsp	(revision 162)
@@ -29,4 +29,13 @@
                             <tr class="prop">
                                 <td valign="top" class="name">
+                                    <label for="name">Name:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}">
+                                    <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
                                     <label for="description">Description:</label>
                                 </td>
@@ -34,12 +43,12 @@
                                     <input type="text" id="description" name="description" value="${fieldValue(bean:systemSectionInstance,field:'description')}"/>
                                 </td>
-                            </tr> 
+                            </tr>
                         
                             <tr class="prop">
                                 <td valign="top" class="name">
-                                    <label for="isActive">Is Active:</label>
+                                    <label for="costCode">Cost Code:</label>
                                 </td>
-                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}">
-                                    <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}">
+                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/>
                                 </td>
                             </tr> 
@@ -47,8 +56,8 @@
                             <tr class="prop">
                                 <td valign="top" class="name">
-                                    <label for="name">Name:</label>
+                                    <label for="department">Department:</label>
                                 </td>
-                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}">
-                                    <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}">
+                                    <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select>
                                 </td>
                             </tr> 
@@ -63,4 +72,13 @@
                             </tr> 
                         
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="isActive">Is Active:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}">
+                                    <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox>
+                                </td>
+                            </tr>
+                        
                         </tbody>
                     </table>
Index: /trunk/grails-app/views/systemSectionDetailed/edit.gsp
===================================================================
--- /trunk/grails-app/views/systemSectionDetailed/edit.gsp	(revision 161)
+++ /trunk/grails-app/views/systemSectionDetailed/edit.gsp	(revision 162)
@@ -32,4 +32,58 @@
                             <tr class="prop">
                                 <td valign="top" class="name">
+                                    <label for="name">Name:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}">
+                                    <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="description">Description:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'description','errors')}">
+                                    <input type="text" id="description" name="description" value="${fieldValue(bean:systemSectionInstance,field:'description')}"/>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}">
+                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="department">Department:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}">
+                                    <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="site">Site:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'site','errors')}">
+                                    <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${systemSectionInstance?.site?.id}" ></g:select>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="isActive">Is Active:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}">
+                                    <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
                                     <label for="assets">Assets:</label>
                                 </td>
@@ -43,22 +97,4 @@
 <g:link controller="assetDetailed" params="['systemSection.id':systemSectionInstance?.id]" action="create">Add Asset</g:link>
 
-                                </td>
-                            </tr> 
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="description">Description:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'description','errors')}">
-                                    <input type="text" id="description" name="description" value="${fieldValue(bean:systemSectionInstance,field:'description')}"/>
-                                </td>
-                            </tr> 
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="isActive">Is Active:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}">
-                                    <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox>
                                 </td>
                             </tr> 
@@ -80,22 +116,4 @@
                             </tr> 
                         
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="name">Name:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}">
-                                    <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/>
-                                </td>
-                            </tr> 
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="site">Site:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'site','errors')}">
-                                    <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${systemSectionInstance?.site?.id}" ></g:select>
-                                </td>
-                            </tr> 
-                        
                         </tbody>
                     </table>
Index: /trunk/grails-app/views/systemSectionDetailed/show.gsp
===================================================================
--- /trunk/grails-app/views/systemSectionDetailed/show.gsp	(revision 161)
+++ /trunk/grails-app/views/systemSectionDetailed/show.gsp	(revision 162)
@@ -31,13 +31,7 @@
                     
                         <tr class="prop">
-                            <td valign="top" class="name">Assets:</td>
+                            <td valign="top" class="name">Name:</td>
                             
-                            <td  valign="top" style="text-align:left;" class="value">
-                                <ul>
-                                <g:each var="a" in="${systemSectionInstance.assets}">
-                                    <li><g:link controller="assetDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
-                                </g:each>
-                                </ul>
-                            </td>
+                            <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'name')}</td>
                             
                         </tr>
@@ -51,7 +45,41 @@
                     
                         <tr class="prop">
+                            <td valign="top" class="name">Cost Code:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'costCode')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Department:</td>
+                            
+                            <td valign="top" class="value"><g:link controller="department" action="show" id="${systemSectionInstance?.department?.id}">${systemSectionInstance?.department?.encodeAsHTML()}</g:link></td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Site:</td>
+                            
+                            <td valign="top" class="value"><g:link controller="site" action="show" id="${systemSectionInstance?.site?.id}">${systemSectionInstance?.site?.encodeAsHTML()}</g:link></td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
                             <td valign="top" class="name">Is Active:</td>
                             
                             <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'isActive')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Assets:</td>
+                            
+                            <td  valign="top" style="text-align:left;" class="value">
+                                <ul>
+                                <g:each var="a" in="${systemSectionInstance.assets}">
+                                    <li><g:link controller="assetDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
+                                </g:each>
+                                </ul>
+                            </td>
                             
                         </tr>
@@ -70,18 +98,4 @@
                         </tr>
                     
-                        <tr class="prop">
-                            <td valign="top" class="name">Name:</td>
-                            
-                            <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'name')}</td>
-                            
-                        </tr>
-                    
-                        <tr class="prop">
-                            <td valign="top" class="name">Site:</td>
-                            
-                            <td valign="top" class="value"><g:link controller="site" action="show" id="${systemSectionInstance?.site?.id}">${systemSectionInstance?.site?.encodeAsHTML()}</g:link></td>
-                            
-                        </tr>
-                    
                     </tbody>
                 </table>
