From 2317c79143cb25bb8cba194442f2fd87e565c6a8 Mon Sep 17 00:00:00 2001
From: n1rwana <93197434+n1rwana@users.noreply.github.com>
Date: Mon, 29 Aug 2022 03:35:23 +0300
Subject: [PATCH] Removed the ability to remove points
---
Web/Presenters/BugtrackerPresenter.php | 8 ++++++--
Web/static/js/openvk.cls.js | 10 ++++------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/Web/Presenters/BugtrackerPresenter.php b/Web/Presenters/BugtrackerPresenter.php
index d8eb86e4..e842e636 100644
--- a/Web/Presenters/BugtrackerPresenter.php
+++ b/Web/Presenters/BugtrackerPresenter.php
@@ -109,8 +109,10 @@ final class BugtrackerPresenter extends OpenVKPresenter
$report = (new BugtrackerReports)->get($report_id);
$report->setStatus($status);
- if ($points)
+ if ($points >= 0)
DB::i()->getContext()->query("UPDATE `profiles` SET `coins` = `coins` + " . $points . " WHERE `id` = " . $report->getReporter()->getId());
+ else
+ $this->flashFail("err", tr("error"), "Число голосов должно быть больше или равно 0.");
$report->save();
@@ -142,8 +144,10 @@ final class BugtrackerPresenter extends OpenVKPresenter
$report = (new BugtrackerReports)->get($report_id);
$report->setPriority($priority);
- if ($points)
+ if ($points >= 0)
DB::i()->getContext()->query("UPDATE `profiles` SET `coins` = `coins` + " . $points . " WHERE `id` = " . $report->getReporter()->getId());
+ else
+ $this->flashFail("err", tr("error"), "Число голосов должно быть больше или равно 0.");
$report->save();
diff --git a/Web/static/js/openvk.cls.js b/Web/static/js/openvk.cls.js
index 8d3b3b42..8095c1bc 100755
--- a/Web/static/js/openvk.cls.js
+++ b/Web/static/js/openvk.cls.js
@@ -490,13 +490,12 @@ function showBtStatusChangeDialog(report, currentBalance, hash) {