Skip to content
Snippets Groups Projects
Commit 5fadd1d7 authored by Patrick Schmalstig's avatar Patrick Schmalstig
Browse files

MANTIS tracker symbol updates

parent 9e0b0b19
Branches
Tags
No related merge requests found
......@@ -157,6 +157,7 @@ class Hook_addon_registry_composr_homesite_support_credits
'sources_custom/hooks/systems/page_groupings/support_credits.php',
'sources_custom/hooks/systems/symbols/MANTIS_SPONSOR_WEEK_ACTIVITY.php',
'sources_custom/hooks/systems/symbols/MANTIS_TOTAL.php',
'sources_custom/hooks/systems/symbols/MANTIS_TOTAL_BY_TAGS.php',
'sources_custom/hooks/systems/symbols/MANTIS_WEEK_ACTIVITY.php',
'sources_custom/mantis.php',
'sources_custom/miniblocks/credit_exps.php',
......
......@@ -21,6 +21,9 @@ class Hook_symbol_MANTIS_TOTAL
public function run($param)
{
$cnt = $GLOBALS['SITE_DB']->query_value_if_there('SELECT COUNT(*) FROM mantis_bug_table WHERE status<80');
return strval($cnt);
if ($cnt === null) {
return '';
}
return integer_format($cnt);
}
}
<?php /*
Composr
Copyright (c) ocProducts, 2004-2016
See text/EN/licence.txt for full licencing information.
*/
/**
* @license http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
* @copyright ocProducts Ltd
* @package composr_homesite_support_credits
*/
/**
* Hook class.
*/
class Hook_symbol_MANTIS_TOTAL_BY_TAGS
{
public function run($param)
{
if (!array_key_exists(0, $param)) {
return '';
}
$in_clause = 'IN';
if ($param[0] == '0') {
$in_clause = 'NOT IN';
}
array_shift($param);
$param = array_map('intval', $param);
$cnt = $GLOBALS['SITE_DB']->query_value_if_there('SELECT COUNT(*) FROM mantis_bug_table WHERE status <80 AND EXISTS (SELECT 1 FROM mantis_bug_tag_table WHERE mantis_bug_tag_table.bug_id = mantis_bug_table.id AND mantis_bug_tag_table.tag_id ' . $in_clause . ' (' . implode(', ', $param) . '))');
if ($cnt === null) {
return '';
}
return integer_format($cnt);
}
}
......@@ -21,6 +21,9 @@ class Hook_symbol_MANTIS_WEEK_ACTIVITY
public function run($param)
{
$cnt_in_last_week = $GLOBALS['SITE_DB']->query_value_if_there('SELECT COUNT(*) FROM mantis_bug_table WHERE last_updated>' . strval(time() - 60 * 60 * 24 * 7));
return strval($cnt_in_last_week);
if ($cnt_in_last_week === null) {
return '';
}
return integer_format($cnt_in_last_week);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment