-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dashboard tab report should not be seen in report generator
- Loading branch information
Showing
1 changed file
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
<?php | ||
|
||
try { | ||
|
||
$user = \xd_security\getLoggedInUser(); | ||
|
||
$templates = XDReportManager::enumerateReportTemplates($user->getRoles()); | ||
|
||
$returnData['status'] = 'success'; | ||
$returnData['success'] = true; | ||
$returnData['templates'] = $templates; | ||
$returnData['count'] = count($templates); | ||
|
||
\xd_controller\returnJSON($returnData); | ||
try { | ||
$user = \xd_security\getLoggedInUser(); | ||
|
||
} | ||
catch (SessionExpiredException $see) { | ||
// TODO: Refactor generic catch block below to handle specific exceptions, | ||
// which would allow this block to be removed. | ||
throw $see; | ||
} | ||
catch (Exception $e) { | ||
$templates = XDReportManager::enumerateReportTemplates($user->getRoles()); | ||
|
||
\xd_response\presentError($e->getMessage()); | ||
|
||
} | ||
|
||
?> | ||
// We do not want to show the "Dashboard Tab Reports" | ||
foreach($templates as $key => $value){ | ||
if ($value['name'] === 'Dashboard Tab Report') { | ||
unset($templates[$key]); | ||
} | ||
} | ||
|
||
$returnData['status'] = 'success'; | ||
$returnData['success'] = true; | ||
$returnData['templates'] = $templates; | ||
$returnData['count'] = count($templates); | ||
|
||
\xd_controller\returnJSON($returnData); | ||
|
||
} catch (SessionExpiredException $see) { | ||
// TODO: Refactor generic catch block below to handle specific exceptions, | ||
// which would allow this block to be removed. | ||
throw $see; | ||
} catch (Exception $e) { | ||
\xd_response\presentError($e->getMessage()); | ||
} |