mirror of
https://github.com/openvk/openvk
synced 2024-11-15 19:49:14 +03:00
Removed the ability to remove points
This commit is contained in:
parent
c5d6c86a9d
commit
2317c79143
2 changed files with 10 additions and 8 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -490,13 +490,12 @@ function showBtStatusChangeDialog(report, currentBalance, hash) {
|
|||
<br>
|
||||
<div style="display: inline;">
|
||||
Вы можете начислить
|
||||
<input style="width: 45px; height: 9px;" type="number" name="points-count" value="0">
|
||||
<input style="width: 45px; height: 9px;" type="number" name="points-count" value="0" min="0">
|
||||
голосов
|
||||
<span class="nobold">(отрицательные значения поддерживаются)</span>
|
||||
</div>
|
||||
<input type="hidden" name="hash" value="${hash}" />
|
||||
</form>
|
||||
`, ["Сохранить", tr("cancel")], [
|
||||
`, ["Сохранить", "Отмена"], [
|
||||
() => {
|
||||
$("#status_change_dialog").submit();
|
||||
},
|
||||
|
@ -542,13 +541,12 @@ function showBtPriorityChangeDialog(report, currentBalance, hash) {
|
|||
<br>
|
||||
<div style="display: inline;">
|
||||
Вы можете начислить
|
||||
<input style="width: 45px; height: 9px;" type="number" name="points-count" value="0">
|
||||
<input style="width: 45px; height: 9px;" type="number" name="points-count" value="0" min="0">
|
||||
голосов
|
||||
<span class="nobold">(отрицательные значения поддерживаются)</span>
|
||||
</div>
|
||||
<input type="hidden" name="hash" value="${hash}" />
|
||||
</form>
|
||||
`, ["Сохранить", tr("cancel")], [
|
||||
`, ["Сохранить", "Отмена"], [
|
||||
() => {
|
||||
$("#priority_change_dialog").submit();
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue