Skip to content

Commit

Permalink
Fix:
Browse files Browse the repository at this point in the history
0008204: Filters not remembered when clicking through from "My View"
0007735: Filters are lost when clicking on page navigation
0006468: My View page incorrectly sets filters


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4506 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
mantis committed Jul 29, 2007
1 parent 5f4ffad commit b7edbec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
30 changes: 20 additions & 10 deletions core/print_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: print_api.php,v 1.173 2007-07-21 22:54:29 giallu Exp $
# $Id: print_api.php,v 1.174 2007-07-29 17:32:14 prichards Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -783,6 +783,7 @@ function print_enum_string_option_list( $p_enum_name, $p_val = 0 ) {
echo ">$t_elem2</option>";
} # end for
}

# --------------------
# Select the proper enum values for status based on workflow
# or the input parameter if workflows are not used
Expand Down Expand Up @@ -1316,20 +1317,25 @@ function print_link( $p_link, $p_url_text ) {
}
# --------------------
# print a HTML page link
function print_page_link( $p_page_url, $p_text = '', $p_page_no=0, $p_page_cur=0 ) {
function print_page_link( $p_page_url, $p_text = '', $p_page_no=0, $p_page_cur=0, $p_temp_filter_id = 0 ) {
if (is_blank( $p_text )) {
$p_text = $p_page_no;
}

if ( ( 0 < $p_page_no ) && ( $p_page_no != $p_page_cur ) ) {
PRINT " <a href=\"$p_page_url?page_number=$p_page_no\">$p_text</a> ";
if ( $p_temp_filter_id > 0 ) {
PRINT " <a href=\"$p_page_url?filter=$p_temp_filter_id&amp;page_number=$p_page_no\">$p_text</a> ";
} else {
PRINT " <a href=\"$p_page_url?page_number=$p_page_no\">$p_text</a> ";
}

} else {
PRINT " $p_text ";
}
}
# --------------------
# print a list of page number links (eg [1 2 3])
function print_page_links( $p_page, $p_start, $p_end, $p_current ) {
function print_page_links( $p_page, $p_start, $p_end, $p_current,$p_temp_filter_id = 0 ) {
$t_items = array();
$t_link = '';

Expand All @@ -1351,8 +1357,8 @@ function print_page_links( $p_page, $p_start, $p_end, $p_current ) {
print( "[ " );

# First and previous links
print_page_link( $p_page, $t_first, 1, $p_current );
print_page_link( $p_page, $t_prev, $p_current - 1, $p_current );
print_page_link( $p_page, $t_first, 1, $p_current, $p_temp_filter_id );
print_page_link( $p_page, $t_prev, $p_current - 1, $p_current, $p_temp_filter_id );

# Page numbers ...

Expand All @@ -1371,7 +1377,11 @@ function print_page_links( $p_page, $p_start, $p_end, $p_current ) {
if ( $i == $p_current ) {
array_push( $t_items, $i );
} else {
array_push( $t_items, "<a href=\"$p_page?page_number=$i\">$i</a>" );
if ( $p_temp_filter_id > 0 ) {
array_push( $t_items, "<a href=\"$p_page?filter=$p_temp_filter_id&amp;page_number=$i\">$i</a>" );
} else {
array_push( $t_items, "<a href=\"$p_page?page_number=$i\">$i</a>" );
}
}
}
PRINT implode( '&nbsp;', $t_items );
Expand All @@ -1382,11 +1392,11 @@ function print_page_links( $p_page, $p_start, $p_end, $p_current ) {

# Next and Last links
if ( $p_current < $p_end ) {
print_page_link( $p_page, $t_next, $p_current + 1, $p_current );
print_page_link( $p_page, $t_next, $p_current + 1, $p_current, $p_temp_filter_id );
} else {
print_page_link( $p_page, $t_next );
print_page_link( $p_page, $t_next, null, null, $p_temp_filter_id );
}
print_page_link( $p_page, $t_last, $p_end, $p_current );
print_page_link( $p_page, $t_last, $p_end, $p_current, $p_temp_filter_id );

print( " ]" );
}
Expand Down
11 changes: 7 additions & 4 deletions view_all_inc.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: view_all_inc.php,v 1.169 2007-07-11 17:03:51 giallu Exp $
# $Id: view_all_inc.php,v 1.170 2007-07-29 17:32:10 prichards Exp $
# --------------------------------------------------------
?>
<?php
Expand Down Expand Up @@ -101,8 +101,8 @@
<td class="right" colspan="2">
<span class="small"> <?php
# -- Page number links --

print_page_links( 'view_all_bug_page.php', 1, $t_page_count, (int)$f_page_number );
$f_filter = gpc_get_int( 'filter', 0);
print_page_links( 'view_all_bug_page.php', 1, $t_page_count, (int)$f_page_number, $f_filter );
?> </span>
</td>
</tr>
Expand Down Expand Up @@ -189,7 +189,10 @@ function write_bug_rows ( $p_rows )
<?php # -- Page number links -- ?>
<td class="right" colspan="2">
<span class="small">
<?php print_page_links( 'view_all_bug_page.php', 1, $t_page_count, (int)$f_page_number ) ?>
<?php
$f_filter = gpc_get_int( 'filter', 0);
print_page_links( 'view_all_bug_page.php', 1, $t_page_count, (int)$f_page_number, $f_filter );
?>
</span>
</td>
</tr>
Expand Down

0 comments on commit b7edbec

Please sign in to comment.