Changeset 181


Ignore:
Timestamp:
Nov 5, 2009, 4:01:35 AM (14 years ago)
Author:
gav
Message:

Change is* in Task to just 'active', 'scheduled' and 'approved'.
Regenerate non detailed controller and views.
Adjust detailed controller, views and services to suite.
Add support for task actions 'approve', 'complete', 'trash' and their counter parts.
Default task status to "not started" when creating a new task.

Location:
trunk
Files:
9 added
15 edited

Legend:

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

    r180 r181  
    1111    def exportService
    1212
    13     // the delete, save and update actions only accept POST requests
    14     static allowedMethods = [delete:'POST', save:'POST', update:'POST']
     13    // these actions only accept POST requests
     14    static allowedMethods = [save:'POST', update:'POST', restore:'POST', trash:'POST', approve:'POST', renegeApproval:'POST', complete:'POST', reopen:'POST']
    1515
    1616    def index = { redirect(action:search,params:params) }
     
    223223    }
    224224
    225     def delete = {
    226         def taskInstance = Task.get( params.id )
    227         if(taskInstance) {
    228             try {
    229                 taskInstance.isActive = false
    230                 flash.message = "Task ${params.id} has been set to inactive."
    231                 redirect(action:search)
    232             }
    233             catch(org.springframework.dao.DataIntegrityViolationException e) {
    234                 flash.message = "Task ${params.id} could not be deleted"
    235                 redirect(action:show,id:params.id)
    236             }
    237         }
    238         else {
     225    def restore = {
     226
     227        if(!Task.exists(params.id)) {
    239228            flash.message = "Task not found with id ${params.id}"
    240             redirect(action:search)
    241         }
     229            redirect(action:'search')
     230        }
     231
     232        def result = taskService.restore(params)
     233
     234        if(!result.error) {
     235                flash.message = "Task ${params.id} has been restored."
     236                redirect(action:show,id:result.taskInstance.id)
     237        }
     238        else {
     239            if(result.taskInstance) {
     240                render(view:'edit',model:[taskInstance:result.taskInstance])
     241            }
     242            else {
     243                flash.message = "Task could not be updated."
     244                redirect(action:'search')
     245            }
     246        }
     247
     248    }
     249
     250    def trash = {
     251
     252        if(!Task.exists(params.id)) {
     253            flash.message = "Task not found with id ${params.id}."
     254            redirect(action:'search')
     255        }
     256
     257        def result = taskService.trash(params)
     258
     259        if(!result.error) {
     260                flash.message = "Task ${params.id} has been moved to trash."
     261                redirect(action:'search')
     262        }
     263        else {
     264            if(result.taskInstance) {
     265                render(view:'edit',model:[taskInstance:result.taskInstance])
     266            }
     267            else {
     268                flash.message = "Task could not be updated."
     269                redirect(action:'search')
     270            }
     271        }
     272
     273    }
     274
     275    def approve = {
     276
     277        if(!Task.exists(params.id)) {
     278            flash.message = "Task not found with id ${params.id}."
     279            redirect(action:'search')
     280        }
     281
     282        def result = taskService.approve(params)
     283
     284        if(!result.error) {
     285                flash.message = "Task ${params.id} has been approved."
     286                redirect(action:show,id:result.taskInstance.id)
     287        }
     288        else {
     289            if(result.taskInstance) {
     290                render(view:'edit',model:[taskInstance:result.taskInstance])
     291            }
     292            else {
     293                flash.message = "Task could not be updated."
     294                redirect(action:'search')
     295            }
     296        }
     297
     298    }
     299
     300    def renegeApproval = {
     301
     302        if(!Task.exists(params.id)) {
     303            flash.message = "Task not found with id ${params.id}."
     304            redirect(action:'search')
     305        }
     306
     307        def result = taskService.renegeApproval(params)
     308
     309        if(!result.error) {
     310                flash.message = "Task ${params.id} has had approval removed."
     311                redirect(action:show,id:result.taskInstance.id)
     312        }
     313        else {
     314            if(result.taskInstance) {
     315                render(view:'edit',model:[taskInstance:result.taskInstance])
     316            }
     317            else {
     318                flash.message = "Task could not be updated."
     319                redirect(action:'search')
     320            }
     321        }
     322
     323    }
     324
     325    def complete = {
     326
     327        if(!Task.exists(params.id)) {
     328            flash.message = "Task not found with id ${params.id}."
     329            redirect(action:'search')
     330        }
     331
     332        def result = taskService.complete(params)
     333
     334        if(!result.error) {
     335                flash.message = "Task ${params.id} has been completed."
     336                redirect(action:show,id:result.taskInstance.id)
     337        }
     338        else {
     339            if(result.taskInstance) {
     340                render(view:'edit',model:[taskInstance:result.taskInstance])
     341            }
     342            else {
     343                flash.message = "Task could not be updated."
     344                redirect(action:'search')
     345            }
     346        }
     347
     348    }
     349
     350    def reopen = {
     351
     352        if(!Task.exists(params.id)) {
     353            flash.message = "Task not found with id ${params.id}."
     354            redirect(action:'search')
     355        }
     356
     357        def result = taskService.reopen(params)
     358
     359        if(!result.error) {
     360                flash.message = "Task ${params.id} has been reopened."
     361                redirect(action:show,id:result.taskInstance.id)
     362        }
     363        else {
     364            if(result.taskInstance) {
     365                render(view:'edit',model:[taskInstance:result.taskInstance])
     366            }
     367            else {
     368                flash.message = "Task could not be updated."
     369                redirect(action:'search')
     370            }
     371        }
     372
    242373    }
    243374
     
    255386        }
    256387        else {
     388            if(taskInstance.trash) {
     389                flash.message = "You may not edit items in the trash."
     390                redirect(action:show,id:taskInstance.id)
     391            }
    257392            def criteria = taskInstance.createCriteria()
    258393            def possibleParentList = criteria {
     
    320455    def create = {
    321456        def taskInstance = new Task()
     457        // Default leadPerson to current user.
     458        taskInstance.leadPerson = Person.get(authenticateService.userDomain().id)
    322459        taskInstance.properties = params
    323460        return ['taskInstance':taskInstance]
  • trunk/grails-app/domain/Task.groovy

    r168 r181  
    1515    Date targetStartDate = new Date()
    1616    Date targetCompletionDate = new Date()
    17     boolean isScheduled = false
    18     boolean isApproved = false
    19     boolean isActive = true
     17    boolean scheduled = false
     18    boolean approved = false
     19    boolean trash = false
    2020
    2121    static hasMany = [entries: Entry,
  • trunk/grails-app/i18n/messages.properties

    r180 r181  
    114114fp.property.text.associatedAssets.name=Associated Asset
    115115fp.property.text.primaryAsset.name=Primary Asset
    116 fp.property.text.isActive=Active
    117 fp.property.text.isScheduled=Scheduled
    118 fp.property.text.isApproved=Approved
     116fp.property.text.trash=Trash
     117fp.property.text.scheduled=Scheduled
     118fp.property.text.approved=Approved
    119119fp.property.text.isObsolete=Obsolete
    120120fp.property.text.taskGroup.name=Group
  • trunk/grails-app/services/CreateDataService.groovy

    r180 r181  
    410410        def taskStatusInstance
    411411
    412         taskStatusInstance = new TaskStatus(name:"Not Started")
     412        taskStatusInstance = new TaskStatus(name:"Not Started") // #1
    413413        saveAndTest(taskStatusInstance)
    414414
    415         taskStatusInstance = new TaskStatus(name:"In Progress")
     415        taskStatusInstance = new TaskStatus(name:"In Progress") // #2
    416416        saveAndTest(taskStatusInstance)
    417417
    418         taskStatusInstance = new TaskStatus(name:"Completed")
     418        taskStatusInstance = new TaskStatus(name:"Completed") // #3
    419419        saveAndTest(taskStatusInstance)
    420420    }
  • trunk/grails-app/services/TaskSearchService.groovy

    r180 r181  
    1919                ge("targetStartDate", dateUtilService.getToday())
    2020                lt("targetStartDate", dateUtilService.getTomorrow())
    21                 eq("isActive", true)
     21                eq("trash", false)
    2222            }
    2323    }
     
    3737                ge("targetStartDate", dateUtilService.getToday())
    3838                lt("targetStartDate", dateUtilService.getTomorrow())
    39                 eq("isActive", true)
     39                eq("trash", false)
    4040            }
    4141    }
     
    5454                ge("targetStartDate", dateUtilService.getToday()-7)
    5555                lt("targetStartDate", dateUtilService.getTomorrow())
    56                 eq("isActive", true)
     56                eq("trash", false)
    5757            }
    5858    }
     
    7272                ge("targetStartDate", dateUtilService.getToday()-7)
    7373                lt("targetStartDate", dateUtilService.getTomorrow())
    74                 eq("isActive", true)
     74                eq("trash", false)
    7575            }
    7676    }
     
    9090                ge("targetStartDate", dateUtilService.getToday()-7)
    9191                lt("targetStartDate", dateUtilService.getTomorrow())
    92                 eq("isActive", true)
     92                eq("trash", false)
    9393            }
    9494    }
     
    108108                ge("targetStartDate", dateUtilService.getToday()-7)
    109109                lt("targetStartDate", dateUtilService.getTomorrow())
    110                 eq("isActive", true)
     110                eq("trash", false)
    111111            }
    112112    }
  • trunk/grails-app/services/TaskService.groovy

    r180 r181  
    99        Task.withTransaction { status ->
    1010            def result = [:]
     11            // Default status to "not started" if not supplied.
     12            params.taskStatus = params.taskStatus ?: TaskStatus.get(1)
    1113            def taskInstance = new Task(params)
    1214            result.taskInstance = taskInstance
     
    5961                }
    6062
    61 
    6263                result.taskInstance.properties = params
    6364
     
    8687    }  // end update()
    8788
    88     def complete() {
    89         //TaskModificationType.get(4)
     89    def complete(params) {
     90        Task.withTransaction { status ->
     91            def result = [:]
     92            result.taskInstance = Task.get(params.id)
     93            if(result.taskInstance) {
     94
     95                // Optimistic locking check.
     96                if(params.version) {
     97                    def version = params.version.toLong()
     98                    if(result.taskInstance.version > version) {
     99                        status.setRollbackOnly()
     100                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
     101                        result.error = true
     102                        return result
     103                    }
     104                }
     105
     106                result.taskInstance.taskStatus = TaskStatus.get(3)
     107
     108                if(result.taskInstance.save()) {
     109                    def taskModification = new TaskModification(person:Person.get(authenticateService.userDomain().id),
     110                                                            taskModificationType: TaskModificationType.get(4),
     111                                                            task: result.taskInstance)
     112                    if(taskModification.save()) {
     113                        // All went well.
     114                        return result
     115                    }
     116                    else {
     117                        status.setRollbackOnly()
     118                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
     119                        result.error = true
     120                        return result
     121                    }
     122                }
     123            }
     124            // Something failed.
     125            status.setRollbackOnly()
     126            result.error = true
     127            return result
     128
     129        } //end withTransaction
    90130    }  // end complete()
    91131
    92     def reopen() {
    93         //TaskModificationType.get(5)
     132    def reopen(params) {
     133        Task.withTransaction { status ->
     134            def result = [:]
     135            result.taskInstance = Task.get(params.id)
     136            if(result.taskInstance) {
     137
     138                // Optimistic locking check.
     139                if(params.version) {
     140                    def version = params.version.toLong()
     141                    if(result.taskInstance.version > version) {
     142                        status.setRollbackOnly()
     143                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
     144                        result.error = true
     145                        return result
     146                    }
     147                }
     148
     149                result.taskInstance.taskStatus = TaskStatus.get(2)
     150
     151                if(result.taskInstance.save()) {
     152                    def taskModification = new TaskModification(person:Person.get(authenticateService.userDomain().id),
     153                                                            taskModificationType: TaskModificationType.get(5),
     154                                                            task: result.taskInstance)
     155                    if(taskModification.save()) {
     156                        // All went well.
     157                        return result
     158                    }
     159                    else {
     160                        status.setRollbackOnly()
     161                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
     162                        result.error = true
     163                        return result
     164                    }
     165                }
     166            }
     167            // Something failed.
     168            status.setRollbackOnly()
     169            result.error = true
     170            return result
     171
     172        } //end withTransaction
    94173    }  // end reopen()
    95174
    96     def trash() {
    97         //TaskModificationType.get(6)
     175    def trash(params) {
     176        Task.withTransaction { status ->
     177            def result = [:]
     178            result.taskInstance = Task.get(params.id)
     179            if(result.taskInstance) {
     180
     181                // Optimistic locking check.
     182                if(params.version) {
     183                    def version = params.version.toLong()
     184                    if(result.taskInstance.version > version) {
     185                        status.setRollbackOnly()
     186                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
     187                        result.error = true
     188                        return result
     189                    }
     190                }
     191
     192                result.taskInstance.trash = true
     193
     194                if(result.taskInstance.save()) {
     195                    def taskModification = new TaskModification(person:Person.get(authenticateService.userDomain().id),
     196                                                            taskModificationType: TaskModificationType.get(6),
     197                                                            task: result.taskInstance)
     198                    if(taskModification.save()) {
     199                        // All went well.
     200                        return result
     201                    }
     202                    else {
     203                        status.setRollbackOnly()
     204                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
     205                        result.error = true
     206                        return result
     207                    }
     208                }
     209            }
     210            // Something failed.
     211            status.setRollbackOnly()
     212            result.error = true
     213            return result
     214
     215        } //end withTransaction
    98216    }  // end trash()
    99217
    100     def restore() {
    101         //TaskModificationType.get(7)
     218    def restore(params) {
     219        Task.withTransaction { status ->
     220            def result = [:]
     221            result.taskInstance = Task.get(params.id)
     222            if(result.taskInstance) {
     223
     224                // Optimistic locking check.
     225                if(params.version) {
     226                    def version = params.version.toLong()
     227                    if(result.taskInstance.version > version) {
     228                        status.setRollbackOnly()
     229                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
     230                        result.error = true
     231                        return result
     232                    }
     233                }
     234
     235                result.taskInstance.trash = false
     236
     237                if(result.taskInstance.save()) {
     238                    def taskModification = new TaskModification(person:Person.get(authenticateService.userDomain().id),
     239                                                            taskModificationType: TaskModificationType.get(7),
     240                                                            task: result.taskInstance)
     241                    if(taskModification.save()) {
     242                        // All went well.
     243                        return result
     244                    }
     245                    else {
     246                        status.setRollbackOnly()
     247                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
     248                        result.error = true
     249                        return result
     250                    }
     251                }
     252            }
     253            // Something failed.
     254            status.setRollbackOnly()
     255            result.error = true
     256            return result
     257
     258        } //end withTransaction
    102259    }  // end restore()
    103260
    104     def approve() {
    105         //TaskModificationType.get(8)
     261    def approve(params) {
     262        Task.withTransaction { status ->
     263            def result = [:]
     264            result.taskInstance = Task.get(params.id)
     265            if(result.taskInstance) {
     266
     267                // Optimistic locking check.
     268                if(params.version) {
     269                    def version = params.version.toLong()
     270                    if(result.taskInstance.version > version) {
     271                        status.setRollbackOnly()
     272                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
     273                        result.error = true
     274                        return result
     275                    }
     276                }
     277
     278                result.taskInstance.approved = true
     279
     280                if(result.taskInstance.save()) {
     281                    def taskModification = new TaskModification(person:Person.get(authenticateService.userDomain().id),
     282                                                            taskModificationType: TaskModificationType.get(8),
     283                                                            task: result.taskInstance)
     284                    if(taskModification.save()) {
     285                        // All went well.
     286                        return result
     287                    }
     288                    else {
     289                        status.setRollbackOnly()
     290                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
     291                        result.error = true
     292                        return result
     293                    }
     294                }
     295            }
     296            // Something failed.
     297            status.setRollbackOnly()
     298            result.error = true
     299            return result
     300
     301        } //end withTransaction
    106302    }  // end approve()
    107303
    108     def renegeApproval() {
    109         //TaskModificationType.get(9)
     304    def renegeApproval(params) {
     305        Task.withTransaction { status ->
     306            def result = [:]
     307            result.taskInstance = Task.get(params.id)
     308            if(result.taskInstance) {
     309
     310                // Optimistic locking check.
     311                if(params.version) {
     312                    def version = params.version.toLong()
     313                    if(result.taskInstance.version > version) {
     314                        status.setRollbackOnly()
     315                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
     316                        result.error = true
     317                        return result
     318                    }
     319                }
     320
     321                result.taskInstance.approved = false
     322
     323                if(result.taskInstance.save()) {
     324                    def taskModification = new TaskModification(person:Person.get(authenticateService.userDomain().id),
     325                                                            taskModificationType: TaskModificationType.get(9),
     326                                                            task: result.taskInstance)
     327                    if(taskModification.save()) {
     328                        // All went well.
     329                        return result
     330                    }
     331                    else {
     332                        status.setRollbackOnly()
     333                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
     334                        result.error = true
     335                        return result
     336                    }
     337                }
     338            }
     339            // Something failed.
     340            status.setRollbackOnly()
     341            result.error = true
     342            return result
     343
     344        } //end withTransaction
    110345    }  // end renegeApproval()
    111346
  • trunk/grails-app/views/_about.gsp

    r152 r181  
    6363        <tbody>
    6464            <tr class="prop">
    65                 <td valign="top" class="name">Silk icon set acknowledgement.</td>
    66                 <td></td>
     65                <td valign="top" class="name">
     66                    Silk icon set acknowledgement.<br />
     67                    Many thanks for the fabulous silk icon set.
     68                </td>
     69
    6770
    6871            </tr>
  • trunk/grails-app/views/task/create.gsp

    r178 r181  
    127127                            <tr class="prop">
    128128                                <td valign="top" class="name">
    129                                     <label for="isActive">Is Active:</label>
     129                                    <label for="approved">Approved:</label>
    130130                                </td>
    131                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isActive','errors')}">
    132                                     <g:checkBox name="isActive" value="${taskInstance?.isActive}" ></g:checkBox>
     131                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'approved','errors')}">
     132                                    <g:checkBox name="approved" value="${taskInstance?.approved}" ></g:checkBox>
    133133                                </td>
    134134                            </tr>
     
    136136                            <tr class="prop">
    137137                                <td valign="top" class="name">
    138                                     <label for="isApproved">Is Approved:</label>
     138                                    <label for="scheduled">Scheduled:</label>
    139139                                </td>
    140                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isApproved','errors')}">
    141                                     <g:checkBox name="isApproved" value="${taskInstance?.isApproved}" ></g:checkBox>
    142                                 </td>
    143                             </tr>
    144                        
    145                             <tr class="prop">
    146                                 <td valign="top" class="name">
    147                                     <label for="isScheduled">Is Scheduled:</label>
    148                                 </td>
    149                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isScheduled','errors')}">
    150                                     <g:checkBox name="isScheduled" value="${taskInstance?.isScheduled}" ></g:checkBox>
     140                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'scheduled','errors')}">
     141                                    <g:checkBox name="scheduled" value="${taskInstance?.scheduled}" ></g:checkBox>
    151142                                </td>
    152143                            </tr>
     
    170161                            </tr>
    171162                       
     163                            <tr class="prop">
     164                                <td valign="top" class="name">
     165                                    <label for="trash">Trash:</label>
     166                                </td>
     167                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'trash','errors')}">
     168                                    <g:checkBox name="trash" value="${taskInstance?.trash}" ></g:checkBox>
     169                                </td>
     170                            </tr>
     171                       
    172172                        </tbody>
    173173                    </table>
  • trunk/grails-app/views/task/edit.gsp

    r178 r181  
    130130                            <tr class="prop">
    131131                                <td valign="top" class="name">
     132                                    <label for="approved">Approved:</label>
     133                                </td>
     134                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'approved','errors')}">
     135                                    <g:checkBox name="approved" value="${taskInstance?.approved}" ></g:checkBox>
     136                                </td>
     137                            </tr>
     138                       
     139                            <tr class="prop">
     140                                <td valign="top" class="name">
    132141                                    <label for="assignedPersons">Assigned Persons:</label>
    133142                                </td>
     
    191200                            <tr class="prop">
    192201                                <td valign="top" class="name">
    193                                     <label for="isActive">Is Active:</label>
    194                                 </td>
    195                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isActive','errors')}">
    196                                     <g:checkBox name="isActive" value="${taskInstance?.isActive}" ></g:checkBox>
    197                                 </td>
    198                             </tr>
    199                        
    200                             <tr class="prop">
    201                                 <td valign="top" class="name">
    202                                     <label for="isApproved">Is Approved:</label>
    203                                 </td>
    204                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isApproved','errors')}">
    205                                     <g:checkBox name="isApproved" value="${taskInstance?.isApproved}" ></g:checkBox>
    206                                 </td>
    207                             </tr>
    208                        
    209                             <tr class="prop">
    210                                 <td valign="top" class="name">
    211                                     <label for="isScheduled">Is Scheduled:</label>
    212                                 </td>
    213                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isScheduled','errors')}">
    214                                     <g:checkBox name="isScheduled" value="${taskInstance?.isScheduled}" ></g:checkBox>
     202                                    <label for="scheduled">Scheduled:</label>
     203                                </td>
     204                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'scheduled','errors')}">
     205                                    <g:checkBox name="scheduled" value="${taskInstance?.scheduled}" ></g:checkBox>
    215206                                </td>
    216207                            </tr>
     
    263254                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'taskType','errors')}">
    264255                                    <g:select optionKey="id" from="${TaskType.list()}" name="taskType.id" value="${taskInstance?.taskType?.id}" ></g:select>
     256                                </td>
     257                            </tr>
     258                       
     259                            <tr class="prop">
     260                                <td valign="top" class="name">
     261                                    <label for="trash">Trash:</label>
     262                                </td>
     263                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'trash','errors')}">
     264                                    <g:checkBox name="trash" value="${taskInstance?.trash}" ></g:checkBox>
    265265                                </td>
    266266                            </tr>
  • trunk/grails-app/views/task/show.gsp

    r178 r181  
    107107                   
    108108                        <tr class="prop">
     109                            <td valign="top" class="name">Approved:</td>
     110                           
     111                            <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'approved')}</td>
     112                           
     113                        </tr>
     114                   
     115                        <tr class="prop">
    109116                            <td valign="top" class="name">Assigned Persons:</td>
    110117                           
     
    159166                   
    160167                        <tr class="prop">
    161                             <td valign="top" class="name">Is Active:</td>
    162                            
    163                             <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isActive')}</td>
    164                            
    165                         </tr>
    166                    
    167                         <tr class="prop">
    168                             <td valign="top" class="name">Is Approved:</td>
    169                            
    170                             <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isApproved')}</td>
    171                            
    172                         </tr>
    173                    
    174                         <tr class="prop">
    175                             <td valign="top" class="name">Is Scheduled:</td>
    176                            
    177                             <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isScheduled')}</td>
     168                            <td valign="top" class="name">Scheduled:</td>
     169                           
     170                            <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'scheduled')}</td>
    178171                           
    179172                        </tr>
     
    216209                           
    217210                            <td valign="top" class="value"><g:link controller="taskType" action="show" id="${taskInstance?.taskType?.id}">${taskInstance?.taskType?.encodeAsHTML()}</g:link></td>
     211                           
     212                        </tr>
     213                   
     214                        <tr class="prop">
     215                            <td valign="top" class="name">Trash:</td>
     216                           
     217                            <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'trash')}</td>
    218218                           
    219219                        </tr>
  • trunk/grails-app/views/taskDetailed/create.gsp

    r180 r181  
    106106                                    <g:select optionKey="id" from="${TaskPriority.list()}" name="taskPriority.id" value="${taskInstance?.taskPriority?.id}" ></g:select>
    107107                                </td>
    108                             </tr> 
     108                            </tr>
    109109                       
    110110                            <tr class="prop">
    111111                                <td valign="top" class="name">
    112                                     <label for="taskStatus">Task Status:</label>
     112                                    <label for="scheduled">Scheduled:</label>
    113113                                </td>
    114                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'taskStatus','errors')}">
    115                                     <g:select optionKey="id" from="${TaskStatus.list()}" name="taskStatus.id" value="${taskInstance?.taskStatus?.id}" ></g:select>
    116                                 </td>
    117                             </tr>
    118                        
    119                             <tr class="prop">
    120                                 <td valign="top" class="name">
    121                                     <label for="isActive">Is Active:</label>
    122                                 </td>
    123                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isActive','errors')}">
    124                                     <g:checkBox name="isActive" value="${taskInstance?.isActive}" ></g:checkBox>
    125                                 </td>
    126                             </tr>
    127                        
    128                             <tr class="prop">
    129                                 <td valign="top" class="name">
    130                                     <label for="isApproved">Is Approved:</label>
    131                                 </td>
    132                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isApproved','errors')}">
    133                                     <g:checkBox name="isApproved" value="${taskInstance?.isApproved}" ></g:checkBox>
    134                                 </td>
    135                             </tr>
    136                        
    137                             <tr class="prop">
    138                                 <td valign="top" class="name">
    139                                     <label for="isScheduled">Is Scheduled:</label>
    140                                 </td>
    141                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isScheduled','errors')}">
    142                                     <g:checkBox name="isScheduled" value="${taskInstance?.isScheduled}" ></g:checkBox>
     114                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'scheduled','errors')}">
     115                                    <g:checkBox name="scheduled" value="${taskInstance?.scheduled}" ></g:checkBox>
    143116                                </td>
    144117                            </tr>
  • trunk/grails-app/views/taskDetailed/edit.gsp

    r168 r181  
    114114                            <tr class="prop">
    115115                                <td valign="top" class="name">
    116                                     <label for="taskStatus">Task Status:</label>
     116                                    <label for="scheduled">Scheduled:</label>
    117117                                </td>
    118                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'taskStatus','errors')}">
    119                                     <g:select optionKey="id" from="${TaskStatus.list()}" name="taskStatus.id" value="${taskInstance?.taskStatus?.id}" ></g:select>
    120                                 </td>
    121                             </tr>
    122                        
    123                             <tr class="prop">
    124                                 <td valign="top" class="name">
    125                                     <label for="isActive">Is Active:</label>
    126                                 </td>
    127                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isActive','errors')}">
    128                                     <g:checkBox name="isActive" value="${taskInstance?.isActive}" ></g:checkBox>
    129                                 </td>
    130                             </tr>
    131                        
    132                             <tr class="prop">
    133                                 <td valign="top" class="name">
    134                                     <label for="isApproved">Is Approved:</label>
    135                                 </td>
    136                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isApproved','errors')}">
    137                                     <g:checkBox name="isApproved" value="${taskInstance?.isApproved}" ></g:checkBox>
    138                                 </td>
    139                             </tr>
    140                        
    141                             <tr class="prop">
    142                                 <td valign="top" class="name">
    143                                     <label for="isScheduled">Is Scheduled:</label>
    144                                 </td>
    145                                 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'isScheduled','errors')}">
    146                                     <g:checkBox name="isScheduled" value="${taskInstance?.isScheduled}" ></g:checkBox>
     118                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'scheduled','errors')}">
     119                                    <g:checkBox name="scheduled" value="${taskInstance?.scheduled}" ></g:checkBox>
    147120                                </td>
    148121                            </tr>
     
    181154                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'assignedPersons','errors')}">
    182155                                   
    183                                                                 <ul>
    184                                                                 <g:each var="a" in="${taskInstance?.assignedPersons?}">
    185                                                                         <li><g:link controller="assignedPersonDetailed" action="edit" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
    186                                                                 </g:each>
    187                                                                 </ul>
    188                                                                 <g:link controller="assignedPersonDetailed" params="['task.id':taskInstance?.id]" action="create">Add AssignedPerson</g:link>
     156                                <ul>
     157                                <g:each var="a" in="${taskInstance?.assignedPersons?}">
     158                                    <li><g:link controller="assignedPersonDetailed" action="edit" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
     159                                </g:each>
     160                                </ul>
    189161
    190162                                </td>
    191                             </tr> 
     163                            </tr>
    192164
    193 
    194                        
    195165                        </tbody>
    196166                    </table>
     
    198168                <div class="buttons">
    199169                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
    200                     <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
     170                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="show"/></span>
     171                    <span class="button"><g:actionSubmit class="trash" onclick="return confirm('Are you sure?');" value="Trash" /></span>
    201172                </div>
    202173            </g:form>
  • trunk/grails-app/views/taskDetailed/searchCalendar.gsp

    r155 r181  
    4444                                    class="overlayPane"
    4545                                    additionalProperties="id"
    46                                     excludeProperties="isActive, comment, targetCompletionDate"
     46                                    excludeProperties="trash, comment, targetCompletionDate"
    4747                                    associatedProperties="leadPerson.lastName, taskPriority.name"
    4848                                    filterPropertyValues="${['taskPriority.name':[values:TaskPriority.list()],
  • trunk/grails-app/views/taskDetailed/show.gsp

    r180 r181  
    1616            <div class="message">${flash.message}</div>
    1717            </g:if>
     18            <g:if test="${taskInstance.trash}" >
     19                <div class="errors">
     20                        This task is in the trash bin, but can be restored if required.
     21                </div>
     22            </g:if>
    1823            <g:hasErrors bean="${taskInstance}">
    1924            <div class="errors">
     
    7580                                                                                    showElement('modControlOpened');
    7681                                                                                    hideElement('modControlClosed'); return false;">
    77                                                     Modifications <img  src="${resource(dir:'images/skin',file:'sorted_asc.gif')}" alt="Show" />
     82                                                    Modifications <img  src="${resource(dir:'images/skin',file:'bullet_toggle_plus.png')}" alt="Show" />
    7883                                                </a>
    7984                                            </div>
     
    8388                                                                                    showElement('modControlClosed');
    8489                                                                                    return false;">
    85                                                     Modifications <img  src="${resource(dir:'images/skin',file:'sorted_desc.gif')}" alt="Show" />
     90                                                    Modifications <img  src="${resource(dir:'images/skin',file:'bullet_toggle_minus.png')}" alt="Show" />
    8691                                                </a>
    8792                                            </div>
     
    142147
    143148                                    <tr class="prop">
    144                                         <td valign="top" class="name">Active:</td>
    145 
    146                                         <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isActive')}</td>
    147 
    148                                     </tr>
    149 
    150                                     <tr class="prop">
    151149                                        <td valign="top" class="name">Approved:</td>
    152150
    153                                         <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isApproved')}</td>
     151                                        <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'approved')}</td>
    154152
    155153                                    </tr>
     
    158156                                        <td valign="top" class="name">Scheduled:</td>
    159157
    160                                         <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isScheduled')}</td>
     158                                        <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'scheduled')}</td>
    161159
    162160                                    </tr>
     
    204202                            <g:form>
    205203                                <input type="hidden" name="id" value="${taskInstance?.id}" />
    206                                 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
    207                                 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
     204
     205                                <g:if test="${taskInstance.trash}" >
     206                                    <span class="button"><g:actionSubmit class="restore" onclick="return confirm('Are you sure?');" value="Restore" /></span>
     207                                </g:if>
     208                                <g:else>
     209
     210                                    <g:if test="${taskInstance.taskStatus.id != 3}" >
     211                                        <span class="button"><g:actionSubmit class="complete" value="Complete" /></span>
     212
     213                                        <g:if test="${taskInstance.approved}" >
     214                                            <span class="button"><g:actionSubmit class="renegeApproval" value="Renege Approval" action="renegeApproval" /></span>
     215                                        </g:if>
     216                                        <g:else>
     217                                            <span class="button"><g:actionSubmit class="approve" value="Approve" /></span>
     218                                        </g:else>
     219
     220                                        <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
     221                                        <span class="button"><g:actionSubmit class="trash" onclick="return confirm('Are you sure?');" value="Trash" /></span>
     222
     223                                    </g:if>
     224                                    <g:else>
     225                                        <span class="button"><g:actionSubmit class="reopen" value="Reopen" /></span>
     226                                    </g:else>
     227
     228                                </g:else>
    208229                            </g:form>
    209230                        </div>
     
    252273                                        <th>Entered By</th>
    253274                                        <th></th>
    254 
    255             <!--                            <g:sortableColumn property="commentW" title="Comment" />
    256 
    257                                         <g:sortableColumn property="dateDoneW" title="Date Done" />
    258 
    259                                         <g:sortableColumn property="enteredByW" title="Entered By" />-->
    260275                                    </tr>
    261276                                </thead>
  • trunk/web-app/css/main.css

    r155 r181  
    344344.buttons input.delete {
    345345    background: transparent url(../images/skin/database_delete.png) 5px 50% no-repeat;
     346    padding-left: 28px;
     347}
     348.buttons input.trash {
     349    background: transparent url(../images/skin/bin_closed.png) 5px 50% no-repeat;
     350    padding-left: 28px;
     351}
     352.buttons input.restore {
     353    background: transparent url(../images/skin/bin_empty.png) 5px 50% no-repeat;
     354    padding-left: 28px;
     355}
     356.buttons input.cancel {
     357    background: transparent url(../images/skin/cross.png) 5px 50% no-repeat;
     358    padding-left: 28px;
     359}
     360.buttons input.complete {
     361    background: transparent url(../images/skin/tick.png) 5px 50% no-repeat;
     362    padding-left: 28px;
     363}
     364.buttons input.reopen {
     365    background: transparent url(../images/skin/door_open.png) 5px 50% no-repeat;
     366    padding-left: 28px;
     367}
     368.buttons input.approve {
     369    background: transparent url(../images/skin/database_gear.png) 5px 50% no-repeat;
     370    padding-left: 28px;
     371}
     372.buttons input.renegeApproval {
     373    background: transparent url(../images/skin/cog_delete.png) 5px 50% no-repeat;
    346374    padding-left: 28px;
    347375}
Note: See TracChangeset for help on using the changeset viewer.