Commit 680e0182 authored by Florian Fittkau's avatar Florian Fittkau

time mesaurements

parent 7db253ba
......@@ -50,11 +50,12 @@ class BootStrap {
def userStory = new UserStory("V-1", "Energiekataster Layer")
userStory.description = "Energiekataster Layer im GIS um über jeder VE die Energieausweise direkt zu sehen."
userStory.author = ffi
userStory.editor = ffi
userStory.points = 3
userStory.color = new Color(250,60,0)
userStory.addToTasks(new Task("Definiere X in GIS", "Definiere X und lege Y an."))
def task = new Task("Definiere X in GIS", "Definiere X und lege Y an.")
task.author = ffi
userStory.addToTasks(task)
userStory.save(failOnError: true)
......@@ -71,13 +72,17 @@ class BootStrap {
def userStory = new UserStory("V-2", "Volltextsuche im GIS")
userStory.description = "Volltextsuche im GIS ermglichen"
userStory.author = ffi
userStory.editor = ffi
userStory.points = 2
userStory.status = UserStoryStatus.OPEN
userStory.color = new Color(250,180,0)
userStory.addToTasks(new Task("Menue links bei GIS", "Definiere Menue links vom GIS."))
userStory.addToTasks(new Task("Passe Suche an", "Suchergebnisse sollen in dem Menue erscheinen."))
def task = new Task("Menue links bei GIS", "Definiere Menue links vom GIS.")
task.author = ffi
userStory.addToTasks(task)
task = new Task("Passe Suche an", "Suchergebnisse sollen in dem Menue erscheinen.")
task.author = ffi
userStory.addToTasks(task)
userStory.save(failOnError: true)
......
......@@ -34,6 +34,7 @@ grails.project.dependency.resolution = {
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
runtime "postgresql:postgresql:9.2-1000.jdbc4"
// runtime 'mysql:mysql-connector-java:5.1.20'
}
......
dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
driverClassName = "org.postgresql.Driver"
dialect = net.sf.hibernate.dialect.PostgreSQLDialect
}
hibernate {
cache.use_second_level_cache = true
......@@ -15,18 +14,25 @@ environments {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
dbCreate = "create-drop"
url = "jdbc:postgresql://127.0.0.1:5432/scrumboard"
username = "postgres"
password = "ESNAdmin2012"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
dbCreate = "create-drop"
url = "jdbc:postgresql://127.0.0.1:5432/scrumboard"
username = "postgres"
password = "ESNAdmin2012"
pooled = true
properties {
maxActive = -1
......
......@@ -8,7 +8,7 @@ class SprintController {
def sprints = projects[0].sprints
def currentSprint = sprints.iterator().next()
def sprintUserStories = currentSprint.userstories
sprintUserStories = sprintUserStories.sort()
sprintUserStories.sort(true)
def sprintTasks = []
......@@ -16,7 +16,7 @@ class SprintController {
sprintTasks.addAll(it.tasks)
}
sprintTasks = sprintTasks.sort()
sprintTasks.sort(true)
render(view: "show", model: [projects: projects,
currentSprint: currentSprint,
......
package scrumboard
import org.apache.shiro.SecurityUtils
import org.apache.shiro.subject.Subject
import scrumboard.shiro.User
class UserStoryController {
def show(int id) {
......@@ -32,16 +36,30 @@ class UserStoryController {
def moveTask(int id, String to) {
def task = Task.get(id)
Subject currentSubject = SecurityUtils.getSubject()
String username = currentSubject.getPrincipal()
User currentUser = User.findByUsername(username)
if (to == "opensprint") {
task.status = UserStoryStatus.OPEN
task.editor = null
task.started_date = null
task.finished_date = null
}
if (to == "inprogresssprint") {
task.status = UserStoryStatus.IN_PROGRESS
task.editor = currentUser
task.started_date = new Date()
task.finished_date = null
}
if (to == "donesprint") {
task.status = UserStoryStatus.DONE
task.editor = currentUser
if (!task.started_date)
task.started_date = new Date()
task.finished_date = new Date()
}
task.save()
......@@ -72,7 +90,13 @@ class UserStoryController {
}
def createTask(int userStoryId) {
def task = new Task("", "")
Subject currentSubject = SecurityUtils.getSubject()
String username = currentSubject.getPrincipal()
User currentUser = User.findByUsername(username)
def task = new Task("New Task", "")
task.author = currentUser
def parent = UserStory.get(userStoryId)
parent.addToTasks(task)
parent.save()
......
package scrumboard
import scrumboard.shiro.User;
class Task implements Comparable {
static final int maxShortDescription = 60
......@@ -8,10 +10,18 @@ class Task implements Comparable {
UserStoryStatus status = UserStoryStatus.OPEN
User author
User editor
Date started_date
Date finished_date
static belongsTo = [parent: UserStory]
static constraints = {
editor nullable: true
started_date nullable: true
finished_date nullable: true
}
Task(title, description) {
......
......@@ -21,6 +21,7 @@ class UserStory implements Comparable {
static hasMany = [ tasks: Task ]
static constraints = {
editor nullable: true
}
UserStory(String shortId, String title) {
......
......@@ -13,7 +13,7 @@ class ShowTaskDialogTagLib {
\$( '#dialog-showTask' ).dialog({
autoOpen: false,
height: 500,
height: 550,
width: 650,
modal: true,
buttons: {
......
......@@ -8,12 +8,36 @@
</tr>
<tr>
<td>Description:</td>
<td><textarea style="width: 50%" id='task_description' name="description">${task.description}</textarea></td>
<td><textarea style="width: 95%" rows="20" cols="6" id='task_description' name="description">${task.description}</textarea></td>
</tr>
<tr>
<td>Status:</td>
<td><input size='60%' disabled id='task_status' type="text" name="status" value="${task.status}" /></td>
<td>Author:</td>
<td><input size='60%' disabled id='task_author' type="text" name="author" value="${task.author.username}" />
<input disabled id='task_authorId' type="hidden" name="authorId" value="${task.author.id}" /></td>
</tr>
<g:if test="${task.editor}">
<tr>
<td>Editor:</td>
<td><input size='60%' disabled id='task_editor' type="text" name="editor" value="${task.editor.username}" />
<input disabled id='task_editorId' type="hidden" name="editorId" value="${task.editor.id}" /></td>
</tr>
</g:if>
<g:if test="${task.started_date}">
<tr>
<td>Started at:</td>
<td><input size='60%' disabled id='task_started_date' type="text" name="started_date" value="${task.started_date.format('HH:mm:ss dd.MM.yyyy')}" /></td>
</tr>
</g:if>
<g:if test="${task.finished_date}">
<tr>
<td>Finished at:</td>
<td><input size='60%' disabled id='task_finished_date' type="text" name="finished_date" value="${task.finished_date.format('HH:mm:ss dd.MM.yyyy')}" /></td>
</tr>
<tr>
<td>Duration:</td>
<td><input size='60%' disabled id='task_duration' type="text" name="duration" value="${new Date(task.finished_date - task.started_date).format('HH:mm:ss dd.MM.yyyy')}" /></td>
</tr>
</g:if>
<tbody>
</table>
</g:form>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment