示例#1
0
/**
 * Print column title for a specific custom column.
 *
 * @param string $p_column Active column
 * @param object $p_column_object Column object
 * @param string $p_sort sort
 * @param string $p_dir direction
 * @param int $p_columns_target see COLUMNS_TARGET_* in constant_inc.php
 * @access public
 */
function print_column_title_plugin($p_column, $p_column_object, $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
    echo '<th class="column-plugin">';
    if ($p_column_object->sortable) {
        print_view_bug_sort_link(string_display_line($p_column_object->title), $p_column, $p_sort, $p_dir, $p_columns_target);
        print_sort_icon($p_dir, $p_sort, $p_column);
    } else {
        echo string_display_line($p_column_object->title);
    }
    echo '</th>';
}
	<td width="10%">
		<?php 
print_manage_project_sort_link('manage_proj_page.php', lang_get('enabled'), 'enabled', $t_direction, $f_sort);
print_sort_icon($t_direction, $f_sort, 'enabled');
?>
	</td>
	<td width="10%">
		<?php 
print_manage_project_sort_link('manage_proj_page.php', lang_get('view_status'), 'view_state', $t_direction, $f_sort);
print_sort_icon($t_direction, $f_sort, 'view_state');
?>
	</td>
	<td width="40%">
		<?php 
print_manage_project_sort_link('manage_proj_page.php', lang_get('description'), 'description', $t_direction, $f_sort);
print_sort_icon($t_direction, $f_sort, 'description');
?>
	</td>
</tr>
<?php 
$t_manage_project_threshold = config_get('manage_project_threshold');
$t_projects = user_get_accessible_projects(auth_get_current_user_id(), true);
$t_full_projects = array();
foreach ($t_projects as $t_project_id) {
    $t_full_projects[] = project_get_row($t_project_id);
}
$t_projects = multi_sort($t_full_projects, $f_sort, $t_direction);
$t_stack = array($t_projects);
while (0 < count($t_stack)) {
    $t_projects = array_shift($t_stack);
    if (0 == count($t_projects)) {
示例#3
0
function print_column_title_summary($p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
    if ($p_columns_target != COLUMNS_TARGET_CSV_PAGE) {
        echo '<td>';
        print_view_bug_sort_link(lang_get('summary'), 'summary', $p_sort, $p_dir, $p_columns_target);
        print_sort_icon($p_dir, $p_sort, 'summary');
        echo '</td>';
    } else {
        echo lang_get('summary');
    }
}
示例#4
0
/**
 * Print the title of a column given its name.
 *
 * @param string  $p_column         Custom_xxx for custom field xxx, or otherwise field name as in bug table.
 * @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
 * @return void
 */
function custom_function_default_print_column_title($p_column, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
    global $t_sort, $t_dir;
    $t_custom_field = column_get_custom_field_name($p_column);
    if ($t_custom_field !== null) {
        if (COLUMNS_TARGET_CSV_PAGE != $p_columns_target) {
            echo '<th class="column-custom-' . $t_custom_field . '">';
        }
        $t_field_id = custom_field_get_id_from_name($t_custom_field);
        if ($t_field_id === false) {
            echo '@', $t_custom_field, '@';
        } else {
            $t_def = custom_field_get_definition($t_field_id);
            $t_custom_field = lang_get_defaulted($t_def['name']);
            if (COLUMNS_TARGET_CSV_PAGE != $p_columns_target) {
                print_view_bug_sort_link($t_custom_field, $p_column, $t_sort, $t_dir, $p_columns_target);
                print_sort_icon($t_dir, $t_sort, $p_column);
            } else {
                echo $t_custom_field;
            }
        }
        if (COLUMNS_TARGET_CSV_PAGE != $p_columns_target) {
            echo '</th>';
        }
    } else {
        $t_plugin_columns = columns_get_plugin_columns();
        $t_function = 'print_column_title_' . $p_column;
        if (function_exists($t_function)) {
            $t_function($t_sort, $t_dir, $p_columns_target);
        } else {
            if (isset($t_plugin_columns[$p_column])) {
                $t_column_object = $t_plugin_columns[$p_column];
                print_column_title_plugin($p_column, $t_column_object, $t_sort, $t_dir, $p_columns_target);
            } else {
                echo '<th>';
                print_view_bug_sort_link(column_get_title($p_column), $p_column, $t_sort, $t_dir, $p_columns_target);
                print_sort_icon($t_dir, $t_sort, $p_column);
                echo '</th>';
            }
        }
    }
}
?>
	</td>
	<td>
		<?php 
print_manage_user_sort_link('manage_user_page.php', lang_get('date_created'), 'date_created', $c_dir, $c_sort, $c_hide);
?>
		<?php 
print_sort_icon($c_dir, $c_sort, 'date_created');
?>
	</td>
	<td>
		<?php 
print_manage_user_sort_link('manage_user_page.php', lang_get('last_visit'), 'last_visit', $c_dir, $c_sort, $c_hide);
?>
		<?php 
print_sort_icon($c_dir, $c_sort, 'last_visit');
?>
	</td>
</tr>
<?php 
for ($i = 0; $i < $user_count; $i++) {
    # prefix user data with u_
    $row = db_fetch_array($result);
    extract($row, EXTR_PREFIX_ALL, 'u');
    $u_date_created = date(config_get('normal_date_format'), db_unixtimestamp($u_date_created));
    $u_last_visit = date(config_get('normal_date_format'), db_unixtimestamp($u_last_visit));
    ?>
<tr <?php 
    echo helper_alternate_class($i);
    ?>
>
		<input type="submit" class="button" value="<?php 
echo lang_get('filter_button');
?>
" />
		</form>
	</td>
</tr>

<tr class="row-category">
<?php 
# Print column headers with sort links
$t_columns = array('username', 'realname', 'email', 'access_level', 'enabled', 'protected', 'date_created', 'last_visit');
foreach ($t_columns as $t_col) {
    echo "\t<td>";
    print_manage_user_sort_link('manage_user_page.php', lang_get($t_col), $t_col, $c_dir, $c_sort, $c_hide_inactive, $c_filter, $c_show_disabled);
    print_sort_icon($c_dir, $c_sort, $t_col);
    echo "</td>\n";
}
?>
</tr>

<?php 
$t_date_format = config_get('normal_date_format');
$t_access_level = array();
for ($i = 0; $i < $user_count; $i++) {
    # prefix user data with u_
    $row = db_fetch_array($result);
    extract($row, EXTR_PREFIX_ALL, 'u');
    $u_date_created = date($t_date_format, $u_date_created);
    $u_last_visit = date($t_date_format, $u_last_visit);
    if (!isset($t_access_level[$u_access_level])) {
function custom_function_default_print_column_title($p_column, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
    global $t_sort, $t_dir;
    if (strpos($p_column, 'custom_') === 0) {
        $t_custom_field = substr($p_column, 7);
        if (COLUMNS_TARGET_CSV_PAGE != $p_columns_target) {
            echo '<td>';
        }
        $t_field_id = custom_field_get_id_from_name($t_custom_field);
        if ($t_field_id === false) {
            echo '@', $t_custom_field, '@';
        } else {
            $t_def = custom_field_get_definition($t_field_id);
            $t_custom_field = lang_get_defaulted($t_def['name']);
            if (COLUMNS_TARGET_CSV_PAGE != $p_columns_target) {
                print_view_bug_sort_link($t_custom_field, $p_column, $t_sort, $t_dir, $p_columns_target);
                print_sort_icon($t_dir, $t_sort, $p_column);
            } else {
                echo $t_custom_field;
            }
        }
        if (COLUMNS_TARGET_CSV_PAGE != $p_columns_target) {
            echo '</td>';
        }
    } else {
        $t_function = 'print_column_title_' . $p_column;
        if (function_exists($t_function)) {
            $t_function($t_sort, $t_dir, $p_columns_target);
        } else {
            echo '<td>';
            print_view_bug_sort_link(lang_get_defaulted($p_column), $p_column, $t_sort, $t_dir, $p_columns_target);
            print_sort_icon($t_dir, $t_sort, $p_column);
            echo '</td>';
        }
    }
}