how to make filter minimised in view all bug page by default

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
ikutluay
Posts: 60
Joined: 20 Mar 2007, 07:21
Location: www.ibrahimkutluay.net/blog
Contact:

how to make filter minimised in view all bug page by default

Post by ikutluay »

i see the javascript code but make it has parameter for this
davidf
Posts: 2
Joined: 13 Apr 2007, 07:36

making Filter minimized by default in view all bug page

Post by davidf »

Hello,

you can find here the change on source code I made on Mantis 1.0.7 for this functionality :

Index: /mantis/core/filter_api.php
===================================================================
--- /mantis/core/filter_api.php (revision 16)
+++ /mantis/core/filter_api.php (revision 17)
@@ -963,9 +963,9 @@
function filter_draw_selection_area( $p_page_number, $p_for_screen = true )
{
collapse_open( 'filter' );
+ filter_draw_selection_area2( $p_page_number, $p_for_screen, false );
+ collapse_closed( 'filter' );
filter_draw_selection_area2( $p_page_number, $p_for_screen, true );
- collapse_closed( 'filter' );
- filter_draw_selection_area2( $p_page_number, $p_for_screen, false );
collapse_end( 'filter' );
}

Index: /mantis/core/collapse_api.php
===================================================================
--- /mantis/core/collapse_api.php (revision 16)
+++ /mantis/core/collapse_api.php (revision 17)
@@ -78,15 +78,26 @@
}

global $g_open_collapse_section;
+
+ if ($p_name==='filter'){
+ if ( $g_open_collapse_section === true ) {
+ $t_icon = 'plus.png';
+ $t_alt = '+';
+ } else {
+ $t_icon = 'minus.png';
+ $t_alt = '-';
+ }
+ }
+ else
+ if ( $g_open_collapse_section === true ) {
+ $t_icon = 'minus.png';
+ $t_alt = '-';
+ } else {
+ $t_icon = 'plus.png';
+ $t_alt = '+';
+ }
+

- if ( $g_open_collapse_section === true ) {
- $t_icon = 'minus.png';
- $t_alt = '-';
- } else {
- $t_icon = 'plus.png';
- $t_alt = '+';
- }
-
echo "<a href=\"\" onclick=\"ToggleDiv( '$p_name', g_div_$p_name ); return false;\"
><img border=\"0\" src=\"images/$t_icon\" alt=\"$t_alt\" /></a>&nbsp;";
}

Like that, the filter are minimized by default on the view all bug page, for all the new users when connecting the first time.
David F
Senior Project Manager
Mr.J!M
Posts: 21
Joined: 11 Dec 2006, 17:43

Post by Mr.J!M »

how do you apply this patch?
i'm very interrested in this.

I have to paste it in a file.patch or what?

the --- etc confusing me.
Peter2
Posts: 2
Joined: 15 Oct 2007, 18:04

Post by Peter2 »

I've found an easier way to change the default, by changing the default cookie value (which is used while no cookie is saved yet).
Read at
http://www.mantisbt.org/bugs/view.php?id=8465
Post Reply