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
02a919db
Commit
02a919db
authored
Apr 01, 2021
by
Project Open
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added dereferencing to im_hours
parent
46f8fd75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
intranet-rest-get-procs.tcl
tcl/intranet-rest-get-procs.tcl
+18
-4
No files found.
tcl/intranet-rest-get-procs.tcl
View file @
02a919db
...
...
@@ -421,16 +421,23 @@ ad_proc -private im_rest_get_im_hours {
set owner_perm_sql
"and h.user_id = :rest_user_id"
if
{
$rest
_otype_read_all_p
}
{
set owner_perm_sql
""
}
set deref_p 0
if
{[
info
exists query_hash
(
deref_p
)]}
{
set deref_p
$query
_hash
(
deref_p
)
}
# -------------------------------------------------------
# Check if there is a where clause specified in the URL and validate the clause.
set where_clause
""
if
{[
info
exists query_hash
(
query
)]}
{
set where_clause
$query
_hash
(
query
)}
# Determine the list of valid columns for the object type
set valid_vars
{
hour_id user_id project_id day hours days note internal_note cost_id conf_object_id invoice_id material_id
}
set valid_vars
{
hour_id user_id main_project_id project_id day hours days note internal_note cost_id conf_object_id invoice_id material_id
}
# Manual implementation of dereferenced variables
if
{
$deref
_p eq
"1"
}
{
lappend valid_vars
"project_id_deref"
}
# -------------------------------------------------------
# Check if there are
"valid_vars"
specified in the HTTP header
# and add these vars to the SQL clause
...
...
@@ -455,7 +462,14 @@ ad_proc -private im_rest_get_im_hours {
im_project_name_from_id(h.project_id) ||
day::date || ', ' || ' - ' ||
h.hours || ')' as object_name,
h.*
h.*,
(select p.project_name from im_projects p where p.project_id = h.project_id) as project_id_deref,
(select main_p.project_id
from im_projects p,
im_projects main_p
where p.project_id = h.project_id and
main_p.tree_sortkey = tree_root_key(p.tree_sortkey)
) as main_project_id
from im_hours h
where 1=1
$owner
_perm_sql
...
...
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