disable creating of new support-ticket if there are no customers
This commit is contained in:
@@ -37,6 +37,11 @@ elseif(isset($_GET['id']))
|
|||||||
if($page == 'tickets'
|
if($page == 'tickets'
|
||||||
&& $userinfo['customers'] != '0')
|
&& $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 == '')
|
if($action == '')
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets");
|
||||||
|
|||||||
@@ -28,11 +28,16 @@ $header
|
|||||||
<td class="field_display_border_left" colspan="10" style=" text-align: center; ">{$pagingcode}</td>
|
<td class="field_display_border_left" colspan="10" style=" text-align: center; ">{$pagingcode}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</if>
|
</if>
|
||||||
<if ($userinfo['tickets_used'] < $userinfo['tickets'] || $userinfo['tickets'] == '-1') >
|
<if ($userinfo['tickets_used'] < $userinfo['tickets'] || $userinfo['tickets'] == '-1') && $countcustomers !=0 >
|
||||||
<tr>
|
<tr>
|
||||||
<td class="field_display_border_left" colspan="10"><a href="$filename?page=tickets&action=new&s=$s">{$lng['ticket']['ticket_new']}</a></td>
|
<td class="field_display_border_left" colspan="10"><a href="$filename?page=tickets&action=new&s=$s">{$lng['ticket']['ticket_new']}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</if>
|
</if>
|
||||||
|
<if $countcustomers == 0 >
|
||||||
|
<tr>
|
||||||
|
<td class="field_display_border_left" colspan="10"><a href="admin_customers.php?s=$s&page=customers&action=add">{$lng['admin']['domain_nocustomeraddingavailable']}</a></td>
|
||||||
|
</tr>
|
||||||
|
</if>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
Reference in New Issue
Block a user