Support: Display the number of unanswered tickets in the left menu

This commit is contained in:
Maxim Leshchenko 2021-12-04 22:15:13 +02:00
parent d9c04d1428
commit 7f4dabef4b
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE
2 changed files with 7 additions and 1 deletions

View file

@ -208,6 +208,8 @@ abstract class OpenVKPresenter extends SimplePresenter
} }
$this->template->ticketAnsweredCount = (new Tickets)->getTicketsCountByuId($this->user->id, 1); $this->template->ticketAnsweredCount = (new Tickets)->getTicketsCountByuId($this->user->id, 1);
if($user->can("write")->model('openvk\Web\Models\Entities\TicketReply')->whichBelongsTo(0))
$this->template->helpdeskTicketAnsweredCount = (new Tickets)->getTicketCount(0);
} }
setlocale(LC_TIME, ...(explode(";", tr("__locale")))); setlocale(LC_TIME, ...(explode(";", tr("__locale"))));

View file

@ -172,7 +172,11 @@
<a href="/admin" class="link">Админ-панель</a> <a href="/admin" class="link">Админ-панель</a>
{/if} {/if}
{if $canAccessHelpdesk} {if $canAccessHelpdesk}
<a href="/support/tickets" class="link">Helpdesk</a> <a href="/support/tickets" class="link">Helpdesk
{if $helpdeskTicketAnsweredCount > 0}
(<b>{$helpdeskTicketAnsweredCount}</b>)
{/if}
</a>
{/if} {/if}
<a <a
n:foreach="OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links'] as $menuItem" n:foreach="OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links'] as $menuItem"