Skip to content

Commit

Permalink
initial steps for planning and scheduling of a person
Browse files Browse the repository at this point in the history
  • Loading branch information
jettro committed Dec 21, 2009
1 parent 580da9d commit e8978ae
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,49 @@
package nl.gridshore.scheduling

import grails.converters.JSON

class PersonController {

def scaffold = true

def planning = {

}

def planningDetail = {
def id = params.id
if (id) {
def person = Person.get(id)

} else {
redirect(action: "planning")
}
}

def planningDataAsJSON = {
response.setHeader("Cache-Control", "no-store")
def list = []
def persons = Person.list(params)
persons.each {
list << [
id:it.id,
name:it.name,
dataUrl: g.createLink(action:"planningDetail") + "/${it.id}"
]
}
def data = [
totalRecords: Person.count(),
results: list
]
render data as JSON
}

static navigation = [
group:'tabs',
order:150,
subItems:[
[group:'tabs',action:'create']
group: 'tabs',
order: 150,
subItems: [
[group: 'tabs', action: 'planning'],
[group: 'tabs', action: 'create']
]
]

Expand Down
30 changes: 30 additions & 0 deletions grails-app/views/person/planning.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
<title>Show all schedule items</title>
<meta name="layout" content="main"/>
<gui:resources components="dataTable"/>
</head>
<body>
<div class="yui-skin-sam">
<gui:dataTable
id="personDatatable"
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']
]"
paginatorConfig="[
template:'{PreviousPageLink} {PageLinks} {NextPageLink} {CurrentPageReport}',
pageReportTemplate:'{totalRecords} total records'
]"
controller="person"
action="planningDataAsJSON"
resultsList="results"
rowExpansion="false"
rowsPerPage="15"
rowClickNavigation="true"/>
</div>
</body>
</html>
13 changes: 13 additions & 0 deletions grails-app/views/person/planningDetail.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<%--
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>

0 comments on commit e8978ae

Please sign in to comment.