Skip to content

Commit

Permalink
ReportMaster: taskbar visibility indicator added for available report…
Browse files Browse the repository at this point in the history
…s list
  • Loading branch information
nightflyza committed Oct 5, 2024
1 parent e122951 commit 64be20c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.9 rev 9213
1.4.9 rev 9214
45 changes: 26 additions & 19 deletions api/libs/api.reportmaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function setLogin() {
* @return string
*/
public function getReports() {
return($this->allReports);
return ($this->allReports);
}

/**
Expand Down Expand Up @@ -142,7 +142,7 @@ public function isMeAllowed($reportId) {
$result = false;
}
}
return($result);
return ($result);
}

/**
Expand Down Expand Up @@ -199,6 +199,7 @@ public function renderReportsList() {
$rows = wf_TableRow($cells, 'row1');

foreach ($this->allReports as $eachReport => $reportData) {

if ($this->isMeAllowed($eachReport)) {
$cells = wf_TableCell(wf_Link(self::URL_ME . '&' . self::ROUTE_VIEW . '=' . $eachReport, __($reportData['REPORT_NAME'])));
if (cfr('REPORTMASTERADM')) {
Expand All @@ -209,6 +210,13 @@ public function renderReportsList() {
$reportAccessLabel = wf_img('skins/icon_key.gif', __('Access restricted')) . ' ';
}

if (empty($reportData['REPORT_ONTB'])) {
$reportTblabel = wf_img('skins/icon_hidden.png', __('Taskbar') . ': ' . __('Hidden')) . ' ';;
} else {
$reportTblabel = wf_img('skins/icon_visible.png', __('Taskbar') . ': ' . __('Visible')) . ' ';;
}

$actControls .= $reportTblabel;
$actControls .= $reportAccessLabel;
$actControls .= wf_JSAlert(self::URL_ME . '&' . self::ROUTE_DELETE . '=' . $eachReport, web_delete_icon(), $this->messages->getDeleteAlert()) . ' ';
$actControls .= wf_JSAlert(self::URL_ME . '&' . self::ROUTE_EDIT . '=' . $eachReport, web_edit_icon(), $this->messages->getEditAlert()) . ' ';
Expand Down Expand Up @@ -315,7 +323,7 @@ public function renderBackControl() {
$backUrl = self::URL_TASKBAR;
}
$result .= wf_BackLink($backUrl);
return($result);
return ($result);
}

/**
Expand All @@ -337,7 +345,7 @@ public function createReport($type, $name, $query, $keys = '', $fields = '', $ad
$pathToSave = self::PATH_REPORTS . $fileName;
$isOk = false;

if (!empty($type) AND ! empty($name) AND ! empty($query)) {
if (!empty($type) and ! empty($name) and ! empty($query)) {
//base params here?
$isOk = true;
}
Expand Down Expand Up @@ -426,7 +434,7 @@ public function renderCreateForm($type = 'sql') {

$result .= wf_Form('', 'POST', $inputs, 'glamour');

return($result);
return ($result);
}

/**
Expand Down Expand Up @@ -612,7 +620,7 @@ protected function getReportData($reportfile, $report_name, $titles, $keys, $all
if ($rowcount) {
$result .= wf_tag('strong') . __('Total') . ': ' . $i . wf_tag('strong', true);
}
return($result);
return ($result);
}

/**
Expand Down Expand Up @@ -675,7 +683,7 @@ public function renderReport($reportId) {
} else {
show_error(__('Unknown report'));
}
return($result);
return ($result);
}

/**
Expand All @@ -691,7 +699,7 @@ protected function getAvailableIcons() {
$result[$each] = pathinfo($each, PATHINFO_FILENAME);
}
}
return($result);
return ($result);
}

/**
Expand Down Expand Up @@ -760,7 +768,7 @@ public function renderEditForm($reportId) {

$result .= wf_delimiter(1);
$result .= $this->renderBackControl();
return($result);
return ($result);
}

/**
Expand All @@ -780,7 +788,7 @@ protected function renderTbPreview($reportId) {
$icon = $reportData['REPORT_ICON'];
$reportLabel = __($reportData['REPORT_NAME']);
$availableIcons = $this->getAvailableIcons();
if (!isset($availableIcons[$icon]) OR empty($icon)) {
if (!isset($availableIcons[$icon]) or empty($icon)) {
$icon = self::ICON_DEFAULT;
}

Expand All @@ -793,7 +801,7 @@ protected function renderTbPreview($reportId) {
$result .= wf_tag('div', true);
}
}
return($result);
return ($result);
}

/**
Expand Down Expand Up @@ -857,7 +865,7 @@ protected function renderCopyPasteForm($reportId) {
$result .= $this->messages->getStyledMessage(__('Something went wrong') . ': ' . __('Report') . ' ' . __('is corrupted'), 'error');
}
}
return($result);
return ($result);
}

/**
Expand All @@ -875,8 +883,8 @@ public function installReport($packedData) {
$unpackedData = base64_decode($packedData);
if (!empty($unpackedData)) {
@$unpackedData = json_decode($unpackedData, true);
if (!empty($unpackedData) AND is_array($unpackedData)) {
if (isset($unpackedData['SOURCE']) AND isset($unpackedData['REPORTID']) AND isset($unpackedData['REPORTCODE']) AND isset($unpackedData['OPSCRIPT'])) {
if (!empty($unpackedData) and is_array($unpackedData)) {
if (isset($unpackedData['SOURCE']) and isset($unpackedData['REPORTID']) and isset($unpackedData['REPORTCODE']) and isset($unpackedData['OPSCRIPT'])) {
$reportSource = trim($unpackedData['SOURCE']);
$reportId = $unpackedData['REPORTID'];
$reportCode = $unpackedData['REPORTCODE'];
Expand Down Expand Up @@ -924,7 +932,7 @@ public function installReport($packedData) {
$result .= __('Report') . ' ' . __('is corrupted');
}

return($result);
return ($result);
}

/**
Expand Down Expand Up @@ -958,7 +966,7 @@ public function saveReport($reportId) {
$newReportOnTb = ubRouting::post(self::PROUTE_EDONTB);
$newReportAotd = ubRouting::post(self::PROUTE_EDAOTD);

if (!empty($newReportType) AND ! empty($newReportName) AND ! empty($newReportQuery)) {
if (!empty($newReportType) and ! empty($newReportName) and ! empty($newReportQuery)) {
//base params here?
$isOk = true;
} else {
Expand Down Expand Up @@ -1002,7 +1010,7 @@ public function saveReport($reportId) {
}
}
}
return($result);
return ($result);
}

/**
Expand Down Expand Up @@ -1032,7 +1040,6 @@ public function getTaskBarReports() {
}
}
}
return($result);
return ($result);
}

}
3 changes: 2 additions & 1 deletion languages/russian/billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3532,4 +3532,5 @@
$lang['def']['OLT is dead now'] = 'OLT сейчас мертва';
$lang['def']['Latest'] = 'Последний';
$lang['def']['Network upgrade report'] = 'Отчет по модернизации сети';
$lang['def']['Item types spent on network upgrade'] = 'ТМЦ использованные для модернизации сети';
$lang['def']['Item types spent on network upgrade'] = 'ТМЦ использованные для модернизации сети';
$lang['def']['Visible'] = 'Видимый';
2 changes: 1 addition & 1 deletion languages/ukrainian/billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3541,6 +3541,6 @@
$lang['def']['Latest'] = 'Останній';
$lang['def']['Network upgrade report'] = 'Звіт по модернізації мережі';
$lang['def']['Item types spent on network upgrade'] = 'ТМЦ витрачені на модернізацію мережі';
$lang['def'][''] = '';
$lang['def']['Visible'] = 'Видимий';
$lang['def'][''] = '';

Binary file added skins/icon_hidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/icon_visible.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 64be20c

Please sign in to comment.