Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rest
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-rest
Commits
e23dab42
Commit
e23dab42
authored
Jul 11, 2017
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- task-tree-action:
Fixed issue that error messages weren't passed back to the server correctly
parent
45d82b9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
intranet-rest-data-source-procs.tcl
tcl/intranet-rest-data-source-procs.tcl
+27
-8
No files found.
tcl/intranet-rest-data-source-procs.tcl
View file @
e23dab42
...
...
@@ -121,7 +121,7 @@ ad_proc im_rest_project_task_tree_delete {
array set var_hash
$var
_hash_list
if
{
""
==
$project
_id
}
{
doc_return 200
"text/plain"
"{success:false, message:
'Delete failed because we did not find project_id in JSON data:
$var
_hash_list'
}"
doc_return 200
"text/plain"
"{success:false, message:
\"
Delete failed because we did not find project_id in JSON data:
$var
_hash_list
\"
}"
return
}
...
...
@@ -130,16 +130,35 @@ ad_proc im_rest_project_task_tree_delete {
if
{
""
eq
$object
_type
}
{
return
};
# Delete object before it really was created. Kind of OK...
${object_type}
_permissions
$current
_user_id
$project
_id view read write admin
if
{
!$admin
}
{
doc_return 200
"text/plain"
"{success:false, message:
'No permissions to admin project_id=
$project
_id for user=
$current
_user_id'
}"
doc_return 200
"text/plain"
"{success:false, message:
\"
No permissions to admin project_id=
$project
_id for user=
$current
_user_id
\"
}"
ad_script_abort
return
}
if
{
2 eq
$pass
}
{
set parent_id
[
db_string task_parent_id
"select parent_id from im_projects where project_id = :project_id"
-default
""
]
# Found the main project. We don't want to delete this project.
if
{
""
==
$parent
_id
}
{
continue
}
# Nuke including timesheet costs logged, task dependencies etc
ns_log Notice
"im_rest_project_task_tree_delete: before 'im_project_nuke
$project
_id'"
set err_msg
[
im_project_nuke
$project
_id
]
if
{
""
ne
$err
_msg
}
{
doc_return 200
"text/plain"
"{success:false, message:
\"
[
im_quotejson
$err
_msg
]
\"
}"
return
}
}
# Old style - just generic object delete
# im_rest_delete_object \
# -format "json" \
# -rest_user_id $current_user_id \
# -rest_otype $object_type \
# -rest_oid $project_id \
# -query_hash_pairs $var_hash_list
im_rest_delete_object
\
-format
"json"
\
-rest_user_id
$current
_user_id
\
-rest_otype
$object
_type
\
-rest_oid
$project
_id
\
-query_hash_pairs
$var
_hash_list
}
...
...
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