/** * @param $edit_page * @param $obsolete_flag */ function print_versions($edit_page, $obsolete_flag) { $specmanagement_database_api = new specmanagement_database_api(); $specmanagement_print_api = new specmanagement_print_api(); $obsolote = false; if ($obsolete_flag) { $obsolote = null; } if ($edit_page) { $versions = version_get_all_rows_with_subs(helper_get_current_project(), null, null); } else { $versions = version_get_all_rows_with_subs(helper_get_current_project(), null, $obsolote); } for ($version_index = 0; $version_index < count($versions); $version_index++) { $version = $versions[$version_index]; $current_type = $specmanagement_database_api->get_type_string($specmanagement_database_api->get_type_by_version($version['id'])); $specmanagement_print_api->printRow(); echo '<input type="hidden" name="version_ids[]" value="' . $version['id'] . '"/>'; print_name($edit_page, $version); print_released($edit_page, $version_index, $version); print_obsolete($edit_page, $version_index, $version); print_date($edit_page, $version); print_type($edit_page, $current_type, $version); print_description($edit_page, $version); print_action($edit_page, $version); echo '</tr>'; } }
/** * @param $obsolete_flag * @param $show_zero_issues * @param $print_flag */ function print_table($obsolete_flag, $show_zero_issues, $print_flag) { $specmanagement_print_api = new specmanagement_print_api(); $obsolote = false; if ($obsolete_flag) { $obsolote = null; } $versions = version_get_all_rows_with_subs(helper_get_current_project(), null, $obsolote); $amount_stat_columns = plugin_config_get('CAmount'); if ($amount_stat_columns > PLUGINS_SPECMANAGEMENT_MAX_COLUMNS) { $amount_stat_columns = PLUGINS_SPECMANAGEMENT_MAX_COLUMNS; } $specmanagement_print_api->printTableTop('90'); print_tablehead($amount_stat_columns, $obsolete_flag, $show_zero_issues, $print_flag); print_tablebody($amount_stat_columns, $print_flag, $show_zero_issues, $versions); $specmanagement_print_api->printTableFoot(); }
function print_version_option_list($p_version = '', $p_project_id = null, $p_released = null, $p_leading_blank = true, $p_with_subs = false) { if (null === $p_project_id) { $c_project_id = helper_get_current_project(); } else { $c_project_id = db_prepare_int($p_project_id); } if ($p_with_subs) { $versions = version_get_all_rows_with_subs($c_project_id, $p_released, null); } else { $versions = version_get_all_rows($c_project_id, $p_released, null); } # Ensure the selected version (if specified) is included in the list # Note: Filter API specifies selected versions as an array if (!is_array($p_version)) { if (!empty($p_version)) { $t_version_id = version_get_id($p_version, $c_project_id); if ($t_version_id !== false) { $versions[] = version_cache_row($t_version_id); } } } if ($p_leading_blank) { echo '<option value=""></option>'; } $t_listed = array(); $t_max_length = config_get('max_dropdown_length'); $t_show_version_dates = access_has_project_level(config_get('show_version_dates_threshold')); $t_short_date_format = config_get('short_date_format'); foreach ($versions as $version) { # If the current version is obsolete, and current version not equal to $p_version, # then skip it. if ((int) $version['obsolete'] == 1) { if ($version['version'] != $p_version) { continue; } } $t_version = string_attribute($version['version']); if (!in_array($t_version, $t_listed)) { $t_listed[] = $t_version; echo '<option value="' . $t_version . '"'; check_selected($p_version, $version['version']); $t_version_string = string_attribute(prepare_version_string($c_project_id, $version['id'])); echo '>', string_shorten($t_version_string, $t_max_length), '</option>'; } } }
} $f_view_type = gpc_get_string('view_type', $f_default_view_type); if (ADVANCED_ONLY == config_get('view_filters')) { $f_view_type = 'advanced'; } if (SIMPLE_ONLY == config_get('view_filters')) { $f_view_type = 'simple'; } if (!in_array($f_view_type, array('simple', 'advanced'))) { $f_view_type = $f_default_view_type; } $t_select_modifier = ''; if ('advanced' == $f_view_type) { $t_select_modifier = 'multiple="multiple" size="10" '; } $t_show_version = ON == config_get('show_product_version') || AUTO == config_get('show_product_version') && count(version_get_all_rows_with_subs($t_project_id)) > 0; $t_show_tags = access_has_global_level(config_get('tag_view_threshold')); ?> <br /> <form method="post" name="filters" action="<?php echo $t_action; ?> "> <input type="hidden" name="type" value="1" /> <input type="hidden" name="view_type" value="<?php print $f_view_type; ?> " /> <?php if ($f_for_screen == false) { print "<input type=\"hidden\" name=\"print\" value=\"1\" />";
function filter_draw_selection_area2($p_page_number, $p_for_screen = true, $p_expanded = true) { $t_form_name_suffix = $p_expanded ? '_open' : '_closed'; $t_filter = current_user_get_bug_filter(); $t_filter = filter_ensure_valid_filter($t_filter); $t_project_id = helper_get_current_project(); $t_page_number = (int) $p_page_number; $t_view_type = $t_filter['_view_type']; $t_tdclass = 'small-caption'; $t_trclass = 'row-category2'; $t_action = 'view_all_set.php?f=3'; if ($p_for_screen == false) { $t_tdclass = 'print'; $t_trclass = ''; $t_action = 'view_all_set.php'; } ?> <br /> <form method="post" name="filters<?php echo $t_form_name_suffix; ?> " id="filters_form<?php echo $t_form_name_suffix; ?> " action="<?php print $t_action; ?> "> <input type="hidden" name="type" value="1" /> <?php if ($p_for_screen == false) { print '<input type="hidden" name="print" value="1" />'; print '<input type="hidden" name="offset" value="0" />'; } ?> <input type="hidden" name="page_number" value="<?php print $t_page_number; ?> " /> <input type="hidden" name="view_type" value="<?php print $t_view_type; ?> " /> <table class="width100" cellspacing="1"> <?php $t_filter_cols = config_get('filter_custom_fields_per_row'); if ($p_expanded) { $t_custom_cols = $t_filter_cols; $t_current_user_access_level = current_user_get_access_level(); $t_accessible_custom_fields_ids = array(); $t_accessible_custom_fields_names = array(); $t_accessible_custom_fields_values = array(); $t_num_custom_rows = 0; $t_per_row = 0; if (ON == config_get('filter_by_custom_fields')) { $t_custom_fields = custom_field_get_linked_ids($t_project_id); foreach ($t_custom_fields as $t_cfid) { $t_field_info = custom_field_cache_row($t_cfid, true); if ($t_field_info['access_level_r'] <= $t_current_user_access_level) { $t_accessible_custom_fields_ids[] = $t_cfid; $t_accessible_custom_fields_names[] = $t_field_info['name']; $t_accessible_custom_fields_types[] = $t_field_info['type']; $t_accessible_custom_fields_values[] = custom_field_distinct_values($t_cfid); } } if (count($t_accessible_custom_fields_ids) > 0) { $t_per_row = config_get('filter_custom_fields_per_row'); $t_num_custom_rows = ceil(count($t_accessible_custom_fields_ids) / $t_per_row); } } $t_filters_url = 'view_filters_page.php?for_screen=' . $p_for_screen; if ('advanced' == $t_view_type) { $t_filters_url = $t_filters_url . '&view_type=advanced'; } $t_filters_url = $t_filters_url . '&target_field='; $t_show_version = ON == config_get('show_product_version') || AUTO == config_get('show_product_version') && count(version_get_all_rows_with_subs($t_project_id)) > 0; # overload handler_id setting if user isn't supposed to see them (ref #6189) if (!access_has_project_level(config_get('view_handler_threshold'), $t_project_id)) { $t_filter['handler_id'] = array(META_FILTER_ANY); } ?> <tr <?php print "class=\"" . $t_trclass . "\""; ?> > <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'reporter_id[]'; ?> " id="reporter_id_filter"><?php print lang_get('reporter'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'user_monitor[]'; ?> " id="user_monitor_filter"><?php print lang_get('monitored_by'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'handler_id[]'; ?> " id="handler_id_filter"><?php print lang_get('assigned_to'); ?> :</a> </td> <td colspan="2" class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'show_category[]'; ?> " id="show_category_filter"><?php print lang_get('category'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'show_severity[]'; ?> " id="show_severity_filter"><?php print lang_get('severity'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'show_resolution[]'; ?> " id="show_resolution_filter"><?php print lang_get('resolution'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'show_profile[]'; ?> " id="show_profile_filter"><?php print lang_get('profile'); ?> :</a> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr class="row-1"> <td class="small-caption" valign="top" id="reporter_id_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['reporter_id']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['reporter_id'] as $t_current) { $t_this_name = ''; ?> <input type="hidden" name="reporter_id[]" value="<?php echo $t_current; ?> " /> <?php if ($t_current === 0 || is_blank($t_current) || META_FILTER_ANY == $t_current) { $t_any_found = true; } else { if (META_FILTER_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 (META_FILTER_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 . $t_this_name; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td class="small-caption" valign="top" id="user_monitor_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['user_monitor']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['user_monitor'] as $t_current) { ?> <input type="hidden" name="user_monitor[]" value="<?php echo $t_current; ?> " /> <?php $t_this_name = ''; if ($t_current === 0 || is_blank($t_current) || META_FILTER_ANY == $t_current) { $t_any_found = true; } else { if (META_FILTER_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 . $t_this_name; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td class="small-caption" valign="top" id="handler_id_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['handler_id']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['handler_id'] as $t_current) { ?> <input type="hidden" name="handler_id[]" value="<?php echo $t_current; ?> " /> <?php $t_this_name = ''; if (META_FILTER_NONE == $t_current) { $t_this_name = lang_get('none'); } else { if ($t_current === 0 || is_blank($t_current) || META_FILTER_ANY == $t_current) { $t_any_found = true; } else { if (META_FILTER_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 . $t_this_name; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td colspan="2" class="small-caption" valign="top" id="show_category_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_category']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['show_category'] as $t_current) { $t_current = stripslashes($t_current); ?> <input type="hidden" name="show_category[]" value="<?php echo string_display($t_current); ?> " /> <?php $t_this_string = ''; if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) { $t_any_found = true; } else { $t_this_string = string_display($t_current); } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td class="small-caption" valign="top" id="show_severity_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_severity']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['show_severity'] as $t_current) { ?> <input type="hidden" name="show_severity[]" value="<?php echo $t_current; ?> " /> <?php $t_this_string = ''; if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current == 0) { $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 . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td class="small-caption" valign="top" id="show_resolution_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_resolution']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['show_resolution'] as $t_current) { ?> <input type="hidden" name="show_resolution[]" value="<?php echo $t_current; ?> " /> <?php $t_this_string = ''; if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current === 0) { $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 . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td class="small-caption" valign="top" id="show_profile_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_profile']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['show_profile'] as $t_current) { ?> <input type="hidden" name="show_profile[]" value="<?php echo $t_current; ?> " /> <?php $t_this_string = ''; if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current === 0) { $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 . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr <?php print "class=\"" . $t_trclass . "\""; ?> > <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'show_status[]'; ?> " id="show_status_filter"><?php print lang_get('status'); ?> :</a> </td> <td class="small-caption" valign="top"> <?php if ('simple' == $t_view_type) { ?> <a href="<?php print $t_filters_url . 'hide_status[]'; ?> " id="hide_status_filter"><?php print lang_get('hide_status'); ?> :</a> <?php } ?> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'show_build[]'; ?> " id="show_build_filter"><?php print lang_get('product_build'); ?> :</a> </td> <?php if ($t_show_version) { ?> <td colspan="2" class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'show_version[]'; ?> " id="show_version_filter"><?php print lang_get('product_version'); ?> :</a> </td> <td colspan="1" class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'fixed_in_version[]'; ?> " id="show_fixed_in_version_filter"><?php print lang_get('fixed_in_version'); ?> :</a> </td> <?php } else { ?> <td colspan="2" class="small-caption" valign="top"> </td> <td colspan="1" class="small-caption" valign="top"> </td> <?php } ?> <td colspan="1" class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'show_priority[]'; ?> " id="show_priority_filter"><?php print lang_get('priority'); ?> :</a> </td> <td colspan="1" class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . 'target_version[]'; ?> " id="show_target_version_filter"><?php echo lang_get('target_version'); ?> :</a> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 7) . '"> </td>'; } ?> </tr> <tr class="row-1"> <td class="small-caption" valign="top" id="show_status_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_status']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['show_status'] as $t_current) { ?> <input type="hidden" name="show_status[]" value="<?php echo $t_current; ?> " /> <?php $t_this_string = ''; if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current === 0) { $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 . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td class="small-caption" valign="top" id="hide_status_filter_target"> <?php if ('simple' == $t_view_type) { $t_output = ''; $t_none_found = false; if (count($t_filter['hide_status']) == 0) { print lang_get('none'); } else { $t_first_flag = true; foreach ($t_filter['hide_status'] as $t_current) { ?> <input type="hidden" name="hide_status[]" value="<?php echo $t_current; ?> " /> <?php $t_this_string = ''; if ($t_current == META_FILTER_NONE || is_blank($t_current) || $t_current === 0) { $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 . $t_this_string; } $t_hide_status_post = ''; if (count($t_filter['hide_status']) == 1) { $t_hide_status_post = ' (' . lang_get('and_above') . ')'; } if (true == $t_none_found) { print lang_get('none'); } else { print $t_output . $t_hide_status_post; } } } ?> </td> <td class="small-caption" valign="top" id="show_build_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_build']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['show_build'] as $t_current) { $t_current = stripslashes($t_current); ?> <input type="hidden" name="show_build[]" value="<?php echo string_display($t_current); ?> " /> <?php $t_this_string = ''; if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) { $t_any_found = true; } else { if (META_FILTER_NONE == $t_current) { $t_this_string = lang_get('none'); } else { $t_this_string = string_display($t_current); } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <?php if ($t_show_version) { ?> <td colspan="2" class="small-caption" valign="top" id="show_version_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_version']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['show_version'] as $t_current) { $t_current = stripslashes($t_current); ?> <input type="hidden" name="show_version[]" value="<?php echo string_display($t_current); ?> " /> <?php $t_this_string = ''; if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) { $t_any_found = true; } else { if (META_FILTER_NONE == $t_current) { $t_this_string = lang_get('none'); } else { $t_this_string = string_display($t_current); } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td colspan="1" class="small-caption" valign="top" id="show_fixed_in_version_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['fixed_in_version']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['fixed_in_version'] as $t_current) { $t_current = stripslashes($t_current); ?> <input type="hidden" name="fixed_in_version[]" value="<?php echo string_display($t_current); ?> " /> <?php $t_this_string = ''; if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) { $t_any_found = true; } else { if (META_FILTER_NONE == $t_current) { $t_this_string = lang_get('none'); } else { $t_this_string = string_display($t_current); } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <?php } else { ?> <td colspan="2" class="small-caption" valign="top"> </td> <td colspan="1" class="small-caption" valign="top"> </td> <?php } ?> <td colspan="1" class="small-caption" valign="top" id="show_priority_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_priority']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['show_priority'] as $t_current) { ?> <input type="hidden" name="show_priority[]" value="<?php echo $t_current; ?> " /> <?php $t_this_string = ''; if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current === 0) { $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 . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <td colspan="1" class="small-caption" valign="top" id="show_target_version_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['target_version']) == 0) { print lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter['target_version'] as $t_current) { $t_current = stripslashes($t_current); ?> <input type="hidden" name="target_version[]" value="<?php echo string_display($t_current); ?> " /> <?php $t_this_string = ''; if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) { $t_any_found = true; } else { if (META_FILTER_NONE == $t_current) { $t_this_string = lang_get('none'); } else { $t_this_string = string_display($t_current); } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . $t_this_string; } if (true == $t_any_found) { print lang_get('any'); } else { print $t_output; } } ?> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 7) . '"> </td>'; } ?> </tr> <tr <?php print "class=\"" . $t_trclass . "\""; ?> > <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'per_page'; ?> " id="per_page_filter"><?php print lang_get('show'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'view_state'; ?> " id="view_state_filter"><?php print lang_get('view_status'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'sticky_issues'; ?> " id="sticky_issues_filter"><?php print lang_get('sticky'); ?> :</a> </td> <td class="small-caption" valign="top" colspan="2"> <a href="<?php print $t_filters_url . 'highlight_changed'; ?> " id="highlight_changed_filter"><?php print lang_get('changed'); ?> :</a> </td> <td class="small-caption" valign="top" > <a href="<?php print $t_filters_url . 'do_filter_by_date'; ?> " id="do_filter_by_date_filter"><?php print lang_get('use_date_filters'); ?> :</a> </td> <td class="small-caption" valign="top" colspan="2"> <a href="<?php print $t_filters_url . 'relationship_type'; ?> " id="relationship_type_filter"><?php print lang_get('bug_relationships'); ?> :</a> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr class="row-1"> <td class="small-caption" valign="top" id="per_page_filter_target"> <?php echo $t_filter['per_page'] == 0 ? lang_get('all') : $t_filter['per_page']; ?> <input type="hidden" name="per_page" value="<?php echo $t_filter['per_page']; ?> " /> </td> <td class="small-caption" valign="top" id="view_state_filter_target"> <?php if (VS_PUBLIC === $t_filter['view_state']) { print lang_get('public'); } else { if (VS_PRIVATE === $t_filter['view_state']) { print lang_get('private'); } else { print lang_get('any'); $t_filter['view_state'] = META_FILTER_ANY; } } ?> <input type="hidden" name="view_state" value="<?php echo $t_filter['view_state']; ?> " /> </td> <td class="small-caption" valign="top" id="sticky_issues_filter_target"> <?php $t_sticky_filter_state = gpc_string_to_bool($t_filter['sticky_issues']); print $t_sticky_filter_state ? lang_get('yes') : lang_get('no'); ?> <input type="hidden" name="sticky_issues" value="<?php echo $t_sticky_filter_state ? 'on' : 'off'; ?> " /> </td> <td class="small-caption" valign="top" colspan="2" id="highlight_changed_filter_target"> <?php print $t_filter['highlight_changed']; ?> <input type="hidden" name="highlight_changed" value="<?php echo $t_filter['highlight_changed']; ?> " /> </td> <td class="small-caption" valign="top" id="do_filter_by_date_filter_target"> <?php if (ON == config_get('dhtml_filters') && ON == config_get('use_javascript')) { ?> <script type="text/javascript" language="JavaScript"> <!-- function SwitchDateFields() { // All fields need to be enabled to go back to the script document.filters_open.start_month.disabled = ! document.filters_open.do_filter_by_date.checked; document.filters_open.start_day.disabled = ! document.filters_open.do_filter_by_date.checked; document.filters_open.start_year.disabled = ! document.filters_open.do_filter_by_date.checked; document.filters_open.end_month.disabled = ! document.filters_open.do_filter_by_date.checked; document.filters_open.end_day.disabled = ! document.filters_open.do_filter_by_date.checked; document.filters_open.end_year.disabled = ! document.filters_open.do_filter_by_date.checked; return true; } // --> </script> <?php } # end if dhtml_filters if ('on' == $t_filter['do_filter_by_date']) { ?> <input type="hidden" name="do_filter_by_date" value="<?php echo $t_filter['do_filter_by_date']; ?> " /> <input type="hidden" name="start_month" value="<?php echo $t_filter['start_month']; ?> " /> <input type="hidden" name="start_day" value="<?php echo $t_filter['start_day']; ?> " /> <input type="hidden" name="start_year" value="<?php echo $t_filter['start_year']; ?> " /> <input type="hidden" name="end_month" value="<?php echo $t_filter['end_month']; ?> " /> <input type="hidden" name="end_day" value="<?php echo $t_filter['end_day']; ?> " /> <input type="hidden" name="end_year" value="<?php echo $t_filter['end_year']; ?> " /> <?php $t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY); $t_time = mktime(0, 0, 0, $t_filter['start_month'], $t_filter['start_day'], $t_filter['start_year']); foreach ($t_chars as $t_char) { if (strcasecmp($t_char, "M") == 0) { print ' '; print date('F', $t_time); } if (strcasecmp($t_char, "D") == 0) { print ' '; print date('d', $t_time); } if (strcasecmp($t_char, "Y") == 0) { print ' '; print date('Y', $t_time); } } print ' - '; $t_time = mktime(0, 0, 0, $t_filter['end_month'], $t_filter['end_day'], $t_filter['end_year']); foreach ($t_chars as $t_char) { if (strcasecmp($t_char, "M") == 0) { print ' '; print date('F', $t_time); } if (strcasecmp($t_char, "D") == 0) { print ' '; print date('d', $t_time); } if (strcasecmp($t_char, "Y") == 0) { print ' '; print date('Y', $t_time); } } } else { print lang_get('no'); } ?> </td> <td class="small-caption" valign="top" colspan="2" id="relationship_type_filter_target"> <input type="hidden" name="relationship_type" value="<?php echo $t_filter['relationship_type']; ?> " /> <input type="hidden" name="relationship_bug" value="<?php echo $t_filter['relationship_bug']; ?> " /> <?php $c_rel_type = $t_filter['relationship_type']; $c_rel_bug = $t_filter['relationship_bug']; if (-1 == $c_rel_type || 0 == $c_rel_bug) { print lang_get('any'); } else { print relationship_get_description_for_history($c_rel_type) . ' ' . $c_rel_bug; } ?> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr <?php print "class=\"" . $t_trclass . "\""; ?> > <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . 'platform'; ?> " id="platform_filter"><?php echo lang_get('platform'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'os'; ?> " id="os_filter"><?php echo lang_get('os'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php print $t_filters_url . 'os_build'; ?> " id="os_build_filter"><?php echo lang_get('os_version'); ?> :</a> </td> <td class="small-caption" valign="top" colspan="5"> <?php if (access_has_global_level(config_get('tag_view_threshold'))) { ?> <a href="<?php print $t_filters_url . 'tag_string'; ?> " id="tag_string_filter"><?php echo lang_get('tags'); ?> :</a> <?php } ?> </td> <?php if ($t_filter_cols > 8) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr class="row-1"> <td class="small-caption" valign="top" id="platform_filter_target"> <?php print_multivalue_field(FILTER_PROPERTY_PLATFORM, $t_filter[FILTER_PROPERTY_PLATFORM]); ?> </td> <td class="small-caption" valign="top" id="os_filter_target"> <?php print_multivalue_field(FILTER_PROPERTY_OS, $t_filter[FILTER_PROPERTY_OS]); ?> </td> <td class="small-caption" valign="top" id="os_build_filter_target"> <?php print_multivalue_field(FILTER_PROPERTY_OS_BUILD, $t_filter[FILTER_PROPERTY_OS_BUILD]); ?> </td> <td class="small-caption" valign="top" id="tag_string_filter_target" colspan="5"> <?php $t_tag_string = $t_filter['tag_string']; if ($t_filter['tag_select'] != 0) { $t_tag_string .= is_blank($t_tag_string) ? '' : config_get('tag_separator'); $t_tag_string .= tag_get_field($t_filter['tag_select'], 'name'); } print $t_tag_string; ?> <input type="hidden" name="tag_string" value="<?php echo $t_tag_string; ?> "/> </td> </tr> <?php 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" valign="top"> '; $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_fields .= string_display(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" valign="top" 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) { # @@@ moved embedded javascript here from print_filter_custom_field_date # it appears not to load properly on Firefox and other browsers if loaded through the httpxmlreq $t_field_id = $t_accessible_custom_fields_ids[$i]; $t_js_toggle_func = "toggle_custom_date_field_" . $t_field_id . "_controls"; if (ON == config_get('dhtml_filters') && ON == config_get('use_javascript')) { ?> <script type="text/javascript" language="JavaScript"> <!-- function <?php echo $t_js_toggle_func . "_start"; ?> (disable) { document.filters_open.custom_field_<?php echo $t_field_id; ?> _start_year.disabled = disable ; document.filters_open.custom_field_<?php echo $t_field_id; ?> _start_month.disabled = disable ; document.filters_open.custom_field_<?php echo $t_field_id; ?> _start_day.disabled = disable ; } ; function <?php echo $t_js_toggle_func . "_end"; ?> (disable) { document.filters_open.custom_field_<?php echo $t_field_id; ?> _end_year.disabled = disable ; document.filters_open.custom_field_<?php echo $t_field_id; ?> _end_month.disabled = disable ; document.filters_open.custom_field_<?php echo $t_field_id; ?> _end_day.disabled = disable ; } ; function <?php echo $t_js_toggle_func; ?> () { switch (document.filters_open.custom_field_<?php echo $t_field_id; ?> _control.selectedIndex) { case <?php echo CUSTOM_FIELD_DATE_ANY; ?> : case <?php echo CUSTOM_FIELD_DATE_NONE; ?> : <?php echo $t_js_toggle_func . "_start"; ?> (true) ; <?php echo $t_js_toggle_func . "_end"; ?> (true) ; break ; case <?php echo CUSTOM_FIELD_DATE_BETWEEN; ?> : <?php echo $t_js_toggle_func . "_start"; ?> (false) ; <?php echo $t_js_toggle_func . "_end"; ?> (false) ; break ; default: <?php echo $t_js_toggle_func . "_start"; ?> (false) ; <?php echo $t_js_toggle_func . "_end"; ?> (true) ; break ; } } // --> </script> <?php } # end if dhtml_filters $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') . '<br />'; $t_values .= $t_start . '<br />' . $t_end; break; case CUSTOM_FIELD_DATE_ONORBEFORE: $t_values .= lang_get('on_or_before') . '<br />'; $t_values .= $t_end; break; case CUSTOM_FIELD_DATE_BEFORE: $t_values .= lang_get('before') . '<br />'; $t_values .= $t_end; break; case CUSTOM_FIELD_DATE_ON: $t_values .= lang_get('on') . '<br />'; $t_values .= $t_start; break; case CUSTOM_FIELD_DATE_AFTER: $t_values .= lang_get('after') . '<br />'; $t_values .= $t_start; break; case CUSTOM_FIELD_DATE_ONORAFTER: $t_values .= lang_get('on_or_after') . '<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 ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) { $t_any_found = true; } else { if (META_FILTER_NONE == $t_current && is_numeric($t_current)) { $t_this_string = lang_get('none'); } else { $t_this_string = string_display($t_current); } } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . $t_this_string; $t_values .= '<input type="hidden" name="custom_field_' . $t_accessible_custom_fields_ids[$i] . '[]" value="' . string_display($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" valign="top"> <a href="<?php print $t_filters_url . 'show_sort'; ?> " id="show_sort_filter"><?php print lang_get('sort'); ?> :</a> </td> <td class="small-caption" valign="top" colspan="2" id="show_sort_filter_target"> <?php $t_sort_fields = split(',', $t_filter['sort']); $t_dir_fields = split(',', $t_filter['dir']); 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(substr($t_sort, strlen('custom_')))); } else { $t_field_name = string_get_field_name($t_sort); } echo $t_field_name . " " . lang_get('bugnote_order_' . strtolower($t_dir_fields[$i])); echo "<input type=\"hidden\" name=\"sort_{$i}\" value=\"{$t_sort_fields[$i]}\" />"; echo "<input type=\"hidden\" name=\"dir_{$i}\" value=\"{$t_dir_fields[$i]}\" />"; } } ?> </td> <?php if ('advanced' == $t_view_type) { ?> <td class="small-caption" valign="top" colspan="2"> <a href="<?php print $t_filters_url . 'project_id'; ?> " id="project_id_filter"><?php print lang_get('email_project'); ?> :</a> </td> <td class="small-caption" valign="top" id="project_id_filter_target"> <?php $t_output = ''; if (!is_array($t_filter['project_id'])) { $t_filter['project_id'] = array($t_filter['project_id']); } if (count($t_filter['project_id']) == 0) { print lang_get('current'); } else { $t_first_flag = true; foreach ($t_filter['project_id'] as $t_current) { ?> <input type="hidden" name="project_id[]" value="<?php echo $t_current; ?> " /> <?php $t_this_name = ''; if (META_FILTER_CURRENT == $t_current) { $t_this_name = lang_get('current'); } else { $t_this_name = project_get_name($t_current); } if ($t_first_flag != true) { $t_output = $t_output . '<br />'; } else { $t_first_flag = false; } $t_output = $t_output . $t_this_name; } print $t_output; } ?> </td> <?php if ($t_filter_cols > 6) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 5) . '"> </td>'; } } else { if ($t_filter_cols > 3) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 2) . '"> </td>'; } } ?> </tr> <?php } // expanded ?> <tr> <td colspan="2"> <?php collapse_icon('filter'); echo lang_get('search'); ?> : <input type="text" size="16" name="search" value="<?php print string_html_specialchars($t_filter['search']); ?> " /> <input type="submit" name="filter" class="button-small" value="<?php print lang_get('filter_button'); ?> " /> </td> </form> <td class="center" colspan="<?php echo $t_filter_cols - 6; ?> "> <!-- use this label for padding --> <?php if (ON == config_get('dhtml_filters')) { $f_switch_view_link = 'view_all_set.php?type=6&view_type='; } else { $f_switch_view_link = 'view_filters_page.php?view_type='; } if (SIMPLE_ONLY != config_get('view_filters') && ADVANCED_ONLY != config_get('view_filters')) { if ('advanced' == $t_view_type) { print_bracket_link($f_switch_view_link . 'simple', lang_get('simple_filters')); } else { print_bracket_link($f_switch_view_link . 'advanced', lang_get('advanced_filters')); } print_bracket_link('permalink_page.php?url=' . urlencode(filter_get_url($t_filter)), lang_get('create_filter_link'), true); } ?> </td> <td class="right" colspan="4"> <?php $t_stored_queries_arr = array(); $t_stored_queries_arr = filter_db_get_available_queries(); if (count($t_stored_queries_arr) > 0) { ?> <form method="get" name="list_queries<?php echo $t_form_name_suffix; ?> " action="view_all_set.php"> <input type="hidden" name="type" value="3" /> <?php if (ON == config_get('use_javascript')) { echo "<select name=\"source_query_id\" onchange=\"document.forms.list_queries{$t_form_name_suffix}.submit();\">"; } else { print '<select name="source_query_id">'; } ?> <option value="-1"><?php print '[' . lang_get('reset_query') . ']'; ?> </option> <option value="-1"></option> <?php foreach ($t_stored_queries_arr as $t_query_id => $t_query_name) { print '<option value="' . $t_query_id . '">' . $t_query_name . '</option>'; } ?> </select> <input type="submit" name="switch_to_query_button" class="button-small" value="<?php print lang_get('use_query'); ?> " /> </form> <form method="post" name="open_queries" action="query_view_page.php"> <input type="submit" name="switch_to_query_button" class="button-small" value="<?php print lang_get('open_queries'); ?> " /> </form> <?php } else { ?> <form method="get" name="reset_query" action="view_all_set.php"> <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 print lang_get('reset_query'); ?> " /> </form> <?php } if (access_has_project_level(config_get('stored_query_create_threshold'))) { ?> <form method="post" name="save_query" action="query_store_page.php"> <input type="submit" name="save_query_button" class="button-small" value="<?php print lang_get('save_query'); ?> " /> </form> <?php } else { ?> <?php } ?> </td> </tr> </table> <?php }
/** * Prints the header element of a document * * @param $type_string * @param $version_id * @param $allRelevantBugs * @param $print_flag */ public function print_document_head($type_string, $version_id, $allRelevantBugs, $print_flag) { $specmanagement_database_api = new specmanagement_database_api(); $project_id = helper_get_current_project(); $parent_project_id = $specmanagement_database_api->get_main_project_by_hierarchy($project_id); $versions = version_get_all_rows_with_subs($project_id, null, null); $act_version = version_get($version_id); $head_project_id = $project_id; if ($parent_project_id == 0) { $parent_project_id = version_get_field($version_id, 'project_id'); $head_project_id = version_get_field($version_id, 'project_id'); } $this->print_editor_table_head($print_flag); $this->print_editor_table_title($type_string, $version_id, $print_flag); $this->print_doc_head_row('head_version', version_get_field($version_id, 'version')); $this->print_doc_head_row('head_customer', project_get_name($parent_project_id)); $this->print_doc_head_row('head_project', project_get_name($head_project_id)); $this->print_doc_head_row('head_date', date('d\\.m\\.Y')); $this->print_doc_head_row('head_person_in_charge', $this->calculate_person_in_charge($version_id)); if (!is_null($allRelevantBugs)) { $process = $this->get_process($allRelevantBugs); if (is_array($process)) { $sum_pt_all = $process[0]; $sum_pt_bug = $process[1]; $pt_process = 0; if ($sum_pt_all != 0) { $pt_process = round($sum_pt_bug * 100 / $sum_pt_all, 2); } $process_string = '<span class="bar" style="width: ' . $pt_process . '%;">' . $sum_pt_bug . '/' . $sum_pt_all . ' ' . plugin_lang_get('editor_duration_unit') . ' (' . $pt_process . ' %)' . '</span>'; } else { $process_string = '<span class="bar" style="width: ' . $process . '%;">' . round($process, 2) . ' %</span>'; } //$this->print_doc_head_row ( 'head_process', $this->create_process_bar ( $process_string ) ); } if (!$print_flag) { $this->print_doc_head_versions($versions, $act_version); } echo '</table>'; echo '<br />'; }
function print_version_option_list($p_version = '', $p_project_id = null, $p_released = null, $p_leading_blank = true, $p_with_subs = false) { if (null === $p_project_id) { $c_project_id = helper_get_current_project(); } else { $c_project_id = db_prepare_int($p_project_id); } if ($p_with_subs) { $versions = version_get_all_rows_with_subs($c_project_id, $p_released); } else { $versions = version_get_all_rows($c_project_id, $p_released); } if ($p_leading_blank) { echo '<option value=""></option>'; } foreach ($versions as $version) { $t_version = string_attribute($version['version']); echo "<option value=\"{$t_version}\""; check_selected($p_version, $t_version); echo '>', string_shorten($t_version), '</option>'; } }