/** * List projects that the current user has access to. * * @param integer $p_project_id The current project id or null to use cookie. * @param bool $p_include_all_projects true: include "All Projects", otherwise false. * @param mixed $p_filter_project_id The id of a project to exclude or null. * @param string $p_trace The current project trace, identifies the sub-project via a path from top to bottom. * @return void */ function print_project_option_list($p_project_id = null, $p_include_all_projects = true, $p_filter_project_id = null, $p_trace = false) { $t_project_ids = current_user_get_accessible_projects(); project_cache_array_rows($t_project_ids); if ($p_include_all_projects) { echo '<option value="' . ALL_PROJECTS . '"'; if ($p_project_id !== null) { check_selected((int) $p_project_id, ALL_PROJECTS); } echo '>' . lang_get('all_projects') . '</option>' . "\n"; } $t_project_count = count($t_project_ids); for ($i = 0; $i < $t_project_count; $i++) { $t_id = $t_project_ids[$i]; if ($t_id != $p_filter_project_id) { echo '<option value="' . $t_id . '"'; if ($p_project_id !== null) { check_selected((int) $p_project_id, $t_id); } echo '>' . string_attribute(project_get_field($t_id, 'name')) . '</option>' . "\n"; print_subproject_option_list($t_id, $p_project_id, $p_filter_project_id, $p_trace, array()); } } }
$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();
/** * List projects that the current user has access to. * * @param integer $p_project_id The current project id or null to use cookie. * @param boolean $p_include_all_projects True: include "All Projects", otherwise false. * @param integer|null $p_filter_project_id The id of a project to exclude or null. * @param string|boolean $p_trace The current project trace, identifies the sub-project via a path from top to bottom. * @param boolean $p_can_report_only If true, disables projects in which user can't report issues; defaults to false (all projects enabled). * @return void */ function print_project_option_list($p_project_id = null, $p_include_all_projects = true, $p_filter_project_id = null, $p_trace = false, $p_can_report_only = false) { $t_user_id = auth_get_current_user_id(); $t_project_ids = user_get_accessible_projects($t_user_id); $t_can_report = true; project_cache_array_rows($t_project_ids); if ($p_include_all_projects && $p_filter_project_id !== ALL_PROJECTS) { echo '<option value="' . ALL_PROJECTS . '"'; if ($p_project_id !== null) { check_selected($p_project_id, ALL_PROJECTS, false); } echo '>' . lang_get('all_projects') . '</option>' . "\n"; } foreach ($t_project_ids as $t_id) { if ($p_can_report_only) { $t_report_bug_threshold = config_get('report_bug_threshold', null, $t_user_id, $t_id); $t_can_report = access_has_project_level($t_report_bug_threshold, $t_id, $t_user_id); } echo '<option value="' . $t_id . '"'; check_selected($p_project_id, $t_id, false); check_disabled($t_id == $p_filter_project_id || !$t_can_report); echo '>' . string_attribute(project_get_field($t_id, 'name')) . '</option>' . "\n"; print_subproject_option_list($t_id, $p_project_id, $p_filter_project_id, $p_trace, $p_can_report_only); } }
/** * List projects that the current user has access to * @param integer $p_parent_id A parent project identifier. * @param integer $p_project_id A project identifier. * @param integer $p_filter_project_id A filter project identifier. * @param boolean $p_trace Whether to trace parent projects. * @param boolean $p_can_report_only If true, disables projects in which user can't report issues; defaults to false (all projects enabled). * @param array $p_parents Array of parent projects. * @return void */ function print_subproject_option_list($p_parent_id, $p_project_id = null, $p_filter_project_id = null, $p_trace = false, $p_can_report_only = false, array $p_parents = array()) { if (config_get('subprojects_enabled') == OFF) { return; } array_push($p_parents, $p_parent_id); $t_user_id = auth_get_current_user_id(); $t_project_ids = user_get_accessible_subprojects($t_user_id, $p_parent_id); project_cache_array_rows($t_project_ids); $t_can_report = true; foreach ($t_project_ids as $t_id) { if ($p_can_report_only) { $t_report_bug_threshold = config_get('report_bug_threshold', null, $t_user_id, $t_id); $t_can_report = access_has_project_level($t_report_bug_threshold, $t_id, $t_user_id); } if ($p_trace) { $t_full_id = join($p_parents, ';') . ';' . $t_id; } else { $t_full_id = $t_id; } echo '<option value="' . $t_full_id . '"'; check_selected($p_project_id, $t_full_id, false); check_disabled($t_id == $p_filter_project_id || !$t_can_report); echo '>' . str_repeat(' ', count($p_parents)) . str_repeat('»', count($p_parents)) . ' ' . string_attribute(project_get_field($t_id, 'name')) . '</option>' . "\n"; print_subproject_option_list($t_id, $p_project_id, $p_filter_project_id, $p_trace, $p_can_report_only, $p_parents); } }