Skip to content

Commit

Permalink
0004279: [bugtracker] My View makes bad use of available space (tazza70)
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2820 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Jeroen Latour committed Aug 7, 2004
1 parent cf4f617 commit c1ea751
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 14 deletions.
5 changes: 4 additions & 1 deletion config_defaults_inc.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: config_defaults_inc.php,v 1.191 2004-08-06 17:17:05 jlatour Exp $
# $Id: config_defaults_inc.php,v 1.192 2004-08-07 16:47:50 jlatour Exp $
# --------------------------------------------------------


Expand Down Expand Up @@ -1274,6 +1274,9 @@
'recent_mod' => '5',
'monitored' => '6'
);

# Toggle whether 'My View' boxes are shown in a fixed position (i.e. adjacent boxes start at the same vertical position)
$g_my_view_boxes_fixed_position = ON;

# Default page after Login or Set Project
$g_default_home_page = 'my_view_page.php';
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -2,6 +2,7 @@ Mantis ChangeLog

2004.08.xx - 0.19.0xx

- 0004279: [bugtracker] My View makes bad use of available space (tazza70)
- 0003689: [bugtracker] index.php is sending wrong HTTP header if not logged in (jlatour)
- 0004193: [bugtracker] Broaden the ldap features to work with Active Directory (alf)
- 0004133: [filters] "Summary stats are links to filters for view_all_bugs" feature is broken (jlatour)
Expand Down
70 changes: 57 additions & 13 deletions my_view_page.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: my_view_page.php,v 1.7 2004-07-20 15:51:50 vboctor Exp $
# $Id: my_view_page.php,v 1.8 2004-08-07 16:47:50 jlatour Exp $
# --------------------------------------------------------
?>
<?php
Expand Down Expand Up @@ -58,39 +58,83 @@

<?php
$t_number_of_boxes = count ( $t_boxes );
$t_boxes_position = config_get( 'my_view_boxes_fixed_position' );
$t_counter = 0;

while (list ($t_box_title, $t_box_display) = each ($t_boxes)) {
# don't display bugs that are set as 0
if ($t_box_display == 0) {
$t_number_of_boxes = $t_number_of_boxes - 1;
}

# don't display "Assigned to Me" bugs to users that bugs can't be assigned to
else if ( $t_box_title == 'assigned' && ( current_user_is_anonymous() OR !access_has_project_level( config_get( 'handle_bug_threshold' ), $t_project_id, $t_current_user_id ) ) ) {
$t_number_of_boxes = $t_number_of_boxes - 1;
}

# don't display "Monitored by Me" bugs to users that can't monitor bugs
else if ( $t_box_title == 'monitored' && ( current_user_is_anonymous() OR !access_has_project_level( config_get( 'monitor_bug_threshold' ), $t_project_id, $t_current_user_id ) ) ) {
$t_number_of_boxes = $t_number_of_boxes - 1;
}
#don't display "Reported by Me" bugs to users that can't report bugs

# don't display "Reported by Me" bugs to users that can't report bugs
else if ( $t_box_title == 'reported' && ( current_user_is_anonymous() OR !access_has_project_level( config_get( 'report_bug_threshold' ), $t_project_id, $t_current_user_id ) ) ) {
$t_number_of_boxes = $t_number_of_boxes - 1;
} else {
}

# display the box
else {
$t_counter++;
if ($t_counter%2 == 1) {
echo '<tr><td valign="top" width="50%">';
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
echo '</td>';
} elseif ($t_counter%2 == 0) {
echo '<td valign="top" width="50%">';
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
echo '</td></tr>';

# check the style of displaying boxes - fixed (ie. each box in a separate table cell) or not
if ( ON == $t_boxes_position ) {
# for even box number start new row and column
if ( 1 == $t_counter%2 ) {
echo '<tr><td valign="top" width="50%">';
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
echo '</td>';
}

# for odd box number only start new column
elseif ( 0 == $t_counter%2 ) {
echo '<td valign="top" width="50%">';
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
echo '</td></tr>';
}

# for odd number of box display one empty table cell in second column
if ( ( $t_counter == $t_number_of_boxes ) && 1 == $t_counter%2 ) {
echo '<td valign="top" width="50%"></td></tr>';
}
}
if ( ($t_counter == $t_number_of_boxes) && $t_counter%2 == 1) {
echo '<td valign="top" width="50%"></td></tr>';
else if ( OFF == $t_boxes_position ) {
# start new table row and column for first box
if ( 1 == $t_counter ) {
echo '<tr><td valign="top" width="50%">';
}

# start new table column for the second half of boxes
if ( $t_counter == ceil ($t_number_of_boxes/2) + 1 ) {
echo '<td valign="top" width="50%">';
}

# display the required box
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
echo '<br>';

# close the first column for first half of boxes
if ( $t_counter == ceil ($t_number_of_boxes/2) ) {
echo '</td>';
}

# close the table row after all of the boxes
if ( $t_counter == $t_number_of_boxes ) {
echo '</td></tr>';
}
}
}
}

?>

<?php
Expand Down

0 comments on commit c1ea751

Please sign in to comment.