Ignore:
Timestamp:
Sep 28, 2009, 10:01:43 AM (15 years ago)
Author:
gav
Message:

Install Navigation plugin, work on navigation and hopefully fixed a few more IE vs Firefox CSS issues.
New skin for class-diagram plugin.
Adjust security config to suite.
Replace home.gsp with start.gsp, remove options.gsp and acknowledgements.gsp as they are now on start.gsp tabs.
Create search pages for Tasks, Assets and Inventory.
Change suggested login to manager.
Change all date formats to format="EEE, dd-MMM-yyyy".

Location:
trunk/grails-app/controllers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/AppCoreController.groovy

    r134 r139  
    55    def authenticateService
    66
    7     def index = { redirect(action:home,params:params) }
     7    def index = { redirect(action:start,params:params) }
    88
    99    // the delete, save and update actions only accept POST requests
    1010    //def allowedMethods = [delete:'POST', save:'POST', update:'POST']
    1111
     12    /**
     13    * This is where we arrive after login.
     14    *  Attach the welcome flash message and redirect to where ever we want the user to start.
     15    * e.g. redirect(controller:"taskDetailed", action:"search")
     16    */
    1217    def welcome = {
    1318        def personInstance = Person.get(authenticateService.userDomain().id)
     
    1621        def sess = getSession()
    1722        sess.setMaxInactiveInterval(personInstance.sessionTimeout)
    18         redirect(action:home)
     23        redirect(action:start)
    1924    }
    2025
    21     def home = {
    22     }
    23 
    24     def options = {
    25     }
    26 
    27     def acknowledgements = {
     26    def start = {
    2827    }
    2928
     
    3534        if (request.method == 'POST') {
    3635            def personInstance = Person.get(authenticateService.userDomain().id)
    37 //             personInstance.sessionTimeout = params.sessionTimeout.toInteger()
    3836                personInstance.properties = params
    3937                if (!personInstance.hasErrors() && personInstance.save()) {
     
    4139                    sess.setMaxInactiveInterval(personInstance.sessionTimeout)
    4240                    flash.message = "Session timeout changed."
    43                     redirect(action:options)
     41                    redirect(action:start)
    4442                }
    4543                else {
     
    6866                    //userCache.removeUserFromCache(personInstance.loginName)
    6967                    flash.message = "Password changed successfully."
    70                     redirect(action:options)
     68                    redirect(action:start)
    7169                }
    7270                else {
  • trunk/grails-app/controllers/AssetDetailedController.groovy

    r124 r139  
    33class AssetDetailedController extends BaseController {
    44   
    5     def index = { redirect(action:list,params:params) }
     5    def index = { redirect(action:search,params:params) }
    66
    77    // the delete, save and update actions only accept POST requests
     
    1313    }
    1414
     15    def search = {
     16        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
     17        [ assetInstanceList: Asset.list( params ), assetInstanceTotal: Asset.count() ]
     18    }
     19
    1520    def show = {
     21       
     22        // In the case of an actionSubmit button, rewrite action name from 'index'.
     23        if(params._action_Show)
     24        { params.action='show' }
     25       
    1626        def assetInstance = Asset.get( params.id )
    1727
    1828        if(!assetInstance) {
    1929            flash.message = "Asset not found with id ${params.id}"
    20             redirect(action:list)
     30            redirect(action:search)
    2131        }
    2232        else { return [ assetInstance : assetInstance ] }
     
    2939                assetInstance.delete()
    3040                flash.message = "Asset ${params.id} deleted"
    31                 redirect(action:list)
     41                redirect(action:search)
    3242            }
    3343            catch(org.springframework.dao.DataIntegrityViolationException e) {
     
    3848        else {
    3949            flash.message = "Asset not found with id ${params.id}"
    40             redirect(action:list)
     50            redirect(action:search)
    4151        }
    4252    }
    4353
    4454    def edit = {
     55       
     56        // In the case of an actionSubmit button, rewrite action name from 'index'.
     57        if(params._action_Edit)
     58        { params.action='edit' }
     59       
    4560        def assetInstance = Asset.get( params.id )
    4661
    4762        if(!assetInstance) {
    4863            flash.message = "Asset not found with id ${params.id}"
    49             redirect(action:list)
     64            redirect(action:search)
    5065        }
    5166        else {
  • trunk/grails-app/controllers/InventoryItemDetailedController.groovy

    r116 r139  
    33class InventoryItemDetailedController extends BaseController {
    44   
    5     def index = { redirect(action:list,params:params) }
     5    def index = { redirect(action:search, params:params) }
    66
    77    // the delete, save and update actions only accept POST requests
     
    1313    }
    1414
     15    def search = {
     16        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
     17        [ inventoryItemInstanceList: InventoryItem.list( params ), inventoryItemInstanceTotal: InventoryItem.count() ]
     18    }
     19
    1520    def show = {
     21       
     22        // In the case of an actionSubmit button, rewrite action name from 'index'.
     23        if(params._action_Show)
     24        { params.action='show' }
     25       
    1626        def inventoryItemInstance = InventoryItem.get( params.id )
    1727
    1828        if(!inventoryItemInstance) {
    1929            flash.message = "InventoryItem not found with id ${params.id}"
    20             redirect(action:list)
     30            redirect(action:search)
    2131        }
    2232        else { return [ inventoryItemInstance : inventoryItemInstance ] }
     
    2939                inventoryItemInstance.delete()
    3040                flash.message = "InventoryItem ${params.id} deleted"
    31                 redirect(action:list)
     41                redirect(action:search)
    3242            }
    3343            catch(org.springframework.dao.DataIntegrityViolationException e) {
     
    3848        else {
    3949            flash.message = "InventoryItem not found with id ${params.id}"
    40             redirect(action:list)
     50            redirect(action:search)
    4151        }
    4252    }
    4353
    4454    def edit = {
     55       
     56        // In the case of an actionSubmit button, rewrite action name from 'index'.
     57        if(params._action_Edit)
     58        { params.action='edit' }
     59       
    4560        def inventoryItemInstance = InventoryItem.get( params.id )
    4661
    4762        if(!inventoryItemInstance) {
    4863            flash.message = "InventoryItem not found with id ${params.id}"
    49             redirect(action:list)
     64            redirect(action:search)
    5065        }
    5166        else {
  • trunk/grails-app/controllers/TaskDetailedController.groovy

    r137 r139  
    22
    33class TaskDetailedController extends BaseController {
    4    
    5     def index = { redirect(action:list,params:params) }
     4
     5    def index = {
     6        println "index called"
     7        redirect(action:search,params:params)
     8    }
    69
    710    // the delete, save and update actions only accept POST requests
    811    static allowedMethods = [delete:'POST', save:'POST', update:'POST']
    9 
    10 //     def list = {
    11 //         params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
    12 //         def taskInstanceActives = Task.findAllByIsActive( true ).list( params )
    13 // //         def taskInstanceList = taskInstanceActives.list( params )
    14 //         return [ taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceActives.count() ]
    15 //     }
    1612
    1713    def list = {
     
    2016    }
    2117
     18    def search = {
     19        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
     20       
     21        if(!params.order) {
     22            params.sort = "id"
     23            params.order = "desc"
     24        }
     25       
     26        if(params.search == "ShowAll")
     27        {
     28            def taskInstanceActivesList = Task.findAllByIsActive(true, params)
     29            def taskInstanceActivesTotal = Task.countByIsActive(true)
     30            return [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal]
     31        }
     32        if(params.search == "ShowDeleted")
     33        {
     34            def taskInstanceActivesList = Task.findAllByIsActive(false, params)
     35            def taskInstanceActivesTotal = Task.countByIsActive(false)
     36            return [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal]
     37        }
     38        // Default:
     39        def taskInstanceActivesList = Task.findAllByIsActive(true, params)
     40        def taskInstanceActivesTotal = Task.countByIsActive(true)
     41        [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal]
     42    }
     43   
     44    def searchShowAll = {
     45        redirect(action:'search', params:[search:"ShowAll"])
     46    }
     47   
     48    def searchShowDeleted = {
     49        redirect(action:'search', params:[search:"ShowDeleted"])
     50    }
     51
    2252    def show = {
     53       
     54        // In the case of an actionSubmit button, rewrite action name from 'index'.
     55        if(params._action_Show)
     56        { params.action='show' }
     57
    2358        def taskInstance = Task.get( params.id )
    2459
    2560        if(!taskInstance) {
    2661            flash.message = "Task not found with id ${params.id}"
    27             redirect(action:list)
     62            redirect(action:search)
    2863        }
    2964        else {
     
    86121                taskInstance.isActive = false
    87122                flash.message = "Task ${params.id} has been set to inactive."
    88                 redirect(action:list)
     123                redirect(action:search)
    89124            }
    90125            catch(org.springframework.dao.DataIntegrityViolationException e) {
     
    95130        else {
    96131            flash.message = "Task not found with id ${params.id}"
    97             redirect(action:list)
     132            redirect(action:search)
    98133        }
    99134    }
    100135
    101136    def edit = {
     137       
     138        // In the case of an actionSubmit button, rewrite action name from 'index'.
     139        if(params._action_Edit)
     140        { params.action='edit' }
     141       
    102142        def taskInstance = Task.get( params.id )
    103143
    104144        if(!taskInstance) {
    105145            flash.message = "Task not found with id ${params.id}"
    106             redirect(action:list)
     146            redirect(action:search)
    107147        }
    108148        else {
     
    166206        if(!parentTaskInstance) {
    167207            flash.message = "Task not found with id ${params.id}"
    168             redirect(action:list)
     208            redirect(action:search)
    169209        }
    170210        else {
Note: See TracChangeset for help on using the changeset viewer.