Commit 2643b36f authored by Frank Bergmann's avatar Frank Bergmann

- added a query to allow only for a task_id

parent 1a65b6a4
......@@ -10,8 +10,8 @@ ad_page_contract {
@author frank.bergmann@project-open.com
} {
task_id:integer,optional
project_id:integer
return_url
{ project_id:integer 0 }
{ return_url "" }
edit_p:optional
message:optional
{ form_mode "display" }
......@@ -28,6 +28,18 @@ set focus "task.var_name"
set page_title [_ intranet-timesheet2-tasks.New_Timesheet_Task]
set context [list $page_title]
# Check the case if there is no project specified.
# This is only OK if there is a task_id specified (new task for project).
if {0 == $project_id} {
if {[info exists task_id]} {
set project_id [db_string project_from_task "select project_id from im_timesheet_tasks where task_id = :task_id" -default 0]
} else {
ad_return_complaint 1 "You need to specify atleast a task or a project"
return
}
}
set project_name [db_string project_name "select project_name from im_projects where project_id=:project_id" -default "Unknown"]
append page_title "for '$project_name'"
......@@ -58,6 +70,8 @@ if {"delete" == $button_pressed} {
}
set return_url ""
# ------------------------------------------------------------------
# Build the form
# ------------------------------------------------------------------
......
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