Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

implemented project backlog

  • Loading branch information...
commit b97c48327872665e661541fc34c2a33177dded35 1 parent e973b9d
Pablo Hess authored
View
8 grails-app/conf/BootStrap.groovy
@@ -20,8 +20,6 @@ import grails.util.GrailsUtil;
import java.awt.Color;
import java.util.Calendar;
-import org.apache.catalina.connector.ResponseFacade.DateHeaderPrivilegedAction;
-
import org.skramboord.StateTask;
import org.skramboord.StateTaskCheckedOut;
import org.skramboord.StateTaskDone;
@@ -50,7 +48,7 @@ class BootStrap {
initDevelopment()
break
case "production":
- // TODO
+ initDevelopment()
break
}
}
@@ -170,9 +168,7 @@ class BootStrap {
* @param finished
*/
def createTask(User user, Sprint sprint, String name, Double effort, String url, StateTask state, Priority priority, Date finished) {
- Task task = new Task(user: user, name: name, effort: effort, url: url, state: state, priority: priority, finishedDate: finished)
+ Task task = new Task(user: user, name: name, effort: effort, url: url, state: state, priority: priority, finishedDate: finished, sprint: sprint, project: null)
task.save()
- sprint.addToTasks(task)
- sprint.save()
}
}
View
2  grails-app/conf/DataSource.groovy
@@ -46,7 +46,7 @@ environments {
driverClassName = "com.mysql.jdbc.Driver"
username = "changeme"
password = "changeme"
- dbCreate = "update" // one of 'create', 'create-drop','update'
+ dbCreate = "create-drop" // one of 'create', 'create-drop','update'
url = "jdbc:mysql://localhost:3306/skramboord"
}
}
View
4 grails-app/controllers/org/skramboord/BaseController.groovy
@@ -17,10 +17,8 @@
package org.skramboord
-import org.grails.plugins.springsecurity.service.AuthenticateService;
-
abstract class BaseController {
- AuthenticateService authenticateService
+ def authenticateService
def beforeInterceptor = [action:this.&doBefore]
View
2  grails-app/controllers/org/skramboord/LoginController.groovy
@@ -16,8 +16,6 @@
*******************************************************************************/
package org.skramboord
-import org.codehaus.groovy.grails.plugins.springsecurity.RedirectUtils
-import org.grails.plugins.springsecurity.service.AuthenticateService
import org.springframework.security.AuthenticationTrustResolverImpl
import org.springframework.security.DisabledException
View
2  grails-app/controllers/org/skramboord/ProjectController.groovy
@@ -17,8 +17,6 @@
package org.skramboord
-import org.grails.plugins.springsecurity.service.AuthenticateService;
-
class ProjectController extends BaseController {
def index = { redirect(controller:'project', action:'list')
View
30 grails-app/controllers/org/skramboord/TaskController.groovy
@@ -29,6 +29,12 @@ class TaskController extends BaseController {
session.sprint = Sprint.get(params.sprint)
}
+ Project project = Project.get(session.project.id)
+ session.projectBacklog = Task.withCriteria {
+ eq('project', project)
+ order('priority',"desc")
+ }
+
session.taskListOpen = Task.withCriteria {
eq('state', StateTask.getStateOpen())
eq('sprint', session.sprint)
@@ -178,7 +184,16 @@ class TaskController extends BaseController {
*/
def changeTaskStateToOpen = {
Task task = Task.get(removeTaskPrefix(params.taskId))
- task.state.open(task)
+ if (task.project) {
+ // task from backlog -> set state to open
+ task.state = StateTask.getStateOpen()
+ task.project = null
+ task.sprint = Sprint.get(session.sprint.id)
+ task.save()
+ } else {
+ // Change to state open
+ task.state.open(task)
+ }
task.save()
redirect(controller:'task', action:'list')
@@ -230,6 +245,19 @@ class TaskController extends BaseController {
}
/**
+ * Copy Task to Backlog
+ */
+ def copyTaskToBacklog = {
+ Task task = Task.get(removeTaskPrefix(params.taskId))
+
+ task.sprint = null
+ task.project = Project.get(session.project.id)
+ task.save()
+
+ redirect(controller:'task', action:'list')
+ }
+
+ /**
* Removes prefix 'taskId_'
*
* @param String
View
2  grails-app/domain/org/skramboord/Project.groovy
@@ -19,7 +19,7 @@ package org.skramboord
class Project {
String name
- static hasMany = [sprints:Sprint]
+ static hasMany = [sprints:Sprint, tasks:Task]
static belongsTo = [owner:User, master:User]
static mapping = {
View
4 grails-app/domain/org/skramboord/Task.groovy
@@ -26,7 +26,7 @@ class Task {
StateTask state
Priority priority
Date finishedDate
- static belongsTo = [sprint:Sprint, user:User]
+ static belongsTo = [sprint:Sprint, project:Project, user:User]
static mapping = {
priority lazy:false
@@ -40,5 +40,7 @@ class Task {
priority(nullable:false)
finishedDate(nullable:true)
user(nullable:true)
+ sprint(nullable:true)
+ project(nullable:true)
}
}
View
32 grails-app/views/task/list.gsp
@@ -4,8 +4,8 @@
<meta name="layout" content="main" />
<style type="text/css">
- #open, #checkout, #done, #next, #standBy { list-style-type: none; margin: 0; padding: 0; float: left; width: 230px;}
- #open li, #checkout li, #done li, #next li, #standBy li { margin: 1px; padding: 5px; font-size: 1.2em; width: 200px; }
+ #open, #checkout, #done, #next, #standBy, #backlog { list-style-type: none; margin: 0; padding: 0; float: left; width: 230px;}
+ #open li, #checkout li, #done li, #next li, #standBy li, #backlog li { margin: 1px; padding: 5px; font-size: 1.2em; width: 200px; }
.taskInfo { font-style:italic; font-weight: normal; font-size:x-small; color: black; }
</style>
@@ -40,6 +40,9 @@
function changeToStandBy(event, ui){
location.href="${resource(dir:'task',file:'changeTaskStateToStandBy')}" + "?taskId=" + $(ui.item).attr("id");
}
+ function copyToBacklog(event, ui){
+ location.href="${resource(dir:'task',file:'copyTaskToBacklog')}" + "?taskId=" + $(ui.item).attr("id");
+ }
$(function() {
$('#create-task')
@@ -48,6 +51,11 @@
$('#dialog-form').dialog('open');
});
+ $("#backlog").sortable({
+ connectWith: '.connectedSortable',
+ dropOnEmpty: true,
+ receive: copyToBacklog
+ }).disableSelection();
$("#open").sortable({
connectWith: '.connectedSortable',
dropOnEmpty: true,
@@ -116,6 +124,26 @@
<table>
<tr>
+ <th>Project Backlog</th>
+ </tr>
+ <tr>
+ <td>
+ <g:if test="${session.projectBacklog.size() > 0}">
+ <ul id="backlog" class="connectedSortable">
+ </g:if>
+ <g:else>
+ <ul id="backlog" class="connectedSortable" style="padding-bottom: 100px;">
+ </g:else>
+ <g:each var="task" in="${session.projectBacklog}" status="i">
+ <g:render template="task" model="['task':task]"/>
+ </g:each>
+ </ul>
+ </td>
+ </tr>
+ </table>
+
+ <table>
+ <tr>
<th>Open</th>
<th>Checkout</th>
<th>Done</th>
Please sign in to comment.
Something went wrong with that request. Please try again.