Permalink
Browse files

added the planning detail screen for a person

  • Loading branch information...
1 parent e8978ae commit 7240519b6889dc699e61c1ac25978520257688f9 @jettro committed Dec 21, 2009
@@ -4,10 +4,10 @@
<facet type="web" name="GrailsWeb">
<configuration>
<webroots>
- <root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/navigation-1.1/web-app" relative="/" />
- <root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/db-util-0.4/web-app" relative="/" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/grails-ui-1.2-SNAPSHOT/web-app" relative="/" />
+ <root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/db-util-0.4/web-app" relative="/" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/yui-2.7.0.1/web-app" relative="/" />
+ <root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/navigation-1.1/web-app" relative="/" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/bubbling-2.1.1/web-app" relative="/" />
</webroots>
<sourceRoots />
@@ -49,10 +49,10 @@
<orderEntry type="module-library" exported="">
<library name="Grails User Library">
<CLASSES>
- <root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/tomcat-1.2.0.RC2/lib" />
- <root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/db-util-0.4/lib" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/grails-ui-1.2-SNAPSHOT/lib" />
+ <root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/db-util-0.4/lib" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/joda-time-0.5/lib" />
+ <root url="file://$MODULE_DIR$/../../.grails/1.2.0.RC2/projects/MyScheduling/plugins/tomcat-1.2.0.RC2/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
View
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
- <facet type="Spring" name="Spring">
- <configuration>
- <fileset id="Grails" name="Grails" removed="false">
- <file>file://$MODULE_DIR$/web-app/WEB-INF/applicationContext.xml</file>
- </fileset>
- </configuration>
- </facet>
<facet type="web" name="GrailsWeb">
<configuration>
<webroots>
@@ -16,6 +9,13 @@
<sourceRoots />
</configuration>
</facet>
+ <facet type="Spring" name="Spring">
+ <configuration>
+ <fileset id="Grails" name="Grails" removed="false">
+ <file>file://$MODULE_DIR$/web-app/WEB-INF/applicationContext.xml</file>
+ </fileset>
+ </configuration>
+ </facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
@@ -3,6 +3,7 @@ package nl.gridshore.scheduling
import grails.converters.JSON
class PersonController {
+ def scheduleItemService
def scaffold = true
@@ -14,7 +15,7 @@ class PersonController {
def id = params.id
if (id) {
def person = Person.get(id)
-
+ return [scheduleItems:scheduleItemService.obtainScheduleItemsForPerson(person)]
} else {
redirect(action: "planning")
}
@@ -7,6 +7,14 @@ class ScheduleItemService {
boolean transactional = true
+ def obtainScheduleItemsForPerson(Person person) {
+ def items = ScheduleItem.findAllByPerson(person)
+ if (!items) {
+ items = []
+ }
+ return items
+ }
+
def createScheduleItems(String personName, String projectName,int numberHours,LocalDate startDate, LocalDate endDate) {
// determine the start and end date
def project = Project.findByName(projectName)
@@ -12,8 +12,7 @@
draggableColumns="true"
columnDefs="[
[key:'id', sortable:true, resizeable: true, label:'ID'],
- [key:'name', sortable:true, resizeable: true, label:'Name'],
- [key:'partTimeFactor', type:'number', sortable:true, resizeable: true, label: 'Part time factor']
+ [key:'name', sortable:true, resizeable: true, label:'Name']
]"
paginatorConfig="[
template:'{PreviousPageLink} {PageLinks} {NextPageLink} {CurrentPageReport}',
@@ -1,13 +1,19 @@
-<%--
- Created by IntelliJ IDEA.
- User: jettropro
- Date: Dec 21, 2009
- Time: 5:49:46 PM
- To change this template use File | Settings | File Templates.
---%>
-
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
- <head><title>Simple GSP page</title></head>
- <body>Place your content here</body>
-</html>
+<head>
+ <title>Show all schedule items</title>
+ <meta name="layout" content="main"/>
+ <gui:resources components="dataTable"/>
+</head>
+<body>
+ <table>
+ <g:each in="${scheduleItems}" var="scheduleItem">
+ <tr>
+ <td>${scheduleItem.project.name}</td>
+ <td>${scheduleItem.weekNr}</td>
+ <td>${scheduleItem.nrHours}</td>
+ </tr>
+ </g:each>
+ </table>
+</body>
+</html>

0 comments on commit 7240519

Please sign in to comment.