logo       

mantisbt print_all_bug_page_word.php,1.52,1.53 print_all_bug_page_excel.php: msg#00069

Subject: mantisbt print_all_bug_page_word.php,1.52,1.53 print_all_bug_page_excel.php,1.41,1.42
Update of /cvsroot/mantisbt/mantisbt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13198

Modified Files:
        print_all_bug_page_word.php print_all_bug_page_excel.php 
Log Message:
fix for 0004909: Printing bugnotes regardless of user rigth and bugnote status
added proper handling for reminders using bugnote note_type selector


Index: print_all_bug_page_word.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_page_word.php,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- print_all_bug_page_word.php 8 Aug 2004 11:39:00 -0000       1.52
+++ print_all_bug_page_word.php 30 Nov 2004 13:48:28 -0000      1.53
@@ -385,11 +385,19 @@
 </tr>
 <?php
        # get the bugnote data
+       if ( !access_has_bug_level( config_get( 'private_bugnote_threshold' ), 
$v_id ) ) {
+               $t_restriction = 'AND view_state=' . VS_PUBLIC;
+       } else {
+               $t_restriction = '';
+       }
+
+       $t_bugnote_table                = config_get( 'mantis_bugnote_table' );
+       $t_bugnote_text_table   = config_get( 'mantis_bugnote_text_table' );
        $t_bugnote_order = current_user_get_pref( 'bugnote_order' );
        
        $query6 = "SELECT *, date_submitted
-                       FROM $g_mantis_bugnote_table
-                       WHERE bug_id='$v_id'
+                       FROM $t_bugnote_table
+                       WHERE bug_id='$v_id' $t_restriction
                        ORDER BY date_submitted $t_bugnote_order";
        $result6 = db_query( $query6 );
        $num_notes = db_num_rows( $result6 );
@@ -423,7 +431,7 @@
 
                        # grab the bugnote text and id and prefix with v3_
                        $query6 = "SELECT note, id
-                                       FROM $g_mantis_bugnote_text_table
+                                       FROM $t_bugnote_text_table
                                        WHERE id='$v3_bugnote_text_id'";
                        $result7 = db_query( $query6 );
                        $v3_note = db_result( $result7, 0, 0 );
@@ -455,7 +463,20 @@
                <table class="hide" cellspacing="1">
                <tr>
                        <td class="print">
-                               <?php echo $v3_note ?>
+                               <?php
+                                       switch ( $v3_note_type ) {
+                                               case REMINDER:
+                                                       echo lang_get( 
'reminder_sent_to' ) . ': ';
+                                                       $v3_note_attr = substr( 
$v3_note_attr, 1, strlen( $v3_note_attr ) - 2 );
+                                                       $t_to = array();
+                                                       foreach ( explode( '|', 
$v3_note_attr ) as $t_recipient ) {
+                                                               $t_to[] = 
prepare_user_name( $t_recipient );
+                                                       }
+                                                       echo implode( ', ', 
$t_to ) . '<br />';
+                                               default:
+                                                       echo $v3_note;
+                                       }
+                               ?>
                        </td>
                </tr>
                </table>

Index: print_all_bug_page_excel.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_page_excel.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- print_all_bug_page_excel.php        8 Aug 2004 11:39:00 -0000       1.41
+++ print_all_bug_page_excel.php        30 Nov 2004 13:48:28 -0000      1.42
@@ -359,11 +359,19 @@
 <td colspan=3>
 <?php  # print bugnotes
                # get the bugnote data
+               if ( !access_has_bug_level( config_get( 
'private_bugnote_threshold' ), $v_id ) ) {
+                       $t_restriction = 'AND view_state=' . VS_PUBLIC;
+               } else {
+                       $t_restriction = '';
+               }
+
+               $t_bugnote_table                = config_get( 
'mantis_bugnote_table' );
+               $t_bugnote_text_table   = config_get( 
'mantis_bugnote_text_table' );
                $t_bugnote_order = current_user_get_pref( 'bugnote_order' );
                
                $query6 = "SELECT *,date_submitted
-                               FROM $g_mantis_bugnote_table
-                               WHERE bug_id='$v_id'
+                               FROM $t_bugnote_table
+                               WHERE bug_id='$v_id' $t_restriction
                                ORDER BY date_submitted $t_bugnote_order";
                $result6 = db_query( $query6 );
                $num_notes = db_num_rows( $result6 );
@@ -379,18 +387,30 @@
 
                        # grab the bugnote text and id and prefix with v3_
                        $query6 = "SELECT note, id
-                                       FROM $g_mantis_bugnote_text_table
+                                       FROM $t_bugnote_text_table
                                        WHERE id='$v3_bugnote_text_id'";
                        $result7 = db_query( $query6 );
                        $v3_note = db_result( $result7, 0, 0 );
                        $v3_bugnote_text_id = db_result( $result7, 0, 1 );
+                       $t_note = '';
 
+                       switch ( $v3_note_type ) {
+                               case REMINDER:
+                                       $t_note .= lang_get( 'reminder_sent_to' 
) . ': ';
+                                       $v3_note_attr = substr( $v3_note_attr, 
1, strlen( $v3_note_attr ) - 2 );
+                                       $t_to = array();
+                                       foreach ( explode( '|', $v3_note_attr ) 
as $t_recipient ) {
+                                               $t_to[] = prepare_user_name( 
$t_recipient );
+                                       }
+                                       $t_note .=  implode( ', ', $t_to ) . 
'|';
+                               default:
+                                       $t_note .=  $v3_note;
+                       }
                        if ( $f_type_page != 'html' ) {
-                               $v3_note = stripslashes( str_replace( 
'\n','|',$v3_note ));
-                               }
-                       else {
-                                       $v3_note = string_display_links( 
$v3_note );
-                               }
+                               $v3_note = stripslashes( str_replace( 
'\n','|',$t_note ));
+                       } else {
+                               $v3_note = string_display_links( $t_note );
+                       }
        ?>
 <table>
 <tr>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe