Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-reporting-dashboard
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-reporting-dashboard
Commits
78d7b656
Commit
78d7b656
authored
Jun 07, 2019
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed JSON return messages
parent
d4d51ef7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
project-eva.json.tcl
www/project-eva.json.tcl
+2
-2
revenue-by-dept.json.tcl
www/revenue-by-dept.json.tcl
+3
-3
top-customers.json.tcl
www/top-customers.json.tcl
+3
-3
No files found.
www/project-eva.json.tcl
View file @
78d7b656
...
...
@@ -19,7 +19,7 @@ set current_user_id [ad_conn user_id]
im_project_permissions
$current
_user_id
$diagram
_project_id view read write admin
if
{
!$read
}
{
set json
"{
\"
success
\"
: false,
\"
message
\"
:
\"
Insufficient permissions - you need read permissions for project #
$diagram
_project_id.
\"
}"
doc_return
200
"text/html
"
$json
doc_return
400
"application/json
"
$json
ad_script_abort
}
...
...
@@ -246,5 +246,5 @@ foreach epoch $timeline_list {
}
set
json
"{
\"
success
\"
: true,
\"
message
\"
:
\"
$message
\"
,
\"
data
\"
:
\[\n
[
join
$json
_lines
",
\n
"
]
\n\]
}"
doc_return 200
"
text/html
"
$json
doc_return 200
"
application/json
"
$json
www/revenue-by-dept.json.tcl
View file @
78d7b656
...
...
@@ -35,7 +35,7 @@ ad_page_contract {
set
current_user_id
[
ad_conn user_id
]
if
{
!
[
im_permission
$current
_user_id view_companies_all
]
|| !
[
im_permission
$current
_user_id view_finance
]}
{
set json
"{
\"
success
\"
: false,
\"
message
\"
:
\"
Insufficient permissions - you need view_companies_all and view_finance.
\"
}"
doc_return
200
"text/html
"
$json
doc_return
400
"application/json
"
$json
ad_script_abort
}
...
...
@@ -70,7 +70,7 @@ switch $diagram_interval {
last_quarter
{
set diagram_start_date
[
db_string year
"select now()::date - 90 - 31"
]
}
default
{
set json
"{
\"
success
\"
: false,
\"
message
\"
:
\"
Invalid diagram_interval option: '
$diagram
_interval'.
\"
}"
doc_return
200
"text/html
"
$json
doc_return
400
"application/json
"
$json
ad_script_abort
}
}
...
...
@@ -200,5 +200,5 @@ foreach now $months {
# ----------------------------------------------------
set json "
{
\"
success
\"
: true,
\"
message
\"
:
\"
Data loaded
\"
,
\"
data
\"
:
\[\n
[
join
$rev
_rows
",
\n
"
]
\n\]
}
"
doc_return 200 "
text/html
"
$json
doc_return 200 "
application/json
"
$json
www/top-customers.json.tcl
View file @
78d7b656
...
...
@@ -20,7 +20,7 @@ ad_page_contract {
set
current_user_id
[
ad_conn user_id
]
if
{
!
[
im_permission
$current
_user_id view_companies_all
]
|| !
[
im_permission
$current
_user_id view_finance
]}
{
set json
"{
\"
success
\"
: false,
\"
message
\"
:
\"
Insufficient permissions - you need view_companies_all and view_finance.
\"
}"
doc_return
200
"text/html
"
$json
doc_return
400
"application/json
"
$json
ad_script_abort
}
...
...
@@ -39,7 +39,7 @@ switch $diagram_interval {
all_time
{
set top_customer_interval_sql
""
}
default
{
set json
"{
\"
success
\"
: false,
\"
message
\"
:
\"
Invalid diagram_interval option: '
$diagram
_interval'.
\"
}"
doc_return
200
"text/html
"
$json
doc_return
400
"application/json
"
$json
ad_script_abort
}
}
...
...
@@ -91,5 +91,5 @@ multirow foreach top_customers {
lappend data_list
"{
\"
name
\"
:
\"
$customer
_name
\"
,
\"
value
\"
:
$customer
_revenues }"
}
set
json
"{
\"
success
\"
: true,
\"
message
\"
:
\"
Data loaded
\"
,
\"
data
\"
:
\[\n
[
join
$data
_list
",
\n
"
]
\n\]
}"
doc_return 200
"
text/html
"
$json
doc_return 200
"
application/json
"
$json
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