From 0bf05d8bea681cf792e35d5e2fe0fe8782148e75 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sat, 30 Jan 2010 16:00:35 +0000 Subject: [PATCH] disable creating of new support-ticket if there are no customers --- admin_tickets.php | 5 +++++ templates/admin/ticket/tickets.tpl | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/admin_tickets.php b/admin_tickets.php index 01782756..711d2d77 100644 --- a/admin_tickets.php +++ b/admin_tickets.php @@ -37,6 +37,11 @@ elseif(isset($_GET['id'])) if($page == 'tickets' && $userinfo['customers'] != '0') { + // Let's see how many customers we have + + $countcustomers = $db->query_first("SELECT COUNT(`customerid`) as `countcustomers` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int)$userinfo['adminid'] . "' ") . ""); + $countcustomers = (int)$countcustomers['countcustomers']; + if($action == '') { $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets"); diff --git a/templates/admin/ticket/tickets.tpl b/templates/admin/ticket/tickets.tpl index 9dceafe5..93090f7f 100644 --- a/templates/admin/ticket/tickets.tpl +++ b/templates/admin/ticket/tickets.tpl @@ -28,11 +28,16 @@ $header {$pagingcode} - + {$lng['ticket']['ticket_new']} + + + {$lng['admin']['domain_nocustomeraddingavailable']} + +