Skip to content

Commit

Permalink
added remember view settings, fixed netscape display problems
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@126 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Jan 25, 2001
1 parent dedb94f commit ceb3ffc
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 37 deletions.
57 changes: 50 additions & 7 deletions view_bug_all_page.php3
Expand Up @@ -9,6 +9,28 @@
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( isset( $f_save )) {
### Save preferences
$t_settings_string = $f_show_category."#".
$f_show_severity."#".
$f_show_status."#".
$f_limit_view."#".
$f_show_changed."#".
$f_hide_resolved;
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
}
else if ( strlen($g_view_all_cookie_val)>6 ) {
### Load preferences
$t_setting_arr = explode( "#", $g_view_all_cookie_val );
$f_show_category = $t_setting_arr[0];
$f_show_severity = $t_setting_arr[1];
$f_show_status = $t_setting_arr[2];
$f_limit_view = $t_setting_arr[3];
$f_show_changed = $t_setting_arr[4];
$f_hide_resolved = $t_setting_arr[5];
}


if ( !isset( $f_limit_view ) ) {
$f_limit_view = $g_default_limit_view;
}
Expand Down Expand Up @@ -98,6 +120,7 @@

<p>
<div align=center>
[ <? echo $s_all_bugs_link ?> ]
[ <a href="<? echo $g_view_user_reported_bug_page ?>"><? echo $s_reported_bugs_link ?></a> ]
[ <a href="<? echo $g_view_user_assigned_bug_page ?>"><? echo $s_assigned_bugs_link ?></a> ]
</div>
Expand All @@ -106,10 +129,11 @@
<table width=100% bgcolor=<? echo $g_primary_border_color." ".$g_primary_table_tags ?>>
<tr>
<td bgcolor=<? echo $g_white_color ?>>
<table width=100% cols=7>
<table width=100%>
<tr>
<form method=post action="<? echo $g_view_bug_all_page ?>">
<input type=hidden name=f_offset value="0">
<input type=hidden name=f_save value="1">
<td align=center>
<select name=f_show_category>
<option value="any"><? echo $s_any ?>
Expand All @@ -126,8 +150,8 @@
<option value="any">
<? print_field_option_list( "status", $f_show_status ) ?>
</select>
<? echo $s_show ?>: <input type=text name=f_limit_view size=3 maxlength=7 value="<? echo $f_limit_view ?>">
<? echo $s_changed ?>: <input type=text name=f_show_changed size=3 maxlength=7 value="<? echo $f_show_changed ?>">
<? echo $s_show ?>: <input type=text name=f_limit_view size=3 maxlength=9 value="<? echo $f_limit_view ?>">
<? echo $s_changed ?>: <input type=text name=f_show_changed size=3 maxlength=9 value="<? echo $f_show_changed ?>">
<? echo $s_hide_resolved ?>: <input type=checkbox name=f_hide_resolved <? if ($f_hide_resolved=="on") echo "CHECKED"?>>
<input type=submit value="<? echo $s_filter_button ?>">
</td>
Expand All @@ -141,7 +165,7 @@
<table width=100% bgcolor=<? echo $g_primary_border_color." ".$g_primary_table_tags ?>>
<tr>
<td bgcolor=<? echo $g_white_color ?>>
<table width=100% cols=7>
<table width=100%>
<tr>
<td colspan=7 bgcolor=<? echo $g_table_title_color ?>>
<b><? echo $s_viewing_bugs_title ?></b>
Expand Down Expand Up @@ -199,7 +223,7 @@
extract( $row, EXTR_PREFIX_ALL, "v" );

$v_summary = string_display( $v_summary );
$t_last_updated = date( "m-d", sql_to_unix_time( $v_last_updated ) );
$t_last_updated = date( $g_short_date_format, sql_to_unix_time( $v_last_updated ) );

### alternate row colors
if ($i % 2== 0) {
Expand All @@ -221,13 +245,32 @@

### grab the bugnote count
$bugnote_count = get_bugnote_count( $v_id );

$query = "SELECT MAX(last_modified)
FROM $g_mantis_bugnote_table
WHERE bug_id='$v_id'";
$res2 = db_query( $query );
$v_bugnote_updated = db_result( $res2, 0, 0 );
?>
<tr bgcolor=<? echo $status_color ?> align=center>
<td>
<? print_bug_link( $v_id ) ?>
</td>
<td>
<? if ($bugnote_count > 0) echo $bugnote_count ?>
<?
if ($bugnote_count > 0){
if ( sql_to_unix_time( $v_bugnote_updated ) >
strtotime( "-$f_show_changed hours" ) ) {
PRINT "<b>$bugnote_count</b>";
}
else {
PRINT "$bugnote_count";
}
}
else {
echo "&nbsp;";
}
?>
</td>
<td>
<? echo $v_category ?>
Expand All @@ -250,7 +293,7 @@
}
?>
</td>
<td>
<td align=left>
<? echo $v_summary ?>
</td>
</tr>
Expand Down
74 changes: 59 additions & 15 deletions view_user_assigned_bug_page.php3
Expand Up @@ -9,12 +9,32 @@
<?
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

### grab the user id currently logged in
$query = "SELECT id
FROM $g_mantis_user_table
WHERE cookie_string='$g_string_cookie_val'";
$result = db_query( $query );
$t_user_id = db_result( $result, 0);
if ( isset( $f_save )) {
### Save preferences
$t_settings_string = $f_assign_id."#".
$f_show_category."#".
$f_show_severity."#".
$f_show_status."#".
$f_limit_view."#".
$f_show_changed."#".
$f_hide_resolved;
setcookie( $g_view_assigned_cookie, $t_settings_string, time()+$g_cookie_time_length );
}
else if ( strlen($g_view_assigned_cookie_val)>6 ) {
### Load preferences
$t_setting_arr = explode( "#", $g_view_assigned_cookie_val );
$f_assign_id = $t_setting_arr[0];
$f_show_category = $t_setting_arr[1];
$f_show_severity = $t_setting_arr[2];
$f_show_status = $t_setting_arr[3];
$f_limit_view = $t_setting_arr[4];
$f_show_changed = $t_setting_arr[5];
$f_hide_resolved = $t_setting_arr[6];
}

if ( !isset( $f_assign_id ) ) {
$f_assign_id = get_current_user_field( "id" );
}

if ( !isset( $f_limit_view ) ) {
$f_limit_view = $g_default_limit_view;
Expand Down Expand Up @@ -79,10 +99,10 @@

if ( !empty( $t_where_clause ) ) {
$t_where_clause = substr( $t_where_clause, 5, strlen( $t_where_clause ) );
$t_where_clause = " WHERE handler_id='$t_user_id' AND ".$t_where_clause;
$t_where_clause = " WHERE handler_id='$f_assign_id' AND ".$t_where_clause;
}
else {
$t_where_clause = " WHERE handler_id='$t_user_id'";
$t_where_clause = " WHERE handler_id='$f_assign_id'";
}

$query = $query.$t_where_clause;
Expand Down Expand Up @@ -111,17 +131,22 @@
<div align=center>
[ <a href="<? echo $g_view_bug_all_page ?>"><? echo $s_all_bugs_link ?></a> ]
[ <a href="<? echo $g_view_user_reported_bug_page ?>"><? echo $s_reported_bugs_link ?></a> ]
[ <? echo $s_assigned_bugs_link ?> ]
</div>

<p>
<table width=100% bgcolor=<? echo $g_primary_border_color." ".$g_primary_table_tags ?>>
<tr>
<td bgcolor=<? echo $g_white_color ?>>
<table width=100% cols=7>
<table width=100%>
<tr>
<form method=post action="<? echo $g_view_user_assigned_bug_page ?>">
<input type=hidden name=f_offset value="0">
<input type=hidden name=f_save value="1">
<td align=center>
<select name=f_assign_id>
<? print_handler_option_list( $f_assign_id ) ?>
</select>
<select name=f_show_category>
<option value="any"><? echo $s_any ?>
<option value="any">
Expand Down Expand Up @@ -152,7 +177,7 @@
<table width=100% bgcolor=<? echo $g_primary_border_color." ".$g_primary_table_tags ?>>
<tr>
<td bgcolor=<? echo $g_white_color ?>>
<table width=100% cols=7>
<table width=100%>
<tr>
<td colspan=7 bgcolor=<? echo $g_table_title_color ?>>
<b><? echo $s_viewing_bugs_title ?></b>
Expand Down Expand Up @@ -210,7 +235,7 @@
extract( $row, EXTR_PREFIX_ALL, "v" );

$v_summary = string_display( $v_summary );
$t_last_updated = date( "m-d", sql_to_unix_time( $v_last_updated ) );
$t_last_updated = date( $g_short_date_format, sql_to_unix_time( $v_last_updated ) );

### alternate row colors
if ($i % 2== 0) {
Expand All @@ -232,13 +257,32 @@

### grab the bugnote count
$bugnote_count = get_bugnote_count( $v_id );

$query = "SELECT MAX(last_modified)
FROM $g_mantis_bugnote_table
WHERE bug_id='$v_id'";
$res2 = db_query( $query );
$v_bugnote_updated = db_result( $res2, 0, 0 );
?>
<tr bgcolor=<? echo $status_color ?> align=center>
<td>
<? print_bug_link( $v_id ) ?>
</td>
<td>
<? if ($bugnote_count > 0) echo $bugnote_count ?>
<?
if ($bugnote_count > 0){
if ( sql_to_unix_time( $v_bugnote_updated ) >
strtotime( "-$f_show_changed hours" ) ) {
PRINT "<b>$bugnote_count</b>";
}
else {
PRINT "$bugnote_count";
}
}
else {
echo "&nbsp;";
}
?>
</td>
<td>
<? echo $v_category ?>
Expand All @@ -261,7 +305,7 @@
}
?>
</td>
<td>
<td align=left>
<? echo $v_summary ?>
</td>
</tr>
Expand All @@ -283,10 +327,10 @@
}

if ( $f_offset_prev >= 0 ) {
PRINT "[ <a href=\"$g_view_user_assigned_bug_page?f_offset=$f_offset_prev&f_show_category=$f_show_category&f_show_severity=$f_show_severity&f_show_status=$f_show_status&f_limit_view=$f_limit_view&f_show_changed=$f_show_changed&f_hide_resolved=$f_hide_resolved\">View Prev $f_limit_view</a> ] ";
PRINT "[ <a href=\"$g_view_user_assigned_bug_page?f_offset=$f_offset_prev&f_show_category=$f_show_category&f_show_severity=$f_show_severity&f_show_status=$f_show_status&f_limit_view=$f_limit_view&f_show_changed=$f_show_changed&f_hide_resolved=$f_hide_resolved&f_assign_id=$f_assign_id\">View Prev $f_limit_view</a> ] ";
}
if ( $row_count == $f_limit_view ) {
PRINT "[ <a href=\"$g_view_user_assigned_bug_page?f_offset=$f_offset_next&f_show_category=$f_show_category&f_show_severity=$f_show_severity&f_show_status=$f_show_status&f_limit_view=$f_limit_view&f_show_changed=$f_show_changed&f_hide_resolved=$f_hide_resolved\">View Next $f_limit_view</a> ]";
PRINT "[ <a href=\"$g_view_user_assigned_bug_page?f_offset=$f_offset_next&f_show_category=$f_show_category&f_show_severity=$f_show_severity&f_show_status=$f_show_status&f_limit_view=$f_limit_view&f_show_changed=$f_show_changed&f_hide_resolved=$f_hide_resolved&f_assign_id=$f_assign_id\">View Next $f_limit_view</a> ]";
}
?>
</div>
Expand Down

0 comments on commit ceb3ffc

Please sign in to comment.