Show our tasks at the top; allow a task to be edited immediately following
creation. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1136 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: index.java,v 1.9 2003/01/23 21:37:13 mdb Exp $
|
// $Id: index.java,v 1.10 2003/05/21 02:40:13 mdb Exp $
|
||||||
|
|
||||||
package com.samskivert.twodue.logic;
|
package com.samskivert.twodue.logic;
|
||||||
|
|
||||||
@@ -67,10 +67,15 @@ public class index extends UserLogic
|
|||||||
// insert the task into the repository
|
// insert the task into the repository
|
||||||
app.getRepository().createTask(task);
|
app.getRepository().createTask(task);
|
||||||
|
|
||||||
// flip back to this same page minus our query parameters to
|
// if they want to edit this task, shoot them to the edit
|
||||||
// clear out the creation form
|
// page, otherwise flip back to this same page minus our query
|
||||||
throw new RedirectException(
|
// parameters to clear out the creation form
|
||||||
"index.wm?msg=index.message.task_created");
|
if (ParameterUtil.isSet(req, "edit")) {
|
||||||
|
throw new RedirectException("edit.wm?task=" + task.taskId);
|
||||||
|
} else {
|
||||||
|
throw new RedirectException(
|
||||||
|
"index.wm?msg=index.message.task_created");
|
||||||
|
}
|
||||||
|
|
||||||
} else if (ParameterUtil.parameterEquals(req, "action", "complete")) {
|
} else if (ParameterUtil.parameterEquals(req, "action", "complete")) {
|
||||||
int taskId = ParameterUtil.requireIntParameter(
|
int taskId = ParameterUtil.requireIntParameter(
|
||||||
@@ -127,6 +132,15 @@ public class index extends UserLogic
|
|||||||
return task.owner;
|
return task.owner;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// look for our name and swap that into the zeroth position
|
||||||
|
for (int ii = 0; ii < otasks.length; ii++) {
|
||||||
|
if (otasks[ii].name.equals(user.username)) {
|
||||||
|
CatList tlist = otasks[0];
|
||||||
|
otasks[0] = otasks[ii];
|
||||||
|
otasks[ii] = tlist;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
ctx.put("otasks", otasks);
|
ctx.put("otasks", otasks);
|
||||||
ctx.put("ocats", new CategoryTool());
|
ctx.put("ocats", new CategoryTool());
|
||||||
|
|
||||||
|
|||||||
@@ -187,8 +187,9 @@ $form.text("category", "size='10'", "")
|
|||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" align="left" bgcolor="$scolor">$form.checkbox("claim", false)
|
<td colspan="2" align="left" bgcolor="$scolor">
|
||||||
Claim created task</td>
|
$form.checkbox("claim", false) Claim created task
|
||||||
|
$form.checkbox("edit", false) Edit created task</td>
|
||||||
<td align="right" bgcolor="$scolor">
|
<td align="right" bgcolor="$scolor">
|
||||||
$form.submit("submit", "Create")</td></tr>
|
$form.submit("submit", "Create")</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user