示例#1
0
function helper_get_current_project_trace()
{
    $t_cookie_name = config_get('project_cookie');
    $t_project_id = gpc_get_cookie($t_cookie_name, null);
    if (null === $t_project_id) {
        $t_bottom = current_user_get_pref('default_project');
        $t_project_id = array($t_bottom);
    } else {
        $t_project_id = split(';', $t_project_id);
        $t_bottom = $t_project_id[count($t_project_id) - 1];
    }
    if (!project_exists($t_bottom) || 0 == project_get_field($t_bottom, 'enabled') || !access_has_project_level(VIEWER, $t_bottom)) {
        $t_project_id = array(ALL_PROJECTS);
    }
    return $t_project_id;
}
<?php 
$t_mantis_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
# User list sponsoring the bug
include $t_mantis_dir . 'bug_sponsorship_list_view_inc.php';
# Bug Relationships
# MASC RELATIONSHIP
if (ON == config_get('enable_relationship')) {
    relationship_view_box($f_bug_id);
}
# MASC RELATIONSHIP
# File upload box
if (!bug_is_readonly($f_bug_id)) {
    include $t_mantis_dir . 'bug_file_upload_inc.php';
}
# User list monitoring the bug
include $t_mantis_dir . 'bug_monitor_list_view_inc.php';
# Bugnotes and "Add Note" box
if ('ASC' == current_user_get_pref('bugnote_order')) {
    include $t_mantis_dir . 'bugnote_view_inc.php';
    include $t_mantis_dir . 'bugnote_add_inc.php';
} else {
    include $t_mantis_dir . 'bugnote_add_inc.php';
    include $t_mantis_dir . 'bugnote_view_inc.php';
}
# History
if ($f_history) {
    include $t_mantis_dir . 'history_inc.php';
}
html_page_bottom1(__FILE__);
last_visited_issue($f_bug_id);
示例#3
0
require_api('helper_api.php');
require_api('lang_api.php');
require_api('prepare_api.php');
require_api('print_api.php');
require_api('string_api.php');
require_api('user_api.php');
# grab the user id currently logged in
$t_user_id = auth_get_current_user_id();
#precache access levels
if (isset($g_project_override)) {
    access_cache_matrix_project($g_project_override);
} else {
    access_cache_matrix_project(helper_get_current_project());
}
# get the bugnote data
$t_bugnote_order = current_user_get_pref('bugnote_order');
$t_bugnotes = bugnote_get_all_visible_bugnotes($f_bug_id, $t_bugnote_order, 0, $t_user_id);
#precache users
$t_bugnote_users = array();
foreach ($t_bugnotes as $t_bugnote) {
    $t_bugnote_users[] = $t_bugnote->reporter_id;
}
user_cache_array_rows($t_bugnote_users);
$num_notes = count($t_bugnotes);
?>

<?php 
# Bugnotes BEGIN
?>
<a id="bugnotes"></a><br />
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
require_once 'core.php';
require_once 'compress_api.php';
require_once 'filter_api.php';
require_once 'last_visited_api.php';
auth_ensure_user_authenticated();
$t_current_user_id = auth_get_current_user_id();
# Improve performance by caching category data in one pass
category_get_all_rows(helper_get_current_project());
compress_enable();
# don't index my view page
html_robots_noindex();
html_page_top1(plugin_lang_get('title'));
if (current_user_get_pref('refresh_delay') > 0) {
    html_meta_redirect(plugin_page('dashboard', true), current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
print_recently_visited();
$f_page_number = gpc_get_int('page_number', 1);
$t_per_page = config_get('my_view_bug_count');
$t_bug_count = null;
$t_page_count = null;
$t_filters = filter_db_get_available_queries();
$t_config_boxes = plugin_config_get('boxes');
$t_boxes = array();
if (is_array($t_config_boxes) && sizeof($t_config_boxes) > 0) {
    $t_result = asort($t_config_boxes);
    foreach ($t_config_boxes as $t_filter_id => $t_box_position) {
        if ($t_box_position > 0 && array_key_exists($t_filter_id, $t_filters)) {
            $t_boxes[$t_filter_id] = $t_filters[$t_filter_id];
示例#5
0
function html_meta_redirect($p_url, $p_time = null, $p_sanitize = false)
{
    if (ON == config_get('stop_on_errors') && error_handled()) {
        return false;
    }
    if (null === $p_time) {
        $p_time = current_user_get_pref('redirect_delay');
    }
    if ($p_sanitize) {
        $t_url = string_sanitize_url($p_url);
    } else {
        $t_url = $p_url;
    }
    echo "\t<meta http-equiv=\"Refresh\" content=\"{$p_time};URL={$t_url}\" />\n";
    return true;
}
示例#6
0
/**
 * Return the current project id as stored in a cookie, in an Array
 * If no cookie exists, the user's default project is returned
 * If the current project is a subproject, the return value will include
 * any parent projects
 * @return array
 */
function helper_get_current_project_trace()
{
    $t_cookie_name = config_get('project_cookie');
    $t_project_id = gpc_get_cookie($t_cookie_name, null);
    if (null === $t_project_id) {
        $t_bottom = current_user_get_pref('default_project');
        $t_parent = $t_bottom;
        $t_project_id = array($t_bottom);
        while (true) {
            $t_parent = project_hierarchy_get_parent($t_parent);
            if (0 == $t_parent) {
                break;
            }
            array_unshift($t_project_id, $t_parent);
        }
    } else {
        $t_project_id = explode(';', $t_project_id);
        $t_bottom = $t_project_id[count($t_project_id) - 1];
    }
    if (!project_exists($t_bottom) || 0 == project_get_field($t_bottom, 'enabled') || !access_has_project_level(VIEWER, $t_bottom)) {
        $t_project_id = array(ALL_PROJECTS);
    }
    return $t_project_id;
}
示例#7
0
$t_page_count = null;
$rows = filter_get_bug_rows($f_page_number, $t_per_page, $t_page_count, $t_bug_count, null, null, null, true);
if ($rows === false) {
    print_header_redirect('view_all_set.php?type=0');
}
$t_bugslist = array();
$t_users_handlers = array();
$t_project_ids = array();
$t_row_count = count($rows);
for ($i = 0; $i < $t_row_count; $i++) {
    array_push($t_bugslist, $rows[$i]->id);
    $t_users_handlers[] = $rows[$i]->handler_id;
    $t_project_ids[] = $rows[$i]->project_id;
}
$t_unique_users_handlers = array_unique($t_users_handlers);
$t_unique_project_ids = array_unique($t_project_ids);
user_cache_array_rows($t_unique_users_handlers);
project_cache_array_rows($t_unique_project_ids);
gpc_set_cookie(config_get('bug_list_cookie'), implode(',', $t_bugslist));
compress_enable();
# don't index view issues pages
html_robots_noindex();
html_page_top1(lang_get('view_bugs_link'));
if (current_user_get_pref('refresh_delay') > 0) {
    html_meta_redirect('view_all_bug_page.php?page_number=' . $f_page_number, current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
print_recently_visited();
define('VIEW_ALL_INC_ALLOW', true);
include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'view_all_inc.php';
html_page_bottom();
示例#8
0
/**
 * (6) Print an HTML meta tag to redirect to another page
 * This function is optional and may be called by pages that need a redirect.
 * $p_time is the number of seconds to wait before redirecting.
 * If we have handled any errors on this page return false and don't redirect.
 *
 * @param string  $p_url      The page to redirect: has to be a relative path.
 * @param integer $p_time     Seconds to wait for before redirecting.
 * @param boolean $p_sanitize Apply string_sanitize_url to passed URL.
 * @return boolean
 */
function html_meta_redirect($p_url, $p_time = null, $p_sanitize = true)
{
    if (ON == config_get_global('stop_on_errors') && error_handled()) {
        return false;
    }
    if (null === $p_time) {
        $p_time = current_user_get_pref('redirect_delay');
    }
    $t_url = config_get('path');
    if ($p_sanitize) {
        $t_url .= string_sanitize_url($p_url);
    } else {
        $t_url .= $p_url;
    }
    $t_url = htmlspecialchars($t_url);
    echo "\t" . '<meta http-equiv="Refresh" content="' . $p_time . ';URL=' . $t_url . '" />' . "\n";
    return true;
}
 * MantisBT Core API's
 */
require_once 'core.php';
require_once 'compress_api.php';
require_once 'filter_api.php';
require_once 'last_visited_api.php';
auth_ensure_user_authenticated();
$t_current_user_id = auth_get_current_user_id();
# Improve performance by caching category data in one pass
category_get_all_rows(helper_get_current_project());
compress_enable();
# don't index my view page
html_robots_noindex();
html_page_top1(lang_get('my_view_link'));
if (current_user_get_pref('refresh_delay') > 0) {
    html_meta_redirect('my_view_page.php', current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
#modifié le 09/08/2012
if (!current_user_is_anonymous()) {
    $t_current_user_id = auth_get_current_user_id();
    $t_hide_status = config_get('bug_resolved_status_threshold');
    echo '<div class="quick-summary-left">';
    echo lang_get('open_and_assigned_to_me') . ': ';
    print_link("view_all_set.php?type=1&handler_id={$t_current_user_id}&hide_status={$t_hide_status}", current_user_get_assigned_open_bug_count(), false, 'subtle');
    echo '</div>';
    echo '<div class="quick-summary-right">';
    echo lang_get('open_and_reported_to_me') . ': ';
    print_link("view_all_set.php?type=1&reporter_id={$t_current_user_id}&hide_status={$t_hide_status}", current_user_get_reported_open_bug_count(), false, 'subtle');
    echo '</div>';
    echo '<div class="quick-summary-left">';
示例#10
0
$t_bugslist = array();
$t_users_handlers = array();
$t_project_ids = array();
$t_row_count = count($t_rows);
for ($i = 0; $i < $t_row_count; $i++) {
    array_push($t_bugslist, $t_rows[$i]->id);
    $t_users_handlers[] = $t_rows[$i]->handler_id;
    $t_project_ids[] = $t_rows[$i]->project_id;
}
$t_unique_users_handlers = array_unique($t_users_handlers);
$t_unique_project_ids = array_unique($t_project_ids);
user_cache_array_rows($t_unique_users_handlers);
project_cache_array_rows($t_unique_project_ids);
gpc_set_cookie(config_get('bug_list_cookie'), implode(',', $t_bugslist));
compress_enable();
# don't index view issues pages
html_robots_noindex();
html_page_top1(lang_get('view_bugs_link'));
if (current_user_get_pref('refresh_delay') > 0) {
    $t_query = '?';
    if ($f_page_number > 1) {
        $t_query .= 'page_number=' . $f_page_number . '&';
    }
    $t_query .= 'refresh=true';
    html_meta_redirect('view_all_bug_page.php' . $t_query, current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
print_recently_visited();
define('VIEW_ALL_INC_ALLOW', true);
include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'view_all_inc.php';
html_page_bottom();