예제 #1
0
파일: search.php 프로젝트: fur81/zofaxiopeu
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);
예제 #2
0
$f_query_name = strip_tags(gpc_get_string('query_name'));
$f_is_public = gpc_get_bool('is_public');
$f_all_projects = gpc_get_bool('all_projects');
$t_query_redirect_url = 'query_store_page.php';
# We can't have a blank name
if (is_blank($f_query_name)) {
    $t_query_redirect_url = $t_query_redirect_url . '?error_msg=' . urlencode(lang_get('query_blank_name'));
    print_header_redirect($t_query_redirect_url);
}
# Check and make sure they don't already have a
# query with the same name
$t_query_arr = filter_db_get_available_queries();
foreach ($t_query_arr as $t_id => $t_name) {
    if ($f_query_name == $t_name) {
        $t_query_redirect_url = $t_query_redirect_url . '?error_msg=' . urlencode(lang_get('query_dupe_name'));
        print_header_redirect($t_query_redirect_url);
        exit;
    }
}
$t_project_id = helper_get_current_project();
if ($f_all_projects) {
    $t_project_id = 0;
}
$t_filter_string = filter_db_get_filter(gpc_get_cookie(config_get('view_all_cookie'), ''));
$t_new_row_id = filter_db_set_for_current_user($t_project_id, $f_is_public, $f_query_name, $t_filter_string);
if ($t_new_row_id == -1) {
    $t_query_redirect_url = $t_query_redirect_url . '?error_msg=' . urlencode(lang_get('query_store_error'));
    print_header_redirect($t_query_redirect_url);
} else {
    print_header_redirect('view_all_bug_page.php');
}