ticket system show user's tickets and all tickets separately in sidebar

This commit is contained in:
OpenXE 2023-05-22 18:42:20 +02:00
parent 674c7b9958
commit 75bd00770c
2 changed files with 13 additions and 3 deletions

View File

@ -440,12 +440,15 @@ class erpooSystem extends Application
);
}
// Creates user specific items
$offene_tickets = $this->erp->AnzahlOffeneTickets(false);
$offene_tickets_user = $this->erp->AnzahlOffeneTickets(true);
$possibleUserItems = [
'Tickets' => [
'link' => 'index.php?module=ticket&action=list',
'counter' => $this->erp->AnzahlOffeneTickets()
'counter' => ($offene_tickets+$offene_tickets_user > 0)?$offene_tickets_user."/".$offene_tickets:""
],
'Aufgaben' => [
'link' => 'index.php?module=aufgaben&action=list',

View File

@ -2696,7 +2696,14 @@ public function NavigationHooks(&$menu)
public function AnzahlOffeneTickets($eigene=true)
{
$sql = "SELECT COUNT(t.id) FROM ticket t WHERE t.status = 'neu' AND ((t.warteschlange = '') OR (t.warteschlange IN (SELECT w.label FROM warteschlangen w WHERE w.adresse = '".$this->app->User->GetAdresse()."')))";
if ($eigene) {
$sql = "SELECT COUNT(t.id) FROM ticket t WHERE t.status = 'neu' AND (t.warteschlange IN (SELECT w.label FROM warteschlangen w WHERE w.adresse = '".$this->app->User->GetAdresse()."'))";
} else
{
$sql = "SELECT COUNT(t.id) FROM ticket t WHERE t.status = 'neu' AND (t.warteschlange = '')";
}
return (int)$this->app->DB->Select($sql);
}