Ignore:
Timestamp:
Nov 3, 2009, 5:58:21 PM (14 years ago)
Author:
gav
Message:

Format to 4 spaces, no tabs.

File:
1 edited

Legend:

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

    r178 r179  
    165165        }
    166166        else {
    167                         params.max = 10
    168                         params.order = "desc"
    169                         params.sort = "id"
    170                        
    171                         def entryWorkDoneList = Entry.withCriteria {
    172                                                                                                                                 def entryType = EntryType.findByName("WorkDone")
    173                                                                                                                                 eq("entryType", entryType)
    174                                                                                                                                 eq("task", taskInstance)
    175                                                                                                                 }
    176                        
    177                         def entryFaultList = Entry.withCriteria {
    178                                                                                                                                 def entryType = EntryType.findByName("Fault")
    179                                                                                                                                 eq("entryType", entryType)
    180                                                                                                                                 eq("task", taskInstance)
    181                                                                                                                 }
    182 
    183                         def subTaskInstanceList = Task.findAllByParentTask(taskInstance, params)
    184                         def subTaskInstanceTotal = Task.countByParentTask(taskInstance)
     167            params.max = 10
     168            params.order = "desc"
     169            params.sort = "id"
     170
     171            def entryWorkDoneList = Entry.withCriteria {
     172                                                                def entryType = EntryType.findByName("WorkDone")
     173                                                                eq("entryType", entryType)
     174                                                                eq("task", taskInstance)
     175                                                        }
     176
     177            def entryFaultList = Entry.withCriteria {
     178                                                                def entryType = EntryType.findByName("Fault")
     179                                                                eq("entryType", entryType)
     180                                                                eq("task", taskInstance)
     181                                                        }
     182
     183            def subTaskInstanceList = Task.findAllByParentTask(taskInstance, params)
     184            def subTaskInstanceTotal = Task.countByParentTask(taskInstance)
    185185            def showTaskTab = new String("true")
    186186
     
    202202                taskRecurringScheduleExits = false
    203203            }
    204                        
     204
    205205            return [ taskInstance: taskInstance,
    206                                                         entryWorkDoneList: entryWorkDoneList,
    207                                                         entryFaultList: entryFaultList,
     206                            entryWorkDoneList: entryWorkDoneList,
     207                            entryFaultList: entryFaultList,
    208208                            taskProcedureInstance: taskProcedureInstance,
    209209                            taskProcedureExits: taskProcedureExits,
    210210                            showTaskTab: showTaskTab,
    211                                                         subTaskInstanceList: subTaskInstanceList,
    212                                                         subTaskInstanceTotal: subTaskInstanceTotal,
    213                                                         subTaskInstanceMax: params.max,
    214                                                         maintenanceActionList: maintenanceActionList,
    215                                                         taskRecurringScheduleInstance: taskRecurringScheduleInstance,
    216                                                         taskRecurringScheduleExits: taskRecurringScheduleExits,
     211                            subTaskInstanceList: subTaskInstanceList,
     212                            subTaskInstanceTotal: subTaskInstanceTotal,
     213                            subTaskInstanceMax: params.max,
     214                            maintenanceActionList: maintenanceActionList,
     215                            taskRecurringScheduleInstance: taskRecurringScheduleInstance,
     216                            taskRecurringScheduleExits: taskRecurringScheduleExits,
    217217                            inventoryMovementList: inventoryMovementList]
    218218        }
     
    268268                def version = params.version.toLong()
    269269                if(taskInstance.version > version) {
    270                    
     270
    271271                    taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
    272272                    render(view:'edit',model:[taskInstance:taskInstance])
     
    305305        }
    306306    }
    307        
    308         def listSubTasks = {
    309                 def parentTaskInstance = Task.get(params.id)
    310                                
     307
     308    def listSubTasks = {
     309        def parentTaskInstance = Task.get(params.id)
     310
    311311        if(!parentTaskInstance) {
    312312            flash.message = "Task not found with id ${params.id}"
     
    314314        }
    315315        else {
    316                 params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
    317                 def subTaskInstanceList = Task.findAllByParentTask(parentTaskInstance, params)
    318                 def subTaskInstanceTotal = Task.countByParentTask(parentTaskInstance)
    319                                
     316        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
     317        def subTaskInstanceList = Task.findAllByParentTask(parentTaskInstance, params)
     318        def subTaskInstanceTotal = Task.countByParentTask(parentTaskInstance)
     319
    320320        [ taskInstanceList: subTaskInstanceList,
    321                         taskInstanceTotal:  subTaskInstanceTotal,
    322                         parentTaskInstance: parentTaskInstance]
    323                 }
    324         }
    325        
     321            taskInstanceTotal:  subTaskInstanceTotal,
     322            parentTaskInstance: parentTaskInstance]
     323        }
     324    }
     325
    326326}
Note: See TracChangeset for help on using the changeset viewer.