report exclude readonly reports as default, added row preview

This commit is contained in:
OpenXE 2023-05-02 13:16:31 +02:00
parent cd3c0f2113
commit 63dbedc1a8
3 changed files with 3193 additions and 3188 deletions

View File

@ -492,6 +492,8 @@ final class ReportService
$testResult['messagetype'] = 'error';
$testResult['message'] = sprintf("QUERY FAILED:\n%s", $e->getMessage());
$testResult['message'] .= "\n\r".$compiled;
return $testResult;
}
@ -500,6 +502,9 @@ final class ReportService
if(count($rows) < 101){
$message = sprintf('Query successful: %s datasets found', count($rows));
}
$message .= "\n\r".print_r($rows[0],true);
$testResult = [
'messagetype' => 'success',
'message' => $message,

View File

@ -26,7 +26,7 @@
<input type="checkbox" id="report-list-filter-own">
<span class="slider round"></span>
</label>
<label for="report-list-filter-own">{|Nur eigene|}</label>
<label for="report-list-filter-own">{|Inkl. Vorlagen|}</label>
</li>
<li class="filter-item">
<label for="report-list-filter-favorites" class="switch">

View File

@ -1113,10 +1113,10 @@ class Report
{
$filterCategory = $this->request->getPost('filter_category', '');
$filterTerm = $this->request->getPost('filter_term', '');
$filterOnlyOwn = $this->request->post->getBool('filter_own', false);
$filterexcludeReadOnly = $this->request->post->getBool('filter_own', false);
$filterOnlyFavorites = $this->request->post->getBool('filter_favorites', false);
try {
$html= $this->getTileView($filterCategory, $filterTerm, $filterOnlyOwn, $filterOnlyFavorites);
$html= $this->getTileView($filterCategory, $filterTerm, !$filterexcludeReadOnly, $filterOnlyFavorites);
$response = new JsonResponse(['success' => true, 'html' => $html]);
} catch (Exception $e) {
$response = new Response($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR);
@ -1176,14 +1176,14 @@ class Report
*
* @return string tiles html
*/
protected function getTileView($category = '', $searchTerm = '', $onlyOwn = false, $onlyFavs = false)
protected function getTileView($category = '', $searchTerm = '', $excludeReadOnly = true, $onlyFavs = false)
{
try {
$reportList = $this->gateway->getReportList(
$category,
$searchTerm,
$this->app->User->GetID(),
$onlyOwn,
$excludeReadOnly,
$onlyFavs
);
} catch (Exception $e) {