Changeset 140 for trunk/grails-app
- Timestamp:
- Oct 1, 2009, 5:11:48 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r137 r140 281 281 taskPriority:TaskPriority.get(2), 282 282 taskType:TaskType.get(1), 283 leadPerson:Person.get( 3),283 leadPerson:Person.get(2), 284 284 description:"Check specific level sensor", 285 285 comment:"Has been noted as problematic, try recalibrating.") -
trunk/grails-app/conf/Config.groovy
r139 r140 86 86 [order:20, controller:'taskDetailed', title:'tasks', action:'search', 87 87 subItems: [ 88 [order:10, controller:'taskDetailed', title:'Search', action:'search', isVisible: { true }], 88 [order:10, controller:'taskDetailed', title:'Search', action:'search', isVisible: { params.action != 'advancedSearch'}], 89 [order:11, controller:'taskDetailed', title:'Advanced Search', action:'advancedSearch', isVisible: { params.action == 'advancedSearch' }], 89 90 [order:20, controller:'taskDetailed', title:'Create', action:'create', isVisible: { true }], 90 91 [order:90, controller:'taskDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }], -
trunk/grails-app/conf/SecurityConfig.groovy
r139 r140 42 42 '/plugins/richui-0.6/**': ['IS_AUTHENTICATED_FULLY'], 43 43 '/plugins/navigation-1.1/**': ['IS_AUTHENTICATED_FULLY'], 44 '/plugins/filterpane-0.6.2/**': ['IS_AUTHENTICATED_FULLY'], 44 45 '/plugins/class-diagram-0.3/**': ['IS_AUTHENTICATED_FULLY'], 45 46 '/classDiagram*': ['IS_AUTHENTICATED_FULLY'], -
trunk/grails-app/controllers/TaskDetailedController.groovy
r139 r140 3 3 class TaskDetailedController extends BaseController { 4 4 5 def index = { 6 println "index called" 7 redirect(action:search,params:params) 8 } 5 def authenticateService 6 def dateUtilService 7 def filterService 9 8 10 9 // the delete, save and update actions only accept POST requests 11 10 static allowedMethods = [delete:'POST', save:'POST', update:'POST'] 12 11 12 def index = { redirect(action:search,params:params) } 13 13 14 def list = { 14 15 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 15 16 [ taskInstanceList: Task.list( params ), taskInstanceTotal: Task.count() ] 16 17 } 17 18 18 19 def search = { 19 20 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 20 21 21 if(!params.order) { 22 params.sort = "id" 23 params.order = "desc" 24 } 25 26 if(params.search == "ShowAll") 27 { 22 if(!params._action_search) 23 { 24 // Default: 28 25 def taskInstanceActivesList = Task.findAllByIsActive(true, params) 29 26 def taskInstanceActivesTotal = Task.countByIsActive(true) 30 27 return [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal] 31 28 } 32 if(params.search == "ShowDeleted") 33 { 34 def taskInstanceActivesList = Task.findAllByIsActive(false, params) 35 def taskInstanceActivesTotal = Task.countByIsActive(false) 29 render( view:'search', 30 model:[ taskInstanceList: filterService.filter( params, Task ), 31 taskInstanceTotal: filterService.count( params, Task ), 32 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 33 params:params ] ) 34 } 35 36 def advancedSearch = { 37 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 38 39 if(!params._action_advancedSearch) 40 { 41 // Default: 42 def taskInstanceActivesList = Task.findAllByIsActive(true, params) 43 def taskInstanceActivesTotal = Task.countByIsActive(true) 36 44 return [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal] 37 45 } 38 // Default: 39 def taskInstanceActivesList = Task.findAllByIsActive(true, params) 40 def taskInstanceActivesTotal = Task.countByIsActive(true) 41 [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal] 42 } 46 render( view:'advancedSearch', 47 model:[ taskInstanceList: filterService.filter( params, Task ), 48 taskInstanceTotal: filterService.count( params, Task ), 49 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 50 params:params ] ) 51 } 52 53 def searchTodays = { 54 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 55 56 def taskInstanceList = Task.createCriteria().list() { 57 eq("targetStartDate", dateUtilService.getToday()) 58 eq("isActive", true) 59 } 60 61 def taskInstanceTotal = Task.createCriteria().count() { 62 eq("targetStartDate", dateUtilService.getToday()) 63 eq("isActive", true) 64 } 65 66 if(taskInstanceTotal > 0) 67 { 68 flash.message = "Today's tasks" 69 } 70 else { flash.message = "No tasks found for today" } 71 72 render( view:'search', 73 model:[ taskInstanceList: taskInstanceList, 74 taskInstanceTotal: taskInstanceTotal]) 75 } 76 77 def searchMyTodays = { 78 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 79 80 def taskInstanceList = Task.createCriteria().list() { 81 eq("leadPerson", Person.get(authenticateService.userDomain().id)) 82 ge("targetStartDate", dateUtilService.getToday()) 83 eq("isActive", true) 84 } 85 86 def taskInstanceTotal = Task.createCriteria().count() { 87 eq("leadPerson", Person.get(authenticateService.userDomain().id)) 88 ge("targetStartDate", dateUtilService.getToday()) 89 eq("isActive", true) 90 } 91 92 if(taskInstanceTotal > 0) 93 { 94 flash.message = "Today's tasks" 95 } 96 else { flash.message = "No tasks found for today" } 97 98 render( view:'search', 99 model:[ taskInstanceList: taskInstanceList, 100 taskInstanceTotal: taskInstanceTotal]) 101 } 102 103 def searchInTheLastWeek = { 104 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 105 106 def taskInstanceList = Task.createCriteria().list() { 107 ge("targetStartDate", dateUtilService.getToday()-7) 108 eq("isActive", true) 109 } 110 111 def taskInstanceTotal = Task.createCriteria().count() { 112 ge("targetStartDate", dateUtilService.getToday()-7) 113 eq("isActive", true) 114 } 115 116 if(taskInstanceTotal > 0) 117 { 118 flash.message = "Tasks with target start date in the last week." 119 } 120 121 else {flash.message = "No tasks found with target start date in the last week." } 122 123 render( view:'search', 124 model:[ taskInstanceList: taskInstanceList, 125 taskInstanceTotal: taskInstanceTotal]) 126 } 127 128 def searchMyInTheLastWeek = { 129 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 130 131 def taskInstanceList = Task.createCriteria().list() { 132 eq("leadPerson", Person.get(authenticateService.userDomain().id)) 133 ge("targetStartDate", dateUtilService.getToday()-7) 134 eq("isActive", true) 135 } 136 137 def taskInstanceTotal = Task.createCriteria().count() { 138 eq("leadPerson", Person.get(authenticateService.userDomain().id)) 139 ge("targetStartDate", dateUtilService.getToday()-7) 140 eq("isActive", true) 141 } 142 143 if(taskInstanceTotal > 0) 144 { 145 flash.message = "Tasks with target start date in the last week." 146 } 147 else { flash.message = "No tasks found with target start date in the last week." } 148 149 render( view:'search', 150 model:[ taskInstanceList: taskInstanceList, 151 taskInstanceTotal: taskInstanceTotal]) 152 } 153 154 // def search = { 155 // params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 156 // 157 // if(!params.order) { 158 // params.sort = "id" 159 // params.order = "desc" 160 // } 161 // 162 // if(params.search == "ShowAll") 163 // { 164 // def taskInstanceActivesList = Task.findAllByIsActive(true, params) 165 // def taskInstanceActivesTotal = Task.countByIsActive(true) 166 // return [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal] 167 // } 168 // if(params.search == "ShowDeleted") 169 // { 170 // def taskInstanceActivesList = Task.findAllByIsActive(false, params) 171 // def taskInstanceActivesTotal = Task.countByIsActive(false) 172 // return [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal] 173 // } 174 // // Default: 175 // def taskInstanceActivesList = Task.findAllByIsActive(true, params) 176 // def taskInstanceActivesTotal = Task.countByIsActive(true) 177 // [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal] 178 // } 43 179 44 180 def searchShowAll = { -
trunk/grails-app/views/appCore/start.gsp
r139 r140 36 36 <br /> 37 37 <br /> 38 Prepared quick links 38 <div class="dialog"> 39 <table> 40 <tbody> 41 42 <tr class="prop"> 43 <td valign="top" class="name"> 44 <label>My Tasks:</label> 45 </td> 46 <td valign="top" class="value"> 47 <g:link controller="taskDetailed" 48 action="searchMyTodays"> 49 Today's 50 </g:link> 51 <br /> 52 <g:link controller="taskDetailed" 53 action="searchMyInTheLastWeek"> 54 In the last week 55 </g:link> 56 </td> 57 </tr> 58 59 <tr class="prop"> 60 <td valign="top" class="name"> 61 <label>Tasks:</label> 62 </td> 63 <td valign="top" class="value"> 64 <g:link controller="taskDetailed" 65 action="searchTodays"> 66 Today's 67 </g:link> 68 <br /> 69 <g:link controller="taskDetailed" 70 action="searchInTheLastWeek"> 71 In the last week 72 </g:link> 73 </td> 74 </tr> 75 76 </tbody> 77 </table> 78 </div> 39 79 <br /> 40 80 <br /> -
trunk/grails-app/views/taskDetailed/create.gsp
r139 r140 6 6 <nav:resources override="true"/> 7 7 </head> 8 <body >8 <body onload="document.createTaskForm.description.focus();"> 9 9 <div class="nav"> 10 10 <nav:renderSubItems group="nav"/> … … 19 19 </div> 20 20 </g:hasErrors> 21 <g:form action="save" method="post" >21 <g:form id='createTaskForm' name='createTaskForm' action="save" method="post" > 22 22 <div class="dialog"> 23 23 <table> -
trunk/grails-app/views/taskDetailed/search.gsp
r139 r140 4 4 <meta name="layout" content="main" /> 5 5 <title>Task Search</title> 6 <filterpane:includes /> 6 7 <nav:resources override="true"/> 7 <resource:tabView skin="tabviewCustom" />8 8 </head> 9 9 <body> … … 21 21 </div> 22 22 </g:hasErrors> 23 24 <richui:tabView id="tabView"> 25 26 <richui:tabLabels> 27 <richui:tabLabel selected="true" title="Quick" /> 28 <richui:tabLabel selected="${0}" title="Basic" /> 29 <richui:tabLabel selected="${0}" title="Advanced" /> 30 </richui:tabLabels> 31 32 <richui:tabContents> 33 34 <!-- Quick tab --> 35 <richui:tabContent> 36 <br /> 37 <br /> 38 <g:form controller="taskDetailed"> 39 Task ID: 40 <input type="text" name="id" value="${taskInstance?.id}" /> 41 <span class="button"><g:actionSubmit class="show" value="Show" /></span> 42 </g:form> 43 <br /> 44 <br /> 45 Show: 46 <g:link action="searchShowAll">Active</g:link> 47 / 48 <g:link action="searchShowDeleted">Inactive</g:link> 49 </richui:tabContent> 50 <!-- End Quick tab --> 51 52 <!-- Basic tab --> 53 <richui:tabContent> 54 <br /> 55 <br /> 56 57 </richui:tabContent> 58 <!-- End Basic tab --> 59 60 <!-- Advanced tab --> 61 <richui:tabContent> 62 <br /> 63 <br /> 64 </richui:tabContent> 65 <!-- End Advanced tab --> 66 67 </richui:tabContents> 68 </richui:tabView> 23 <filterpane:currentCriteria domainBean="Task" 24 action="search" 25 dateFormat="${'EEE, dd-MMM-yyyy'}" 26 removeImgDir="images" 27 removeImgFile="bullet_delete.png" 28 title="Quick Search"/> 69 29 70 <div class="list"> 30 <div class="list"> 71 31 <table> 72 32 <thead> 73 33 <tr> 74 34 75 <g:sortableColumn property="id" title="Id" />35 <g:sortableColumn property="id" title="Id" params="${filterParams}" /> 76 36 77 <g:sortableColumn property="targetStartDate" title="Target Start Date" />37 <g:sortableColumn property="targetStartDate" title="Target Start Date" params="${filterParams}" /> 78 38 79 <g:sortableColumn property="description" title="Description" />39 <g:sortableColumn property="description" title="Description" params="${filterParams}" /> 80 40 81 <g:sortableColumn property="leadPerson" title="Lead Person" />41 <g:sortableColumn property="leadPerson" title="Lead Person" params="${filterParams}" /> 82 42 83 <g:sortableColumn property="taskPriority" title="Task Priority" />43 <g:sortableColumn property="taskPriority" title="Task Priority" params="${filterParams}" /> 84 44 85 <g:sortableColumn property="taskStatus" title="Task Status" />45 <g:sortableColumn property="taskStatus" title="Task Status" params="${filterParams}" /> 86 46 87 47 <th></th> … … 117 77 </div> 118 78 <div class="paginateButtons"> 119 <g:paginate total="${taskInstanceTotal}" /> 79 <g:paginate total="${taskInstanceTotal}" params="${filterParams}" /> 80 <filterpane:filterButton text="Search" appliedText="Change Search" /> 81 Results:${taskInstanceTotal} 82 <g:link action="advancedSearch">Goto: Advanced Search</g:link> 120 83 </div> 121 84 85 <filterpane:filterPane domainBean="Task" 86 title="Quick Search" 87 action="search" 88 additionalProperties="id" 89 excludeProperties="isActive, comment, targetCompletionDate" 90 associatedProperties="leadPerson.lastName, taskPriority.name" 91 filterPropertyValues="${['taskPriority.name':[values:TaskPriority.list()], 92 'leadPerson.lastName':[values:Person.executeQuery('select t.lastName from Person t')], 93 targetStartDate:[years:2020..2000,precision:'day']]}"/> 122 94 </div> <!-- end body div --> 123 95 </body>
Note: See TracChangeset
for help on using the changeset viewer.