当前位置: 首页>>代码示例>>PHP>>正文


PHP current_user_get_bug_filter函数代码示例

本文整理汇总了PHP中current_user_get_bug_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP current_user_get_bug_filter函数的具体用法?PHP current_user_get_bug_filter怎么用?PHP current_user_get_bug_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了current_user_get_bug_filter函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: current_user_get_bug_filter

    $t_incr = 60 * 60;
    // less than 14 days, use hourly
} else {
    if ($t_interval_days <= 92) {
        $t_incr = 24 * 60 * 60;
        // less than three months, use daily
    } else {
        $t_incr = 7 * 24 * 60 * 60;
        // otherwise weekly
    }
}
$f_page_number = 1;
$t_per_page = -1;
$t_bug_count = null;
$t_page_count = 0;
$t_filter = current_user_get_bug_filter();
$t_filter['_view_type'] = 'advanced';
$t_filter['show_status'] = array(META_FILTER_ANY);
$t_filter['sort'] = '';
$rows = filter_get_bug_rows($f_page_number, $t_per_page, $t_page_count, $t_bug_count, $t_filter, null, null, true);
if (count($rows) == 0) {
    // no data to graph
    exit;
}
$t_bug_table = db_get_table('mantis_bug_table');
$t_bug_hist_table = db_get_table('mantis_bug_history_table');
$t_marker = array();
$t_data = array();
$t_ptr = 0;
$t_end = $t_interval->get_end_timestamp();
$t_start = $t_interval->get_start_timestamp();
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:31,代码来源:bug_graph_bystatus.php

示例2: filter_draw_selection_area2

/**
 * Prints the filter selection area for both the bug list view screen and
 * the bug list print screen. This function was an attempt to make it easier to
 * add new filters and rearrange them on screen for both pages.
 * @param integer $p_page_number Page number.
 * @param boolean $p_for_screen  Whether output is for screen view.
 * @param boolean $p_expanded    Whether to display expanded.
 * @return void
 */
function filter_draw_selection_area2($p_page_number, $p_for_screen = true, $p_expanded = true)
{
    $t_form_name_suffix = $p_expanded ? '_open' : '_closed';
    $t_filter = current_user_get_bug_filter();
    $t_filter = filter_ensure_valid_filter($t_filter === false ? array() : $t_filter);
    $t_project_id = helper_get_current_project();
    $t_page_number = (int) $p_page_number;
    $t_view_type = $t_filter['_view_type'];
    $t_tdclass = 'small-caption';
    $t_trclass = 'row-category2';
    $t_action = 'view_all_set.php?f=3';
    if ($p_for_screen == false) {
        $t_tdclass = 'print';
        $t_trclass = '';
        $t_action = 'view_all_set.php';
    }
    ?>

	<div class="filter-box">
		<form method="post" name="filters<?php 
    echo $t_form_name_suffix;
    ?>
" id="filters_form<?php 
    echo $t_form_name_suffix;
    ?>
" action="<?php 
    echo $t_action;
    ?>
">
		<?php 
    # CSRF protection not required here - form does not result in modifications
    ?>
		<input type="hidden" name="type" value="1" />
		<?php 
    if ($p_for_screen == false) {
        echo '<input type="hidden" name="print" value="1" />';
        echo '<input type="hidden" name="offset" value="0" />';
    }
    ?>
		<input type="hidden" name="page_number" value="<?php 
    echo $t_page_number;
    ?>
" />
		<input type="hidden" name="view_type" value="<?php 
    echo $t_view_type;
    ?>
" />
		<?php 
    $t_filter_cols = config_get('filter_custom_fields_per_row');
    if ($p_expanded) {
        ?>
		<table width="100%" cellspacing="1">
		<?php 
        $t_custom_cols = $t_filter_cols;
        $t_current_user_access_level = current_user_get_access_level();
        $t_accessible_custom_fields_ids = array();
        $t_accessible_custom_fields_names = array();
        $t_accessible_custom_fields_values = array();
        $t_num_custom_rows = 0;
        $t_per_row = 0;
        if (ON == config_get('filter_by_custom_fields')) {
            $t_custom_fields = custom_field_get_linked_ids($t_project_id);
            foreach ($t_custom_fields as $t_cfid) {
                $t_field_info = custom_field_cache_row($t_cfid, true);
                if ($t_field_info['access_level_r'] <= $t_current_user_access_level && $t_field_info['filter_by']) {
                    $t_accessible_custom_fields_ids[] = $t_cfid;
                    $t_accessible_custom_fields_names[] = $t_field_info['name'];
                    $t_accessible_custom_fields_types[] = $t_field_info['type'];
                    $t_accessible_custom_fields_values[] = custom_field_distinct_values($t_field_info);
                }
            }
            if (count($t_accessible_custom_fields_ids) > 0) {
                $t_per_row = config_get('filter_custom_fields_per_row');
                $t_num_custom_rows = ceil(count($t_accessible_custom_fields_ids) / $t_per_row);
            }
        }
        $t_filters_url = 'view_filters_page.php?for_screen=' . $p_for_screen;
        if ('advanced' == $t_view_type) {
            $t_filters_url = $t_filters_url . '&amp;view_type=advanced';
        }
        $t_filters_url = $t_filters_url . '&amp;target_field=';
        $t_show_product_version = version_should_show_product_version($t_project_id);
        $t_show_build = $t_show_product_version && config_get('enable_product_build') == ON;
        # overload handler_id setting if user isn't supposed to see them (ref #6189)
        if (!access_has_any_project(config_get('view_handler_threshold'))) {
            $t_filter[FILTER_PROPERTY_HANDLER_ID] = array(META_FILTER_ANY);
        }
        $t_dynamic_filter_expander_class = config_get('use_dynamic_filters') ? ' class="dynamic-filter-expander"' : '';
        ?>

		<tr <?php 
//.........这里部分代码省略.........
开发者ID:vipjaven,项目名称:mantisbt,代码行数:101,代码来源:filter_api.php

示例3: html_status_legend

/**
 * Print the color legend for the status colors
 * @param string
 * @return null
 */
function html_status_legend()
{
    # Don't show the legend if only one status is selected by the current filter
    $t_current_filter = current_user_get_bug_filter();
    if ($t_current_filter === false) {
        $t_current_filter = filter_get_default();
    }
    $t_simple_filter = $t_current_filter['_view_type'] == 'simple';
    if ($t_simple_filter) {
        if (!filter_field_is_any($t_current_filter[FILTER_PROPERTY_STATUS][0])) {
            return null;
        }
    }
    $t_status_array = MantisEnum::getAssocArrayIndexedByValues(config_get('status_enum_string'));
    $t_status_names = MantisEnum::getAssocArrayIndexedByValues(lang_get('status_enum_string'));
    $enum_count = count($t_status_array);
    # read through the list and eliminate unused ones for the selected project
    # assumes that all status are are in the enum array
    $t_workflow = config_get('status_enum_workflow');
    if (!empty($t_workflow)) {
        foreach ($t_status_array as $t_status => $t_name) {
            if (!isset($t_workflow[$t_status])) {
                # drop elements that are not in the workflow
                unset($t_status_array[$t_status]);
            }
        }
    }
    # Remove status values that won't appear as a result of the current filter
    foreach ($t_status_array as $t_status => $t_name) {
        if ($t_simple_filter) {
            if (!filter_field_is_none($t_current_filter[FILTER_PROPERTY_HIDE_STATUS][0]) && $t_status >= $t_current_filter[FILTER_PROPERTY_HIDE_STATUS][0]) {
                unset($t_status_array[$t_status]);
            }
        } else {
            if (!in_array(META_FILTER_ANY, $t_current_filter[FILTER_PROPERTY_STATUS]) && !in_array($t_status, $t_current_filter[FILTER_PROPERTY_STATUS])) {
                unset($t_status_array[$t_status]);
            }
        }
    }
    # If there aren't at least two statuses showable by the current filter,
    # don't draw the status bar
    if (count($t_status_array) <= 1) {
        return null;
    }
    echo '<br />';
    echo '<table class="status-legend width100" cellspacing="1">';
    echo '<tr>';
    # draw the status bar
    $width = (int) (100 / count($t_status_array));
    $t_status_enum_string = config_get('status_enum_string');
    foreach ($t_status_array as $t_status => $t_name) {
        $t_val = $t_status_names[$t_status];
        $t_status_label = MantisEnum::getLabel($t_status_enum_string, $t_status);
        echo "<td class=\"small-caption {$t_status_label}-color\">{$t_val}</td>";
    }
    echo '</tr>';
    echo '</table>';
    if (ON == config_get('status_percentage_legend')) {
        html_status_percentage_legend();
    }
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:66,代码来源:html_api.php

示例4: filter_draw_selection_area2

function filter_draw_selection_area2($p_page_number, $p_for_screen = true, $p_expanded = true)
{
    $t_form_name_suffix = $p_expanded ? '_open' : '_closed';
    $t_filter = current_user_get_bug_filter();
    $t_filter = filter_ensure_valid_filter($t_filter);
    $t_project_id = helper_get_current_project();
    $t_page_number = (int) $p_page_number;
    $t_view_type = $t_filter['_view_type'];
    $t_tdclass = 'small-caption';
    $t_trclass = 'row-category2';
    $t_action = 'view_all_set.php?f=3';
    if ($p_for_screen == false) {
        $t_tdclass = 'print';
        $t_trclass = '';
        $t_action = 'view_all_set.php';
    }
    ?>

		<br />
		<form method="post" name="filters<?php 
    echo $t_form_name_suffix;
    ?>
" id="filters_form<?php 
    echo $t_form_name_suffix;
    ?>
" action="<?php 
    print $t_action;
    ?>
">
		<input type="hidden" name="type" value="1" />
		<?php 
    if ($p_for_screen == false) {
        print '<input type="hidden" name="print" value="1" />';
        print '<input type="hidden" name="offset" value="0" />';
    }
    ?>
		<input type="hidden" name="page_number" value="<?php 
    print $t_page_number;
    ?>
" />
		<input type="hidden" name="view_type" value="<?php 
    print $t_view_type;
    ?>
" />
		<table class="width100" cellspacing="1">

		<?php 
    $t_filter_cols = config_get('filter_custom_fields_per_row');
    if ($p_expanded) {
        $t_custom_cols = $t_filter_cols;
        $t_current_user_access_level = current_user_get_access_level();
        $t_accessible_custom_fields_ids = array();
        $t_accessible_custom_fields_names = array();
        $t_accessible_custom_fields_values = array();
        $t_num_custom_rows = 0;
        $t_per_row = 0;
        if (ON == config_get('filter_by_custom_fields')) {
            $t_custom_fields = custom_field_get_linked_ids($t_project_id);
            foreach ($t_custom_fields as $t_cfid) {
                $t_field_info = custom_field_cache_row($t_cfid, true);
                if ($t_field_info['access_level_r'] <= $t_current_user_access_level) {
                    $t_accessible_custom_fields_ids[] = $t_cfid;
                    $t_accessible_custom_fields_names[] = $t_field_info['name'];
                    $t_accessible_custom_fields_types[] = $t_field_info['type'];
                    $t_accessible_custom_fields_values[] = custom_field_distinct_values($t_cfid);
                }
            }
            if (count($t_accessible_custom_fields_ids) > 0) {
                $t_per_row = config_get('filter_custom_fields_per_row');
                $t_num_custom_rows = ceil(count($t_accessible_custom_fields_ids) / $t_per_row);
            }
        }
        $t_filters_url = 'view_filters_page.php?for_screen=' . $p_for_screen;
        if ('advanced' == $t_view_type) {
            $t_filters_url = $t_filters_url . '&amp;view_type=advanced';
        }
        $t_filters_url = $t_filters_url . '&amp;target_field=';
        $t_show_version = ON == config_get('show_product_version') || AUTO == config_get('show_product_version') && count(version_get_all_rows_with_subs($t_project_id)) > 0;
        # overload handler_id setting if user isn't supposed to see them (ref #6189)
        if (!access_has_project_level(config_get('view_handler_threshold'), $t_project_id)) {
            $t_filter['handler_id'] = array(META_FILTER_ANY);
        }
        ?>

		<tr <?php 
        print "class=\"" . $t_trclass . "\"";
        ?>
>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'reporter_id[]';
        ?>
" id="reporter_id_filter"><?php 
        print lang_get('reporter');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'user_monitor[]';
//.........这里部分代码省略.........
开发者ID:amjadtbssm,项目名称:website,代码行数:101,代码来源:filter_api.php

示例5: filter_draw_selection_area2

/**
 *  Prints the filter selection area for both the bug list view screen and
 *  the bug list print screen. This function was an attempt to make it easier to
 *  add new filters and rearrange them on screen for both pages.
 * @param int $p_page_number
 * @param bool $p_for_screen
 * @param bool $p_expanded
 */
function filter_draw_selection_area2($p_page_number, $p_for_screen = true, $p_expanded = true)
{
    $t_form_name_suffix = $p_expanded ? '_open' : '_closed';
    $t_filter = current_user_get_bug_filter();
    $t_filter = filter_ensure_valid_filter($t_filter);
    $t_project_id = helper_get_current_project();
    $t_page_number = (int) $p_page_number;
    $t_view_type = $t_filter['_view_type'];
    $t_tdclass = 'small-caption';
    $t_trclass = 'row-category2';
    $t_action = 'view_all_set.php?f=3';
    if ($p_for_screen == false) {
        $t_tdclass = 'print';
        $t_trclass = '';
        $t_action = 'view_all_set.php';
    }
    ?>

		<br />
		<form method="post" name="filters<?php 
    echo $t_form_name_suffix;
    ?>
" id="filters_form<?php 
    echo $t_form_name_suffix;
    ?>
" action="<?php 
    echo $t_action;
    ?>
">
		<?php 
    # CSRF protection not required here - form does not result in modifications
    ?>
		<input type="hidden" name="type" value="1" />
		<?php 
    if ($p_for_screen == false) {
        echo '<input type="hidden" name="print" value="1" />';
        echo '<input type="hidden" name="offset" value="0" />';
    }
    ?>
		<input type="hidden" name="page_number" value="<?php 
    echo $t_page_number;
    ?>
" />
		<input type="hidden" name="view_type" value="<?php 
    echo $t_view_type;
    ?>
" />
		<table class="width100" cellspacing="1">

		<?php 
    $t_filter_cols = config_get('filter_custom_fields_per_row');
    if ($p_expanded) {
        $t_custom_cols = $t_filter_cols;
        $t_current_user_access_level = current_user_get_access_level();
        $t_accessible_custom_fields_ids = array();
        $t_accessible_custom_fields_names = array();
        $t_accessible_custom_fields_values = array();
        $t_num_custom_rows = 0;
        $t_per_row = 0;
        if (ON == config_get('filter_by_custom_fields')) {
            $t_custom_fields = custom_field_get_linked_ids($t_project_id);
            foreach ($t_custom_fields as $t_cfid) {
                $t_field_info = custom_field_cache_row($t_cfid, true);
                if ($t_field_info['access_level_r'] <= $t_current_user_access_level && $t_field_info['filter_by']) {
                    $t_accessible_custom_fields_ids[] = $t_cfid;
                    $t_accessible_custom_fields_names[] = $t_field_info['name'];
                    $t_accessible_custom_fields_types[] = $t_field_info['type'];
                    $t_accessible_custom_fields_values[] = custom_field_distinct_values($t_field_info);
                }
            }
            if (count($t_accessible_custom_fields_ids) > 0) {
                $t_per_row = config_get('filter_custom_fields_per_row');
                $t_num_custom_rows = ceil(count($t_accessible_custom_fields_ids) / $t_per_row);
            }
        }
        $t_filters_url = 'view_filters_page.php?for_screen=' . $p_for_screen;
        if ('advanced' == $t_view_type) {
            $t_filters_url = $t_filters_url . '&amp;view_type=advanced';
        }
        $t_filters_url = $t_filters_url . '&amp;target_field=';
        $t_show_product_version = version_should_show_product_version($t_project_id);
        $t_show_build = $t_show_product_version && config_get('enable_product_build') == ON;
        # overload handler_id setting if user isn't supposed to see them (ref #6189)
        if (!access_has_project_level(config_get('view_handler_threshold'), $t_project_id)) {
            $t_filter[FILTER_PROPERTY_HANDLER_ID] = array(META_FILTER_ANY);
        }
        ?>

		<tr <?php 
        echo "class=\"" . $t_trclass . "\"";
        ?>
>
//.........这里部分代码省略.........
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:101,代码来源:filter_api.php

示例6: html_status_legend

/**
 * Print the color legend for the status colors at the requested position
 * @param int  $p_display_position   STATUS_LEGEND_POSITION_TOP or STATUS_LEGEND_POSITION_BOTTOM
 * @param bool $p_restrict_by_filter If true, only display status visible in current filter
 * @return void
 */
function html_status_legend($p_display_position, $p_restrict_by_filter = false)
{
    if ($p_restrict_by_filter) {
        # Don't show the legend if only one status is selected by the current filter
        $t_current_filter = current_user_get_bug_filter();
        if ($t_current_filter === false) {
            $t_current_filter = filter_get_default();
        }
        $t_simple_filter = $t_current_filter['_view_type'] == 'simple';
        if ($t_simple_filter) {
            if (!filter_field_is_any($t_current_filter[FILTER_PROPERTY_STATUS][0])) {
                return;
            }
        }
    }
    $t_status_array = MantisEnum::getAssocArrayIndexedByValues(config_get('status_enum_string'));
    $t_status_names = MantisEnum::getAssocArrayIndexedByValues(lang_get('status_enum_string'));
    # read through the list and eliminate unused ones for the selected project
    # assumes that all status are are in the enum array
    $t_workflow = config_get('status_enum_workflow');
    if (!empty($t_workflow)) {
        foreach ($t_status_array as $t_status => $t_name) {
            if (!isset($t_workflow[$t_status])) {
                # drop elements that are not in the workflow
                unset($t_status_array[$t_status]);
            }
        }
    }
    if ($p_restrict_by_filter) {
        # Remove status values that won't appear as a result of the current filter
        foreach ($t_status_array as $t_status => $t_name) {
            if ($t_simple_filter) {
                if (!filter_field_is_none($t_current_filter[FILTER_PROPERTY_HIDE_STATUS][0]) && $t_status >= $t_current_filter[FILTER_PROPERTY_HIDE_STATUS][0]) {
                    unset($t_status_array[$t_status]);
                }
            } else {
                if (!in_array(META_FILTER_ANY, $t_current_filter[FILTER_PROPERTY_STATUS]) && !in_array($t_status, $t_current_filter[FILTER_PROPERTY_STATUS])) {
                    unset($t_status_array[$t_status]);
                }
            }
        }
        # If there aren't at least two statuses showable by the current filter,
        # don't draw the status bar
        if (count($t_status_array) <= 1) {
            return;
        }
    }
    # Display the legend
    $t_legend_position = config_get('status_legend_position') & $p_display_position;
    if (STATUS_LEGEND_POSITION_NONE != $t_legend_position) {
        echo '<br />';
        echo '<table class="status-legend width100" cellspacing="1">';
        echo '<tr>';
        # draw the status bar
        foreach ($t_status_array as $t_status => $t_name) {
            $t_val = isset($t_status_names[$t_status]) ? $t_status_names[$t_status] : $t_status_array[$t_status];
            echo '<td class="small-caption status-legend-width ' . html_get_status_css_class($t_status) . '">' . $t_val . '</td>';
        }
        echo '</tr>';
        echo '</table>';
        if (ON == config_get('status_percentage_legend')) {
            html_status_percentage_legend();
        }
    }
    if (STATUS_LEGEND_POSITION_TOP == $t_legend_position) {
        echo '<br />';
    }
}
开发者ID:AsBilou,项目名称:mantisbt,代码行数:74,代码来源:html_api.php


注:本文中的current_user_get_bug_filter函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。