Changeset 143
- Timestamp:
- Oct 3, 2009, 2:51:02 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r140 r143 5 5 def authenticateService 6 6 def dateUtilService 7 def taskSearchService 7 8 def filterService 8 9 … … 13 14 14 15 def list = { 15 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 )16 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 ) 16 17 [ taskInstanceList: Task.list( params ), taskInstanceTotal: Task.count() ] 17 18 } 18 19 19 20 def search = { 20 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 )21 22 if(!params. _action_search)21 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 ) 22 23 if(!params.filter) 23 24 { 24 // Default: 25 def taskInstanceActivesList = Task.findAllByIsActive(true, params) 26 def taskInstanceActivesTotal = Task.countByIsActive(true) 27 return [taskInstanceList: taskInstanceActivesList, taskInstanceTotal: taskInstanceActivesTotal] 28 } 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 25 // if(params.searchMyTodays) { def taskInstanceList = taskSearchService.getMyTodays(params) } 26 // else { def taskInstanceList = taskSearchService.getTodays(params) } 27 28 def taskInstanceList = taskSearchService.getTodays(params) 29 30 if(taskInstanceList.totalCount > 0) { params.message = "Today's tasks" } 31 else { params.message = "No tasks found for today" } 32 return[ taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceList.totalCount] 33 } 34 // filterPane: 35 return[ taskInstanceList: filterService.filter( params, Task ), 36 taskInstanceTotal: filterService.count( params, Task ), 37 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 38 params:params ] 39 } 40 36 41 def advancedSearch = { 37 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 )42 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 ) 38 43 39 44 if(!params._action_advancedSearch) … … 51 56 } 52 57 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 } 58 // def searchTodays = { 59 // def taskInstanceList = taskSearchService.getTodays(params) 60 // 61 // if(taskInstanceList.totalCount > 0) 62 // { 63 // flash.message = "Today's tasks" 64 // } 65 // else { flash.message = "No tasks found for today" } 66 // 67 // render( view:'search', 68 // model:[ taskInstanceList: taskInstanceList, 69 // taskInstanceTotal: taskInstanceList.totalCount]) 70 // } 71 72 // def searchMyTodays = { 73 // params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 74 // 75 // def taskInstanceList = Task.createCriteria().list() { 76 // eq("leadPerson", Person.get(authenticateService.userDomain().id)) 77 // ge("targetStartDate", dateUtilService.getToday()) 78 // eq("isActive", true) 79 // } 80 // 81 // def taskInstanceTotal = Task.createCriteria().count() { 82 // eq("leadPerson", Person.get(authenticateService.userDomain().id)) 83 // ge("targetStartDate", dateUtilService.getToday()) 84 // eq("isActive", true) 85 // } 86 // 87 // if(taskInstanceTotal > 0) 88 // { 89 // flash.message = "Today's tasks" 90 // } 91 // else { flash.message = "No tasks found for today" } 92 // 93 // render( view:'search', 94 // model:[ taskInstanceList: taskInstanceList, 95 // taskInstanceTotal: taskInstanceTotal]) 96 // } 102 97 103 98 def searchInTheLastWeek = { … … 284 279 else { 285 280 def criteria = taskInstance.createCriteria() 286 def result s= criteria {281 def result = criteria { 287 282 and { 288 283 notEqual('id', taskInstance.id) 289 284 } 290 285 } 291 return [ taskInstance : taskInstance, possibleParentList: result s]286 return [ taskInstance : taskInstance, possibleParentList: result ] 292 287 } 293 288 } -
trunk/grails-app/services/TaskService.groovy
r137 r143 4 4 static scope = "request" 5 5 6 6 def dateUtilService 7 7 8 8 def taskDates(taskInstance, params) { 9 println "yes" 10 9 println "yes" 11 10 } 12 13 11 } -
trunk/grails-app/views/appCore/manager.gsp
r139 r143 19 19 <br /> 20 20 <br /> 21 View Entity Relationship Diagram:21 <!-- View Entity Relationship Diagram: 22 22 <a href="${createLink(controller:'classDiagram', action:'model', params:[outputFormat: 'pdf', skin: 'classicSpacey', showMethods: 'false', autoUpdate: 'false'])}">pdf</a> 23 23 and 24 24 <a href="${createLink(controller:'classDiagram', action:'legend', target:'_blank')}">legend</a> 25 25 or 26 <a href="${createLink(controller:'classDiagram', action:'show')}">interactive.</a> 26 <a href="${createLink(controller:'classDiagram', action:'show')}">interactive.</a>--> 27 27 </div> 28 28 </body> -
trunk/grails-app/views/appCore/start.gsp
r140 r143 46 46 <td valign="top" class="value"> 47 47 <g:link controller="taskDetailed" 48 action="searchMyTodays"> 48 action="search" 49 params="[searchMyTodays]"> 49 50 Today's 50 51 </g:link> … … 63 64 <td valign="top" class="value"> 64 65 <g:link controller="taskDetailed" 65 action="search Todays">66 action="search"> 66 67 Today's 67 68 </g:link> -
trunk/grails-app/views/taskDetailed/search.gsp
r140 r143 15 15 <g:if test="${flash.message}"> 16 16 <div class="message">${flash.message}</div> 17 </g:if> 18 <g:if test="${params.message}"> 19 <div class="message">${params.message}</div> 17 20 </g:if> 18 21 <g:hasErrors bean="${appCore}">
Note: See TracChangeset
for help on using the changeset viewer.