function wiki_xwiki_get_page_id_for_project($p_project_id) { if ($p_project_id == ALL_PROJECTS) { return config_get('wiki_root_namespace'); } else { $t_project_name = project_get_name($p_project_id); return $t_project_name; } }
function wiki_dokuwiki_get_page_id_for_project($p_project_id) { $t_home = 'start'; if ($p_project_id == ALL_PROJECTS) { return $t_home; } else { $t_project_name = project_get_name($p_project_id); return $t_project_name . ':' . $t_home; } }
function addExtraBugData($bug) { $bug["project_name"] = project_get_name($bug["project_id"]); if ($bug["reporter_id"] != "") { $bug["reporter_name"] = user_get_field($bug["reporter_id"], 'username'); } $bug["severity_name"] = get_enum_element('severity', $bug["severity"]); $bug["priority_name"] = get_enum_element('priority', $bug["priority"]); $bug["status_name"] = get_enum_element('status', $bug["status"]); $bug["reproducibility_name"] = get_enum_element('reproducibility', $bug["reproducibility"]); if ($bug["handler_id"] == "") { $bug["handler_name"] = user_get_field($bug["handler_id"], 'username'); } $bug["projection_name"] = get_enum_element('projection', $bug["projection"]); $bug["eta_name"] = get_enum_element('eta', $bug["eta"]); $bug["resolution_name"] = get_enum_element('resolution', $bug["resolution"]); $bug["description"] = bug_get_text_field($bug["id"], 'description'); return $bug; }
/** * Print column content for column project id * * @param BugData $p_bug bug object * @param int $p_columns_target see COLUMNS_TARGET_* in constant_inc.php * @return null * @access public */ function print_column_project_id($p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE) { echo '<td class="column-project-id">'; echo string_display_line(project_get_name($p_bug->project_id)); echo '</td>'; }
/** * 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 . '&view_type=advanced'; } $t_filters_url = $t_filters_url . '&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 echo 'class="' . $t_trclass . '"'; ?> > <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_REPORTER_ID . '[]'; ?> " id="reporter_id_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('reporter_label'); ?> </a> </td> <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_MONITOR_USER_ID . '[]'; ?> " id="user_monitor_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('monitored_by_label'); ?> </a> </td> <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_HANDLER_ID . '[]'; ?> " id="handler_id_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('assigned_to_label'); ?> </a> </td> <td colspan="2" class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_CATEGORY_ID . '[]'; ?> " id="show_category_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('category_label'); ?> </a> </td> <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_SEVERITY . '[]'; ?> " id="show_severity_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('severity_label'); ?> </a> </td> <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_RESOLUTION . '[]'; ?> " id="show_resolution_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('resolution_label'); ?> </a> </td> <td class="small-caption"> <?php if (ON == config_get('enable_profiles')) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_PROFILE_ID . '[]'; ?> " id="show_profile_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('profile_label'); ?> </a> <?php } ?> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr class="row-1"> <td class="small-caption" id="reporter_id_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_REPORTER_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_REPORTER_ID] as $t_current) { $t_this_name = ''; echo '<input type="hidden" name="', FILTER_PROPERTY_REPORTER_ID, '[]" value="', string_attribute($t_current), '" />'; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_myself($t_current)) { if (access_has_project_level(config_get('report_bug_threshold'))) { $t_this_name = '[' . lang_get('myself') . ']'; } else { $t_any_found = true; } } else { if (filter_field_is_none($t_current)) { $t_this_name = lang_get('none'); } else { $t_this_name = user_get_name($t_current); } } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_name); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <td class="small-caption" id="user_monitor_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_MONITOR_USER_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_MONITOR_USER_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_MONITOR_USER_ID, '[]" value="', string_attribute($t_current), '" />'; $t_this_name = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_myself($t_current)) { if (access_has_project_level(config_get('monitor_bug_threshold'))) { $t_this_name = '[' . lang_get('myself') . ']'; } else { $t_any_found = true; } } else { $t_this_name = user_get_name($t_current); } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_name); } if (true == $t_any_found) { echo lang_get('any'); } else { echo string_display($t_output); } } ?> </td> <td class="small-caption" id="handler_id_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_HANDLER_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_HANDLER_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_HANDLER_ID, '[]" value="', string_attribute($t_current), '" />'; $t_this_name = ''; if (filter_field_is_none($t_current)) { $t_this_name = lang_get('none'); } else { if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_myself($t_current)) { if (access_has_project_level(config_get('handle_bug_threshold'))) { $t_this_name = '[' . lang_get('myself') . ']'; } else { $t_any_found = true; } } else { $t_this_name = user_get_name($t_current); } } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_name); } if (true == $t_any_found) { echo lang_get('any'); } else { echo string_display($t_output); } } ?> </td> <td colspan="2" class="small-caption" id="show_category_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_CATEGORY_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_CATEGORY_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_CATEGORY_ID, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { $t_this_string = $t_current; } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <td class="small-caption" id="show_severity_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_SEVERITY]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_SEVERITY] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_SEVERITY, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { $t_this_string = get_enum_element('severity', $t_current); } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <td class="small-caption" id="show_resolution_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_RESOLUTION]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_RESOLUTION] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_RESOLUTION, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { $t_this_string = get_enum_element('resolution', $t_current); } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <?php if (ON == config_get('enable_profiles')) { ?> <td class="small-caption" id="show_profile_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_PROFILE_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_PROFILE_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_PROFILE_ID, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { $t_profile = profile_get_row_direct($t_current); $t_this_string = $t_profile['platform'] . ' ' . $t_profile['os'] . ' ' . $t_profile['os_build']; } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <?php } else { ?> <td></td> <?php } if ($t_filter_cols > 8) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr <?php echo 'class="' . $t_trclass . '"'; ?> > <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_STATUS . '[]'; ?> " id="show_status_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('status_label'); ?> </a> </td> <td class="small-caption"> <?php if ('simple' == $t_view_type) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_HIDE_STATUS . '[]'; ?> " id="hide_status_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('hide_status_label'); ?> </a> <?php } ?> </td> <td class="small-caption"> <?php if ($t_show_build) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_BUILD . '[]'; ?> " id="show_build_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('product_build_label'); ?> </a> <?php } ?> </td> <?php if ($t_show_product_version) { ?> <td colspan="2" class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_VERSION . '[]'; ?> " id="show_version_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('product_version_label'); ?> </a> </td> <td colspan="1" class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_FIXED_IN_VERSION . '[]'; ?> " id="show_fixed_in_version_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('fixed_in_version_label'); ?> </a> </td> <?php } else { ?> <td colspan="2" class="small-caption">   </td> <td colspan="1" class="small-caption">   </td> <?php } ?> <td colspan="1" class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_PRIORITY . '[]'; ?> " id="show_priority_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('priority_label'); ?> </a> </td> <?php if ($t_show_product_version) { ?> <td colspan="1" class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_TARGET_VERSION . '[]'; ?> " id="show_target_version_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('target_version_label'); ?> </a> </td> <?php } else { ?> <td colspan="1" class="small-caption">   </td> <?php } if ($t_filter_cols > 8) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 7) . '"> </td>'; } ?> </tr> <tr class="row-1"> <td class="small-caption" id="show_status_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_STATUS]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_STATUS] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_STATUS, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { $t_this_string = get_enum_element('status', $t_current); } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <td class="small-caption" id="hide_status_filter_target"> <?php if ('simple' == $t_view_type) { $t_output = ''; $t_none_found = false; if (count($t_filter[FILTER_PROPERTY_HIDE_STATUS]) == 0) { echo lang_get('none'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_HIDE_STATUS] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_HIDE_STATUS, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_none($t_current)) { $t_none_found = true; } else { $t_this_string = get_enum_element('status', $t_current); } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } $t_hide_status_post = ''; if (count($t_filter[FILTER_PROPERTY_HIDE_STATUS]) == 1) { $t_hide_status_post = ' (' . lang_get('and_above') . ')'; } if (true == $t_none_found) { echo lang_get('none'); } else { echo $t_output . string_display_line($t_hide_status_post); } } } ?> </td> <?php if ($t_show_build) { ?> <td class="small-caption" id="show_build_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_BUILD]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_BUILD] as $t_current) { $t_current = stripslashes($t_current); echo '<input type="hidden" name="', FILTER_PROPERTY_BUILD, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_none($t_current)) { $t_this_string = lang_get('none'); } else { $t_this_string = $t_current; } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <?php } else { ?> <td class="small-caption"></td> <?php } if ($t_show_product_version) { ?> <td colspan="2" class="small-caption" id="show_version_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_VERSION]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_VERSION] as $t_current) { $t_current = stripslashes($t_current); echo '<input type="hidden" name="', FILTER_PROPERTY_VERSION, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_none($t_current)) { $t_this_string = lang_get('none'); } else { $t_this_string = $t_current; } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <td colspan="1" class="small-caption" id="show_fixed_in_version_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_FIXED_IN_VERSION]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_FIXED_IN_VERSION] as $t_current) { $t_current = stripslashes($t_current); echo '<input type="hidden" name="', FILTER_PROPERTY_FIXED_IN_VERSION, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_none($t_current)) { $t_this_string = lang_get('none'); } else { $t_this_string = $t_current; } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <?php } else { ?> <td colspan="2" class="small-caption">   </td> <td colspan="1" class="small-caption">   </td> <?php } ?> <td colspan="1" class="small-caption" id="show_priority_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_PRIORITY]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_PRIORITY] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_PRIORITY, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { $t_this_string = get_enum_element('priority', $t_current); } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <?php if ($t_show_product_version) { ?> <td colspan="1" class="small-caption" id="show_target_version_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_TARGET_VERSION]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_TARGET_VERSION] as $t_current) { $t_current = stripslashes($t_current); echo '<input type="hidden" name="', FILTER_PROPERTY_TARGET_VERSION, '[]" value="', string_attribute($t_current), '" />'; $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_none($t_current)) { $t_this_string = lang_get('none'); } else { $t_this_string = $t_current; } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <?php } else { ?> <td colspan="1" class="small-caption">   </td> <?php } if ($t_filter_cols > 8) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 7) . '"> </td>'; } ?> </tr> <tr <?php echo 'class="' . $t_trclass . '"'; ?> > <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_ISSUES_PER_PAGE; ?> " id="per_page_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('show_label'); ?> </a> </td> <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_VIEW_STATE; ?> " id="view_state_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('view_status_label'); ?> </a> </td> <td class="small-caption"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_STICKY; ?> " id="sticky_issues_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('sticky_label'); ?> </a> </td> <td class="small-caption" colspan="2"> </td> <td class="small-caption" > <a href="<?php echo $t_filters_url . FILTER_PROPERTY_FILTER_BY_DATE; ?> " id="do_filter_by_date_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('use_date_filters_label'); ?> </a> </td> <td class="small-caption" colspan="2"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_RELATIONSHIP_TYPE; ?> " id="relationship_type_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('bug_relationships_label'); ?> </a> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr class="row-1"> <td class="small-caption" id="per_page_filter_target"> <?php echo $t_filter[FILTER_PROPERTY_ISSUES_PER_PAGE] == 0 ? lang_get('all') : string_display_line($t_filter[FILTER_PROPERTY_ISSUES_PER_PAGE]); echo '<input type="hidden" name="', FILTER_PROPERTY_ISSUES_PER_PAGE, '" value="', string_attribute($t_filter[FILTER_PROPERTY_ISSUES_PER_PAGE]), '" />'; ?> </td> <td class="small-caption" id="view_state_filter_target"> <?php if (VS_PUBLIC === $t_filter[FILTER_PROPERTY_VIEW_STATE]) { echo lang_get('public'); } else { if (VS_PRIVATE === $t_filter[FILTER_PROPERTY_VIEW_STATE]) { echo lang_get('private'); } else { echo lang_get('any'); $t_filter[FILTER_PROPERTY_VIEW_STATE] = META_FILTER_ANY; } } echo '<input type="hidden" name="', FILTER_PROPERTY_VIEW_STATE, '" value="', string_attribute($t_filter[FILTER_PROPERTY_VIEW_STATE]), '" />'; ?> </td> <td class="small-caption" id="sticky_issues_filter_target"> <?php $t_sticky_filter_state = gpc_string_to_bool($t_filter[FILTER_PROPERTY_STICKY]); print $t_sticky_filter_state ? lang_get('yes') : lang_get('no'); ?> <input type="hidden" name="<?php echo FILTER_PROPERTY_STICKY; ?> " value="<?php echo $t_sticky_filter_state ? 'on' : 'off'; ?> " /> </td> <td class="small-caption" colspan="2">  </td> <td class="small-caption" id="do_filter_by_date_filter_target"> <?php if ('on' == $t_filter[FILTER_PROPERTY_FILTER_BY_DATE]) { echo '<input type="hidden" name="', FILTER_PROPERTY_FILTER_BY_DATE, '" value="', string_attribute($t_filter[FILTER_PROPERTY_FILTER_BY_DATE]), '" />'; echo '<input type="hidden" name="', FILTER_PROPERTY_START_MONTH, '" value="', string_attribute($t_filter[FILTER_PROPERTY_START_MONTH]), '" />'; echo '<input type="hidden" name="', FILTER_PROPERTY_START_DAY, '" value="', string_attribute($t_filter[FILTER_PROPERTY_START_DAY]), '" />'; echo '<input type="hidden" name="', FILTER_PROPERTY_START_YEAR, '" value="', string_attribute($t_filter[FILTER_PROPERTY_START_YEAR]), '" />'; echo '<input type="hidden" name="', FILTER_PROPERTY_END_MONTH, '" value="', string_attribute($t_filter[FILTER_PROPERTY_END_MONTH]), '" />'; echo '<input type="hidden" name="', FILTER_PROPERTY_END_DAY, '" value="', string_attribute($t_filter[FILTER_PROPERTY_END_DAY]), '" />'; echo '<input type="hidden" name="', FILTER_PROPERTY_END_YEAR, '" value="', string_attribute($t_filter[FILTER_PROPERTY_END_YEAR]), '" />'; $t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY); $t_time = mktime(0, 0, 0, $t_filter[FILTER_PROPERTY_START_MONTH], $t_filter[FILTER_PROPERTY_START_DAY], $t_filter[FILTER_PROPERTY_START_YEAR]); foreach ($t_chars as $t_char) { if (strcasecmp($t_char, 'M') == 0) { echo ' '; echo date('F', $t_time); } if (strcasecmp($t_char, 'D') == 0) { echo ' '; echo date('d', $t_time); } if (strcasecmp($t_char, 'Y') == 0) { echo ' '; echo date('Y', $t_time); } } echo ' - '; $t_time = mktime(0, 0, 0, $t_filter[FILTER_PROPERTY_END_MONTH], $t_filter[FILTER_PROPERTY_END_DAY], $t_filter[FILTER_PROPERTY_END_YEAR]); foreach ($t_chars as $t_char) { if (strcasecmp($t_char, 'M') == 0) { echo ' '; echo date('F', $t_time); } if (strcasecmp($t_char, 'D') == 0) { echo ' '; echo date('d', $t_time); } if (strcasecmp($t_char, 'Y') == 0) { echo ' '; echo date('Y', $t_time); } } } else { echo lang_get('no'); } ?> </td> <td class="small-caption" colspan="2" id="relationship_type_filter_target"> <?php echo '<input type="hidden" name="', FILTER_PROPERTY_RELATIONSHIP_TYPE, '" value="', string_attribute($t_filter[FILTER_PROPERTY_RELATIONSHIP_TYPE]), '" />'; echo '<input type="hidden" name="', FILTER_PROPERTY_RELATIONSHIP_BUG, '" value="', string_attribute($t_filter[FILTER_PROPERTY_RELATIONSHIP_BUG]), '" />'; $c_rel_type = $t_filter[FILTER_PROPERTY_RELATIONSHIP_TYPE]; $c_rel_bug = $t_filter[FILTER_PROPERTY_RELATIONSHIP_BUG]; if (-1 == $c_rel_type || 0 == $c_rel_bug) { echo lang_get('any'); } else { echo relationship_get_description_for_history($c_rel_type) . ' ' . $c_rel_bug; } ?> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr <?php echo 'class="' . $t_trclass . '"'; ?> > <td class="small-caption"> <?php if (ON == config_get('enable_profiles')) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_PLATFORM; ?> " id="platform_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('platform_label'); ?> </a> <?php } ?> </td> <td class="small-caption"> <?php if (ON == config_get('enable_profiles')) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_OS; ?> " id="os_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('os_label'); ?> </a> <?php } ?> </td> <td class="small-caption"> <?php if (ON == config_get('enable_profiles')) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_OS_BUILD; ?> " id="os_build_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('os_version_label'); ?> </a> <?php } ?> </td> <td class="small-caption" colspan="5"> <?php if (access_has_global_level(config_get('tag_view_threshold'))) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_TAG_STRING; ?> " id="tag_string_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('tags_label'); ?> </a> <?php } ?> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr class="row-1"> <?php if (ON == config_get('enable_profiles')) { ?> <td class="small-caption" id="platform_filter_target"> <?php print_multivalue_field(FILTER_PROPERTY_PLATFORM, $t_filter[FILTER_PROPERTY_PLATFORM]); ?> </td> <td class="small-caption" id="os_filter_target"> <?php print_multivalue_field(FILTER_PROPERTY_OS, $t_filter[FILTER_PROPERTY_OS]); ?> </td> <td class="small-caption" id="os_build_filter_target"> <?php print_multivalue_field(FILTER_PROPERTY_OS_BUILD, $t_filter[FILTER_PROPERTY_OS_BUILD]); ?> </td> <?php } else { ?> <td colspan="3"> </td> <?php } ?> <td class="small-caption" id="tag_string_filter_target" colspan="5"> <?php $t_tag_string = $t_filter[FILTER_PROPERTY_TAG_STRING]; if ($t_filter[FILTER_PROPERTY_TAG_SELECT] != 0 && tag_exists($t_filter[FILTER_PROPERTY_TAG_SELECT])) { $t_tag_string .= is_blank($t_tag_string) ? '' : config_get('tag_separator'); $t_tag_string .= tag_get_field($t_filter[FILTER_PROPERTY_TAG_SELECT], 'name'); } echo string_html_entities($t_tag_string); echo '<input type="hidden" name="', FILTER_PROPERTY_TAG_STRING, '" value="', string_attribute($t_tag_string), '" />'; ?> </td> </tr> <?php # get plugin filters $t_plugin_filters = filter_get_plugin_filters(); $t_plugin_filter_links = array(); $t_plugin_filter_fields = array(); $t_column_count_by_row = array(); $t_row = 0; foreach ($t_plugin_filters as $t_field_name => $t_filter_object) { # be sure the colspan is an integer $t_colspan = (int) $t_filter_object->colspan; # prevent silliness. if ($t_colspan < 0) { $t_colspan = abs($t_colspan); } else { if ($t_colspan > $t_filter_cols) { $t_colspan = $t_filter_cols; } else { if ($t_colspan == 0) { $t_colspan = 1; } } } # the row may already have elements in it. find out. $t_columns_available = $t_filter_cols - $t_column_count_by_row[$t_row]; if ($t_columns_available == 0) { $t_row++; } # see if there is room in the current row if ($t_columns_available >= $t_colspan) { $t_assigned_row = $t_row; $t_column_count_by_row[$t_row] += $t_colspan; } else { $t_is_assigned = false; # find a row with space foreach ($t_column_count_by_row as $t_row_num => $t_col_count) { if ($t_colspan <= $t_filter_cols - $t_col_count) { $t_assigned_row = $t_row_num; $t_column_count_by_row[$t_row_num] += $t_colspan; $t_is_assigned = true; break; } } if (!$t_is_assigned) { # no space was found in existing rows. Add a new row for it. $t_assigned_row = count($t_plugin_filter_links); $t_column_count_by_row[$t_assigned_row] = $t_colspan; } } $t_colspan_attr = $t_colspan > 1 ? 'colspan="' . $t_colspan . '" ' : ''; $t_plugin_filter_links[$t_assigned_row][] = '<td ' . $t_colspan_attr . 'class="small-caption"> <a href="' . $t_filters_url . string_attribute($t_field_name) . '" id="' . string_attribute($t_field_name) . '_filter">' . string_display_line($t_filter_object->title) . '</a> </td>'; $t_values = '<td ' . $t_colspan_attr . 'class="small-caption" id="' . string_attribute($t_field_name) . '_filter_target"> '; if (!isset($t_filter[$t_field_name])) { $t_values .= lang_get('any'); } else { switch ($t_filter_object->type) { case FILTER_TYPE_STRING: case FILTER_TYPE_INT: if (filter_field_is_any($t_filter[$t_field_name])) { $t_values .= lang_get('any'); } else { $t_values .= string_display_line($t_filter[$t_field_name]); } $t_values .= '<input type="hidden" name="' . string_attribute($t_field_name) . '" value="' . string_attribute($t_filter[$t_field_name]) . '"/>'; break; case FILTER_TYPE_BOOLEAN: $t_values .= string_display_line($t_filter_object->display((bool) $t_filter[$t_field_name])); $t_values .= '<input type="hidden" name="' . string_attribute($t_field_name) . '" value="' . (bool) $t_filter[$t_field_name] . '"/>'; break; case FILTER_TYPE_MULTI_STRING: case FILTER_TYPE_MULTI_INT: $t_first = true; $t_output = ''; if (!is_array($t_filter[$t_field_name])) { $t_filter[$t_field_name] = array($t_filter[$t_field_name]); } foreach ($t_filter[$t_field_name] as $t_current) { if (filter_field_is_any($t_current)) { $t_output .= lang_get('any'); } else { $t_output .= ($t_first ? '' : '<br/>') . string_display_line($t_filter_object->display($t_current)); $t_first = false; } $t_values .= '<input type="hidden" name="' . string_attribute($t_field_name) . '[]" value="' . string_attribute($t_current) . '"/>'; } $t_values .= $t_output; break; } } $t_values .= '</td>'; $t_plugin_filter_fields[$t_assigned_row][] = $t_values; } $t_row_count = count($t_plugin_filter_links); for ($i = 0; $i < $t_row_count; $i++) { if ($t_column_count_by_row[$i] < $t_filter_cols) { $t_plugin_filter_links[$i][] = '<td class="small-caption" colspan="' . ($t_filter_cols - $t_column_count_by_row[$i]) . '"> </td>'; $t_plugin_filter_fields[$i][] = '<td class="small-caption" colspan="' . ($t_filter_cols - $t_column_count_by_row[$i]) . '"> </td>'; } $t_links_row = "\n\t\t" . join("\n\t\t", $t_plugin_filter_links[$i]); $t_values_row = "\n\t\t" . join("\n\t\t", $t_plugin_filter_fields[$i]); echo "\n\t" . '<tr class="', $t_trclass, '">', $t_links_row, "\n\t</tr>"; echo "\n\t" . '<tr class="row-1">', $t_values_row, "\n\t</tr>\n\t"; } if (ON == config_get('filter_by_custom_fields')) { # -- Custom Field Searching -- if (count($t_accessible_custom_fields_ids) > 0) { $t_per_row = config_get('filter_custom_fields_per_row'); $t_num_fields = count($t_accessible_custom_fields_ids); $t_row_idx = 0; $t_col_idx = 0; $t_fields = ''; $t_values = ''; for ($i = 0; $i < $t_num_fields; $i++) { if ($t_col_idx == 0) { $t_fields = '<tr class="' . $t_trclass . '">'; $t_values = '<tr class="row-1">'; } if (isset($t_accessible_custom_fields_names[$i])) { $t_fields .= '<td class="small-caption"> '; $t_fields .= '<a href="' . $t_filters_url . 'custom_field_' . $t_accessible_custom_fields_ids[$i] . '[]" id="custom_field_' . $t_accessible_custom_fields_ids[$i] . '_filter"' . $t_dynamic_filter_expander_class . '>'; $t_fields .= string_display_line(lang_get_defaulted($t_accessible_custom_fields_names[$i])); $t_fields .= '</a> </td> '; } $t_output = ''; $t_any_found = false; $t_values .= '<td class="small-caption" id="custom_field_' . $t_accessible_custom_fields_ids[$i] . '_filter_target"> '; if (!isset($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]])) { $t_values .= lang_get('any'); } else { if ($t_accessible_custom_fields_types[$i] == CUSTOM_FIELD_TYPE_DATE) { $t_short_date_format = config_get('short_date_format'); if (!isset($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][1])) { $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][1] = 0; } $t_start = date($t_short_date_format, $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][1]); if (!isset($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][2])) { $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][2] = 0; } $t_end = date($t_short_date_format, $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][2]); switch ($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][0]) { case CUSTOM_FIELD_DATE_ANY: $t_values .= lang_get('any'); break; case CUSTOM_FIELD_DATE_NONE: $t_values .= lang_get('none'); break; case CUSTOM_FIELD_DATE_BETWEEN: $t_values .= lang_get('between_date') . '<br />'; $t_values .= $t_start . '<br />' . $t_end; break; case CUSTOM_FIELD_DATE_ONORBEFORE: $t_values .= lang_get('on_or_before_date') . '<br />'; $t_values .= $t_end; break; case CUSTOM_FIELD_DATE_BEFORE: $t_values .= lang_get('before_date') . '<br />'; $t_values .= $t_end; break; case CUSTOM_FIELD_DATE_ON: $t_values .= lang_get('on_date') . '<br />'; $t_values .= $t_start; break; case CUSTOM_FIELD_DATE_AFTER: $t_values .= lang_get('after_date') . '<br />'; $t_values .= $t_start; break; case CUSTOM_FIELD_DATE_ONORAFTER: $t_values .= lang_get('on_or_after_date') . '<br />'; $t_values .= $t_start; break; } } else { $t_first_flag = true; foreach ($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]] as $t_current) { $t_current = stripslashes($t_current); $t_this_string = ''; if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_none($t_current)) { $t_this_string = lang_get('none'); } else { $t_this_string = $t_current; } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_string); $t_values .= '<input type="hidden" name="custom_field_' . $t_accessible_custom_fields_ids[$i] . '[]" value="' . string_attribute($t_current) . '" />'; } } if (true == $t_any_found) { $t_values .= lang_get('any'); } else { $t_values .= $t_output; } } $t_values .= ' </td>'; $t_col_idx++; if ($t_col_idx == $t_per_row) { if ($t_filter_cols > $t_per_row) { $t_fields .= '<td colspan="' . ($t_filter_cols - $t_per_row) . '"> </td> '; $t_values .= '<td colspan="' . ($t_filter_cols - $t_per_row) . '"> </td> '; } $t_fields .= '</tr>' . "\n"; $t_values .= '</tr>' . "\n"; echo $t_fields; echo $t_values; $t_col_idx = 0; $t_row_idx++; } } if ($t_col_idx > 0) { if ($t_col_idx < $t_per_row) { $t_fields .= '<td colspan="' . ($t_per_row - $t_col_idx) . '"> </td> '; $t_values .= '<td colspan="' . ($t_per_row - $t_col_idx) . '"> </td> '; } if ($t_filter_cols > $t_per_row) { $t_fields .= '<td colspan="' . ($t_filter_cols - $t_per_row) . '"> </td> '; $t_values .= '<td colspan="' . ($t_filter_cols - $t_per_row) . '"> </td> '; } $t_fields .= '</tr>' . "\n"; $t_values .= '</tr>' . "\n"; echo $t_fields; echo $t_values; } } } ?> <tr class="row-1"> <td class="small-caption category2"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_NOTE_USER_ID; ?> " id="note_user_id_filter"<?php echo $t_dynamic_filter_expander_class; ?> > <?php echo lang_get('note_user_id_label'); ?> </a> </td> <td class="small-caption" id="note_user_id_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_NOTE_USER_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_NOTE_USER_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_NOTE_USER_ID, '[]" value="', string_attribute($t_current), '" />'; $t_this_name = ''; if (filter_field_is_none($t_current)) { $t_this_name = lang_get('none'); } else { if (filter_field_is_any($t_current)) { $t_any_found = true; } else { if (filter_field_is_myself($t_current)) { if (access_has_project_level(config_get('handle_bug_threshold'))) { $t_this_name = '[' . lang_get('myself') . ']'; } else { $t_any_found = true; } } else { $t_this_name = user_get_name($t_current); } } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_name); } if (true == $t_any_found) { echo lang_get('any'); } else { echo $t_output; } } ?> </td> <!-- Sort by --> <td class="small-caption category2"> <a href="<?php echo $t_filters_url . 'show_sort'; ?> " id="show_sort_filter"<?php echo $t_dynamic_filter_expander_class; ?> > <?php echo lang_get('sort_label'); ?> </a> </td> <td class="small-caption" id="show_sort_filter_target"> <?php $t_sort_fields = explode(',', $t_filter[FILTER_PROPERTY_SORT_FIELD_NAME]); $t_dir_fields = explode(',', $t_filter[FILTER_PROPERTY_SORT_DIRECTION]); for ($i = 0; $i < 2; $i++) { if (isset($t_sort_fields[$i])) { if (0 < $i) { echo ', '; } $t_sort = $t_sort_fields[$i]; if (strpos($t_sort, 'custom_') === 0) { $t_field_name = string_display(lang_get_defaulted(utf8_substr($t_sort, utf8_strlen('custom_')))); } else { $t_field_name = string_get_field_name($t_sort); } echo $t_field_name . ' ' . lang_get('bugnote_order_' . utf8_strtolower($t_dir_fields[$i])); echo '<input type="hidden" name="', FILTER_PROPERTY_SORT_FIELD_NAME, '_', $i, '" value="', string_attribute($t_sort_fields[$i]), '" />'; echo '<input type="hidden" name="', FILTER_PROPERTY_SORT_DIRECTION, '_', $i, '" value="', string_attribute($t_dir_fields[$i]), '" />'; } } ?> </td> <?php if ('advanced' == $t_view_type) { ?> <!-- Project --> <td class="small-caption category2" colspan="2"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_PROJECT_ID; ?> " id="project_id_filter"<?php echo $t_dynamic_filter_expander_class; ?> > <?php echo lang_get('email_project_label'); ?> </a> </td> <td class="small-caption" id="project_id_filter_target"> <?php $t_output = ''; if (!is_array($t_filter[FILTER_PROPERTY_PROJECT_ID])) { $t_filter[FILTER_PROPERTY_PROJECT_ID] = array($t_filter[FILTER_PROPERTY_PROJECT_ID]); } if (count($t_filter[FILTER_PROPERTY_PROJECT_ID]) == 0) { echo lang_get('current'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_PROJECT_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_PROJECT_ID, '[]" value="', string_attribute($t_current), '" />'; $t_this_name = ''; if (META_FILTER_CURRENT == $t_current) { $t_this_name = '[' . lang_get('current') . ']'; } else { $t_this_name = project_get_name($t_current, false); } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . string_display_line($t_this_name); } echo $t_output; } ?> </td> <?php if ($t_filter_cols > 6) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 5) . '"> </td>'; } } else { if ($t_filter_cols > 3) { echo '<td class="small-caption" colspan="' . ($t_filter_cols - 2) . '"> </td>'; } } ?> </tr> <!-- Match Type --> <tr class="row-1"> <td class="small-caption category2"><a href="<?php echo $t_filters_url . FILTER_PROPERTY_MATCH_TYPE; ?> " id="match_type_filter"><?php echo lang_get('filter_match_type'); ?> :</a></td> <td class="small-caption" id="match_type_filter_target"> <?php switch ($t_filter[FILTER_PROPERTY_MATCH_TYPE]) { case FILTER_MATCH_ANY: echo lang_get('filter_match_any'); break; case FILTER_MATCH_ALL: default: echo lang_get('filter_match_all'); break; } ?> <input type="hidden" name="match_type" value="<?php echo $t_filter[FILTER_PROPERTY_MATCH_TYPE]; ?> "/> </td> <td class="small-caption category2"> <a id="highlight_changed_filter" href="<?php echo $t_filters_url . FILTER_PROPERTY_HIGHLIGHT_CHANGED; ?> " <?php #echo $t_dynamic_filter_expander_class; ?> > <?php echo lang_get('changed_label'); ?> </a> </td> <td class="small-caption" valign="top" id="highlight_changed_filter_target"> <?php echo $t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED]; ?> <input type="hidden" name="<?php echo FILTER_PROPERTY_HIGHLIGHT_CHANGED; ?> " value="<?php echo string_attribute($t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED]); ?> " /> </td> <td colspan="4"> </td> </tr> </table> <?php } # expanded collapse_icon('filter'); echo '<div class="search-box">'; echo '<label>'; echo lang_get('search') . ' '; echo '<input type="text" size="16" name="', FILTER_PROPERTY_SEARCH, '" value="', string_attribute($t_filter[FILTER_PROPERTY_SEARCH]), '" />'; echo '</label>'; echo '</div>'; ?> <div class="submit-query"><input type="submit" name="filter" value="<?php echo lang_get('filter_button'); ?> " /></div> </form> <?php $t_stored_queries_arr = filter_db_get_available_queries(); if (access_has_project_level(config_get('stored_query_create_threshold'))) { ?> <div class="save-query"> <form method="post" name="save_query" action="query_store_page.php"> <?php # CSRF protection not required here - form does not result in modifications ?> <input type="submit" name="save_query_button" class="button-small" value="<?php echo lang_get('save_query'); ?> " /> </form> </div><?php } if (count($t_stored_queries_arr) > 0) { ?> <div class="manage-queries"> <form method="post" name="open_queries" action="query_view_page.php"> <?php # CSRF protection not required here - form does not result in modifications ?> <input type="submit" name="switch_to_query_button" class="button-small" value="<?php echo lang_get('open_queries'); ?> " /> </form> </div> <div class="stored-queries"> <form method="get" name="list_queries<?php echo $t_form_name_suffix; ?> " action="view_all_set.php"> <?php # CSRF protection not required here - form does not result in modifications ?> <input type="hidden" name="type" value="3" /> <select name="source_query_id"> <option value="-1"><?php echo '[' . lang_get('reset_query') . ']'; ?> </option> <option value="-1"></option> <?php $t_source_query_id = isset($t_filter['_source_query_id']) ? (int) $t_filter['_source_query_id'] : -1; foreach ($t_stored_queries_arr as $t_query_id => $t_query_name) { echo '<option value="' . $t_query_id . '" '; check_selected($t_query_id, $t_source_query_id); echo '>' . string_display_line($t_query_name) . '</option>'; } ?> </select> <input type="submit" name="switch_to_query_button" class="button-small" value="<?php echo lang_get('use_query'); ?> " /> </form> </div> <?php } else { ?> <div class="reset-query"> <form method="get" name="reset_query" action="view_all_set.php"> <?php # CSRF protection not required here - form does not result in modifications ?> <input type="hidden" name="type" value="3" /> <input type="hidden" name="source_query_id" value="-1" /> <input type="submit" name="reset_query_button" class="button-small" value="<?php echo lang_get('reset_query'); ?> " /> </form> </div><?php } ?> <div class="filter-links"> <?php if (access_has_project_level(config_get('create_permalink_threshold'))) { ?> <form method="get" action="permalink_page.php"> <?php # CSRF protection not required here - form does not result in modifications ?> <input type="hidden" name="url" value="<?php echo urlencode(filter_get_url($t_filter)); ?> " /> <input type="submit" name="reset_query_button" class="button-small" value="<?php echo lang_get('create_filter_link'); ?> " /> </form> <?php } $t_view_filters = config_get('view_filters'); if (SIMPLE_ONLY != $t_view_filters && ADVANCED_ONLY != $t_view_filters) { ?> <form method="get" action="view_all_set.php"> <?php # CSRF protection not required here - form does not result in modifications ?> <input type="hidden" name="type" value="<?php echo config_get('use_dynamic_filters') ? '6' : ''; ?> " /> <input type="hidden" name="view_type" value="<?php echo 'advanced' == $t_view_type ? 'simple' : 'advanced'; ?> " /> <input type="submit" name="reset_query_button" class="button-small" value="<?php echo 'advanced' == $t_view_type ? lang_get('simple_filters') : lang_get('advanced_filters'); ?> " /> </form> <?php } ?> </div> </div> <br /> <?php }
} else { echo '<td>' . MantisEnum::getLabel(lang_get('access_levels_enum_string'), config_get_access($p_threshold)) . ' </td>'; } echo '</tr>' . "\n"; } function get_section_end() { echo '</table><br />' . "\n"; } $t_colour_project = config_get('colour_project'); $t_colour_global = config_get('colour_global'); echo "<br /><br />\n"; if (ALL_PROJECTS == $t_project_id) { $t_project_title = lang_get('config_all_projects'); } else { $t_project_title = sprintf(lang_get('config_project'), string_display(project_get_name($t_project_id))); } echo '<p class="bold">' . $t_project_title . '</p>' . "\n"; echo '<p>' . lang_get('colour_coding') . '<br />'; if (ALL_PROJECTS != $t_project_id) { echo '<span style="background-color:' . $t_colour_project . '">' . lang_get('colour_project') . '</span><br />'; } echo '<span style="background-color:' . $t_colour_global . '">' . lang_get('colour_global') . '</span></p>'; echo "<form name=\"mail_config_action\" method=\"post\" action=\"manage_config_work_threshold_set.php\">\n"; echo form_security_field('manage_config_work_threshold_set'); # Issues get_section_begin_mcwt(lang_get('issues')); get_capability_row(lang_get('report_issue'), 'report_bug_threshold'); get_capability_enum(lang_get('submit_status'), 'bug_submit_status', 'status'); get_capability_row(lang_get('update_issue'), 'update_bug_threshold'); get_capability_boolean(lang_get('allow_reporter_close'), 'allow_reporter_close');
* @uses print_api.php * @uses project_api.php */ require_once 'core.php'; require_api('access_api.php'); require_api('authentication_api.php'); require_api('config_api.php'); require_api('form_api.php'); require_api('gpc_api.php'); require_api('helper_api.php'); require_api('html_api.php'); require_api('lang_api.php'); require_api('print_api.php'); require_api('project_api.php'); form_security_validate('manage_user_proj_delete'); auth_reauthenticate(); $f_project_id = gpc_get_int('project_id'); $f_user_id = gpc_get_int('user_id'); user_ensure_exists($f_user_id); $t_user = user_get_row($f_user_id); access_ensure_project_level(config_get('project_user_threshold'), $f_project_id); access_ensure_project_level($t_user['access_level'], $f_project_id); $t_project_name = project_get_name($f_project_id); # Confirm with the user helper_ensure_confirmed(lang_get('remove_user_sure_msg') . '<br/>' . lang_get('project_name_label') . lang_get('word_separator') . $t_project_name, lang_get('remove_user_button')); project_remove_user($f_project_id, $f_user_id); form_security_purge('manage_user_proj_delete'); $t_redirect_url = 'manage_user_edit_page.php?user_id=' . $f_user_id; html_page_top(null, $t_redirect_url); html_operation_successful($t_redirect_url); html_page_bottom();
/** * Update a project * * @param string $p_username The name of the user * @param string $p_password The password of the user * @param integer $p_project_id A project's id * @param Array $p_project A new ProjectData structure * @return bool returns true or false depending on the success of the update action */ function mc_project_update($p_username, $p_password, $p_project_id, $p_project) { $t_user_id = mci_check_login($p_username, $p_password); if ($t_user_id === false) { return new soap_fault('Client', '', 'Access Denied', 'Username/password combination was incorrect'); } if (!mci_has_administrator_access($t_user_id, $p_project_id)) { return new soap_fault('Client', '', 'Access Denied', 'User does not have administrator access'); } if (!project_exists($p_project_id)) { return new soap_fault('Client', '', "Project '{$p_project_id}' does not exist."); } if (!isset($p_project['name'])) { return new soap_fault('Client', '', 'Missing Field', 'Required Field Missing'); } else { $t_name = $p_project['name']; } // check to make sure project doesn't already exist if ($t_name != project_get_name($p_project_id)) { if (!project_is_name_unique($t_name)) { return new soap_fault('Client', '', 'Project name exists', 'The project name you attempted to add exists already'); } } if (!isset($p_project['description'])) { $t_description = project_get_field($p_project_id, 'description'); } else { $t_description = $p_project['description']; } if (!isset($p_project['status'])) { $t_status = project_get_field($p_project_id, 'status'); } else { $t_status = $p_project['status']; } if (!isset($p_project['view_state'])) { $t_view_state = project_get_field($p_project_id, 'view_state'); } else { $t_view_state = $p_project['view_state']; } if (!isset($p_project['file_path'])) { $t_file_path = project_get_field($p_project_id, 'file_path'); } else { $t_file_path = $p_project['file_path']; } if (!isset($p_project['enabled'])) { $t_enabled = project_get_field($p_project_id, 'enabled'); } else { $t_enabled = $p_project['enabled']; } if (!isset($p_project['inherit_global'])) { $t_inherit_global = project_get_field($p_project_id, 'inherit_global'); } else { $t_inherit_global = $p_project['inherit_global']; } $t_project_status = mci_get_project_status_id($t_status); $t_project_view_state = mci_get_project_view_state_id($t_view_state); return project_update($p_project_id, $t_name, $t_description, $t_project_status, $t_project_view_state, $t_file_path, $t_enabled, $t_inherit_global); }
if ($f_project_id != ALL_PROJECTS) { access_ensure_project_level(VIEWER, $f_project_id); } if ($f_sort === 'update') { $c_sort_field = 'last_updated'; } else { $c_sort_field = 'date_submitted'; } $t_path = config_get('path'); # construct rss file $encoding = 'utf-8'; $about = $t_path; $title = config_get('window_title'); $image_link = $t_path . 'images/mantis_logo_button.gif'; # only rss 2.0 $category = project_get_name($f_project_id); if ($f_project_id !== 0) { $title .= ' - ' . $category; } $title .= ' - ' . lang_get('issues'); if ($f_username !== null) { $title .= " - ({$f_username})"; } if ($f_filter_id !== 0) { $title .= ' (' . filter_get_field($f_filter_id, 'name') . ')'; } $description = $title; # in minutes (only rss 2.0) $cache = '10'; $rssfile = new RSSBuilder($encoding, $about, $title, $description, $image_link, $category, $cache); # person, an organization, or a service
if (OFF == config_get('allow_anonymous_login')) { access_denied(); } # Make sure that the user selected either all projects or a public one. $f_project_id = gpc_get_int('project_id', 0); if ($f_project_id != 0 && VS_PRIVATE == project_get_field($f_project_id, 'view_state')) { access_denied(); } # construct rss file $encoding = lang_get('charset'); $about = config_get('path'); $title = string_rss_links(config_get('window_title') . ' - ' . lang_get('news')); $description = $title; $image_link = config_get('path') . 'images/mantis_logo_button.gif'; # only rss 2.0 $category = string_rss_links(project_get_name($f_project_id)); # in minutes (only rss 2.0) $cache = '60'; $rssfile = new RSSBuilder($encoding, $about, $title, $description, $image_link, $category, $cache); # person, an organization, or a service $publisher = ''; # person, an organization, or a service $creator = ''; $date = (string) date('r'); $language = lang_get('phpmailer_language'); $rights = ''; # spatial location , temporal period or jurisdiction $coverage = (string) ''; # person, an organization, or a service $contributor = (string) ''; $rssfile->setPublisher($publisher);
<?php if ($t_cost_col) { ?> <td class="small-caption bold right"> <?php echo lang_get('time_tracking_cost'); ?> </td> <?php } ?> </tr> <?php foreach ($t_bugnote_stats['issues'] as $t_issue_id => $t_issue) { $t_project_info = !isset($f_bug_id) && $f_project_id == ALL_PROJECTS ? '[' . project_get_name($t_issue['project_id']) . ']' . lang_get('word_separator') : ''; $t_link = sprintf(lang_get('label'), string_get_bug_view_link($t_issue_id)) . lang_get('word_separator') . $t_project_info . string_display($t_issue['summary']); echo '<tr class="row-category-history"><td colspan="4">' . $t_link . '</td></tr>'; foreach ($t_issue['users'] as $t_username => $t_user_info) { ?> <tr> <td class="small-caption"> <?php echo $t_username; ?> </td> <td class="small-caption"> <?php echo db_minutes_to_hhmm($t_user_info['minutes']); ?> </td>
############################################### if (empty($a_userProject_ids)) { echo lang_get('plugin_mite_no_projets_assigned'); exit; } $o_userMiteData = $o_pluginController->getMiteUserData(); $a_userMiteRsrces[Mantis2mitePlugin::API_RSRC_P] = $o_userMiteData->getProjects(); $a_userMiteRsrces[Mantis2mitePlugin::API_RSRC_S] = $o_userMiteData->getServices(); $a_userMiteBindings = $o_userMiteData->getBindings(); # build form with configured values ################################### $s_output .= "\n\t\t<hr size='1' />\n\t\t<form id='frm_mite_mantis_bindings'>\n\t\t<h2>" . lang_get('plugin_mite_header_preferences') . "</h2>"; $s_quickLinksList = "<ul>"; # gather Mantis project names accessible for the user foreach ($a_userProject_ids as $i_project_id) { $s_projectName = project_get_name($i_project_id); # create select boxes for all MITE resources of the user ####################################################### foreach (Mantis2mitePlugin::$a_rsrcTypes as $s_type) { $a_selectBoxesRsrc[$s_type] = ''; $s_selectBoxRsrc = ''; $i_sizeSelectBox = 0; if ($s_type == Mantis2mitePlugin::API_RSRC_P) { $s_selectBoxRsrc .= "<option value=''>" . lang_get('plugin_mite_please_select') . "</option>"; } foreach ($a_userMiteRsrces[$s_type] as $i_miteRsrc_id => $a_rsrc) { $s_selectBoxRsrc .= "<option value='{$i_miteRsrc_id}'"; # mark as selected if it is binded if (isset($a_userMiteBindings[$s_type][$i_miteRsrc_id]) && in_array($i_project_id, $a_userMiteBindings[$s_type][$i_miteRsrc_id])) { $s_selectBoxRsrc .= " selected='selected'"; }
function base_url($p_project_id = null) { $t_base = plugin_config_get('engine_url'); if (!is_null($p_project_id) && $p_project_id != ALL_PROJECTS) { $t_base .= urlencode(project_get_name($p_project_id)) . '/'; } else { $t_base .= urlencode(plugin_config_get('root_namespace')); } return $t_base; }
/** * Update a project * * @param string $p_username The name of the user. * @param string $p_password The password of the user. * @param integer $p_project_id A project's identifier. * @param stdClass $p_project A new ProjectData structure. * @return boolean returns true or false depending on the success of the update action */ function mc_project_update($p_username, $p_password, $p_project_id, stdClass $p_project) { global $g_project_override; $t_user_id = mci_check_login($p_username, $p_password); if ($t_user_id === false) { return mci_soap_fault_access_denied(); } if (!mci_has_administrator_access($t_user_id, $p_project_id)) { return mci_soap_fault_access_denied($t_user_id); } if (!project_exists($p_project_id)) { return SoapObjectsFactory::newSoapFault('Client', 'Project \'' . $p_project_id . '\' does not exist.'); } $g_project_override = $p_project_id; $p_project = SoapObjectsFactory::unwrapObject($p_project); if (!isset($p_project['name'])) { return SoapObjectsFactory::newSoapFault('Client', 'Missing required field \'name\'.'); } else { $t_name = $p_project['name']; } # check to make sure project doesn't already exist if ($t_name != project_get_name($p_project_id)) { if (!project_is_name_unique($t_name)) { return SoapObjectsFactory::newSoapFault('Client', 'Project name exists'); } } if (!isset($p_project['description'])) { $t_description = project_get_field($p_project_id, 'description'); } else { $t_description = $p_project['description']; } if (!isset($p_project['status'])) { $t_status = project_get_field($p_project_id, 'status'); } else { $t_status = $p_project['status']; } if (!isset($p_project['view_state'])) { $t_view_state = project_get_field($p_project_id, 'view_state'); } else { $t_view_state = $p_project['view_state']; } if (!isset($p_project['file_path'])) { $t_file_path = project_get_field($p_project_id, 'file_path'); } else { $t_file_path = $p_project['file_path']; } if (!isset($p_project['enabled'])) { $t_enabled = project_get_field($p_project_id, 'enabled'); } else { $t_enabled = $p_project['enabled']; } if (!isset($p_project['inherit_global'])) { $t_inherit_global = project_get_field($p_project_id, 'inherit_global'); } else { $t_inherit_global = $p_project['inherit_global']; } $t_project_status = mci_get_project_status_id($t_status); $t_project_view_state = mci_get_project_view_state_id($t_view_state); project_update($p_project_id, $t_name, $t_description, $t_project_status, $t_project_view_state, $t_file_path, $t_enabled, $t_inherit_global); return true; }
/** * Gets the formatted project id value. * @param object $p_bug the bug * @returns The project name. */ function excel_format_project_id($p_bug) { return excel_prepare_string(project_get_name($p_bug->project_id)); }
/** * Checks if an obsolete configuration variable is still in use. If so, an error * will be generated and the script will exit. * * @param string $p_var Old configuration option. * @param string $p_replace New configuration option. * @return void */ function config_obsolete($p_var, $p_replace = '') { global $g_cache_config; # @@@ we could trigger a WARNING here, once we have errors that can # have extra data plugged into them (we need to give the old and # new config option names in the warning text) if (config_is_set($p_var)) { $t_description = 'The configuration option <em>' . $p_var . '</em> is now obsolete'; $t_info = ''; # Check if set in the database if (is_array($g_cache_config) && array_key_exists($p_var, $g_cache_config)) { $t_info .= 'it is currently defined in '; if (isset($GLOBALS['g_' . $p_var])) { $t_info .= 'config_inc.php, as well as in '; } $t_info .= 'the database configuration for: <ul>'; foreach ($g_cache_config[$p_var] as $t_user_id => $t_user) { $t_info .= '<li>' . ($t_user_id == 0 ? lang_get('all_users') : user_get_name($t_user_id)) . ': '; foreach ($t_user as $t_project_id => $t_project) { $t_info .= project_get_name($t_project_id) . ', '; } $t_info = rtrim($t_info, ', ') . '</li>'; } $t_info .= '</ul>'; } # Replacement defined if (is_array($p_replace)) { $t_info .= 'please see the following options: <ul>'; foreach ($p_replace as $t_option) { $t_info .= '<li>' . $t_option . '</li>'; } $t_info .= '</ul>'; } else { if (!is_blank($p_replace)) { $t_info .= 'please use ' . $p_replace . ' instead.'; } } check_print_test_warn_row($t_description, false, $t_info); } }
$t_show_projection = in_array('projection', $t_fields); $t_show_eta = in_array('eta', $t_fields); $t_show_versions = version_should_show_product_version($t_bug->project_id); $t_show_product_version = $t_show_versions && in_array('product_version', $t_fields); $t_show_product_build = $t_show_versions && in_array('product_build', $t_fields) && config_get('enable_product_build'); $t_show_fixed_in_version = $t_show_versions && in_array('fixed_in_version', $t_fields); $t_show_target_version = $t_show_versions && in_array('target_version', $t_fields) && access_has_bug_level(config_get('roadmap_view_threshold'), $f_bug_id); $t_show_summary = in_array('summary', $t_fields); $t_show_description = in_array('description', $t_fields); $t_show_steps_to_reproduce = in_array('steps_to_reproduce', $t_fields); $t_show_additional_information = in_array('additional_info', $t_fields); $t_show_tags = in_array('tags', $t_fields); $t_show_attachments = in_array('attachments', $t_fields); $t_show_history = access_has_bug_level(config_get('view_history_threshold'), $f_bug_id); $t_window_title = string_display_line(config_get('window_title')); $t_project_name = $t_show_project ? string_display_line(project_get_name($t_bug->project_id)) : ''; $t_formatted_bug_id = $t_show_id ? bug_format_id($f_bug_id) : ''; $t_category_name = $t_show_category ? string_display_line(category_full_name($t_bug->category_id)) : ''; $t_severity = string_display_line(get_enum_element('severity', $t_bug->severity)); $t_reproducibility = string_display_line(get_enum_element('reproducibility', $t_bug->reproducibility)); $t_date_submitted = $t_show_date_submitted ? string_display_line(date(config_get('normal_date_format'), $t_bug->date_submitted)) : ''; $t_last_updated = $t_show_last_updated ? string_display_line(date(config_get('normal_date_format'), $t_bug->last_updated)) : ''; $t_platform = string_display_line($t_bug->platform); $t_os = string_display_line($t_bug->os); $t_os_version = string_display_line($t_bug->os_build); $t_is = string_display_line($t_bug->os); $t_status = string_display_line(get_enum_element('status', $t_bug->status)); $t_priority = string_display_line(get_enum_element('priority', $t_bug->priority)); $t_resolution = string_display_line(get_enum_element('resolution', $t_bug->resolution)); $t_product_build = string_display_line($t_bug->build); $t_projection = string_display_line(get_enum_element('projection', $t_bug->projection));
$p_projects = null; $p_level = 0; $p_cache = null; if (null == $p_projects) { $t_project_id = helper_get_current_project(); if (ALL_PROJECTS == $t_project_id) { $p_projects = current_user_get_accessible_projects(); } else { $p_projects = array($t_project_id); } } foreach ($p_projects as $t_project) { ?> <!-- PROJECTS --> <?php $t_project_name = str_repeat("» ", $p_level) . project_get_name($t_project); ?> <tr valign="top"> <td class="category"><?php echo $t_project_name; ?> </td> <td> <table> <!-- PROJECT VERSIONS --> <?php $t_versions = version_get_all_rows($t_project, null, null); if (count($t_versions) > 0) { foreach ($t_versions as $t_version) { if ($t_version['project_id'] != $t_project) {
/** * Get a project definition. * * @param integer $p_project_id The id of the project to retrieve. * @return Array an Array containing the id and the name of the project. */ function mci_project_as_array_by_id($p_project_id) { $t_result = array(); $t_result['id'] = $p_project_id; $t_result['name'] = project_get_name($p_project_id); return $t_result; }
/** * Gets the full name of a version. This may include the project name as a prefix (e.g. '[MantisBT] 1.2.0') * * @param int $p_version_id The version id. * @param bool $p_show_project Whether to include the project or not, null means include the project if different from current. * @param int $p_current_project_id The current project id or null to use the cookie. * @return string The full name of the version. */ function version_full_name($p_version_id, $p_show_project = null, $p_current_project_id = null) { if (0 == $p_version_id) { # No Version return ''; } else { $t_row = version_cache_row($p_version_id); $t_project_id = $t_row['project_id']; $t_current_project_id = is_null($p_current_project_id) ? helper_get_current_project() : $p_current_project_id; if ($p_show_project === null) { $t_show_project = $t_project_id != $t_current_project_id; } else { $t_show_project = $p_show_project; } if ($t_show_project && $t_project_id != $t_current_project_id) { return '[' . project_get_name($t_project_id) . '] ' . $t_row['version']; } return $t_row['version']; } }
/** * returns the project name corresponding to the supplied bug * @param object $p_bug the bug * @return string csv formatted project name * @access public */ function csv_format_project_id($p_bug) { return csv_escape_string(project_get_name($p_bug->project_id)); }
/** * Update Issue in database * * Created By KGB * @param string $p_username The name of the user trying to add the issue. * @param string $p_password The password of the user. * @param integer $p_issue_id The issue id of the existing issue being updated. * @param stdClass $p_issue A IssueData structure containing information about the new issue. * @return integer The id of the created issue. */ function mc_issue_update($p_username, $p_password, $p_issue_id, stdClass $p_issue) { global $g_project_override; $t_user_id = mci_check_login($p_username, $p_password); if ($t_user_id === false) { return mci_soap_fault_login_failed(); } if (!bug_exists($p_issue_id)) { return SoapObjectsFactory::newSoapFault('Client', 'Issue \'' . $p_issue_id . '\' does not exist.'); } if (bug_is_readonly($p_issue_id)) { return SoapObjectsFactory::newSoapFault('Client', 'Issue \'' . $p_issue_id . '\' is readonly'); } $t_project_id = bug_get_field($p_issue_id, 'project_id'); if (!mci_has_readwrite_access($t_user_id, $t_project_id)) { return mci_soap_fault_access_denied($t_user_id); } $g_project_override = $t_project_id; # ensure that helper_get_current_project() calls resolve to this project id $p_issue = SoapObjectsFactory::unwrapObject($p_issue); $t_project_id = mci_get_project_id($p_issue['project']); $t_reporter_id = isset($p_issue['reporter']) ? mci_get_user_id($p_issue['reporter']) : $t_user_id; $t_handler_id = isset($p_issue['handler']) ? mci_get_user_id($p_issue['handler']) : 0; $t_project = $p_issue['project']; $t_summary = isset($p_issue['summary']) ? $p_issue['summary'] : ''; $t_description = isset($p_issue['description']) ? $p_issue['description'] : ''; if ($t_project_id == 0 || !project_exists($t_project_id)) { if ($t_project_id == 0) { return SoapObjectsFactory::newSoapFault('Client', 'Project \'' . $t_project['name'] . '\' does not exist.'); } return SoapObjectsFactory::newSoapFault('Client', 'Project \'' . $t_project_id . '\' does not exist.'); } if (!access_has_bug_level(config_get('update_bug_threshold'), $p_issue_id, $t_user_id)) { return mci_soap_fault_access_denied($t_user_id, 'Not enough rights to update issues'); } $t_category = isset($p_issue['category']) ? $p_issue['category'] : null; $t_category_id = translate_category_name_to_id($t_category, $t_project_id); if ($t_category_id == 0 && !config_get('allow_no_category')) { if (isset($p_issue['category']) && !is_blank($p_issue['category'])) { return SoapObjectsFactory::newSoapFault('Client', 'Category field must be supplied.'); } else { $t_project_name = project_get_name($t_project_id); return SoapObjectsFactory::newSoapFault('Client', 'Category \'' . $p_issue['category'] . '\' not found for project \'' . $t_project_name . '\'.'); } } if (isset($p_issue['version']) && !is_blank($p_issue['version']) && !version_get_id($p_issue['version'], $t_project_id)) { $t_error_when_version_not_found = config_get('webservice_error_when_version_not_found'); if ($t_error_when_version_not_found == ON) { $t_project_name = project_get_name($t_project_id); return SoapObjectsFactory::newSoapFault('Client', 'Version \'' . $p_issue['version'] . '\' does not exist in project \'' . $t_project_name . '\'.'); } else { $t_version_when_not_found = config_get('webservice_version_when_not_found'); $p_issue['version'] = $t_version_when_not_found; } } if (is_blank($t_summary)) { return SoapObjectsFactory::newSoapFault('Client', 'Mandatory field \'summary\' is missing.'); } if (is_blank($t_description)) { return SoapObjectsFactory::newSoapFault('Client', 'Mandatory field \'description\' is missing.'); } # fields which we expect to always be set $t_bug_data = bug_get($p_issue_id, true); $t_bug_data->project_id = $t_project_id; $t_bug_data->reporter_id = $t_reporter_id; $t_access_check_result = mci_issue_handler_access_check($t_user_id, $t_project_id, $t_bug_data->handler_id, $t_handler_id); if ($t_access_check_result !== true) { return $t_access_check_result; } $t_bug_data->handler_id = $t_handler_id; $t_bug_data->category_id = $t_category_id; $t_bug_data->summary = $t_summary; $t_bug_data->description = $t_description; # fields which might not be set if (isset($p_issue['steps_to_reproduce'])) { $t_bug_data->steps_to_reproduce = $p_issue['steps_to_reproduce']; } if (isset($p_issue['additional_information'])) { $t_bug_data->additional_information = $p_issue['additional_information']; } if (isset($p_issue['priority'])) { $t_bug_data->priority = mci_get_priority_id($p_issue['priority']); } if (isset($p_issue['severity'])) { $t_bug_data->severity = mci_get_severity_id($p_issue['severity']); } if (isset($p_issue['status'])) { $t_bug_data->status = mci_get_status_id($p_issue['status']); } if (isset($p_issue['reproducibility'])) { $t_bug_data->reproducibility = mci_get_reproducibility_id($p_issue['reproducibility']); } if (isset($p_issue['resolution'])) { $t_bug_data->resolution = mci_get_resolution_id($p_issue['resolution']); } if (isset($p_issue['projection'])) { $t_bug_data->projection = mci_get_projection_id($p_issue['projection']); } if (isset($p_issue['eta'])) { $t_bug_data->eta = mci_get_eta_id($p_issue['eta']); } if (isset($p_issue['view_state'])) { $t_bug_data->view_state = mci_get_view_state_id($p_issue['view_state']); } if (isset($p_issue['date_submitted'])) { $t_bug_data->date_submitted = $p_issue['date_submitted']; } if (isset($p_issue['date_updated'])) { $t_bug_data->last_updated = $p_issue['last_updated']; } if (isset($p_issue['profile_id'])) { $t_bug_data->profile_id = $p_issue['profile_id']; } if (isset($p_issue['os'])) { $t_bug_data->os = $p_issue['os']; } if (isset($p_issue['os_build'])) { $t_bug_data->os_build = $p_issue['os_build']; } if (isset($p_issue['build'])) { $t_bug_data->build = $p_issue['build']; } if (isset($p_issue['platform'])) { $t_bug_data->platform = $p_issue['platform']; } if (isset($p_issue['version'])) { $t_bug_data->version = $p_issue['version']; } if (isset($p_issue['fixed_in_version'])) { $t_bug_data->fixed_in_version = $p_issue['fixed_in_version']; } if (isset($p_issue['sticky']) && access_has_bug_level(config_get('set_bug_sticky_threshold'), $t_bug_data->id)) { $t_bug_data->sticky = $p_issue['sticky']; } if (isset($p_issue['due_date']) && access_has_global_level(config_get('due_date_update_threshold'))) { $t_bug_data->due_date = SoapObjectsFactory::parseDateTimeString($p_issue['due_date']); } else { $t_bug_data->due_date = date_get_null(); } if (access_has_project_level(config_get('roadmap_update_threshold'), $t_bug_data->project_id, $t_user_id)) { $t_bug_data->target_version = isset($p_issue['target_version']) ? $p_issue['target_version'] : ''; } $t_set_custom_field_error = mci_issue_set_custom_fields($p_issue_id, $p_issue['custom_fields'], true); if ($t_set_custom_field_error != null) { return $t_set_custom_field_error; } if (isset($p_issue['monitors'])) { mci_issue_set_monitors($p_issue_id, $t_user_id, $p_issue['monitors']); } if (isset($p_issue['notes']) && is_array($p_issue['notes'])) { $t_bugnotes = bugnote_get_all_visible_bugnotes($p_issue_id, 'DESC', 0); $t_bugnotes_by_id = array(); foreach ($t_bugnotes as $t_bugnote) { $t_bugnotes_by_id[$t_bugnote->id] = $t_bugnote; } foreach ($p_issue['notes'] as $t_note) { $t_note = SoapObjectsFactory::unwrapObject($t_note); if (isset($t_note['view_state'])) { $t_view_state = $t_note['view_state']; } else { $t_view_state = config_get('default_bugnote_view_status'); } if (isset($t_note['id']) && (int) $t_note['id'] > 0) { $t_bugnote_id = (int) $t_note['id']; $t_view_state_id = mci_get_enum_id_from_objectref('view_state', $t_view_state); if (array_key_exists($t_bugnote_id, $t_bugnotes_by_id)) { $t_bugnote_changed = false; if ($t_bugnote->note !== $t_note['text']) { bugnote_set_text($t_bugnote_id, $t_note['text']); $t_bugnote_changed = true; } if ($t_bugnote->view_state != $t_view_state_id) { bugnote_set_view_state($t_bugnote_id, $t_view_state_id == VS_PRIVATE); $t_bugnote_changed = true; } if (isset($t_note['time_tracking']) && $t_note['time_tracking'] != $t_bugnote->time_tracking) { bugnote_set_time_tracking($t_bugnote_id, mci_get_time_tracking_from_note($p_issue_id, $t_note)); $t_bugnote_changed = true; } if ($t_bugnote_changed) { bugnote_date_update($t_bugnote_id); } } } else { $t_view_state_id = mci_get_enum_id_from_objectref('view_state', $t_view_state); $t_note_type = isset($t_note['note_type']) ? (int) $t_note['note_type'] : BUGNOTE; $t_note_attr = isset($t_note['note_type']) ? $t_note['note_attr'] : ''; bugnote_add($p_issue_id, $t_note['text'], mci_get_time_tracking_from_note($p_issue_id, $t_note), $t_view_state_id == VS_PRIVATE, $t_note_type, $t_note_attr, $t_user_id, false); } } # The issue has been cached earlier in the bug_get() call. Flush the cache since it is # now stale. Otherwise, the email notification will be based on the cached data. bugnote_clear_cache($p_issue_id); } if (isset($p_issue['tags']) && is_array($p_issue['tags'])) { mci_tag_set_for_issue($p_issue_id, $p_issue['tags'], $t_user_id); } # submit the issue log_event(LOG_WEBSERVICE, 'updating issue \'' . $p_issue_id . '\''); return $t_bug_data->update(true, true); }
$writer->writeAttribute('id', $t_value); $writer->text($t_element_data); $writer->endElement(); break; case 'category_id': // id for categories were introduced in 1.2 $t_element_name = 'category'; $t_element_data = category_get_name($t_value); $writer->startElement($t_element_name); $writer->writeAttribute('id', $t_value); $writer->text($t_element_data); $writer->endElement(); break; case 'project_id': $t_element_name = 'project'; $t_element_data = project_get_name($t_value); $writer->startElement($t_element_name); $writer->writeAttribute('id', $t_value); $writer->text($t_element_data); $writer->endElement(); break; case 'eta': case 'priority': case 'projection': case 'reproducibility': case 'resolution': case 'severity': case 'status': case 'view_state': $t_element_data = get_enum_element($t_element, $t_value); $writer->startElement($t_element);
require_api('html_api.php'); require_api('lang_api.php'); require_api('print_api.php'); require_api('project_api.php'); require_api('string_api.php'); form_security_validate('manage_config_revert'); auth_reauthenticate(); $f_project_id = gpc_get_int('project', 0); $f_revert = gpc_get_string('revert', ''); $f_return = gpc_get_string('return'); $t_access = true; $t_revert_vars = explode(',', $f_revert); array_walk($t_revert_vars, 'trim'); foreach ($t_revert_vars as $t_revert) { $t_access &= access_has_project_level(config_get_access($t_revert), $f_project_id); } if (!$t_access) { access_denied(); } if ('' != $f_revert) { # Confirm with the user helper_ensure_confirmed(lang_get('config_delete_sure') . lang_get('word_separator') . string_html_specialchars(implode(', ', $t_revert_vars)) . lang_get('word_separator') . lang_get('in_project') . lang_get('word_separator') . project_get_name($f_project_id), lang_get('delete_config_button')); foreach ($t_revert_vars as $t_revert) { config_delete($t_revert, null, $f_project_id); } } form_security_purge('manage_config_revert'); $t_redirect_url = $f_return; html_page_top(null, $t_redirect_url); html_operation_successful($t_redirect_url); html_page_bottom();
/** * return formatted string with all the details on the requested relationship * @param integer $p_bug_id A bug identifier. * @param BugRelationshipData $p_relationship A bug relationship object. * @param boolean $p_html Whether to return html or text output. * @param boolean $p_html_preview Whether to include style/hyperlinks - if preview is false, we prettify the output. * @param boolean $p_show_project Show Project details. * @return string */ function relationship_get_details($p_bug_id, BugRelationshipData $p_relationship, $p_html = false, $p_html_preview = false, $p_show_project = false) { $t_summary_wrap_at = utf8_strlen(config_get('email_separator2')) - 28; $t_icon_path = config_get('icon_path'); if ($p_bug_id == $p_relationship->src_bug_id) { # root bug is in the source side, related bug in the destination side $t_related_bug_id = $p_relationship->dest_bug_id; $t_related_project_name = project_get_name($p_relationship->dest_project_id); $t_relationship_descr = relationship_get_description_src_side($p_relationship->type); } else { # root bug is in the dest side, related bug in the source side $t_related_bug_id = $p_relationship->src_bug_id; $t_related_project_name = project_get_name($p_relationship->src_project_id); $t_relationship_descr = relationship_get_description_dest_side($p_relationship->type); } # related bug not existing... if (!bug_exists($t_related_bug_id)) { return ''; } # user can access to the related bug at least as a viewer if (!access_has_bug_level(VIEWER, $t_related_bug_id)) { return ''; } if ($p_html_preview == false) { $t_td = '<td>'; } else { $t_td = '<td class="print">'; } # get the information from the related bug and prepare the link $t_bug = bug_get($t_related_bug_id, false); $t_status_string = get_enum_element('status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id); $t_resolution_string = get_enum_element('resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id); $t_relationship_info_html = $t_td . string_no_break($t_relationship_descr) . ' </td>'; if ($p_html_preview == false) { $t_relationship_info_html .= '<td><a href="' . string_get_bug_view_url($t_related_bug_id) . '">' . string_display_line(bug_format_id($t_related_bug_id)) . '</a></td>'; $t_relationship_info_html .= '<td><span class="issue-status" title="' . string_attribute($t_resolution_string) . '">' . string_display_line($t_status_string) . '</span></td>'; } else { $t_relationship_info_html .= $t_td . string_display_line(bug_format_id($t_related_bug_id)) . '</td>'; $t_relationship_info_html .= $t_td . string_display_line($t_status_string) . ' </td>'; } $t_relationship_info_text = utf8_str_pad($t_relationship_descr, 20); $t_relationship_info_text .= utf8_str_pad(bug_format_id($t_related_bug_id), 8); # get the handler name of the related bug $t_relationship_info_html .= $t_td; if ($t_bug->handler_id > 0) { $t_relationship_info_html .= string_no_break(prepare_user_name($t_bug->handler_id)); } $t_relationship_info_html .= ' </td>'; # add project name if ($p_show_project) { $t_relationship_info_html .= $t_td . string_display_line($t_related_project_name) . ' </td>'; } # add summary if ($p_html == true) { $t_relationship_info_html .= $t_td . string_display_line_links($t_bug->summary); if (VS_PRIVATE == $t_bug->view_state) { $t_relationship_info_html .= sprintf(' <img src="%s" alt="(%s)" title="%s" />', $t_icon_path . 'protected.gif', lang_get('private'), lang_get('private')); } } else { if (utf8_strlen($t_bug->summary) <= $t_summary_wrap_at) { $t_relationship_info_text .= string_email_links($t_bug->summary); } else { $t_relationship_info_text .= utf8_substr(string_email_links($t_bug->summary), 0, $t_summary_wrap_at - 3) . '...'; } } # add delete link if bug not read only and user has access level if (!bug_is_readonly($p_bug_id) && !current_user_is_anonymous() && $p_html_preview == false) { if (access_has_bug_level(config_get('update_bug_threshold'), $p_bug_id)) { $t_relationship_info_html .= ' [<a class="small" href="bug_relationship_delete.php?bug_id=' . $p_bug_id . '&rel_id=' . $p_relationship->id . htmlspecialchars(form_security_param('bug_relationship_delete')) . '">' . lang_get('delete_link') . '</a>]'; } } $t_relationship_info_html .= ' </td>'; $t_relationship_info_text .= "\n"; if ($p_html_preview == false) { # choose color based on status $t_status_label = html_get_status_css_class($t_bug->status, auth_get_current_user_id(), $t_bug->project_id); $t_relationship_info_html = '<tr class="' . $t_status_label . '">' . $t_relationship_info_html . '</tr>' . "\n"; } else { $t_relationship_info_html = '<tr>' . $t_relationship_info_html . '</tr>'; } if ($p_html == true) { return $t_relationship_info_html; } else { return $t_relationship_info_text; } }
function html_project_manage_map($map) { $release_properties = session_get_properties("project_manage"); $project_manage = session_get_properties('project_manage'); $html = "<table>" . NEWLINE; $html .= "<tr>" . NEWLINE; $html .= "\t<td>" . NEWLINE; foreach ($map as $key) { $hyperlink = ""; switch ($key) { case "project_manage_link": $hyperlink = "project_manage_page.php"; $text = project_get_name($project_manage['project_id']); break; case "area_tested_link": $hyperlink = "project_manage_areatested_page.php"; $text = lang_get('area_tested'); break; case "environment_link": $hyperlink = "project_manage_environment_page.php"; $text = lang_get('environment'); break; case "machine_link": $hyperlink = "project_manage_machines_page.php"; $text = lang_get('machine'); break; case "reqareacovered_link": $hyperlink = "project_manage_reqareacovered_page.php"; $text = lang_get('req_area_covered'); break; case "reqdoctype_link": $hyperlink = "project_manage_reqdoctype_page.php"; $text = lang_get('req_doc_type'); break; case "reqfunctionality_link": $hyperlink = "project_manage_reqfunctionality_page.php"; $text = lang_get('req_functionality'); break; case "testdoctype_link": $hyperlink = "project_manage_testdoctype_page.php"; $text = lang_get('test_doc_type'); break; case "testtype_link": $hyperlink = "project_manage_testtype_page.php"; $text = lang_get('testtype'); break; case "bug_category_link": $hyperlink = "project_manage_bug_category_page.php"; $text = lang_get('bug_category'); break; case "bug_component_link": $hyperlink = "project_manage_bug_component_page.php"; $text = lang_get('bug_component'); break; } if ($hyperlink) { $html .= "<table align=left>" . NEWLINE; $html .= "<tr>" . NEWLINE; $html .= "<td class='sub_menu' nowrap><b><a href='{$hyperlink}'>{$text}</a></b></td>" . NEWLINE; $html .= "</tr>" . NEWLINE; $html .= "</table>" . NEWLINE; } else { $html .= "<table align=left>" . NEWLINE; $html .= "<tr>" . NEWLINE; $html .= "<td class='sub_menu' nowrap><b>{$key}</b></td>" . NEWLINE; $html .= "</tr>" . NEWLINE; $html .= "</table>" . NEWLINE; } } $html .= "\t</td>" . NEWLINE; $html .= "</tr>" . NEWLINE; $html .= "</table>" . NEWLINE; print $html; }
$redirect_url = $page . "?project_id=" . $selected_project_id; $s_user_properties = session_get_user_properties(); $user_id = $s_user_properties['user_id']; $row_style = ''; $order_by = MAN_DOC_TYPE_NAME; $order_dir = "ASC"; $page_number = 1; util_set_order_by($order_by, $_GET); util_set_order_dir($order_dir, $_GET); util_set_page_number($page_number, $_GET); util_set_order_by($order_by, $_POST); util_set_order_dir($order_dir, $_POST); util_set_page_number($page_number, $_POST); html_window_title(); html_print_body(); html_page_title(project_get_name($selected_project_id) . " - " . lang_get('manage_project_page')); html_page_header($db, $project_name); html_print_menu(); admin_menu_print($page, $project_id, $user_id); html_project_manage_menu(); html_project_manage_tests_menu(); error_report_check($_GET); $project_details = project_get_details($selected_project_id); print "<div align=center>" . NEWLINE; print "<br>" . NEWLINE; if (!empty($project_details)) { $project_id = $project_details[PROJ_ID]; $project_name = $project_details[PROJ_NAME]; $project_status = $project_details[PROJ_STATUS]; $project_description = $project_details[PROJ_DESCRIPTION]; ####################################################################################
/** * print bug counts by project * @todo check p_cache - static? * * @param array $p_projects Array of project id's. * @param integer $p_level Indicates the depth of the project within the sub-project hierarchy. * @param array $p_cache Summary cache. * @return void */ function summary_print_by_project(array $p_projects = array(), $p_level = 0, array $p_cache = null) { $t_project_id = helper_get_current_project(); if (empty($p_projects)) { if (ALL_PROJECTS == $t_project_id) { $p_projects = current_user_get_accessible_projects(); } else { $p_projects = array($t_project_id); } } # Retrieve statistics one time to improve performance. if (null === $p_cache) { $t_query = 'SELECT project_id, status, COUNT( status ) AS bugcount FROM {bug} GROUP BY project_id, status'; $t_result = db_query($t_query); $p_cache = array(); $t_resolved_val = config_get('bug_resolved_status_threshold'); $t_closed_val = config_get('bug_closed_status_threshold'); while ($t_row = db_fetch_array($t_result)) { $t_project_id = $t_row['project_id']; $t_status = $t_row['status']; $t_bugcount = $t_row['bugcount']; if ($t_closed_val <= $t_status) { if (isset($p_cache[$t_project_id]['closed'])) { $p_cache[$t_project_id]['closed'] += $t_bugcount; } else { $p_cache[$t_project_id]['closed'] = $t_bugcount; } } else { if ($t_resolved_val <= $t_status) { if (isset($p_cache[$t_project_id]['resolved'])) { $p_cache[$t_project_id]['resolved'] += $t_bugcount; } else { $p_cache[$t_project_id]['resolved'] = $t_bugcount; } } else { if (isset($p_cache[$t_project_id]['open'])) { $p_cache[$t_project_id]['open'] += $t_bugcount; } else { $p_cache[$t_project_id]['open'] = $t_bugcount; } } } } } foreach ($p_projects as $t_project) { $t_name = str_repeat('» ', $p_level) . project_get_name($t_project); $t_pdata = isset($p_cache[$t_project]) ? $p_cache[$t_project] : array('open' => 0, 'resolved' => 0, 'closed' => 0); $t_bugs_open = isset($t_pdata['open']) ? $t_pdata['open'] : 0; $t_bugs_resolved = isset($t_pdata['resolved']) ? $t_pdata['resolved'] : 0; $t_bugs_closed = isset($t_pdata['closed']) ? $t_pdata['closed'] : 0; $t_bugs_total = $t_bugs_open + $t_bugs_resolved + $t_bugs_closed; summary_helper_print_row(string_display_line($t_name), $t_bugs_open, $t_bugs_resolved, $t_bugs_closed, $t_bugs_total); if (count(project_hierarchy_get_subprojects($t_project)) > 0) { $t_subprojects = current_user_get_accessible_subprojects($t_project); if (count($t_subprojects) > 0) { summary_print_by_project($t_subprojects, $p_level + 1, $p_cache); } } } }
$t_page_count = null; $result = filter_get_bug_rows($f_page_number, $t_per_page, $t_page_count, $t_bug_count); $row_count = count($result); # pre-cache custom column data columns_plugin_cache_issue_data($result); # for export $t_show_flag = gpc_get_int('show_flag', 0); html_page_top1(); html_head_end(); html_body_begin(); ?> <table class="width100"><tr><td class="form-title"> <div class="center"> <?php echo string_display(config_get('window_title')) . ' - ' . string_display(project_get_name($t_project_id)); ?> </div> </td></tr></table> <br /> <form method="post" action="view_all_set.php"> <?php # CSRF protection not required here - form does not result in modifications ?> <input type="hidden" name="type" value="1" /> <input type="hidden" name="print" value="1" /> <input type="hidden" name="offset" value="0" /> <input type="hidden" name="<?php echo FILTER_PROPERTY_SORT_FIELD_NAME;
<?php # Pre-generate a form security token to avoid performance issues when the # db contains a large number of configurations $t_form_security_token = form_security_token('adm_config_delete'); while ($t_row = db_fetch_array($t_result)) { extract($t_row, EXTR_PREFIX_ALL, 'v'); ?> <!-- Repeated Info Rows --> <tr width="100%"> <td> <?php echo $v_user_id == 0 ? lang_get('all_users') : string_display_line(user_get_name($v_user_id)); ?> </td> <td><?php echo string_display_line(project_get_name($v_project_id, false)); ?> </td> <td><?php echo string_display_line($v_config_id); ?> </td> <td><?php echo string_display_line(get_config_type($v_type)); ?> </td> <td style="overflow-x:auto;"><?php print_config_value_as_string($v_type, $v_value); ?> </td> <td><?php