outsource check for open support-tickets to init.php so that themes may display the info wherever they want
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -148,18 +148,6 @@ if($page == 'overview')
|
|||||||
$cron_last_runs = getCronjobsLastRun();
|
$cron_last_runs = getCronjobsLastRun();
|
||||||
$outstanding_tasks = getOutstandingTasks();
|
$outstanding_tasks = getOutstandingTasks();
|
||||||
|
|
||||||
$opentickets = 0;
|
|
||||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
|
||||||
WHERE `answerto` = "0" AND (`status` = "0" OR `status` = "1")
|
|
||||||
AND `lastreplier`="0" AND `adminid` = "' . $userinfo['adminid'] . '"');
|
|
||||||
$awaitingtickets = $opentickets['count'];
|
|
||||||
$awaitingtickets_text = '';
|
|
||||||
|
|
||||||
if($opentickets > 0)
|
|
||||||
{
|
|
||||||
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="admin_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(function_exists('sys_getloadavg'))
|
if(function_exists('sys_getloadavg'))
|
||||||
{
|
{
|
||||||
$loadArray = sys_getloadavg();
|
$loadArray = sys_getloadavg();
|
||||||
|
|||||||
@@ -60,18 +60,6 @@ if ($page == 'overview') {
|
|||||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||||
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota email_autoresponder ftps tickets subdomains aps_packages');
|
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota email_autoresponder ftps tickets subdomains aps_packages');
|
||||||
$opentickets = 0;
|
|
||||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
|
||||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
|
||||||
AND `answerto` = "0"
|
|
||||||
AND (`status` = "0" OR `status` = "2")
|
|
||||||
AND `lastreplier`="1"');
|
|
||||||
$awaitingtickets = $opentickets['count'];
|
|
||||||
$awaitingtickets_text = '';
|
|
||||||
|
|
||||||
if ($opentickets > 0) {
|
|
||||||
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="customer_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
|
||||||
}
|
|
||||||
|
|
||||||
eval("echo \"" . getTemplate('index/index') . "\";");
|
eval("echo \"" . getTemplate('index/index') . "\";");
|
||||||
} elseif ($page == 'change_password') {
|
} elseif ($page == 'change_password') {
|
||||||
|
|||||||
34
lib/init.php
34
lib/init.php
@@ -431,6 +431,40 @@ if (AREA == 'admin' || AREA == 'customer') {
|
|||||||
unset($navigation_data);
|
unset($navigation_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* header information about open tickets (only if used)
|
||||||
|
*/
|
||||||
|
if ($settings['ticket']['enabled'] == '1') {
|
||||||
|
$awaitingtickets = 0;
|
||||||
|
$awaitingtickets_text = '';
|
||||||
|
$opentickets = 0;
|
||||||
|
|
||||||
|
if (AREA == 'admin' && isset($userinfo['adminid'])) {
|
||||||
|
$opentickets = $db->query_first('
|
||||||
|
SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||||
|
WHERE `answerto` = "0" AND (`status` = "0" OR `status` = "1")
|
||||||
|
AND `lastreplier`="0" AND `adminid` = "' . $userinfo['adminid'] . '"
|
||||||
|
');
|
||||||
|
$awaitingtickets = $opentickets['count'];
|
||||||
|
|
||||||
|
if ($opentickets > 0) {
|
||||||
|
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="admin_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (AREA == 'customer' && isset($userinfo['customerid'])) {
|
||||||
|
$opentickets = $db->query_first('
|
||||||
|
SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||||
|
WHERE `answerto` = "0" AND (`status` = "0" OR `status` = "2")
|
||||||
|
AND `lastreplier`="1" AND `customerid` = "' . $userinfo['customerid'] . '"
|
||||||
|
');
|
||||||
|
$awaitingtickets = $opentickets['count'];
|
||||||
|
|
||||||
|
if ($opentickets > 0) {
|
||||||
|
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="customer_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$webfont = str_replace('+', ' ', $settings['panel']['webfont']);
|
$webfont = str_replace('+', ' ', $settings['panel']['webfont']);
|
||||||
eval("\$header = \"" . getTemplate('header', '1') . "\";");
|
eval("\$header = \"" . getTemplate('header', '1') . "\";");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user