Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-tasks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-timesheet2-tasks
Commits
a09dd19e
Commit
a09dd19e
authored
Mar 06, 2007
by
Christof Damian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- form for dependencies
- better task tree list (not used atm)
parent
80c74736
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
9 deletions
+93
-9
intranet-timesheet2-tasks-procs.tcl
tcl/intranet-timesheet2-tasks-procs.tcl
+71
-9
add-dependency.tcl
www/add-dependency.tcl
+20
-0
delete-dependency.tcl
www/delete-dependency.tcl
+2
-0
No files found.
tcl/intranet-timesheet2-tasks-procs.tcl
View file @
a09dd19e
...
...
@@ -480,25 +480,50 @@ ad_proc -public im_timesheet_task_list_component {
# ---------------------------------------------------------------------
ad_proc -public im_timesheet_task_list_tree_component
{
{
-view_name
"im_timesheet_task_list"
}
{
-restrict_to_project_id 0
}
project_id
return_url
}
{
# ---------------------- Security - Show the comp? -------------------------------
set user_id
[
ad_get_user_id
]
# Is this a
"Consulting Project"
?
if
{
0 !=
$restrict
_to_project_id
}
{
if
{
!
[
im_project_has_type
$restrict
_to_project_id
"Consulting Project"
]}
{
return
""
}
}
# Check vertical permissions -
# Is this user allowed to see TS stuff at all?
if
{
!
[
im_permission
$user
_id
"view_timesheet_tasks"
]}
{
return
""
}
# Check horizontal permissions -
# Is the user allowed to see this project?
im_project_permissions
$user
_id
$restrict
_to_project_id view read write admin
if
{
!$read && !
[
im_permission
$user
_id view_timesheet_tasks_all
]}
{
return
""
}
db_multirow tree tree
"
select
tree_level(subtree.tree_sortkey) AS level,
subtree.project_id AS task_id,
(repeat('* ',tree_level(subtree.tree_sortkey)-tree_level(parent.tree_sortkey))
subtree.parent_id AS parent_id,
(repeat('- ',tree_level(subtree.tree_sortkey)-tree_level(parent.tree_sortkey))
|| subtree.project_nr) AS task_nr,
subtree.project_name AS task_name,
'add' AS add_subtask
'add' AS add_subtask,
subtree.sort_order
from
im_projects parent, im_projects subtree
im_projects parent, im_projects subtree
where subtree.tree_sortkey between parent.tree_sortkey and tree_right(parent.tree_sortkey)
and parent.parent_id = :project_id
ORDER BY
subtree.tree_sortkey
"
multirow_sort_tree -integer tree task_id parent_id sort_order
template::list::create
\
-name tree
\
...
...
@@ -524,9 +549,19 @@ ad_proc -public im_timesheet_task_list_tree_component {
}
\
-bulk_actions
{
"Delete"
"/intranet-timesheet2-tasks/task-delete"
"Delete selected task"
}
}
\
-actions
[
list
\
"Add Subtask"
"/intranet-timesheet2-tasks/new?
[
export_vars -url
{
project_id return_url
}
]
"
\
]
return
[
template::list::render -name tree
]
set tree_html
[
template::list::render -name tree
]
# this is ugly. but I haven't found a way to do this with template::list yet
regsub -all
{(
<td class=
\"
list
\"
>
\s
*
)(
<a href=
\"
[
^
\"
]
+
\"
>
)((
-
)
+
)}
$tree
_html
{
\1\3\2
}
tree_html
append html
$tree
_html
return
$html
}
# ----------------------------------------------------------------------
...
...
@@ -540,6 +575,33 @@ ad_proc -public im_timesheet_task_info_component {
}
{
set html
""
#
# small form to add new dependency
#
append html
"<form action=
\"
/intranet-timesheet2-tasks/add-dependency
\"
>"
append html
[
export_vars -form
{
return_url task_id
}
]
append html
"<select name=dependency_id><option value=
\"
0
\"
>---</option>"
db_foreach options
"select
subtree.project_id AS id,
(repeat(' ',tree_level(subtree.tree_sortkey)-tree_level(parent.tree_sortkey))
|| subtree.project_nr) AS task_nr
from
im_projects parent, im_projects subtree
where subtree.tree_sortkey between parent.tree_sortkey and tree_right(parent.tree_sortkey)
and parent.parent_id = :project_id
AND subtree.project_id != :task_id
ORDER BY
subtree.tree_sortkey
"
{
append html
"<option value=
\"
$id
\"
>
$task
_nr</option>"
}
append html
"</select><input type=submit value=
\"
add dependency
\"
></form>"
#
# the two dependency lists
#
foreach
{
a b info
}
{
two one
"This task depends on"
one two
"These tasks depend on this one"
...
...
www/add-dependency.tcl
0 → 100644
View file @
a09dd19e
ad_page_contract
{
}
{
task_id
dependency_id
return_url
}
# TODO: security
db_dml insert_dependency
"
insert into im_timesheet_task_dependencies
(task_id_one, task_id_two, dependency_type_id) values (:task_id, :dependency_id, 9650)
"
ad_returnredirect
$return
_url
www/delete-dependency.tcl
View file @
a09dd19e
...
...
@@ -7,6 +7,8 @@ ad_page_contract {
return_url
}
# TODO: security
if
{
$task
_id_one !=
""
}
{
foreach i
$task
_id_one
{
db_dml delete_dependency1
"delete from im_timesheet_task_dependencies where task_id_one=:i and task_id_two=:task_id"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment