document.filters.start_day.disabled = ! document.filters.do_filter_by_date.checked; document.filters.start_year.disabled = ! document.filters.do_filter_by_date.checked; document.filters.end_month.disabled = ! document.filters.do_filter_by_date.checked; document.filters.end_day.disabled = ! document.filters.do_filter_by_date.checked; document.filters.end_year.disabled = ! document.filters.do_filter_by_date.checked; return true; } // --> </script> <?php } # @@@ thraxisp - could this be replaced by a call to filter_draw_selection_area2 $t_filter = current_user_get_bug_filter(); $t_filter = filter_ensure_valid_filter($t_filter); $t_project_id = helper_get_current_project(); $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_type = array(); $t_accessible_custom_fields_values = array(); $t_filter_cols = config_get('filter_custom_fields_per_row'); $t_custom_cols = 1; $t_custom_rows = 0; #get valid target fields $t_fields = helper_get_columns_to_view(); $t_n_fields = count($t_fields); for ($i = 0; $i < $t_n_fields; $i++) { if (in_array($t_fields[$i], array('selection', 'edit', 'bugnotes_count', 'attachment'))) { unset($t_fields[$i]);
if ($t_highlight_changed != -1) { $my_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED] = $t_highlight_changed; } # Handle custom fields. $t_custom_fields = array(); foreach ($_GET as $t_var_name => $t_var_value) { if (strpos($t_var_name, 'custom_field_') === 0) { $t_custom_field_id = utf8_substr($t_var_name, 13); $t_custom_fields[$t_custom_field_id] = $t_var_value; } } $my_filter['custom_fields'] = $t_custom_fields; # Must use advanced filter so that the project_id is applied and multiple # selections are handled. $my_filter['_view_type'] = 'advanced'; $tc_setting_arr = filter_ensure_valid_filter($my_filter); $t_settings_serialized = serialize($tc_setting_arr); $t_settings_string = config_get('cookie_version') . '#' . $t_settings_serialized; # Store the filter string in the database: its the current filter, so some values won't change $t_project_id = helper_get_current_project(); $t_project_id = $t_project_id * -1; $t_row_id = filter_db_set_for_current_user($t_project_id, false, '', $t_settings_string); # set cookie values gpc_set_cookie(config_get('view_all_cookie'), $t_row_id, time() + config_get('cookie_time_length'), config_get('cookie_path')); # redirect to print_all or view_all page if ($f_print) { $t_redirect_url = 'print_all_bug_page.php'; } else { $t_redirect_url = 'view_all_bug_page.php'; } print_header_redirect($t_redirect_url);
/** * Basically this is a copy of core/filter_api.php#filter_db_get_available_queries(). * The only difference is that the result of this function is not an array of filter * names but an array of filter structures. * @param integer $p_project_id Project id. * @param integer $p_user_id User id. * @return array */ function mci_filter_db_get_available_queries($p_project_id = null, $p_user_id = null) { $t_overall_query_arr = array(); if (null === $p_project_id) { $t_project_id = helper_get_current_project(); } else { $t_project_id = (int) $p_project_id; } if (null === $p_user_id) { $t_user_id = auth_get_current_user_id(); } else { $t_user_id = (int) $p_user_id; } # If the user doesn't have access rights to stored queries, just return if (!access_has_project_level(config_get('stored_query_use_threshold'))) { return $t_overall_query_arr; } # Get the list of available queries. By sorting such that public queries are # first, we can override any query that has the same name as a private query # with that private one $t_query = 'SELECT * FROM {filters} WHERE (project_id=' . db_param() . ' OR project_id=0) AND name!=\'\' AND (is_public = ' . db_param() . ' OR user_id = ' . db_param() . ') ORDER BY is_public DESC, name ASC'; $t_result = db_query($t_query, array($t_project_id, true, $t_user_id)); $t_query_count = db_num_rows($t_result); for ($i = 0; $i < $t_query_count; $i++) { $t_row = db_fetch_array($t_result); $t_filter_detail = explode('#', $t_row['filter_string'], 2); if (!isset($t_filter_detail[1])) { continue; } $t_filter = json_decode($t_filter_detail[1], true); $t_filter = filter_ensure_valid_filter($t_filter); $t_row['url'] = filter_get_url($t_filter); $t_overall_query_arr[$t_row['name']] = $t_row; } return array_values($t_overall_query_arr); }
/** * Returns the issue filter parameters for the current user * * @return Active issue filter for current user or false if no filter is currently defined. * @access public */ function current_user_get_bug_filter($p_project_id = null) { $f_filter_string = gpc_get_string('filter', ''); $t_view_all_cookie = ''; $t_cookie_detail = ''; $t_filter = ''; if (!is_blank($f_filter_string)) { if (is_numeric($f_filter_string)) { $t_token = token_get_value(TOKEN_FILTER); if (null != $t_token) { $t_filter = unserialize($t_token); } } else { $t_filter = unserialize($f_filter_string); } } else { if (!filter_is_cookie_valid()) { return false; } else { $t_user_id = auth_get_current_user_id(); $t_filter = user_get_bug_filter($t_user_id, $p_project_id); } } $t_filter = filter_ensure_valid_filter($t_filter); return $t_filter; }
/** * Get all issue rows matching the custom filter. * * @param integer $p_user_id The user id. * @param FilterSearchData $p_filter_search The custom filter. * @param integer $p_page_number Start with the given page number (zero-based). * @param integer $p_per_page Number of issues to display per page. * @return array of issue rows */ function mci_filter_search_get_rows($p_user_id, $p_filter_search, $p_page_number, $p_per_page) { global $g_soap_api_to_filter_names; // object to array if (is_object($p_filter_search)) { $p_filter_search = get_object_vars($p_filter_search); } $t_project_id = array(); if (isset($p_filter_search['project_id'])) { // check access right to all projects foreach ($p_filter_search['project_id'] as $t_id) { if (mci_has_readonly_access($p_user_id, $t_id)) { $t_project_id[] = $t_id; } else { error_log('User: '******' has not access right to project: ' . $t_id . '.'); } } // user has not access right to any project if (count($t_project_id) < 1) { return mci_soap_fault_access_denied($p_user_id); } } else { if (!mci_has_readonly_access($p_user_id, ALL_PROJECTS)) { return mci_soap_fault_access_denied($p_user_id); } $t_project_id = array(ALL_PROJECTS); } $t_filter = array('_view_type' => 'advanced'); $t_filter['project_id'] = $t_project_id; // default fields foreach ($g_soap_api_to_filter_names as $t_soap_name => $t_filter_name) { if (isset($p_filter_search[$t_soap_name])) { $t_value = $p_filter_search[$t_soap_name]; $t_filter[$t_filter_name] = $t_value; } } // custom fields if (isset($p_filter_search['custom_fields'])) { foreach ($p_filter_search['custom_fields'] as $t_custom_field) { // object to array if (is_object($t_custom_field)) { $t_custom_field = get_object_vars($t_custom_field); } $t_field = $t_custom_field['field']; if (is_object($t_field)) { $t_field = get_object_vars($t_field); } // if is set custom_field's id, use it primary if (isset($t_field['id'])) { $t_custom_field_id = $t_field['id']; } else { $t_custom_field_id = custom_field_get_id_from_name($t_field['name']); } $t_value = $t_custom_field['value']; $t_filter['custom_fields'][$t_custom_field_id] = $t_value; } } $t_filter = filter_ensure_valid_filter($t_filter); $t_result = array(); $t_page_number = $p_page_number < 1 ? 1 : $p_page_number; $t_page_count = 0; $t_bug_count = 0; return filter_get_bug_rows($t_page_number, $p_per_page, $t_page_count, $t_bug_count, $t_filter); }
/** * Basically this is a copy of core/filter_api.php#filter_db_get_available_queries(). * The only difference is that the result of this function is not an array of filter * names but an array of filter structures. */ function mci_filter_db_get_available_queries($p_project_id = null, $p_user_id = null) { $t_filters_table = db_get_table('filters'); $t_overall_query_arr = array(); if (null === $p_project_id) { $t_project_id = helper_get_current_project(); } else { $t_project_id = db_prepare_int($p_project_id); } if (null === $p_user_id) { $t_user_id = auth_get_current_user_id(); } else { $t_user_id = db_prepare_int($p_user_id); } # If the user doesn't have access rights to stored queries, just return if (!access_has_project_level(config_get('stored_query_use_threshold'))) { return $t_overall_query_arr; } # Get the list of available queries. By sorting such that public queries are # first, we can override any query that has the same name as a private query # with that private one $query = "SELECT * FROM {$t_filters_table}\n\t\t\t\t\tWHERE (project_id=" . db_param() . "\n\t\t\t\t\t\tOR project_id=0)\n\t\t\t\t\tAND name!=''\n\t\t\t\t\tAND (is_public = " . db_prepare_bool(true) . "\n\t\t\t\t\t\tOR user_id = " . db_param() . ")\n\t\t\t\t\tORDER BY is_public DESC, name ASC"; $result = db_query_bound($query, array($t_project_id, $t_user_id)); $query_count = db_num_rows($result); for ($i = 0; $i < $query_count; $i++) { $row = db_fetch_array($result); $t_filter_detail = explode('#', $row['filter_string'], 2); if (!isset($t_filter_detail[1])) { continue; } $t_filter = unserialize($t_filter_detail[1]); $t_filter = filter_ensure_valid_filter($t_filter); $row['url'] = filter_get_url($t_filter); $t_overall_query_arr[$row['name']] = $row; } return array_values($t_overall_query_arr); }
/** * Get the issue headers that match the specified filter and paging details. * * @param string $p_username The name of the user trying to access the filters. * @param string $p_password The password of the user. * @param integer $p_filter_id The id of the filter to apply. * @param integer $p_page_number Start with the given page number (zero-based) * @param integer $p_per_page Number of issues to display per page * @return Array that represents an IssueDataArray structure */ function mc_filter_get_issue_headers($p_username, $p_password, $p_project_id, $p_filter_id, $p_page_number, $p_per_page) { $t_user_id = mci_check_login($p_username, $p_password); if ($t_user_id === false) { return mci_soap_fault_login_failed(); } if (!mci_has_readonly_access($t_user_id, $p_project_id)) { return mci_soap_fault_access_denied($t_user_id); } $t_orig_page_number = $p_page_number < 1 ? 1 : $p_page_number; $t_page_count = 0; $t_bug_count = 0; $t_filter = filter_db_get_filter($p_filter_id); $t_filter_detail = explode('#', $t_filter, 2); if (!isset($t_filter_detail[1])) { return SoapObjectsFactory::newSoapFault('Server', 'Invalid Filter'); } $t_filter = unserialize($t_filter_detail[1]); $t_filter = filter_ensure_valid_filter($t_filter); $t_result = array(); $t_rows = filter_get_bug_rows($p_page_number, $p_per_page, $t_page_count, $t_bug_count, $t_filter, $p_project_id); // the page number was moved back, so we have exceeded the actual page number, see bug #12991 if ($t_orig_page_number > $p_page_number) { return $t_result; } foreach ($t_rows as $t_issue_data) { $t_result[] = mci_issue_data_as_header_array($t_issue_data); } return $t_result; }
/** * Get an array of timeline events * Events for which the skip() method returns true will be excluded * @param integer $p_start_time Timestamp representing start time of the period. * @param integer $p_end_time Timestamp representing end time of the period. * @param integer $p_max_events The maximum number of events to return or 0 for unlimited. * @param type $p_filter Filter array to use for filtering bugs * @return array */ function timeline_events($p_start_time, $p_end_time, $p_max_events, $p_filter = null) { $t_timeline_events = array(); if (null === $p_filter) { # create an empty filter, to match all bugs $t_filter = filter_ensure_valid_filter(array()); # Override the default hide status, to show all bugs $t_filter[FILTER_PROPERTY_HIDE_STATUS] = array(); } $t_result = history_get_range_result_filter($t_filter, $p_start_time, $p_end_time, 'DESC'); $t_count = 0; while ($t_history_event = history_get_event_from_row($t_result, auth_get_current_user_id(), true)) { $t_event = null; $t_user_id = $t_history_event['userid']; $t_timestamp = $t_history_event['date']; $t_issue_id = $t_history_event['bug_id']; switch ($t_history_event['type']) { case NEW_BUG: $t_event = new IssueCreatedTimelineEvent($t_timestamp, $t_user_id, $t_issue_id); break; case BUGNOTE_ADDED: $t_bugnote_id = $t_history_event['old_value']; $t_event = new IssueNoteCreatedTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_bugnote_id); break; case BUG_MONITOR: # Skip monitors added for others due to reminders, only add monitor events where added # user is the same as the logged in user. if ((int) $t_history_event['old_value'] == (int) $t_history_event['userid']) { $t_event = new IssueMonitorTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, true); } break; case BUG_UNMONITOR: $t_event = new IssueMonitorTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, false); break; case TAG_ATTACHED: $t_event = new IssueTagTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_history_event['old_value'], true); break; case TAG_DETACHED: $t_event = new IssueTagTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_history_event['old_value'], false); break; case NORMAL_TYPE: switch ($t_history_event['field']) { case 'status': $t_event = new IssueStatusChangeTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_history_event['old_value'], $t_history_event['new_value']); break; case 'handler_id': $t_event = new IssueAssignedTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_history_event['new_value']); break; } break; } # Do not include skipped events if ($t_event != null && !$t_event->skip()) { $t_timeline_events[] = $t_event; $t_count++; if ($p_max_events > 0 && $t_count >= $p_max_events) { break; } } } return $t_timeline_events; }
/** * Returns the issue filter parameters for the current user * * @param integer $p_project_id Project id. This argument is only used if a 'filter' string is not passed via the web request. * The default value is null meaning return the current filter for user's current project if a filter string is not supplied. * @return array User filter, if not set, then default filter. * @access public */ function current_user_get_bug_filter($p_project_id = null) { $f_filter_string = gpc_get_string('filter', ''); $t_filter = ''; if (!is_blank($f_filter_string)) { if (is_numeric($f_filter_string)) { $t_token = token_get_value(TOKEN_FILTER); if (null != $t_token) { $t_filter = json_decode($t_token, true); } } else { $t_filter = json_decode($f_filter_string, true); } $t_filter = filter_ensure_valid_filter($t_filter); } else { if (!filter_is_cookie_valid()) { $t_filter = filter_get_default(); } else { $t_user_id = auth_get_current_user_id(); $t_filter = user_get_bug_filter($t_user_id, $p_project_id); } } return $t_filter; }
/** * The filters have been changed so the field names are the same as the database * field names. This updates any filters stored in the database to use the correct * keys. The 'and_not_assigned' field is no longer used as it is replaced by the meta * filter None. This removes it from all filters. * * Filter Versions: * v1,2,3,4 - Legacy Filters that can not be migrated (not used since 2004) * v5 - https://github.com/mantisbt/mantisbt/commit/eb1b93057e470e40727bc75a85f436ab35b84a74 * v6 - https://github.com/mantisbt/mantisbt/commit/de2e2931f993c3b6fc82781eff051f9037fdc6b5 * v7 - https://github.com/mantisbt/mantisbt/commit/0450981225647544083d21576dfb2bae044b3e98 * v8 - https://github.com/mantisbt/mantisbt/commit/5cb368796528bcb35aa3935bf431b08a29cb1e90 * v9 - https://github.com/mantisbt/mantisbt/commit/9dfc5fb6edb6da1e0324ceac3a27a727f2b23ba7 * * Filters are stored within the database as vX#FILTER, where vX is a raw version string and * FILTER is a serialized string in php serialization or json format. * * This function is used to upgrade any previous filters to the latest version, and should be * updated when bouncing filter version number. Schema.php should be updated to call do_nothing * for the existing filter schema update and the updated version of this function called in a * new schema update step * * @return integer */ function install_stored_filter_migrate() { # Disable query logging even if enabled in config, due to possibility of mass spam $t_log_queries = install_set_log_queries(); require_api('filter_api.php'); # convert filters to use the same value for the filter key and the form field # Note: This list should only be updated for basic renames i.e. data + type of data remain the same # before and after the rename. $t_filter_fields['show_category'] = 'category_id'; $t_filter_fields['show_severity'] = 'severity'; $t_filter_fields['show_status'] = 'status'; $t_filter_fields['show_priority'] = 'priority'; $t_filter_fields['show_resolution'] = 'resolution'; $t_filter_fields['show_build'] = 'build'; $t_filter_fields['show_version'] = 'version'; $t_filter_fields['user_monitor'] = 'monitor_user_id'; $t_filter_fields['show_profile'] = 'profile_id'; $t_filter_fields['do_filter_by_date'] = 'filter_by_date'; $t_filter_fields['and_not_assigned'] = null; $t_filter_fields['sticky_issues'] = 'sticky'; $t_query = 'SELECT * FROM {filters}'; $t_result = db_query($t_query); while ($t_row = db_fetch_array($t_result)) { # Grab Filter Version and data into $t_setting_arr $t_setting_arr = explode('#', $t_row['filter_string'], 2); switch ($t_setting_arr[0]) { # Remove any non-upgradeable filters i.e. versions 1 to 4. case 'v1': case 'v2': case 'v3': case 'v4': $t_delete_query = 'DELETE FROM {filters} WHERE id=' . db_param(); $t_delete_result = db_query($t_delete_query, array($t_row['id'])); continue; } if (isset($t_setting_arr[1])) { switch ($t_setting_arr[0]) { # Filter versions 5 to 8 are stored in php serialized format case 'v5': case 'v6': case 'v7': case 'v8': $t_filter_arr = unserialize($t_setting_arr[1]); break; default: $t_filter_arr = json_decode($t_setting_arr[1], true); } } else { $t_delete_query = 'DELETE FROM {filters} WHERE id=' . db_param(); $t_delete_result = db_query($t_delete_query, array($t_row['id'])); continue; } # serialized or json encoded data in filter table is invalid - abort upgrade as this should not be possible # so we should investigate and fix underlying data issue first if necessary if ($t_filter_arr === false) { return 1; # Fatal: invalid data found in filters table } # Ff the filter version does not match the latest version, pass it through filter_ensure_valid_filter to do any updates # This will set default values for filter fields if ($t_filter_arr['_version'] != FILTER_VERSION) { $t_filter_arr = filter_ensure_valid_filter($t_filter_arr); } # For any fields that are being renamed, we can now perform the rename and migrate existing data. # We unset the old field when done to ensure the filter contains only current optimised data. foreach ($t_filter_fields as $t_old => $t_new) { if (isset($t_filter_arr[$t_old])) { $t_value = $t_filter_arr[$t_old]; unset($t_filter_arr[$t_old]); if (!is_null($t_new)) { $t_filter_arr[$t_new] = $t_value; } } } # We now have a valid filter in with updated version number (version is updated by filter_ensure_valid_filter) # Check that this is the case, to before storing the updated filter values. # Abort if the filter is invalid as this should not be possible if ($t_filter_arr['_version'] != FILTER_VERSION) { return 1; # Fatal: invalid data found in filters table } $t_filter_serialized = json_encode($t_filter_arr); $t_filter_string = FILTER_VERSION . '#' . $t_filter_serialized; $t_update_query = 'UPDATE {filters} SET filter_string=' . db_param() . ' WHERE id=' . db_param(); $t_update_result = db_query($t_update_query, array($t_filter_string, $t_row['id'])); } # Re-enable query logging if we disabled it install_set_log_queries($t_log_queries); # Return 2 because that's what ADOdb/DataDict does when things happen properly return 2; }
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 }
/** * Get the issue headers that match the specified filter and paging details. * * @param string $p_username The name of the user trying to access the filters. * @param string $p_password The password of the user. * @param integer $p_filter_id The id of the filter to apply. * @param integer $p_page_number Start with the given page number (zero-based) * @param integer $p_per_page Number of issues to display per page * @return Array that represents an IssueDataArray structure */ function mc_filter_get_issue_headers($p_username, $p_password, $p_project_id, $p_filter_id, $p_page_number, $p_per_page) { $t_user_id = mci_check_login($p_username, $p_password); if ($t_user_id === false) { return mci_soap_fault_login_failed(); } if (!mci_has_readonly_access($t_user_id, $p_project_id)) { return mci_soap_fault_access_denied($t_user_id); } $t_page_count = 0; $t_bug_count = 0; $t_filter = filter_db_get_filter($p_filter_id); $t_filter_detail = explode('#', $t_filter, 2); if (!isset($t_filter_detail[1])) { return new soap_fault('Server', '', 'Invalid Filter'); } $t_filter = unserialize($t_filter_detail[1]); $t_filter = filter_ensure_valid_filter($t_filter); $t_result = array(); $t_rows = filter_get_bug_rows($p_page_number, $p_per_page, $t_page_count, $t_bug_count, $t_filter, $p_project_id); foreach ($t_rows as $t_issue_data) { $t_id = $t_issue_data->id; $t_issue = array(); $t_issue['id'] = $t_id; $t_issue['view_state'] = $t_issue_data->view_state; $t_issue['last_updated'] = timestamp_to_iso8601($t_issue_data->last_updated); $t_issue['project'] = $t_issue_data->project_id; $t_issue['category'] = mci_get_category($t_issue_data->category_id); $t_issue['priority'] = $t_issue_data->priority; $t_issue['severity'] = $t_issue_data->severity; $t_issue['status'] = $t_issue_data->status; $t_issue['reporter'] = $t_issue_data->reporter_id; $t_issue['summary'] = $t_issue_data->summary; if (!empty($t_issue_data->handler_id)) { $t_issue['handler'] = $t_issue_data->handler_id; } $t_issue['resolution'] = $t_issue_data->resolution; $t_issue['attachments_count'] = count(mci_issue_get_attachments($t_issue_data->id)); $t_issue['notes_count'] = count(mci_issue_get_notes($t_issue_data->id)); $t_result[] = $t_issue; } return $t_result; }
/** * Prints the filter selection area for both the bug list view screen and * the bug list print screen. This function was an attempt to make it easier to * add new filters and rearrange them on screen for both pages. * @param int $p_page_number * @param bool $p_for_screen * @param bool $p_expanded */ function filter_draw_selection_area2($p_page_number, $p_for_screen = true, $p_expanded = true) { $t_form_name_suffix = $p_expanded ? '_open' : '_closed'; $t_filter = current_user_get_bug_filter(); $t_filter = filter_ensure_valid_filter($t_filter); $t_project_id = helper_get_current_project(); $t_page_number = (int) $p_page_number; $t_view_type = $t_filter['_view_type']; $t_tdclass = 'small-caption'; $t_trclass = 'row-category2'; $t_action = 'view_all_set.php?f=3'; if ($p_for_screen == false) { $t_tdclass = 'print'; $t_trclass = ''; $t_action = 'view_all_set.php'; } ?> <br /> <form method="post" name="filters<?php echo $t_form_name_suffix; ?> " id="filters_form<?php echo $t_form_name_suffix; ?> " action="<?php echo $t_action; ?> "> <?php # CSRF protection not required here - form does not result in modifications ?> <input type="hidden" name="type" value="1" /> <?php if ($p_for_screen == false) { echo '<input type="hidden" name="print" value="1" />'; echo '<input type="hidden" name="offset" value="0" />'; } ?> <input type="hidden" name="page_number" value="<?php echo $t_page_number; ?> " /> <input type="hidden" name="view_type" value="<?php echo $t_view_type; ?> " /> <table class="width100" cellspacing="1"> <?php $t_filter_cols = config_get('filter_custom_fields_per_row'); if ($p_expanded) { $t_custom_cols = $t_filter_cols; $t_current_user_access_level = current_user_get_access_level(); $t_accessible_custom_fields_ids = array(); $t_accessible_custom_fields_names = array(); $t_accessible_custom_fields_values = array(); $t_num_custom_rows = 0; $t_per_row = 0; if (ON == config_get('filter_by_custom_fields')) { $t_custom_fields = custom_field_get_linked_ids($t_project_id); foreach ($t_custom_fields as $t_cfid) { $t_field_info = custom_field_cache_row($t_cfid, true); if ($t_field_info['access_level_r'] <= $t_current_user_access_level && $t_field_info['filter_by']) { $t_accessible_custom_fields_ids[] = $t_cfid; $t_accessible_custom_fields_names[] = $t_field_info['name']; $t_accessible_custom_fields_types[] = $t_field_info['type']; $t_accessible_custom_fields_values[] = custom_field_distinct_values($t_field_info); } } if (count($t_accessible_custom_fields_ids) > 0) { $t_per_row = config_get('filter_custom_fields_per_row'); $t_num_custom_rows = ceil(count($t_accessible_custom_fields_ids) / $t_per_row); } } $t_filters_url = 'view_filters_page.php?for_screen=' . $p_for_screen; if ('advanced' == $t_view_type) { $t_filters_url = $t_filters_url . '&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_project_level(config_get('view_handler_threshold'), $t_project_id)) { $t_filter[FILTER_PROPERTY_HANDLER_ID] = array(META_FILTER_ANY); } ?> <tr <?php echo "class=\"" . $t_trclass . "\""; ?> > <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_REPORTER_ID . '[]'; ?> " id="reporter_id_filter"><?php echo lang_get('reporter'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_MONITOR_USER_ID . '[]'; ?> " id="user_monitor_filter"><?php echo lang_get('monitored_by'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_HANDLER_ID . '[]'; ?> " id="handler_id_filter"><?php echo lang_get('assigned_to'); ?> :</a> </td> <td colspan="2" class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_CATEGORY . '[]'; ?> " id="show_category_filter"><?php echo lang_get('category'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_SEVERITY_ID . '[]'; ?> " id="show_severity_filter"><?php echo lang_get('severity'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_RESOLUTION_ID . '[]'; ?> " id="show_resolution_filter"><?php echo lang_get('resolution'); ?> :</a> </td> <td class="small-caption" valign="top"> <?php if (ON == config_get('enable_profiles')) { ?> <a href="<?php echo $t_filters_url . 'show_profile[]'; ?> " id="show_profile_filter"><?php echo lang_get('profile'); ?> :</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="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" valign="top" 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" valign="top" 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" valign="top" id="show_category_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_CATEGORY]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_CATEGORY] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_CATEGORY, '[]" 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" valign="top" id="show_severity_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_SEVERITY_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_SEVERITY_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_SEVERITY_ID, '[]" 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" valign="top" id="show_resolution_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_RESOLUTION_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_RESOLUTION_ID] as $t_current) { ?> <input type="hidden" name="show_resolution[]" value="<?php echo string_attribute($t_current); ?> " /> <?php $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" valign="top" id="show_profile_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter['show_profile']) == 0) { echo 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 string_attribute($t_current); ?> " /> <?php $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" valign="top" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr <?php echo "class=\"" . $t_trclass . "\""; ?> > <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_STATUS_ID . '[]'; ?> " id="show_status_filter"><?php echo lang_get('status'); ?> :</a> </td> <td class="small-caption" valign="top"> <?php if ('simple' == $t_view_type) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_HIDE_STATUS_ID . '[]'; ?> " id="hide_status_filter"><?php echo lang_get('hide_status'); ?> :</a> <?php } ?> </td> <td class="small-caption" valign="top"> <?php if ($t_show_build) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_PRODUCT_BUILD . '[]'; ?> " id="show_build_filter"><?php echo lang_get('product_build'); ?> :</a> <?php } ?> </td> <?php if ($t_show_product_version) { ?> <td colspan="2" class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_PRODUCT_VERSION . '[]'; ?> " id="show_version_filter"><?php echo lang_get('product_version'); ?> :</a> </td> <td colspan="1" class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_FIXED_IN_VERSION . '[]'; ?> " id="show_fixed_in_version_filter"><?php echo lang_get('fixed_in_version'); ?> :</a> </td> <td colspan="1" class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_TARGET_VERSION . '[]'; ?> " id="show_target_version_filter"><?php echo lang_get('target_version'); ?> :</a> </td> <?php } else { ?> <td colspan="2" class="small-caption" valign="top">   </td> <td colspan="1" 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 echo $t_filters_url . FILTER_PROPERTY_PRIORITY_ID . '[]'; ?> " id="show_priority_filter"><?php echo lang_get('priority'); ?> :</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[FILTER_PROPERTY_STATUS_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_STATUS_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_STATUS_ID, '[]" 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" valign="top" 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_ID]) == 0) { echo lang_get('none'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_HIDE_STATUS_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_HIDE_STATUS_ID, '[]" 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_ID]) == 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" valign="top" id="show_build_filter_target"> <?php $t_output = ''; $t_any_found = false; if (count($t_filter[FILTER_PROPERTY_PRODUCT_BUILD]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_PRODUCT_BUILD] as $t_current) { $t_current = stripslashes($t_current); echo '<input type="hidden" name="', FILTER_PROPERTY_PRODUCT_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" valign="top"></td> <?php } if ($t_show_product_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[FILTER_PROPERTY_PRODUCT_VERSION]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_PRODUCT_VERSION] as $t_current) { $t_current = stripslashes($t_current); echo '<input type="hidden" name="', FILTER_PROPERTY_PRODUCT_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" valign="top" 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> <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[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="2" class="small-caption" valign="top">   </td> <td colspan="1" 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[FILTER_PROPERTY_PRIORITY_ID]) == 0) { echo lang_get('any'); } else { $t_first_flag = true; foreach ($t_filter[FILTER_PROPERTY_PRIORITY_ID] as $t_current) { echo '<input type="hidden" name="', FILTER_PROPERTY_PRIORITY_ID, '[]" 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_filter_cols > 8) { echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 7) . '"> </td>'; } ?> </tr> <tr <?php echo "class=\"" . $t_trclass . "\""; ?> > <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_ISSUES_PER_PAGE; ?> " id="per_page_filter"><?php echo lang_get('show'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_VIEW_STATE_ID; ?> " id="view_state_filter"><?php echo lang_get('view_status'); ?> :</a> </td> <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_SHOW_STICKY_ISSUES; ?> " id="sticky_issues_filter"><?php echo lang_get('sticky'); ?> :</a> </td> <td class="small-caption" valign="top" colspan="2"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_HIGHLIGHT_CHANGED; ?> " id="highlight_changed_filter"><?php echo lang_get('changed'); ?> :</a> </td> <td class="small-caption" valign="top" > <a href="<?php echo $t_filters_url . FILTER_PROPERTY_FILTER_BY_DATE; ?> " id="do_filter_by_date_filter"><?php echo lang_get('use_date_filters'); ?> :</a> </td> <td class="small-caption" valign="top" colspan="2"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_RELATIONSHIP_TYPE; ?> " id="relationship_type_filter"><?php echo 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[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" valign="top" id="view_state_filter_target"> <?php if (VS_PUBLIC === $t_filter[FILTER_PROPERTY_VIEW_STATE_ID]) { echo lang_get('public'); } else { if (VS_PRIVATE === $t_filter[FILTER_PROPERTY_VIEW_STATE_ID]) { echo lang_get('private'); } else { echo lang_get('any'); $t_filter[FILTER_PROPERTY_VIEW_STATE_ID] = META_FILTER_ANY; } } echo '<input type="hidden" name="', FILTER_PROPERTY_VIEW_STATE_ID, '" value="', string_attribute($t_filter[FILTER_PROPERTY_VIEW_STATE_ID]), '" />'; ?> </td> <td class="small-caption" valign="top" id="sticky_issues_filter_target"> <?php $t_sticky_filter_state = gpc_string_to_bool($t_filter[FILTER_PROPERTY_SHOW_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 echo $t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED]; echo '<input type="hidden" name="', FILTER_PROPERTY_HIGHLIGHT_CHANGED, '" value="', string_attribute($t_filter[FILTER_PROPERTY_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[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" valign="top" 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" valign="top" colspan="' . ($t_filter_cols - 8) . '"> </td>'; } ?> </tr> <tr <?php echo "class=\"" . $t_trclass . "\""; ?> > <td class="small-caption" valign="top"> <?php if (ON == config_get('enable_profiles')) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_PLATFORM; ?> " id="platform_filter"><?php echo lang_get('platform'); ?> :</a> <?php } ?> </td> <td class="small-caption" valign="top"> <?php if (ON == config_get('enable_profiles')) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_OS; ?> " id="os_filter"><?php echo lang_get('os'); ?> :</a> <?php } ?> </td> <td class="small-caption" valign="top"> <?php if (ON == config_get('enable_profiles')) { ?> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_OS_BUILD; ?> " id="os_build_filter"><?php echo lang_get('os_version'); ?> :</a> <?php } ?> </td> <td class="small-caption" valign="top" 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 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"> <?php if (ON == config_get('enable_profiles')) { ?> <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> <?php } else { ?> <td colspan="3"> </td> <?php } ?> <td class="small-caption" valign="top" 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_column = 0; $t_fields = ''; $t_values = ''; # output a filter form element for each plugin filter foreach ($t_plugin_filters as $t_field_name => $t_filter_object) { $t_fields .= '<td class="small-caption" valign="top"> <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 class="small-caption" valign="top" 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_column++; # wrap at the appropriate column if ($t_column >= $t_filter_cols) { echo '<tr class="', $t_trclass, '">', $t_fields, '</tr>'; echo '<tr class="row-1">', $t_values, '</tr>'; $t_fields = ''; $t_values = ''; $t_column = 0; } } # output any remaining plugin filters if ($t_column > 0) { if ($t_column < $t_filter_cols) { $t_fields .= '<td class="small-caption" colspan="' . ($t_filter_cols - $t_column) . '"> </td>'; $t_values .= '<td class="small-caption" colspan="' . ($t_filter_cols - $t_column) . '"> </td>'; } echo '<tr class="', $t_trclass, '">', $t_fields, '</tr>'; echo '<tr class="row-1">', $t_values, '</tr>'; } 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_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" 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) { /** @todo 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_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" valign="top"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_NOTE_USER_ID; ?> " id="note_user_id_filter"><?php echo lang_get('note_user_id'); ?> :</a> </td> <td class="small-caption" valign="top" 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 { $t_output; } } ?> </td> <td class="small-caption" valign="top"> <a href="<?php echo $t_filters_url . 'show_sort'; ?> " id="show_sort_filter"><?php echo lang_get('sort'); ?> :</a> </td> <td class="small-caption" valign="top" 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) { ?> <td class="small-caption" valign="top" colspan="2"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_PROJECT_ID; ?> " id="project_id_filter"><?php echo 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[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" 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') . ' '; echo '<input type="text" size="16" name="', FILTER_PROPERTY_FREE_TEXT, '" value="', string_attribute($t_filter[FILTER_PROPERTY_FREE_TEXT]), '" />'; ?> <input type="submit" name="filter" class="button-small" value="<?php echo 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='; } $t_view_filters = config_get('view_filters'); if (SIMPLE_ONLY != $t_view_filters && ADVANCED_ONLY != $t_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')); } } if (access_has_project_level(config_get('create_permalink_threshold'))) { 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"> <?php # CSRF protection not required here - form does not result in modifications ?> <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 { echo '<select name="source_query_id">'; } ?> <option value="-1"><?php echo '[' . lang_get('reset_query') . ']'; ?> </option> <option value="-1"></option> <?php foreach ($t_stored_queries_arr as $t_query_id => $t_query_name) { echo '<option value="' . string_attribute($t_query_id) . '">' . 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> <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> <?php } else { ?> <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> <?php } if (access_has_project_level(config_get('stored_query_create_threshold'))) { ?> <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> <?php } ?> </td> </tr> </table> <?php }
/** * return the bug filter parameters for the specified user * * @param integer $p_user_id A valid user identifier. * @param integer $p_project_id A valid project identifier. * @return array The user filter, or default filter if not valid. */ function user_get_bug_filter($p_user_id, $p_project_id = null) { if (null === $p_project_id) { $t_project_id = helper_get_current_project(); } else { $t_project_id = $p_project_id; } $t_view_all_cookie_id = filter_db_get_project_current($t_project_id, $p_user_id); $t_view_all_cookie = filter_db_get_filter($t_view_all_cookie_id, $p_user_id); $t_cookie_detail = explode('#', $t_view_all_cookie, 2); if (!isset($t_cookie_detail[1])) { return filter_get_default(); } $t_filter = json_decode($t_cookie_detail[1], true); $t_filter = filter_ensure_valid_filter($t_filter); return $t_filter; }
/** * Prints the filter selection area for both the bug list view screen and * the bug list print screen. This function was an attempt to make it easier to * add new filters and rearrange them on screen for both pages. * @param int $p_page_number * @param bool $p_for_screen * @param bool $p_expanded */ function filter_draw_selection_area2($p_page_number, $p_for_screen = true, $p_expanded = true) { $t_form_name_suffix = $p_expanded ? '_open' : '_closed'; $t_filter = current_user_get_bug_filter(); $t_filter = filter_ensure_valid_filter($t_filter); $t_project_id = helper_get_current_project(); $t_page_number = (int) $p_page_number; $t_view_type = $t_filter['_view_type']; $t_tdclass = 'small-caption'; $t_trclass = 'row-category2'; $t_action = 'view_all_set.php?f=3'; if ($p_for_screen == false) { $t_tdclass = 'print'; $t_trclass = ''; $t_action = 'view_all_set.php'; } ?> <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_project_level(config_get('view_handler_threshold'), $t_project_id)) { $t_filter[FILTER_PROPERTY_HANDLER_ID] = array(META_FILTER_ANY); } $t_dynamic_filter_expander_class = config_get('use_javascript') && 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"> <a href="<?php echo $t_filters_url . FILTER_PROPERTY_HIGHLIGHT_CHANGED; ?> " id="highlight_changed_filter"<?php echo $t_dynamic_filter_expander_class; ?> ><?php echo lang_get('changed_label'); ?> </a> </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="sticky_issues" value="<?php echo $t_sticky_filter_state ? 'on' : 'off'; ?> " /> </td> <td class="small-caption" colspan="2" id="highlight_changed_filter_target"> <?php echo $t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED]; echo '<input type="hidden" name="', FILTER_PROPERTY_HIGHLIGHT_CHANGED, '" value="', string_attribute($t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED]), '" />'; ?> </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 { $t_output; } } ?> </td> <td class="small-caption"> <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) { ?> <td class="small-caption" 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> </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 $f_switch_view_link = config_get('use_javascript') && config_get('use_dynamic_filters') ? 'view_all_set.php?type=6&view_type=' : 'view_filters_page.php?view_type='; $t_view_filters = config_get('view_filters'); if (SIMPLE_ONLY != $t_view_filters && ADVANCED_ONLY != $t_view_filters) { if ('advanced' == $t_view_type) { echo '<span class="switch-view"><a href="', $f_switch_view_link, 'simple">', lang_get('simple_filters'), '</a></span>'; } else { echo '<span class="switch-view"><a href="', $f_switch_view_link, 'advanced">', lang_get('advanced_filters'), '</a></span>'; } } if (access_has_project_level(config_get('create_permalink_threshold'))) { echo '<span class="permalink"><a href="permalink_page.php?url=', urlencode(filter_get_url($t_filter)), '">', lang_get('create_filter_link'), '</a></span>'; } ?> </div> </div> <br /> <?php }
/** * Create a filter for getting issues monitored by the specified project and user. * @param integer $p_project_id The project id or ALL_PROJECTS. * @param integer $p_user_id The user id. * @return array a valid filter. */ function filter_create_monitored_by($p_project_id, $p_user_id) { $t_filter = filter_get_default(); if ($p_user_id == 0) { $t_filter[FILTER_PROPERTY_MONITOR_USER_ID] = array('0' => META_FILTER_NONE); } else { $t_filter[FILTER_PROPERTY_MONITOR_USER_ID] = array('0' => $p_user_id); } if ($p_project_id != ALL_PROJECTS) { $t_filter[FILTER_PROPERTY_PROJECT_ID] = array('0' => $p_project_id); } return filter_ensure_valid_filter($t_filter); }
case '5': # Just set the search string value log_event(LOG_FILTERING, 'view_all_set.php: Search Text'); $t_setting_arr[FILTER_PROPERTY_SEARCH] = $f_search; break; case '6': # Just set the view_state (simple / advanced) value log_event(LOG_FILTERING, 'view_all_set.php: View state (simple/advanced)'); $t_setting_arr['_view_type'] = $f_view_type; break; default: # does nothing. catch all case log_event(LOG_FILTERING, 'view_all_set.php: default - do nothing'); break; } $t_setting_arr = filter_ensure_valid_filter($t_setting_arr); # Remove any statuses that should be excluded by the hide_status field if ($f_view_type == 'advanced') { if ($t_setting_arr[FILTER_PROPERTY_HIDE_STATUS][0] > 0) { $t_statuses = MantisEnum::getValues(config_get('status_enum_string')); foreach ($t_statuses as $t_key => $t_val) { if ($t_val < $t_setting_arr[FILTER_PROPERTY_HIDE_STATUS][0]) { $t_keep_statuses[$t_key] = $t_val; } } $t_setting_arr[FILTER_PROPERTY_STATUS] = $t_keep_statuses; } } # If a status is selected in the status and the hide_status field, # remove it from hide status if ($f_view_type == 'simple' && $t_setting_arr[FILTER_PROPERTY_HIDE_STATUS][0] > 0) {