mirror of
https://github.com/openvk/openvk
synced 2024-11-15 11:39:13 +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 = (new BugtrackerReports)->get($report_id);
|
||||||
$report->setStatus($status);
|
$report->setStatus($status);
|
||||||
|
|
||||||
if ($points)
|
if ($points >= 0)
|
||||||
DB::i()->getContext()->query("UPDATE `profiles` SET `coins` = `coins` + " . $points . " WHERE `id` = " . $report->getReporter()->getId());
|
DB::i()->getContext()->query("UPDATE `profiles` SET `coins` = `coins` + " . $points . " WHERE `id` = " . $report->getReporter()->getId());
|
||||||
|
else
|
||||||
|
$this->flashFail("err", tr("error"), "Число голосов должно быть больше или равно 0.");
|
||||||
|
|
||||||
$report->save();
|
$report->save();
|
||||||
|
|
||||||
|
@ -142,8 +144,10 @@ final class BugtrackerPresenter extends OpenVKPresenter
|
||||||
$report = (new BugtrackerReports)->get($report_id);
|
$report = (new BugtrackerReports)->get($report_id);
|
||||||
$report->setPriority($priority);
|
$report->setPriority($priority);
|
||||||
|
|
||||||
if ($points)
|
if ($points >= 0)
|
||||||
DB::i()->getContext()->query("UPDATE `profiles` SET `coins` = `coins` + " . $points . " WHERE `id` = " . $report->getReporter()->getId());
|
DB::i()->getContext()->query("UPDATE `profiles` SET `coins` = `coins` + " . $points . " WHERE `id` = " . $report->getReporter()->getId());
|
||||||
|
else
|
||||||
|
$this->flashFail("err", tr("error"), "Число голосов должно быть больше или равно 0.");
|
||||||
|
|
||||||
$report->save();
|
$report->save();
|
||||||
|
|
||||||
|
|
|
@ -490,13 +490,12 @@ function showBtStatusChangeDialog(report, currentBalance, hash) {
|
||||||
<br>
|
<br>
|
||||||
<div style="display: inline;">
|
<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>
|
</div>
|
||||||
<input type="hidden" name="hash" value="${hash}" />
|
<input type="hidden" name="hash" value="${hash}" />
|
||||||
</form>
|
</form>
|
||||||
`, ["Сохранить", tr("cancel")], [
|
`, ["Сохранить", "Отмена"], [
|
||||||
() => {
|
() => {
|
||||||
$("#status_change_dialog").submit();
|
$("#status_change_dialog").submit();
|
||||||
},
|
},
|
||||||
|
@ -542,13 +541,12 @@ function showBtPriorityChangeDialog(report, currentBalance, hash) {
|
||||||
<br>
|
<br>
|
||||||
<div style="display: inline;">
|
<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>
|
</div>
|
||||||
<input type="hidden" name="hash" value="${hash}" />
|
<input type="hidden" name="hash" value="${hash}" />
|
||||||
</form>
|
</form>
|
||||||
`, ["Сохранить", tr("cancel")], [
|
`, ["Сохранить", "Отмена"], [
|
||||||
() => {
|
() => {
|
||||||
$("#priority_change_dialog").submit();
|
$("#priority_change_dialog").submit();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue