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
18976484
Commit
18976484
authored
Aug 12, 2005
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- made working
parent
dfc78828
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
68 deletions
+36
-68
task-action.tcl
www/task-action.tcl
+36
-68
No files found.
www/task-action.tcl
View file @
18976484
# /packages/intranet-
forum/www/intranet/forum/forum
-action.tcl
# /packages/intranet-
timesheet2-tasks/www/task
-action.tcl
#
# Copyright (C
)
2003-200
4
Project/Open
# Copyright (C
)
2003-200
5
Project/Open
#
# All rights reserved. Please check
# http://www.project-open.com/license/ for details.
ad_page_contract
{
Purpose: Takes commands from the /intranet/projects/view
page and saves changes, deletes tasks and scans for Trados
files.
page and saves changes, deletes tasks etc.
@param return_url the url to return to
@param group_id group id
@param action
"delete"
and other actions.
@param submit Not used
(
may be localized!
)
@task_id List of tasks to be processes
@author frank.bergmann@project-open.com
}
{
submit
action
topic_id:array,optional
{
return_url
""
}
project_id:integer
task_id:array,optional
return_url
}
set
user_id
[
ad_maybe_redirect_for_registration
]
set
page_body
"<PRE>
\n
"
if
{
$return
_url ==
""
}
{
set return_url
"/intranet-forum/"
}
set
topic_list
[
array
names topic_id
]
ns_log Notice
"forum-action: topic_list=
$topic
_list"
set
task_list
[
array
names task_id
]
ns_log Notice
"task-action: task_list=
$task
_list"
if
{
0 ==
[
llength
$t
opic
_list
]}
{
if
{
0 ==
[
llength
$t
ask
_list
]}
{
ad_returnredirect
$return
_url
}
# Make sure the respective im_forum_topic_user_map entries exist:
foreach
topic_insert_id
$topic
_list
{
if
{
[
catch
{
db_dml insert_forum_topic_map
"insert into im_forum_topic_user_map
(topic_id, user_id) values (
$topic
_insert_id,
$user
_id)"
}
err_msg
]
}
{
# nothing - probably existed before
}
}
# Convert the list of selected topics into a
# "topic_id in (1,2,3,4...
)
" clause
# Convert the list of selected tasks into a
# "task_id in (1,2,3,4...
)
" clause
#
set topic_in_clause "
and topic_id in
(
"
append topic_in_clause
[
join
$topic
_list
", "
]
append topic_in_clause "
)
\n
"
ns_log Notice "
forum-action: topic_in_clause=$topic_in_clause
"
set task_in_clause "
and task_id in
([
join
$task
_list
", "
])
\n
"
ns_log Notice "
task-action: task_in_clause=$task_in_clause
"
set error_list
[
list
]
switch
$action
{
move_to_deleted {
set sql "
update im_forum_topic_user_map
set folder_id = 1
where
user_id=:user_id
$topic
_in_clause
"
db_dml mark_topics
$sql
}
move_to_inbox {
set sql "
update im_forum_topic_user_map
set folder_id = 0
where user_id=:user_id
$topic
_in_clause
"
db_dml mark_topics
$sql
}
mark_as_read {
set sql "
update im_forum_topic_user_map
set read_p = 't'
where user_id=:user_id
$topic
_in_clause
"
db_dml mark_topics
$sql
}
mark_as_unread {
set sql "
update im_forum_topic_user_map
set read_p = 'f'
where user_id=:user_id
$topic
_in_clause
"
db_dml mark_topics
$sql
delete {
if {
[
catch
{
set sql
"
delete from im_timesheet_tasks
where
project_id = :project_id
$task
_in_clause"
db_dml delete_tasks
$sql
}
errmsg
]
} {
set task_list
[
db_list task_names
"select task_name from im_timesheet_tasks where project_id = :project_id
$task
_in_clause"
]
set task_names
[
join
$task
_list
"<li>"
]
ad_return_complaint 1 "
<li><B>
[
_ intranet-timesheet2-tasks.Unable_to_delete_tasks
]
</B>:<br>
[
_ intranet-timesheet2-tasks.Dependent_Objects_Exist
]
"
return
}
}
default {
ad_return_complaint 1 "
<li>
[
_ intranet-
forum.lt_Unknown_value_for_act
]
: '$action'
"
ad_return_complaint 1 "
<li>
[
_ intranet-
timesheet2-tasks.Unknown_action_value
]
: '$action'
"
}
}
ad_returnredirect
$return
_url
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