22 $this->reports = Query::create(
CustomReport,
"WHERE title != '' AND $constraints")->execute();
25 $this->list =
new PagedList($this->reports,
"{$id}_list", array($this,
formatReport));
27 $this->list->emptyList =
"<em>No reports found.</em>";
34 $out =
"<div class='report_title'>";
37 $out .=
"<i class='fa-fw fas fa-share'></i> ";
40 $out .=
"{$report->title}</div><div class='report_description'>{$report->description}</div>";
42 $out .=
"<a class='button' href='custom_report_results?report_id={$report->report_id}'><i class='fa-fw far fa-file-alt'></i> Run Report</a>";
44 if (checkRole(
"admin,data") ||
$report->user_id ==
$user->user_id)
46 $out .=
" <a class='button' href='custom_report?report_id={$report->report_id}&edit=1'><i class='fa-fw fas fa-pencil-alt'></i> Edit</a>";
49 if (checkRole(
"admin,data"))
53 $out .=
" <a class='button' href='#' onclick='ReportManager.unshareReport({$report->report_id}); return false;'><i class='fa-fw far fa-share reverse'></i> Unshare</a>";
57 $out .=
" <a class='button' href='#' onclick='ReportManager.shareReport({$report->report_id}); return false;'><i class='fa-fw far fa-share'></i> Share</a>";
60 $out .=
" <a class='button' href='#' onclick='ReportManager.deleteReport({$report->report_id}); return false;'><i class='fa-fw far fa-trash-alt'></i> Delete</a>";
67 return $this->list->writeScript();
72 echo
"<div id='$this->id' class='custom_report_list_panel'>";
73 echo
"<h3>$this->title</h3>";
74 echo
"<div class='report_list'>";
75 $this->list->drawList();
__construct($title, $id, $constraints, $pageSize)
static usingFeature()
Uses the specified framework feature(s).