phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: email/inc class.boaction.inc.php,1.11,1.11.2.1 c


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.boaction.inc.php,1.11,1.11.2.1 class.bocompose.inc.php,1.1,1.1.2.1 class.bofolder.inc.php,1.4,1.4.2.1 class.boindex.inc.php,1.20,1.20.2.1 class.bomessage.inc.php,1.5,1.5.2.1 class.bopreferences.inc.php,1.10,1.10.2.1 class.bosend.inc.php,1.6,1.6.2.1 class.mail_dcom_imap.inc.php,1.18,1.18.2.1 class.mail_msg_base.inc.php,1.61.2.1,1.61.2.2 class.mail_msg_display.inc.php,1.31,1.31.2.1 class.mail_msg_wrappers.inc.php,1.23,1.23.2.1 class.uicompose.inc.php,1.1,1.1.2.1 class.uimessage.inc.php,1.2,1.2.2.1 class.uipreferences.inc.php,1.9.2.1,1.9.2.2 hook_home.inc.php,1.48,1.48.2.1 hook_notifywindow.inc.php,1.7.2.1,1.7.2.2 hook_preferences.inc.php,1.9,1.9.2.1
Date: Thu, 14 Feb 2002 01:42:48 -0500

Update of /cvsroot/phpgroupware/email/inc
In directory subversions:/tmp/cvs-serv13086/inc

Modified Files:
      Tag: Version-0_9_14-branch
        class.boaction.inc.php class.bocompose.inc.php 
        class.bofolder.inc.php class.boindex.inc.php 
        class.bomessage.inc.php class.bopreferences.inc.php 
        class.bosend.inc.php class.mail_dcom_imap.inc.php 
        class.mail_msg_base.inc.php class.mail_msg_display.inc.php 
        class.mail_msg_wrappers.inc.php class.uicompose.inc.php 
        class.uimessage.inc.php class.uipreferences.inc.php 
        hook_home.inc.php hook_notifywindow.inc.php 
        hook_preferences.inc.php 
Log Message:
merging in the HEAD code after discussion and vote in irc channel had skeeter, 
milosch and myself in agreement with this action. A strongly worded email will 
be sent explaining that new features wont be accepted again like this

Index: class.boaction.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.boaction.inc.php,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -r1.11 -r1.11.2.1
*** class.boaction.inc.php      12 Jan 2002 02:38:14 -0000      1.11
--- class.boaction.inc.php      14 Feb 2002 06:42:44 -0000      1.11.2.1
***************
*** 74,78 ****
                        {
                                if ($this->debug > 0) { echo 
'emai.boaction.delmov: get_arg_value(what) == "move") <br>'; }
!                               // called by the "move selected messages to" 
listbox onChange action
                                
                                /*
--- 74,80 ----
                        {
                                if ($this->debug > 0) { echo 
'emai.boaction.delmov: get_arg_value(what) == "move") <br>'; }
!                               // (1) generally called by the "move selected 
messages to" listbox onChange action
!                               // (2) also can be called by uimessage "move 
this message into" listbox onChange action
!                               //  if (2) then this flag is set as such: 
msgball[called_by] = uimessage
                                
                                /*
***************
*** 138,165 ****
                                // report folder messages were moved to
                                $tf = 
$GLOBALS['phpgw']->msg->prep_folder_out($to_fldball['folder']);
-                               // folder we should go back to
-                               $return_to_fldball['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_out($delmov_list[0]['folder']);
-                               $return_to_fldball['acctnum'] = 
$delmov_list[0]['acctnum'];
                                
!                               $this->redirect_to = $GLOBALS['phpgw']->link(
!                                                               '/index.php',
!                                                                
'menuaction=email.uiindex.index'
!                                                               
.'&fldball[folder]='.$return_to_fldball['folder']
!                                                               
.'&fldball[acctnum]='.$return_to_fldball['acctnum']
!                                                               .'&tm='.$tm
!                                                               .'&tf='.$tf
!                                                               
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
!                                                               
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
!                                                               
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               
!                               $goto_args=array( 
!                                       'folder'  => 
$return_to_fldball['folder'],
!                                       'acctnum' => 
$return_to_fldball['acctnum'],
!                                       'tm'    => $tm,
!                                       'tf'    => $tf,
!                                       'sort'  => 
$GLOBALS['phpgw']->msg->get_arg_value('sort'),
!                                       'order'  => 
$GLOBALS['phpgw']->msg->get_arg_value('order'),
!                                       'start'  => 
$GLOBALS['phpgw']->msg->get_arg_value('start')
!                               );
                                // end session if we are not going to reuse the 
current object
                                if ($attempt_reuse == False)
--- 140,184 ----
                                // report folder messages were moved to
                                $tf = 
$GLOBALS['phpgw']->msg->prep_folder_out($to_fldball['folder']);
                                
!                               // folder or message we should go back to
!                               if 
(($GLOBALS['phpgw']->msg->get_isset_arg('move_postmove_goto'))
!                               && 
($GLOBALS['phpgw']->msg->get_arg_value('move_postmove_goto') != ''))
!                               {
!                                       // THIS MEANS WE WERE CALLED BY 
UIMESSAGE
!                                       // treat the post-move navigation like 
a "delete_single_msg", as per data passed to us from that page
!                                       $move_postmove_goto = 
$GLOBALS['phpgw']->msg->get_arg_value('move_postmove_goto');
!                                       if ($this->debug > 1) { echo 
'emai.boaction.delmov: move single *called by uimessage*: $move_postmove_goto: 
: '.$move_postmove_goto.'<br>'; }
!                                       // ----  "Go To Previous Message" 
Handling  -----
!                                       // these insrustions passed from 
uimessage when prev_next_navigation is obtained anyway
!                                       $this->redirect_to = 
$move_postmove_goto;
!                                       if ($this->debug > 1) { echo 
'emai.boaction.delmov: move single *called by uimessage*: determination of 
$this->redirect_to : ['.$this->redirect_to.']<br>'; }
!                               }
!                               else
!                               {
!                                       $return_to_fldball['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_out($delmov_list[0]['folder']);
!                                       $return_to_fldball['acctnum'] = 
$delmov_list[0]['acctnum'];
!                                       
!                                       $this->redirect_to = 
$GLOBALS['phpgw']->link(
!                                                                       
'/index.php',
!                                                                        
'menuaction=email.uiindex.index'
!                                                                       
.'&fldball[folder]='.$return_to_fldball['folder']
!                                                                       
.'&fldball[acctnum]='.$return_to_fldball['acctnum']
!                                                                       
.'&tm='.$tm
!                                                                       
.'&tf='.$tf
!                                                                       
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
!                                                                       
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
!                                                                       
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                                       
!                                       $goto_args=array( 
!                                               'folder'  => 
$return_to_fldball['folder'],
!                                               'acctnum' => 
$return_to_fldball['acctnum'],
!                                               'tm'    => $tm,
!                                               'tf'    => $tf,
!                                               'sort'  => 
$GLOBALS['phpgw']->msg->get_arg_value('sort'),
!                                               'order'  => 
$GLOBALS['phpgw']->msg->get_arg_value('order'),
!                                               'start'  => 
$GLOBALS['phpgw']->msg->get_arg_value('start')
!                                       );
!                                       if ($this->debug > 1) { echo 
'emai.boaction.delmov: NOT called by uimessage, determination of 
$this->redirect_to : ['.$this->redirect_to.']<br>'; }
!                               }
                                // end session if we are not going to reuse the 
current object
                                if ($attempt_reuse == False)
***************
*** 375,395 ****
                        //echo '$GLOBALS[phpgw]->msg->get_arg_value(encoding): 
['.$GLOBALS['phpgw']->msg->get_arg_value('encoding').']<br>';
                        
!                       if ($GLOBALS['phpgw']->msg->get_arg_value('encoding') 
== 'base64')
                        {
-                               //echo 
$GLOBALS['phpgw']->msg->de_base64($GLOBALS['phpgw']->msg->phpgw_fetchbody($part_no));
                                echo 
$GLOBALS['phpgw']->msg->de_base64($GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball));
                        }
                        elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'qprint')
                        {
-                               //echo 
$GLOBALS['phpgw']->msg->qprint($GLOBALS['phpgw']->msg->phpgw_fetchbody($part_no));
                                echo 
$GLOBALS['phpgw']->msg->qprint($GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball));
                        }
                        else
                        {
-                               //echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($part_no);
                                echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
                        }
!                       
!                       $GLOBALS['phpgw']->msg->end_request();
                        $GLOBALS['phpgw']->common->phpgw_footer();
                }
--- 394,425 ----
                        //echo '$GLOBALS[phpgw]->msg->get_arg_value(encoding): 
['.$GLOBALS['phpgw']->msg->get_arg_value('encoding').']<br>';
                        
!                       // ----  'irregular' "view raw message" functionality  
----
!                       if ($msgball['part_no'] == 'raw_message')
!                       {
!                               // to dump out the whole raw message, do this:
!                               // 1) output the headers, 2) output the raw 
body 3) output a "closing" CRLF
!                               //headers_msgball will be used get the message 
headers, by specifying "part_no" = 0
!                               $headers_msgball = $msgball;
!                               $headers_msgball['part_no'] = 0;
!                               // that can also be used to ge tthe raw message 
body because phpgw_body() doesn't care about "part_no" 
!                               echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($headers_msgball);
!                               echo 
$GLOBALS['phpgw']->msg->phpgw_body($headers_msgball);
!                               echo "\r\n";
!                       }
!                       // ---- "regular" attachment handling  ----
!                       elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'base64')
                        {
                                echo 
$GLOBALS['phpgw']->msg->de_base64($GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball));
                        }
                        elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'qprint')
                        {
                                echo 
$GLOBALS['phpgw']->msg->qprint($GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball));
                        }
                        else
                        {
                                echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
                        }
!                       // you may feed "end_request" a msgball or a fldball 
and "end_request" will close the acctnum specified therein
!                       $GLOBALS['phpgw']->msg->end_request($msgball);
                        $GLOBALS['phpgw']->common->phpgw_footer();
                }

Index: class.bocompose.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.bocompose.inc.php,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -r1.1 -r1.1.2.1
*** class.bocompose.inc.php     8 Jan 2002 15:06:03 -0000       1.1
--- class.bocompose.inc.php     14 Feb 2002 06:42:44 -0000      1.1.2.1
***************
*** 19,26 ****
                        'compose'               => True
                );
!               //var $debug = True;
!               var $debug = False;
                var $xi;
                var $xml_functions = array();
                
                var $soap_functions = array(
--- 19,27 ----
                        'compose'               => True
                );
!               //var $debug = 3;
!               var $debug = 0;
                var $xi;
                var $xml_functions = array();
+               var $my_validator;
                
                var $soap_functions = array(
***************
*** 63,88 ****
                        }
                        
!                       // do we attempt to reuse the existing msg object?
!                       if ($attempt_reuse)
!                       {
!                               // no not create, we will reuse existing
!                               if ($this->debug) { echo 
'email.bocompose.compose: reusing existing mail_msg login'.'<br>'; }
!                               // we need to feed the existing object some 
params begin_request uses to re-fill the msg->args[] data
!                               $args_array = Array();
!                               // any args passed in $args_array will override 
or replace any pre-existing arg value
!                               $args_array = $reuse_feed_args;
!                               // add this to keep the error checking code 
(below) happy
!                               $args_array['do_login'] = True;
!                       }
!                       else
!                       {
!                               if ($this->debug) { echo 
'email.bocompose.compose: cannot or not trying to reusing existing'.'<br>'; }
!                               $args_array = Array();
!                               // should we log in or not
!                               $args_array['do_login'] = True;
!                       }
                        
                        // "start your engines"
!                       if ($this->debug == True) { echo 
'email.bocompose.compose: call msg->begin_request with args array:<pre>'; 
print_r($args_array); echo '</pre>'; }
                        $some_stream = 
$GLOBALS['phpgw']->msg->begin_request($args_array);
                        // error if login failed
--- 64,73 ----
                        }
                        
!                       $args_array = Array();
!                       // should we log in or not
!                       $args_array['do_login'] = True;
                        
                        // "start your engines"
!                       if ($this->debug > 1) { echo 'email.bocompose.compose: 
call msg->begin_request with args array:<pre>'; print_r($args_array); echo 
'</pre>'; }
                        $some_stream = 
$GLOBALS['phpgw']->msg->begin_request($args_array);
                        // error if login failed
***************
*** 99,102 ****
--- 84,89 ----
                        if 
($GLOBALS['phpgw']->msg->get_isset_arg('["msgball"]["msgnum"]'))
                        {
+                               if ($this->debug > 1) { echo 
'email.bocompose.compose: get_isset_arg ["msgball"]["msgnum"] is TRUE <br>'; }
+                               if ($this->debug > 1) { echo 
'email.bocompose.compose: $GLOBALS[phpgw]->msg->get_arg_value(action) : 
['.$GLOBALS['phpgw']->msg->get_arg_value('action').'] <br>'; }
                                $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
                                $msg_headers = 
$GLOBALS['phpgw']->msg->phpgw_header($msgball);
***************
*** 211,214 ****
--- 198,203 ----
                                        // NOTE: we should ALWAYS get a "First 
Presentable" value from class.bomessage
                                        // if not (a rare and screwed up 
situation) then assume msgball[part_no]=1
+                                       // Also, if the first presentable part 
is encoded as qprint or base64, or is subtype html
+                                       // class.bomessage should pass that 
info along as well
                                        if ((!isset($msgball['part_no']))
                                        || ($msgball['part_no'] == ''))
***************
*** 221,225 ****
                                        $bodystring = 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
                                        // see if we have to un-do qprint (or 
other) encoding of the part we are about to quote
!                                       if 
($GLOBALS['phpgw']->msg->get_isset_arg('encoding'))
                                        {
                                                // see if we have to un-do 
qprint encoding (fairly common)
--- 210,215 ----
                                        $bodystring = 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
                                        // see if we have to un-do qprint (or 
other) encoding of the part we are about to quote
!                                       if 
(($GLOBALS['phpgw']->msg->get_isset_arg('encoding'))
!                                       || 
($GLOBALS['phpgw']->msg->get_isset_arg('subtype')))
                                        {
                                                // see if we have to un-do 
qprint encoding (fairly common)
***************
*** 229,233 ****
                                                }
                                                // *rare, maybe never seen* see 
if we have to un-do base64 encoding
!                                               elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'qprint')
                                                {
                                                        // a human readable 
body part (non-attachment) should NOT be base64 encoded
--- 219,223 ----
                                                }
                                                // *rare, maybe never seen* see 
if we have to un-do base64 encoding
!                                               elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'base64')
                                                {
                                                        // a human readable 
body part (non-attachment) should NOT be base64 encoded
***************
*** 235,238 ****
--- 225,238 ----
                                                        $bodystring = 
$GLOBALS['phpgw']->msg->de_base64($bodystring);
                                                }
+                                               // after that idiot check, we 
need another now as well...
+                                               // *TOTALLY IDIOTIC* 
hotmail.com may send HTML ONLY mail
+                                               // without the rfc REQUIRED 
text only part, so we have to strip html
+                                               if 
($GLOBALS['phpgw']->msg->get_arg_value('subtype') == 'html')
+                                               {
+                                                       // class validator has 
the required function
+                                                       $this->my_validator = 
CreateObject("phpgwapi.validator");
+                                                       // you can never 
account for idiots, there should be a plain version of this IN THE MAIL
+                                                       $bodystring = 
$this->my_validator->strip_html($bodystring);
+                                               }
                                        }
                                        // "normalize" all line breaks into 
CRLF pairs
***************
*** 392,400 ****
                        {
                                // generally, msgball arg exists when 
reply,replyall, or forward is being done
!                               // if it exists, preserve (carry forward) its 
"folder" and "acctnum" values
                                $send_btn_action = $GLOBALS['phpgw']->link(
                                                '/index.php',
                                                'menuaction=email.bosend.send'
!                                               .'&action=forward'
                                                .'&'.$msgball['uri']
                                                // this is used to preserve 
these values when we return to folder list after the send
--- 392,401 ----
                        {
                                // generally, msgball arg exists when 
reply,replyall, or forward is being done
!                               // if it exists, preserve (carry forward) its 
"folder" "action" and "acctnum" values
                                $send_btn_action = $GLOBALS['phpgw']->link(
                                                '/index.php',
                                                'menuaction=email.bosend.send'
!                                               //.'&action=forward'
!                                               
.'&action='.$GLOBALS['phpgw']->msg->get_arg_value('action')
                                                .'&'.$msgball['uri']
                                                // this is used to preserve 
these values when we return to folder list after the send
***************
*** 459,462 ****
--- 460,468 ----
                        $this->xi['to_box_value'] = $to_box_value;
                        $this->xi['cc_box_value'] = $cc_box_value;
+                       // FUTURE: when we do spell check or message GPG 
encoding, we may need to submit whatever is in 
+                       // the bcc box (along with the other filled in data) 
simply so we can re-display this same page with 
+                       // spell checked or encoded message text
+                       $bcc_box_value = '';
+                       $this->xi['bcc_box_value'] = $bcc_box_value;
                        $this->xi['subject'] = $subject;
                        $this->xi['body'] = $body;
***************
*** 478,481 ****
--- 484,489 ----
                        $this->xi['cc_box_desc'] = lang('cc');
                        $this->xi['cc_box_name'] = 'cc';
+                       $this->xi['bcc_box_desc'] = lang('bcc');
+                       $this->xi['bcc_box_name'] = 'bcc';
                        $this->xi['subj_box_desc'] = lang('subject');
                        $this->xi['subj_box_name'] = 'subject';

Index: class.bofolder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.bofolder.inc.php,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -r1.4 -r1.4.2.1
*** class.bofolder.inc.php      9 Jan 2002 10:55:29 -0000       1.4
--- class.bofolder.inc.php      14 Feb 2002 06:42:44 -0000      1.4.2.1
***************
*** 50,62 ****
                }
                
!               function folder($reuse_feed_args=array())
                {
-                       // attempt (or not) to reuse an existing mail_msg 
object, i.e. if one ALREADY exists before entering
-                       // FIXME:   What????   can pass a useful, existing 
object for us to use here
-                       //$attempt_reuse = True;
-                       $attempt_reuse = False;
-                       
                        if ($this->debug) { echo 'ENTERING: 
email.bofolder.folder'.'<br>'; }
-                       if ($this->debug) { echo 'email.bofolder.folder: local 
var attempt_reuse=['.serialize($attempt_reuse).'] ; reuse_feed_args[] 
dump<pre>'; print_r($reuse_feed_args); echo '</pre>'; }
                        // create class objects
                        $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
--- 50,56 ----
                }
                
!               function folder()
                {
                        if ($this->debug) { echo 'ENTERING: 
email.bofolder.folder'.'<br>'; }
                        // create class objects
                        $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
***************
*** 72,96 ****
                        }
                        
!                       // do we attempt to reuse the existing msg object?
!                       if ($attempt_reuse)
!                       {
!                               // no not create, we will reuse existing
!                               if ($this->debug) { echo 
'email.bofolder.folder: reusing existing mail_msg login'.'<br>'; }
!                               // we need to feed the existing object some 
params begin_request uses to re-fill the msg->args[] data
!                               $args_array = Array();
!                               // any args passed in $args_array will override 
or replace any pre-existing arg value
!                               $args_array = $reuse_feed_args;
!                               // add this to keep the error checking code 
(below) happy
!                               $args_array['do_login'] = True;
!                       }
!                       else
!                       {
!                               if ($this->debug) { echo 
'email.bofolder.folder: cannot or not trying to reusing existing'.'<br>'; }
!                               $args_array = Array();
!                               // should we log in or not
!                               $args_array['do_login'] = True;
!                       }
!                       
!                       // "start your engines"
                        if ($this->debug == True) { echo 
'email.bofolder.folder: call msg->begin_request with args array:<pre>'; 
print_r($args_array); echo '</pre>'; }
                        $some_stream = 
$GLOBALS['phpgw']->msg->begin_request($args_array);
--- 66,71 ----
                        }
                        
!                       $args_array = Array();
!                       $args_array['do_login'] = True;
                        if ($this->debug == True) { echo 
'email.bofolder.folder: call msg->begin_request with args array:<pre>'; 
print_r($args_array); echo '</pre>'; }
                        $some_stream = 
$GLOBALS['phpgw']->msg->begin_request($args_array);
***************
*** 268,275 ****
                        return $success;
                }
! 
! 
! 
! 
                function folder_data()
                {
--- 243,248 ----
                        return $success;
                }
!               
!               
                function folder_data()
                {

Index: class.boindex.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.boindex.inc.php,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -C2 -r1.20 -r1.20.2.1
*** class.boindex.inc.php       11 Jan 2002 10:39:27 -0000      1.20
--- class.boindex.inc.php       14 Feb 2002 06:42:44 -0000      1.20.2.1
***************
*** 134,150 ****
                                'email_prefs_txt'       => lang('Email 
Preferences'),
                                'filters_txt'           => lang('EMail 
Filters'),
!                               'accounts_txt'          => lang('Manage 
Accounts'),
                                //'accounts_label'      => lang('Accounts:'),
!                               'accounts_label'        => lang('Switch 
Accounts'),
                                // some langs for the sort by box
                                'lang_sort_by'          => lang('Sort By'),
                                'lang_email_date'       => lang('Email Date'),
                                'lang_arrival_date'     => lang('Arrival Date'),
!                               'lang_from'             => lang('From'),
                                'lang_subject'          => lang('Subject'),
!                               'lang_size'             => lang('Size'),
                                // folder stats Information bar
!                               'lang_new'              => lang('New'),
!                               'lang_new2'             => lang('New Messages'),
                                'lang_total'            => lang('Total'),
                                'lang_total2'           => lang('Total 
Messages'),
--- 134,150 ----
                                'email_prefs_txt'       => lang('Email 
Preferences'),
                                'filters_txt'           => lang('EMail 
Filters'),
!                               'accounts_txt'          => lang('Extra 
Accounts'),
                                //'accounts_label'      => lang('Accounts:'),
!                               'accounts_label'        => lang('Account'),
                                // some langs for the sort by box
                                'lang_sort_by'          => lang('Sort By'),
                                'lang_email_date'       => lang('Email Date'),
                                'lang_arrival_date'     => lang('Arrival Date'),
!                               'lang_from'                     => lang('From'),
                                'lang_subject'          => lang('Subject'),
!                               'lang_size'                     => lang('Size'),
                                // folder stats Information bar
!                               'lang_new'                      => lang('New'),
!                               'lang_new2'                     => lang('New 
Messages'),
                                'lang_total'            => lang('Total'),
                                'lang_total2'           => lang('Total 
Messages'),
***************
*** 152,156 ****
                                'stats_to_txt'          => lang('to'),
                                'lang_get_size'         => lang('get size'),
!                               'lang_date'             => lang('date'),
                                'lang_lines'            => lang('lines'),
                                'lang_counld_not_open'  => lang('Could not open 
this mailbox'),
--- 152,156 ----
                                'stats_to_txt'          => lang('to'),
                                'lang_get_size'         => lang('get size'),
!                               'lang_date'                     => lang('date'),
                                'lang_lines'            => lang('lines'),
                                'lang_counld_not_open'  => lang('Could not open 
this mailbox'),
***************
*** 262,266 ****
                        
                        // establish all manner of important data
!                       // can not put acctnum=X here because any single peice 
of data may apply to a different account
                        $this->xi['svr_image_dir'] = PHPGW_IMAGES_DIR;
                        $this->xi['image_dir'] = PHPGW_IMAGES;
--- 262,266 ----
                        
                        // establish all manner of important data
!                       // can not put acctnum=X here because any single piece 
of data may apply to a different account
                        $this->xi['svr_image_dir'] = PHPGW_IMAGES_DIR;
                        $this->xi['image_dir'] = PHPGW_IMAGES;
***************
*** 273,278 ****
                        
                        // ---- account switchbox  ----
- 
- 
                        // make a HTML comobox used to switch accounts
                        $make_acctbox = True;
--- 273,276 ----
***************
*** 338,346 ****
                        //$this->xi['arrows_td_backcolor'] = 
$GLOBALS['phpgw_info']['theme']['th_bg'];
                        $this->xi['arrows_td_backcolor'] = '';
                        $nav_args = Array (
                                'start'         => 
$GLOBALS['phpgw']->msg->get_arg_value('start'),
!                               'total'         => 
$this->xi['folder_info']['number_all'],
!                               'cmd_prefix'    => 'do_navigate(\'',
!                               'cmd_suffix'    => '\')'
                        );
                        $arrows_links = array();
--- 336,356 ----
                        //$this->xi['arrows_td_backcolor'] = 
$GLOBALS['phpgw_info']['theme']['th_bg'];
                        $this->xi['arrows_td_backcolor'] = '';
+                       
+                       $this->xi['current_sort'] = 
$GLOBALS['phpgw']->msg->get_arg_value('sort');
+                       $this->xi['current_order'] = 
$GLOBALS['phpgw']->msg->get_arg_value('order');
+                       $this->xi['current_start'] = 
$GLOBALS['phpgw']->msg->get_arg_value('start');
+ 
+                       $nav_common_uri = $GLOBALS['phpgw']->link(
+                                                               '/index.php',
+                                                                
'menuaction=email.uiindex.index'
+                                                               
.'&fldball[folder]='.$GLOBALS['phpgw']->msg->prep_folder_out()
+                                                               
.'&fldball[acctnum]='.$GLOBALS['phpgw']->msg->get_acctnum()
+                                                               
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
+                                                               
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order'));
+                       
                        $nav_args = Array (
                                'start'         => 
$GLOBALS['phpgw']->msg->get_arg_value('start'),
!                               'common_uri'    => $nav_common_uri,
!                               'total'         => 
$this->xi['folder_info']['number_all']
                        );
                        $arrows_links = array();
***************
*** 404,421 ****
                        $this->xi['email_prefs_link'] = $GLOBALS['phpgw']->link(
                                                                '/index.php',
!                                                                
'menuaction=email.uipreferences.preferences'
!                                                               
.'&acctnum='.$GLOBALS['phpgw']->msg->get_acctnum());
                        
                        $this->xi['filters_link'] = $GLOBALS['phpgw']->link(
!                                                               
'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/filters.php'
!                                                               );
                        
                        $this->xi['filters_href'] = '<a 
href="'.$this->xi['filters_link'].'">'.$this->xi['filters_txt'].'</a>';
                        // FIXME
                        // multiple account maintenance - not yet implemented
                        $this->xi['accounts_link'] = $GLOBALS['phpgw']->link(
                                                                '/index.php',
!                                                                
'menuaction=email.uipreferences.ex_accounts'
!                                                               .'&acctnum=1');
                        $this->xi['accounts_href'] = '<a 
href="'.$this->xi['accounts_link'].'">'.$this->xi['accounts_txt'].'</a>';
                        
--- 414,433 ----
                        $this->xi['email_prefs_link'] = $GLOBALS['phpgw']->link(
                                                                '/index.php',
!                                                                
'menuaction=email.uipreferences.preferences');
                        
                        $this->xi['filters_link'] = $GLOBALS['phpgw']->link(
!                                                               '/index.php',
!                                                                
'menuaction=email.uifilters.filters_list');
                        
                        $this->xi['filters_href'] = '<a 
href="'.$this->xi['filters_link'].'">'.$this->xi['filters_txt'].'</a>';
                        // FIXME
                        // multiple account maintenance - not yet implemented
+                       //$this->xi['accounts_link'] = $GLOBALS['phpgw']->link(
+                       //                                      '/index.php',
+                       //                                       
'menuaction=email.uipreferences.ex_accounts'
+                       //                                      .'&acctnum=1');
                        $this->xi['accounts_link'] = $GLOBALS['phpgw']->link(
                                                                '/index.php',
!                                                                
'menuaction=email.uipreferences.ex_accounts_list');
                        $this->xi['accounts_href'] = '<a 
href="'.$this->xi['accounts_link'].'">'.$this->xi['accounts_txt'].'</a>';
                        
***************
*** 430,433 ****
--- 442,446 ----
                        }
                        
+                       // DEPRECIATED
                        $this->xi['ctrl_bar_acct_0_link'] = 
$GLOBALS['phpgw']->link(
                                                                '/index.php',
***************
*** 441,444 ****
--- 454,458 ----
                        $this->xi['ctrl_bar_acct_0_link'] = '<a 
href="'.$this->xi['ctrl_bar_acct_0_link'].'">'.'goto default'.'</a>';
                        
+                       // DEPRECIATED
                        $this->xi['ctrl_bar_acct_1_link'] = 
$GLOBALS['phpgw']->link(
                                                                '/index.php',

Index: class.bomessage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.bomessage.inc.php,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -r1.5 -r1.5.2.1
*** class.bomessage.inc.php     11 Jan 2002 06:10:32 -0000      1.5
--- class.bomessage.inc.php     14 Feb 2002 06:42:44 -0000      1.5.2.1
***************
*** 22,25 ****
--- 22,26 ----
                var $nextmatchs;
                var $debug = 0;
+               //var $debug = 3;
                var $xi;
                var $part_nice = '';
***************
*** 46,51 ****
                        // attempt (or not) to reuse an existing mail_msg 
object, i.e. if one ALREADY exists before entering
                        // this function. As of Dec 14, 2001 only 
class.boaction can pass a useful, existing object for us to use here
!                       $attempt_reuse = True;
!                       //$attempt_reuse = False;
                        
                        if ($this->debug > 0) { echo 'ENTERING: 
email.bomessage.message_data'.'<br>'; }
--- 47,52 ----
                        // attempt (or not) to reuse an existing mail_msg 
object, i.e. if one ALREADY exists before entering
                        // this function. As of Dec 14, 2001 only 
class.boaction can pass a useful, existing object for us to use here
!                       //$attempt_reuse = True;
!                       $attempt_reuse = False;
                        
                        if ($this->debug > 0) { echo 'ENTERING: 
email.bomessage.message_data'.'<br>'; }
***************
*** 97,105 ****
                        // ---- BEGIN BOMESSAGE ----
                        
                        // ----  Fill Some Important Variables  -----
                        $svr_image_dir = PHPGW_IMAGES_DIR;
                        $image_dir = PHPGW_IMAGES;
!                       $sm_envelope_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir.'/sm_envelope.gif','Add to 
address book','8','10','0');
!                       //$default_sorting = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['default_sorting'];
                        $not_set = $GLOBALS['phpgw']->msg->not_set;
                        
--- 98,217 ----
                        // ---- BEGIN BOMESSAGE ----
                        
+                       // ---- LANGS ----
+                       $this->xi['lang_add_to_address_book'] = lang('Add to 
address book');
+                       $this->xi['lang_previous_message'] = lang('Previous 
Message');
+                       $this->xi['lang_no_previous_message'] = lang('No 
Previous Message');
+                       $this->xi['lang_next_message'] = lang('Next Message');  
        
+                       $this->xi['lang_no_next_message'] = lang('No Next 
Message');
+                       $this->xi['lang_from'] = lang('from');
+                       $this->xi['lang_to'] = lang('to');
+                       $this->xi['lang_cc'] = lang('cc');
+                       $this->xi['lang_date'] = lang('date');
+                       $this->xi['lang_files'] = lang('files');
+                       $this->xi['lang_subject'] = lang('subject');
+                       $this->xi['lang_undisclosed_sender'] = 
lang('Undisclosed Sender');                      
+                       $this->xi['lang_undisclosed_recipients'] = 
lang('Undisclosed Recipients');
+                       $this->xi['lang_reply'] = lang('reply');
+                       $this->xi['lang_reply_all'] = lang('reply all');
+                       $this->xi['lang_forward'] = lang('forward');
+                       $this->xi['lang_delete'] = lang('delete');
+                       $this->xi['lang_view_headers'] = lang('view headers');
+                       $this->xi['lang_view_raw_message'] = lang('raw 
message');
+                       $this->xi['lang_message'] = lang('message');
+                       $this->xi['lang_keywords'] = lang('keywords');
+                       $this->xi['lang_section'] = lang('section');
+                       $this->xi['lang_view_as_html'] = lang('View as HTML');
+                       $this->xi['lang_view_formatted'] = lang('view 
formatted');
+                       $this->xi['lang_view_unformatted'] = lang('view 
unformatted');
+                       $this->xi['lang_charset'] = lang('charset');
+                       $this->xi['lang_attachment'] = lang('Attachment');
+                       $this->xi['lang_size'] = lang('size');
+                       $this->xi['lang_error_unknown_message_data'] = 
lang('ERROR: Unknown Message Data');
+                       $this->xi['accounts_label'] = lang('Switch Accounts');
+                       $this->xi['lang_move_this_message_into'] = lang('Move 
This Message into');
+                       
+                       
+                       //  ----  TOOL BAR / MENU BAR ----
+                       $this->xi['ctrl_bar_font'] = 
$GLOBALS['phpgw_info']['theme']['font'];
+                       $this->xi['ctrl_bar_font_size'] =  '-1';
+                       $this->xi['ctrl_bar_back1'] = 
$GLOBALS['phpgw_info']['theme']['row_on'];
+                       // ---- account switchbox  ----
+                       // make a HTML comobox used to switch accounts
+                       $make_acctbox = True;
+                       //$make_acctbox = False;
+                       // borrow code from boindex and uiindex for this 
functionality
+                       if ($make_acctbox)
+                       {
+                               $feed_args = Array(
+                                       'pre_select_acctnum'    => 
$GLOBALS['phpgw']->msg->get_acctnum(),
+                                       'widget_name'           => 
'fldball_fake_uri',
+                                       'folder_key_name'       => 'folder',
+                                       'acctnum_key_name'      => 'acctnum',
+                                       'on_change'             => 
'document.acctbox.submit()'
+                               );
+                               $this->xi['acctbox_listbox'] = 
$GLOBALS['phpgw']->msg->all_ex_accounts_listbox($feed_args);
+                       }
+                       else
+                       {
+                               $this->xi['acctbox_listbox'] = '&nbsp';
+                       }
+                       $this->xi['acctbox_frm_name'] = 'acctbox';
+                       // switchbox will itself contain "fake_uri" embedded 
data which includes the applicable account number for the folder
+                       $this->xi['acctbox_action'] = $GLOBALS['phpgw']->link(
+                                                               '/index.php',
+                                                                
'menuaction=email.uiindex.index');
+                       
+                       // ---- Move Message Box  ----
+                       // borrow code from boindex and uiindex for this 
functionality
+                       // pass on (preserve these valus) after the message move
+                       $this->xi['move_current_sort'] = 
$GLOBALS['phpgw']->msg->get_arg_value('sort');
+                       $this->xi['move_current_order'] = 
$GLOBALS['phpgw']->msg->get_arg_value('order');
+                       $this->xi['move_current_start'] = 
$GLOBALS['phpgw']->msg->get_arg_value('start');
+                       // POST MOVE INSTRUCTIONS
+                       // will pass as hidden var, this is the name of the 
POST var
+                       $this->xi['move_postmove_goto_name'] = 
'move_postmove_goto';
+                       // this is the value of the POST var
+                       // THIS CAN NOT be filled YET - wait till after 
prev/next arrows code obtains this data for us
+                       //$this->xi['move_postmove_goto_value'] = '';
+                       
+                       $this->xi['mlist_checkbox_name'] = 'delmov_list[]';
+                       $this->xi['frm_delmov_action'] = 
$GLOBALS['phpgw']->link(
+                                                               '/index.php',
+                                                               
'menuaction=email.boaction.delmov');
+                       $this->xi['frm_delmov_name'] = 'delmov';
+                       // imitate the stuff that happens when message(s) 
is/are selected on the uiindex page, then the move combobox is used
+                       $this->xi['mlist_embedded_uri'] = 
$GLOBALS['phpgw']->msg->get_arg_value('["msgball"]["uri"]');
+                       // add a special flag to the uri to indicate we should 
goto the next message, not to the index page
+                       //$this->xi['mlist_embedded_uri'] .= 
'&msgball[called_by]=uimessage';
+                       // that has been REPLACED by "move_postmove_goto" POST 
var
+                       $this->xi['mailsvr_supports_folders'] = 
$GLOBALS['phpgw']->msg->get_mailsvr_supports_folders();
+                       if ($this->xi['mailsvr_supports_folders'])
+                       {
+                               $feed_args = Array();
+                               $feed_args = Array(
+                                       'mailsvr_stream'        => '',
+                                       'pre_select_folder'     => '',
+                                       'skip_folder'           => 
$GLOBALS['phpgw']->msg->get_folder_short($GLOBALS['phpgw']->msg->get_arg_value('folder')),
+                                       'show_num_new'          => False,
+                                       'widget_name'           => 
'to_fldball_fake_uri',
+                                       'folder_key_name'       => 'folder',
+                                       'acctnum_key_name'      => 'acctnum',
+                                       'on_change'             => 
'do_action(\'move\')',
+                                       'first_line_txt'        => 
$this->xi['lang_move_this_message_into']
+                               );
+                               $this->xi['delmov_listbox'] = 
$GLOBALS['phpgw']->msg->all_folders_listbox($feed_args);
+                       }
+                       else
+                       {
+                               $this->xi['delmov_listbox'] = '&nbsp;';
+                       }
+                       
+                       
+                       
+                       
                        // ----  Fill Some Important Variables  -----
                        $svr_image_dir = PHPGW_IMAGES_DIR;
                        $image_dir = PHPGW_IMAGES;
!                       $sm_envelope_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir.'/sm_envelope.gif',$this->xi['lang_add_to_address_book'],'8','10','0');
                        $not_set = $GLOBALS['phpgw']->msg->not_set;
                        
***************
*** 116,119 ****
--- 228,232 ----
                        $message_date = 
$GLOBALS['phpgw']->common->show_date($msg_headers->udate);
                        
+                       if ($this->debug > 2) { echo 
'class.bomessage.message_data: $msg_struct DUMP:<pre>'; print_r($msg_struct); 
echo '</pre>';  }
                        #set_time_limit(0);
                        
***************
*** 161,165 ****
                        {
                                $prev_msg_link = $GLOBALS['phpgw']->link(
-                                       // 
'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/message.php',
                                        '/index.php',
                                         'menuaction=email.uimessage.message'
--- 274,277 ----
***************
*** 168,178 ****
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               $prev_msg_img = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/left.gif',lang('Previous 
Message'),'','','0');
                                $ilnk_prev_msg = 
$GLOBALS['phpgw']->msg->href_maketag($prev_msg_link,$prev_msg_img);
                        }
                        else
                        {
!                               //if ($this->debug > 0) { echo 'messages.php 
'.lang('No Previous Message').'<br>'; }
!                               $ilnk_prev_msg = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/left-grey.gif',lang('No 
Previous Message'),'','','0');
                        }
                        
--- 280,289 ----
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               $prev_msg_img = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/left.gif',$this->xi['lang_previous_message'],'','','0');
                                $ilnk_prev_msg = 
$GLOBALS['phpgw']->msg->href_maketag($prev_msg_link,$prev_msg_img);
                        }
                        else
                        {
!                               $ilnk_prev_msg = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/left-grey.gif',$this->xi['lang_no_previous_message'],'','','0');
                        }
                        
***************
*** 183,187 ****
                        {
                                $next_msg_link = $GLOBALS['phpgw']->link(
- //                                     
'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/message.php',
                                        '/index.php',
                                         'menuaction=email.uimessage.message'
--- 294,297 ----
***************
*** 190,200 ****
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               $next_msg_img = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/right.gif',lang('Next 
Message'),'','','0');
                                $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->href_maketag($next_msg_link,$next_msg_img);
                        }
                        else
                        {
!                               //if ($this->debug > 0) { echo 'messages.php 
'.lang('No Next Message').'<br>'; }
!                               $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/right-grey.gif',lang('No 
Next Message'),'','','0');
                        }
                        
--- 300,309 ----
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               $next_msg_img = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/right.gif',$this->xi['lang_next_message'],'','','0');
                                $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->href_maketag($next_msg_link,$next_msg_img);
                        }
                        else
                        {
!                               $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/right-grey.gif',$this->xi['lang_no_next_message'],'','','0');
                        }
                        
***************
*** 203,223 ****
                        $this->xi['ilnk_prev_msg'] = $ilnk_prev_msg;
                        $this->xi['ilnk_next_msg'] = $ilnk_next_msg;
! 
                        // ----  Labels and Colors for From, To, CC, Files, and 
Subject  -----
                        $this->xi['tofrom_labels_bkcolor'] = 
$GLOBALS['phpgw_info']['theme']['th_bg'];
                        $this->xi['tofrom_data_bkcolor'] = 
$GLOBALS['phpgw_info']['theme']['row_on'];
                        
-                       $this->xi['lang_from'] = lang('from');
-                       $this->xi['lang_to'] = lang('to');
-                       $this->xi['lang_cc'] = lang('cc');
-                       $this->xi['lang_date'] = lang('date');
-                       $this->xi['lang_files'] = lang('files');
-                       $this->xi['lang_subject'] = lang('subject');
-                       
                        // ----  From: Message Data  -----
                        if (!$msg_headers->from)
                        {
                                // no header info about this sender is available
!                               $from_data_final = lang('Undisclosed Sender');
                        }
                        else
--- 312,354 ----
                        $this->xi['ilnk_prev_msg'] = $ilnk_prev_msg;
                        $this->xi['ilnk_next_msg'] = $ilnk_next_msg;
!                       
!                       
!                       // ----  "MOVE THIS MESSAGE TO" MENU BAR BOX  ----
!                       // now that we have obtained "$next_msg_link" we can 
make this combobox widget
!                       // since we already need and use prev / next message 
navigation data on this page
!                       // we will make use of it and pass it on as a hidden 
var which will tell us which message
!                       // to show the user after the move has taken place. If 
folder becomes empty after the move, goto index page instead
!                       // Concept: after the move, we should goto the "PREV 
MESSAGE", unless the folder is now empty
!                       // why "PREV MESSAGE" : it more likely to take you to a 
message you habenot seen yet
!                       // "prev message" means "go to the message above this 
one in the message list on the uiindex page"
!                       //$this->xi['move_nav_mext_msgball_value'] = '';
!                       if ($nav_data['prev_msg'] != $not_set)
!                       {
!                               // use the "$prev_msg_link" generated above
!                               $this->xi['move_postmove_goto_value'] = 
$prev_msg_link;
!                       }
!                       else
!                       {
!                               // folder is probably empty, probably no more 
messages to show, so goto uiindex page *for this same folder*
!                               $this->xi['move_postmove_goto_value'] = 
$GLOBALS['phpgw']->link(
!                                               '/index.php',
!                                                
'menuaction=email.uiindex.index'
!                                               
.'&fldball[folder]='.$GLOBALS['phpgw']->msg->prep_folder_out()
!                                               
.'&fldball[acctnum]='.$GLOBALS['phpgw']->msg->get_acctnum()
!                                               
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
!                                               
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
!                                               
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                       }
!                       
!                       
                        // ----  Labels and Colors for From, To, CC, Files, and 
Subject  -----
                        $this->xi['tofrom_labels_bkcolor'] = 
$GLOBALS['phpgw_info']['theme']['th_bg'];
                        $this->xi['tofrom_data_bkcolor'] = 
$GLOBALS['phpgw_info']['theme']['row_on'];
                        
                        // ----  From: Message Data  -----
                        if (!$msg_headers->from)
                        {
                                // no header info about this sender is available
!                               $from_data_final = 
$this->xi['lang_undisclosed_sender'];
                        }
                        else
***************
*** 239,244 ****
                                }
                                // display "From" according to user preferences
-                               //if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['email']['show_addresses'])
-                               //&& 
($GLOBALS['phpgw_info']['user']['preferences']['email']['show_addresses'] != 
'none')
                                if 
(($GLOBALS['phpgw']->msg->get_isset_pref('show_addresses'))
                                && 
($GLOBALS['phpgw']->msg->get_pref_value('show_addresses') != 'none')
--- 370,373 ----
***************
*** 259,264 ****
                                                '/index.php',
                                                 
'menuaction=email.uicompose.compose'
!                                                // DO NOT USE msgball - bosend 
will interpret this the wrong way
!                                               //.'&'.$msgball['uri']
                                                
.'&fldball[folder]='.$msgball['folder']
                                                
.'&fldball[acctnum]='.$msgball['acctnum']
--- 388,392 ----
                                                '/index.php',
                                                 
'menuaction=email.uicompose.compose'
!                                                // DO NOT USE msgball[] - 
bosend will interpret this incorrectly as a reply or forward
                                                
.'&fldball[folder]='.$msgball['folder']
                                                
.'&fldball[acctnum]='.$msgball['acctnum']
***************
*** 291,295 ****
                        if (!$msg_headers->to)
                        {
!                               $to_data_final = lang('Undisclosed Recipients');
                        }
                        else
--- 419,423 ----
                        if (!$msg_headers->to)
                        {
!                               $to_data_final = 
$this->xi['lang_undisclosed_recipients'];
                        }
                        else
***************
*** 307,311 ****
                                                $to_personal = 
$GLOBALS['phpgw']->msg->decode_header_string($topeople->personal);
                                        }
-                                       //if 
(($GLOBALS['phpgw_info']['user']['preferences']['email']['show_addresses'] != 
'none')
                                        if 
(($GLOBALS['phpgw']->msg->get_pref_value('show_addresses') != 'none')
                                        && ($to_personal != $to_plain))
--- 435,438 ----
***************
*** 322,327 ****
                                                        '/index.php',
                                                         
'menuaction=email.uicompose.compose'
!                                                       // DO NOT USE msgball - 
bosend will interpret this the wrong way
!                                                       //.'&'.$msgball['uri']
                                                        
.'&fldball[folder]='.$msgball['folder']
                                                        
.'&fldball[acctnum]='.$msgball['acctnum']
--- 449,453 ----
                                                        '/index.php',
                                                         
'menuaction=email.uicompose.compose'
!                                                       // DO NOT USE msgball[] 
- bosend will interpret this incorrectly as a reply or forward
                                                        
.'&fldball[folder]='.$msgball['folder']
                                                        
.'&fldball[acctnum]='.$msgball['acctnum']
***************
*** 471,474 ****
--- 597,614 ----
                                                $first_presentable = 
$first_presentable .'&encoding=qprint';
                                        }
+                                       elseif 
(stristr($this->part_nice[$i]['m_keywords'], 'base64'))
+                                       {
+                                               // usually only spammers do 
this, but *RARELY* the text message is base 64 encoded
+                                               // then we must decode in the 
reply process
+                                               $first_presentable = 
$first_presentable .'&encoding=base64';
+                                       }
+                                       // also check for this mess...
+                                       if 
(stristr($this->part_nice[$i]['m_keywords'], 'html'))
+                                       {
+                                               // hotmail.com is the ONLY 
mailer to BREAK RFC RULES and send
+                                               // out html parts WITHOUT the 
required PLAIN part
+                                               // then we must decode in the 
reply process
+                                               $first_presentable = 
$first_presentable .'&subtype=html';
+                                       }
                                        break;
                                }
***************
*** 489,493 ****
                        
                        // ----  Images and Hrefs For Reply, ReplyAll, Forward, 
and Delete  -----
!                       $reply_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir.'/sm_reply.gif',lang('reply'),'','','0');
                        $reply_url = $GLOBALS['phpgw']->link(
                                        '/index.php',
--- 629,633 ----
                        
                        // ----  Images and Hrefs For Reply, ReplyAll, Forward, 
and Delete  -----
!                       $reply_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir.'/sm_reply.gif',$this->xi['lang_reply'],'','','0');
                        $reply_url = $GLOBALS['phpgw']->link(
                                        '/index.php',
***************
*** 502,506 ****
                        $ilnk_reply = 
$GLOBALS['phpgw']->msg->href_maketag($reply_url, $reply_img);
                        
!                       $replyall_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir .'/sm_reply_all.gif',lang('reply 
all'),'','','0');
                        $replyall_url = $GLOBALS['phpgw']->link(
                                        '/index.php',
--- 642,646 ----
                        $ilnk_reply = 
$GLOBALS['phpgw']->msg->href_maketag($reply_url, $reply_img);
                        
!                       $replyall_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_reply_all.gif',$this->xi['lang_reply_all'],'','','0');
                        $replyall_url = $GLOBALS['phpgw']->link(
                                        '/index.php',
***************
*** 515,519 ****
                        $ilnk_replyall = 
$GLOBALS['phpgw']->msg->href_maketag($replyall_url, $replyall_img);
                        
!                       $forward_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_forward.gif',lang('forward'),'','','0');
                        $forward_url =  $GLOBALS['phpgw']->link(
                                        '/index.php',
--- 655,659 ----
                        $ilnk_replyall = 
$GLOBALS['phpgw']->msg->href_maketag($replyall_url, $replyall_img);
                        
!                       $forward_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_forward.gif',$this->xi['lang_forward'],'','','0');
                        $forward_url =  $GLOBALS['phpgw']->link(
                                        '/index.php',
***************
*** 529,533 ****
                        $ilnk_forward = 
$GLOBALS['phpgw']->msg->href_maketag($forward_url, $forward_img);
                        
!                       $delete_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_delete.gif',lang('delete'),'','','0');
                        $delete_url = $GLOBALS['phpgw']->link(
                                         '/index.php',
--- 669,673 ----
                        $ilnk_forward = 
$GLOBALS['phpgw']->msg->href_maketag($forward_url, $forward_img);
                        
!                       $delete_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_delete.gif',$this->xi['lang_delete'],'','','0');
                        $delete_url = $GLOBALS['phpgw']->link(
                                         '/index.php',
***************
*** 641,652 ****
                                                }
                                        }
!                                       if 
($this->part_nice[$i]['ex_num_subparts'] != $not_set)
                                        {
!                                               $msg_body_info .= 
'ex_num_subparts: '. $this->part_nice[$i]['ex_num_subparts'] .$crlf;
!                                               if 
(strlen($this->part_nice[$i]['m_part_num_mime']) > 2)
                                                {
!                                                       $msg_body_info .= 
'subpart: '. serialize($this->part_nice[$i]['subpart']) .$crlf;
                                                }
                                        }
                                        if 
($this->part_nice[$i]['ex_attachment'])
                                        {
--- 781,799 ----
                                                }
                                        }
!                                       if 
($this->part_nice[$i]['ex_num_dparam_pairs'] > 0)
                                        {
!                                               for ($p = 0; $p < 
$this->part_nice[$i]['ex_num_dparam_pairs']; $p++)
                                                {
!                                                       $msg_body_info .= 
'dparams['.$p.']: 
'.$this->part_nice[$i]['dparams'][$p]['attribute'].'='.$this->part_nice[$i]['dparams'][$p]['value']
 .$crlf;
                                                }
                                        }
+                                       if 
($this->part_nice[$i]['ex_num_subparts'] != $not_set)
+                                       {
+                                               $msg_body_info .= 
'ex_num_subparts: '. $this->part_nice[$i]['ex_num_subparts'] .$crlf;
+                                               //if 
(strlen($this->part_nice[$i]['m_part_num_mime']) > 2)
+                                               //{
+                                               //      $msg_body_info .= 
'subpart: '. serialize($this->part_nice[$i]['subpart']) .$crlf;
+                                               //}
+                                       }
                                        if 
($this->part_nice[$i]['ex_attachment'])
                                        {
***************
*** 704,711 ****
                                .'&encoding=7bit'
                                );
!                       //$view_headers_href = 
$GLOBALS['phpgw']->msg->href_maketag($view_headers_url, lang('view headers'));
!                       $view_headers_href = '<a href="'.$view_headers_url.'" 
target="new">'.lang('view headers').'</a>';
                        $this->xi['view_headers_href'] = $view_headers_href;
                        
                        // Force Echo Out Unformatted Text for email with 1 
part which is a large text messages (in bytes) , such as a system report from 
cron
                        // php (4.0.4pl1 last tested) and some imap servers 
(courier and uw-imap are confirmed) will time out retrieving this type of 
message
--- 851,873 ----
                                .'&encoding=7bit'
                                );
!                       
!                       $view_headers_href = '<a href="'.$view_headers_url.'" 
target="new">'.$this->xi['lang_view_headers'].'</a>';
                        $this->xi['view_headers_href'] = $view_headers_href;
                        
+                       // (3) view or download the raw message, including 
headers
+                       $this_msgball = $msgball;
+                       $this_msgball['part_no'] = 'raw_message';
+                       $view_raw_message_url = $GLOBALS['phpgw']->link(
+                                '/index.php',
+                               'menuaction=email.boaction.get_attach'
+                               
.'&'.$msgball['uri'].'&msgball[part_no]='.$this_msgball['part_no']
+                               .'&type=text'
+                               .'&subtype=plain'
+                               .'&name=raw_message.txt'
+                               .'&encoding=7bit'
+                               );
+                       $view_raw_message_href = '<a 
href="'.$view_raw_message_url.'" 
target="new">'.$this->xi['lang_view_raw_message'].'</a>';
+                       $this->xi['view_raw_message_href'] = 
$view_raw_message_href;
+                       
                        // Force Echo Out Unformatted Text for email with 1 
part which is a large text messages (in bytes) , such as a system report from 
cron
                        // php (4.0.4pl1 last tested) and some imap servers 
(courier and uw-imap are confirmed) will time out retrieving this type of 
message
***************
*** 774,778 ****
                                        $title_text = '&nbsp;Mime-Ignorant 
Email Server: ';
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
!                                       $display_str = lang('keywords').': 
'.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
                                        
--- 936,940 ----
                                        $title_text = '&nbsp;Mime-Ignorant 
Email Server: ';
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
!                                       $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
                                        
***************
*** 831,836 ****
                                && ((int)$this->part_nice[$i]['bytes'] > 
$force_echo_size))
                                {
!                                       $title_text = 
'&nbsp;'.lang('message').': ';
!                                       $display_str = lang('keywords').': 
'.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
                                                .'; meets force_echo 
('.$GLOBALS['phpgw']->msg->format_byte_size($force_echo_size).') criteria';
                                        
--- 993,998 ----
                                && ((int)$this->part_nice[$i]['bytes'] > 
$force_echo_size))
                                {
!                                       $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
!                                       $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
                                                .'; meets force_echo 
('.$GLOBALS['phpgw']->msg->format_byte_size($force_echo_size).') criteria';
                                        
***************
*** 852,858 ****
                                        
                                        // -----  Prepare a Table for this Echo 
Dump
!                                       $title_text = 
'&nbsp;'.lang('message').': ';
                                        
$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
!                                       $display_str = lang('keywords').': 
'.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
                                                .'; meets force_echo 
('.$GLOBALS['phpgw']->msg->format_byte_size($force_echo_size).') criteria';
                                        
$GLOBALS['phpgw']->template->set_var('display_str',$display_str);
--- 1014,1020 ----
                                        
                                        // -----  Prepare a Table for this Echo 
Dump
!                                       $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
                                        
$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
!                                       $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
                                                .'; meets force_echo 
('.$GLOBALS['phpgw']->msg->format_byte_size($force_echo_size).') criteria';
                                        
$GLOBALS['phpgw']->template->set_var('display_str',$display_str);
***************
*** 891,903 ****
                                        if ($count_part_nice > 2)
                                        {
!                                               $title_text = 
lang('section').': '.$this->part_nice[$i]['m_part_num_mime'];
                                        }
                                        else
                                        {
!                                               $title_text = 
'&nbsp;'.lang('message').': ';
                                        }
                                        
                                        //$display_str = 
$this->part_nice[$i]['type'].'/'.strtolower($this->part_nice[$i]['subtype']);
!                                       $display_str = lang('keywords').': 
'.$this->part_nice[$i]['m_keywords']
                                                .' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
--- 1053,1065 ----
                                        if ($count_part_nice > 2)
                                        {
!                                               $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                        }
                                        else
                                        {
!                                               $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
                                        }
                                        
                                        //$display_str = 
$this->part_nice[$i]['type'].'/'.strtolower($this->part_nice[$i]['subtype']);
!                                       $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords']
                                                .' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
***************
*** 981,985 ****
                                                                .'<input 
type="hidden" name="html_part" value="'.base64_encode($dsp).'">'."\r\n"
                                                                .'&nbsp;&nbsp;'
!                                                               .'<input 
type="submit" value="'.lang('View as HTML').'">'."\r\n"
                                                        .'</p>'
                                                        .'<br>';
--- 1143,1147 ----
                                                                .'<input 
type="hidden" name="html_part" value="'.base64_encode($dsp).'">'."\r\n"
                                                                .'&nbsp;&nbsp;'
!                                                               .'<input 
type="submit" value="'.$this->xi['lang_view_as_html'].'">'."\r\n"
                                                        .'</p>'
                                                        .'<br>';
***************
*** 1018,1022 ****
                                                                .'<input 
type="hidden" name="html_reference" value="'.$part_href.'">'."\r\n"
                                                                .'&nbsp;&nbsp;'
!                                                               .'<input 
type="submit" value="'.lang('View as HTML').'">'."\r\n"
                                                        .'</p>'
                                                        .'<br>';
--- 1180,1184 ----
                                                                .'<input 
type="hidden" name="html_reference" value="'.$part_href.'">'."\r\n"
                                                                .'&nbsp;&nbsp;'
!                                                               .'<input 
type="submit" value="'.$this->xi['lang_view_as_html'].'">'."\r\n"
                                                        .'</p>'
                                                        .'<br>';
***************
*** 1081,1085 ****
                                        {
                                                $skip_this_part = True;
-                                               
//$GLOBALS['phpgw']->template->set_var('V_display_part','');
                                                
$this->part_nice[$i]['title_text'] = '';
                                                
$this->part_nice[$i]['display_str'] = '';
--- 1243,1246 ----
***************
*** 1122,1134 ****
                                                        // how many chars to 
allow on any single line, if more then we ADD a CRLF and split the line
                                                        $wrap_text_at = 85;
!                                                       $dsp = 
$GLOBALS['phpgw']->msg->body_hard_wrap($dsp, $wrap_text_at);
                                                        $dsp = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($dsp);
                                                        $dsp = 
'<pre>'.$dsp.'</pre>';
                                                        // alternate (toggle) 
to view formatted
!                                                       $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url, lang('view formatted'));
                                                }
                                                else
                                                {
!                                                       if 
(strtoupper(lang('charset')) <> 'BIG5')
                                                        {
                                                                // before we 
can encode some chars into html entities (ex. change > to &gt;)
--- 1283,1295 ----
                                                        // how many chars to 
allow on any single line, if more then we ADD a CRLF and split the line
                                                        $wrap_text_at = 85;
!                                                       $dsp = 
$GLOBALS['phpgw']->msg->body_hard_wrap($dsp, $wrap_text_at) ."\r\n";
                                                        $dsp = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($dsp);
                                                        $dsp = 
'<pre>'.$dsp.'</pre>';
                                                        // alternate (toggle) 
to view formatted
!                                                       $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url, 
$this->xi['lang_view_formatted']);
                                                }
                                                else
                                                {
!                                                       if 
(strtoupper($this->xi['lang_charset']) <> 'BIG5')
                                                        {
                                                                // before we 
can encode some chars into html entities (ex. change > to &gt;)
***************
*** 1149,1153 ****
                                                        $dsp = $dsp .'<br><br>';
                                                        // alternate (toggle) 
to view unformatted, for this we add "&no_fmt=1" to the URL
!                                                       $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url.'&no_fmt=1', lang('view 
unformatted'));
                                                }
                                                
--- 1310,1314 ----
                                                        $dsp = $dsp .'<br><br>';
                                                        // alternate (toggle) 
to view unformatted, for this we add "&no_fmt=1" to the URL
!                                                       $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url.'&no_fmt=1', 
$this->xi['lang_view_unformatted']);
                                                }
                                                
***************
*** 1160,1172 ****
                                                if ($count_part_nice > 2)
                                                {
!                                                       $title_text = 
lang('section').': '.$this->part_nice[$i]['m_part_num_mime'];
                                                }
                                                else
                                                {
!                                                       $title_text = 
'&nbsp;'.lang('message').': ';
                                                }
                                                
//$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
                                                
$this->part_nice[$i]['title_text'] = $title_text;
!                                               $display_str = 
lang('keywords').': '.$this->part_nice[$i]['m_keywords']
                                                        .' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                                // View formatted / unformatted 
moved to toolbar, do not show it here
--- 1321,1333 ----
                                                if ($count_part_nice > 2)
                                                {
!                                                       $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                                }
                                                else
                                                {
!                                                       $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
                                                }
                                                
//$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
                                                
$this->part_nice[$i]['title_text'] = $title_text;
!                                               $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords']
                                                        .' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                                // View formatted / unformatted 
moved to toolbar, do not show it here
***************
*** 1187,1194 ****
                                elseif ($this->part_nice[$i]['m_description'] 
== 'presentable/image')
                                {
!                                       $title_text = lang('section').': 
'.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
                                                .' - ' 
.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes']) 
!                                               .' - '.lang('keywords').': ' 
.$this->part_nice[$i]['m_keywords'];
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
--- 1348,1355 ----
                                elseif ($this->part_nice[$i]['m_description'] 
== 'presentable/image')
                                {
!                                       $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
                                                .' - ' 
.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes']) 
!                                               .' - 
'.$this->xi['lang_keywords'].': ' .$this->part_nice[$i]['m_keywords'];
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
***************
*** 1207,1218 ****
                                elseif ($this->part_nice[$i]['m_description'] 
== 'attachment')
                                {
!                                       $title_text = lang('section').': 
'.$this->part_nice[$i]['m_part_num_mime'];
!                                       $display_str = lang('keywords').': ' 
.$this->part_nice[$i]['m_keywords'];
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
                                        
!                                       $msg_text = '&nbsp;&nbsp; 
<strong>'.lang('Attachment').':</strong>'
                                                .'&nbsp;&nbsp; 
'.$this->part_nice[$i]['ex_part_clickable']
!                                               .'&nbsp;&nbsp; 
'.lang('size').': 
'.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes'])
                                                .'<br><br>';
                                        
--- 1368,1379 ----
                                elseif ($this->part_nice[$i]['m_description'] 
== 'attachment')
                                {
!                                       $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
!                                       $display_str = 
$this->xi['lang_keywords'].': ' .$this->part_nice[$i]['m_keywords'];
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
                                        
!                                       $msg_text = '&nbsp;&nbsp; 
<strong>'.$this->xi['lang_attachment'].':</strong>'
                                                .'&nbsp;&nbsp; 
'.$this->part_nice[$i]['ex_part_clickable']
!                                               .'&nbsp;&nbsp; 
'.$this->xi['lang_size'].': 
'.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes'])
                                                .'<br><br>';
                                        
***************
*** 1230,1236 ****
                                {
                                        // if we get here then we've got some 
kind of error, all things we know about are handle above
!                                       $title_text = lang("section").': 
'.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
!                                               .' - '.lang('keywords').': ' 
.$this->part_nice[$i]['m_keywords'];
                                        
//$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
--- 1391,1397 ----
                                {
                                        // if we get here then we've got some 
kind of error, all things we know about are handle above
!                                       $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
!                                               .' - 
'.$this->xi['lang_keywords'].': ' .$this->part_nice[$i]['m_keywords'];
                                        
//$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
***************
*** 1240,1244 ****
                                        $msg_text = '';
                                        // UNKNOWN DATA
!                                       $msg_text = $msg_text 
.'<br><strong>'.lang('ERROR: Unknown Message Data').'</strong><br>';
                                        if ($this->part_nice[$i]['encoding'] == 
'base64')
                                        {
--- 1401,1405 ----
                                        $msg_text = '';
                                        // UNKNOWN DATA
!                                       $msg_text = $msg_text 
.'<br><strong>'.$this->xi['lang_error_unknown_message_data'].'</strong><br>';
                                        if ($this->part_nice[$i]['encoding'] == 
'base64')
                                        {

Index: class.bopreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.bopreferences.inc.php,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -C2 -r1.10 -r1.10.2.1
*** class.bopreferences.inc.php 10 Jan 2002 10:04:41 -0000      1.10
--- class.bopreferences.inc.php 14 Feb 2002 06:42:44 -0000      1.10.2.1
***************
*** 20,24 ****
                        'init_available_prefs' => True,
                        'grab_set_prefs' => True,
!                       'ex_accounts' => True
                );
                var $not_set='-1';
--- 20,26 ----
                        'init_available_prefs' => True,
                        'grab_set_prefs' => True,
!                       'ex_accounts_edit' => True,
!                       'ex_accounts_list' => True,
[...1505 lines suppressed...]
+                       if ( (!isset($prelim_acctnum))
+                       || ($prelim_acctnum == $this->add_new_account_token)
+                       || ($prelim_acctnum == '##NOTHING##')
+                       || ((string)$prelim_acctnum == '')
+                       || ((string)$prelim_acctnum == '0') )
+                       {
+                               // get the next blank acctnum
+                               $final_acctnum = 
$this->get_first_empty_ex_acctnum();
+                       }
+                       else
+                       {
+                               $final_acctnum = $prelim_acctnum;
+                       }
+                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.obtain_ex_acctnum: LEAVING, returning $final_acctnum: 
['.serialize($final_acctnum).'] <br>'; }
+                       return $final_acctnum;
+               }
+ 
+ 
        }
  ?>

Index: class.bosend.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.bosend.inc.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** class.bosend.inc.php        10 Jan 2002 10:04:41 -0000      1.6
--- class.bosend.inc.php        14 Feb 2002 06:42:44 -0000      1.6.2.1
***************
*** 16,45 ****
        {
                var $public_functions = array(
-                       'get_langed_labels'     => True,
                        'send'          => True
                );
                var $nextmatchs;
                var $mail_out = array();
!               //var $debug = True;
!               var $debug = False;
                var $xi;
-               var $xml_functions = array();
-               
-               var $soap_functions = array(
-                       'get_langed_labels' => array(
-                               'in'  => array('int'),
-                               'out' => array('array')
-                       ),
-                       'send' => array(
-                               'in'  => array('array'),
-                               'out' => array('int')
-                       )
-               );
                
                function bosend()
                {
                        
                }
                
                //  -------  This will be called just before leaving this page, 
to clear / unset variables / objects -----------
                function send_message_cleanup()
--- 16,93 ----
        {
                var $public_functions = array(
                        'send'          => True
                );
                var $nextmatchs;
+               var $not_set='-1';
                var $mail_out = array();
!               var $debug = 0;
                var $xi;
                
                function bosend()
                {
+                       if ($this->debug > 0) { echo 'email.bosend 
*constructor*: ENTERING<br>'; }
+                       if (is_object($GLOBALS['phpgw']->msg))
+                       {
+                               if ($this->debug > 1) { echo 'email.bosend 
*constructor*: is_object test: $GLOBALS[phpgw]->msg is already set, do not 
create again<br>'; }
+                       }
+                       else
+                       {
+                               if ($this->debug > 1) { echo 'email.bosend 
*constructor*: is_object: $GLOBALS[phpgw]->msg is NOT set, creating mail_msg 
object<br>'; }
+                               $GLOBALS['phpgw']->msg = 
CreateObject("email.mail_msg");
+                       }
+                       $this->not_set = $GLOBALS['phpgw']->msg->not_set;
+                       if 
($GLOBALS['phpgw']->msg->get_isset_arg('already_grab_class_args_gpc'))
+                       {
+                               if ($this->debug > 0) { echo 'email.bosend 
*constructor*: LEAVING , msg object already initialized<br>'; }
+                               return True;
+                       }
+                               
+                       if ($this->debug > 1) { echo 'email.bosend 
*constructor*: msg object NOT yet initialized<br>'; }
+                       $args_array = Array();
+                       // should we log in or not, no, we only need prefs 
initialized
+                       // if any data is needed mail_msg will open stream for 
us
+                       $args_array['do_login'] = True;
+                       if ($this->debug > 1) { echo 'email.bosend 
*constructor*: call msg->begin_request with args 
array:'.serialize($args_array).'<br>'; }
+                       $some_stream = 
$GLOBALS['phpgw']->msg->begin_request($args_array);
+                       // error if login failed
+                       if (($args_array['do_login'] == True)
+                       && (!$some_stream))
+                       {
+                               
$GLOBALS['phpgw']->msg->login_error($GLOBALS['PHP_SELF'].', constructor()');
+                               // is this needed?
+                               return False;
+                       }
+                       if ($this->debug > 0) { echo 'email.bosend 
*constructor*: LEAVING<br>'; }
+               }
+               
+               /*!
+               @function get_originating_ip
+               @abstract the client IP for this phpgw user at the time the 
send button was clicked
+               @discussion Gets the value for the "X-Originating-IP" header. 
That header  is used
+               by hotmail, for example, it looked like a "good thing" and was 
a feature request, so we 
+               use it here too. Even if the IP private (such as on a LAN), 
this can still be useful for the admin.
+               */
+               function get_originating_ip()
+               {
+                       $got_ip = '';
+                       if (is_object($GLOBALS['phpgw']->session))
+                       {
+                               $got_ip = 
$GLOBALS['phpgw']->session->getuser_ip();
+                       }
+                       elseif 
(isset($GLOBALS['HTTP_SERVER_VARS']['REMOTE_ADDR']))
+                       {
+                               $got_ip = 
$GLOBALS['HTTP_SERVER_VARS']['REMOTE_ADDR'];
+                       }
                        
+                       // did we get anything useful ?
+                       if (trim((string)$got_ip) == '')
+                       {
+                               $got_ip = 'not available';
+                       }
+                       return $got_ip;
                }
                
+               
+               
                //  -------  This will be called just before leaving this page, 
to clear / unset variables / objects -----------
                function send_message_cleanup()
***************
*** 56,64 ****
                function send()
                {
                        // attempt (or not) to reuse an existing mail_msg 
object, i.e. if one ALREADY exists before entering
                        //$attempt_reuse = True;
                        $attempt_reuse = False;
                        
-                       if ($this->debug) { echo 'ENTERING: 
email.bosend.send'.'<br>'; }
                        if ($this->debug) { echo 'email.bosend.send: local var 
attempt_reuse=['.serialize($attempt_reuse).'] ; reuse_feed_args[] dump<pre>'; 
print_r($reuse_feed_args); echo '</pre>'; }
                        // create class objects
--- 104,113 ----
                function send()
                {
+                       if ($this->debug) { echo 'ENTERING: 
email.bosend.send'.'<br>'; }
+                       /*
                        // attempt (or not) to reuse an existing mail_msg 
object, i.e. if one ALREADY exists before entering
                        //$attempt_reuse = True;
                        $attempt_reuse = False;
                        
                        if ($this->debug) { echo 'email.bosend.send: local var 
attempt_reuse=['.serialize($attempt_reuse).'] ; reuse_feed_args[] dump<pre>'; 
print_r($reuse_feed_args); echo '</pre>'; }
                        // create class objects
***************
*** 74,78 ****
                                $GLOBALS['phpgw']->msg = 
CreateObject("email.mail_msg");
                        }
-                       
                        // do we attempt to reuse the existing msg object?
                        if ($attempt_reuse)
--- 123,126 ----
***************
*** 94,98 ****
                                $args_array['do_login'] = True;
                        }
-                       
                        // "start your engines"
                        if ($this->debug == True) { echo 'email.bosend.send: 
call msg->begin_request with args array:<pre>'; print_r($args_array); echo 
'</pre>'; }
--- 142,145 ----
***************
*** 104,107 ****
--- 151,155 ----
                                
$GLOBALS['phpgw']->msg->login_error($GLOBALS['PHP_SELF'].', send()');
                        }
+                       */
                        
                        // ---- BEGIN BO SEND LOGIC
***************
*** 121,124 ****
--- 169,173 ----
                        $this->mail_out['boundary'] = 
$GLOBALS['phpgw']->msg->make_boundary();
                        $this->mail_out['date'] = '';
+                       $this->mail_out['originating_ip'] = 
'['.$this->get_originating_ip().']';
                        $this->mail_out['main_headers'] = Array();
                        $this->mail_out['body'] = Array();
***************
*** 297,300 ****
--- 346,350 ----
                        
                        // ----  Attachment Detection  -----
+                       // some of this attachment uploading and handling code 
is from squirrelmail (www.squirrelmail.org)
                        $upload_dir = $GLOBALS['phpgw']->msg->att_files_dir;
                        if (file_exists($upload_dir))
***************
*** 325,328 ****
--- 375,379 ----
                        $to = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('to'));
                        $cc = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('cc'));
+                       $bcc = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('bcc'));
                        $body = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->get_arg_value('body')));
                        $subject = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('subject'));
***************
*** 335,341 ****
                        // THIS NEEDS TO BE CHANGED WHEN MULTIPLE PART FORWARDS 
ARE ENABLED
                        // BECAUSE WE CAN ONLY ALTER THE 1ST PART, I.E. THE 
PART THE USER JUST TYPED IN
!                       /*  // I think the email needs to be sent out as if it 
were PLAIN text (at least the part we are handling here)
!                       // i.e. with NO ENCODED HTML ENTITIES, so use > instead 
of $rt; and " instead of &quot; . etc...
!                       // it's up to the endusers MUA to handle any 
htmlspecialchars, whether to encode them or leave as it, the MUA should decide  
*/
                        $body = 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode($body);
                        
--- 386,393 ----
                        // THIS NEEDS TO BE CHANGED WHEN MULTIPLE PART FORWARDS 
ARE ENABLED
                        // BECAUSE WE CAN ONLY ALTER THE 1ST PART, I.E. THE 
PART THE USER JUST TYPED IN
!                       /*  email needs to be sent out as if it were PLAIN text 
(at least the part we are handling here)
!                       i.e. with NO ENCODED HTML ENTITIES, so use > instead of 
$rt; and " instead of &quot; . etc...
!                       it's up to the endusers MUA to handle any 
htmlspecialchars, whether to encode them or leave as it, the MUA should decide 
!                       */
                        $body = 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode($body);
                        
***************
*** 368,371 ****
--- 420,430 ----
                                $mta_to .= ',' 
.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['cc'], False);
                        }
+                       if ($bcc)
+                       {
+                               // here we will add bcc addresses to the list 
of adresses we will feed the MTA via the "RCPT TO" command
+                               // *however* this bcc data NEVER actually gets 
put in the message headers
+                               $this->mail_out['bcc'] = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($bcc);
+                               $mta_to .= ',' 
.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['bcc'], False);
+                       }
                        // now make mta_to an array because we will loop 
through it in class mail_send
                        $this->mail_out['mta_to'] = explode(',', $mta_to);
***************
*** 494,497 ****
--- 553,558 ----
                        {
                                // -----   INCOMPLETE CODE HERE  --------
+                               // -----   INCOMPLETE CODE HERE  --------
+                               // -----   INCOMPLETE CODE HERE  --------
                                $body_part_num++;
                                
$this->mail_out['body'][$body_part_num]['mime_headers'] = Array();
***************
*** 601,604 ****
--- 662,668 ----
                                
                                // Make Sure ALL INLINE BOUNDARY strings 
actually have CRLF CRLF preceeding them
+                               // because some lame MUA's don't properly 
format the message with CRLF CRLF BOUNDARY
+                               // in which case when we encapsulate such a 
malformed message, it *may* not be understood correctly 
+                               // by the receiving MUA, so we attempt to 
correct such a malformed message before we encapsulate it
                                // ---- not yet complete ----
                                $char_quot = '"';
***************
*** 642,645 ****
--- 706,711 ----
                                
//$this->mail_out['body'][$body_part_num]['mime_body'] = explode("\r\n", 
$fwd_this['processed']);
                                
$this->mail_out['body'][$body_part_num]['mime_body'] = 
$GLOBALS['phpgw']->msg->explode_linebreaks(trim($fwd_this['processed']));
+                               // clear this no longer needed var
+                               $fwd_this = '';
                                unset($fwd_this);
                        }
***************
*** 733,736 ****
--- 799,804 ----
                        // --- MAIN HEADERS  -------
                        $hdr_line = 0;
+                       $this->mail_out['main_headers'][$hdr_line] =            
'X-Originating-IP: '.$this->mail_out['originating_ip'];
+                       $hdr_line++;
                        $this->mail_out['main_headers'][$hdr_line] =            
'From: '.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['from']);
                        $hdr_line++;

Index: class.mail_dcom_imap.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.mail_dcom_imap.inc.php,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C2 -r1.18 -r1.18.2.1
*** class.mail_dcom_imap.inc.php        19 Dec 2001 16:17:50 -0000      1.18
--- class.mail_dcom_imap.inc.php        14 Feb 2002 06:42:44 -0000      1.18.2.1
***************
*** 104,107 ****
--- 104,112 ----
                        }
                        return 
imap_header($stream,$msg_nr,$fromlength,$tolength,$defaulthost);
+               }
+               
+               function headers($stream)
+               {
+                       return imap_headers($stream);
                } 
  

Index: class.mail_msg_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.mail_msg_base.inc.php,v
retrieving revision 1.61.2.1
retrieving revision 1.61.2.2
diff -C2 -r1.61.2.1 -r1.61.2.2
*** class.mail_msg_base.inc.php 16 Jan 2002 10:41:16 -0000      1.61.2.1
--- class.mail_msg_base.inc.php 14 Feb 2002 06:42:44 -0000      1.61.2.2
***************
*** 56,59 ****
--- 56,61 ----
        //var $reuse_existing_obj = True;
        var $reuse_existing_obj = False;
+       // raw prefs, before we process them to extract extra acct and/or 
filters data, not of much use
+       var $unprocessed_prefs=array();
        
        // ---- Data Caching  ----
***************
*** 80,91 ****
        
[...1145 lines suppressed...]
--- 3137,3144 ----
  
        // ==  "poor-man's" database compatibility ==
+       function db_defang_encode($str)
+       {
+               return $this->html_quotes_encode($str);
+       }
        function html_quotes_encode($str)
        {
***************
*** 2955,2958 ****
--- 3159,3166 ----
  
        // ==  "poor-man's" database compatibility ==
+       function db_defang_decode($str)
+       {
+               return $this->html_quotes_decode($str);
+       }
        function html_quotes_decode($str)
        {

Index: class.mail_msg_display.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.mail_msg_display.inc.php,v
retrieving revision 1.31
retrieving revision 1.31.2.1
diff -C2 -r1.31 -r1.31.2.1
*** class.mail_msg_display.inc.php      12 Jan 2002 19:04:13 -0000      1.31
--- class.mail_msg_display.inc.php      14 Feb 2002 06:42:44 -0000      1.31.2.1
***************
*** 214,218 ****
        }
  
! 
        // ---- Messages Sort Order Start and Msgnum  -----
        function fill_sort_order_start_msgnum()
--- 214,379 ----
        }
  
!       /*!
!       @function folders_mega_listbox
!       @abstract like "all_folders_listbox" except it really shows ALL folder 
from EVERY account
!       @param $feed_args[] array or args that you will "feed" into the 
function ??
!       @result string representing an HTML listbox widget 
!       @discussion ?
!       @access : private
!       */
!       function folders_mega_listbox($feed_args='')
!       {
!               if(!$feed_args)
!               {
!                       $feed_args=array();
!               }
!               //$debug_widget = True;
!               $debug_widget = False;
!               
!               $acctnum = $this->get_acctnum();
!               // establish fallback default args
!               $local_args = Array(
!                       'acctnum'               => $acctnum,
!                       'mailsvr_stream'        => 
$this->get_arg_value('mailsvr_stream', $acctnum),
!                       'pre_select_folder'     => '',
!                       'pre_select_folder_acctnum'     => $acctnum,
!                       'skip_folder'           => '',
!                       'show_num_new'          => False,
!                       'widget_name'           => 'folder_fake_uri',
!                       'folder_key_name'       => 'folder',
!                       'acctnum_key_name'      => 'acctnum',
!                       'on_change'             => 
'document.switchbox.submit()',
!                       'first_line_txt'        => lang('switch current folder 
to')
!               );              
!               // loop thru $local_args[], replacing defaults with any args 
specified in $feed_args[]
!               if ($debug_widget) { echo 'folders_mega_listbox $feed_args data 
dump<pre>'; print_r($feed_args); echo '</pre>'; }
!               if (count($feed_args) == 0)
!               {
!                       if ($debug_widget) { echo 'folders_mega_listbox 
$feed_args is EMPTY<br>'.serialize($feed_args).'<br>'; }
!               }
!               else
!               {
!                       reset($local_args);
!                       // the feed args may not be an array, the @ will 
supress warnings
!                       @reset($feed_args);             
!                       while(list($key,$value) = each($local_args))
!                       {
!                               // DEBUG
!                               if ($debug_widget) { echo 'a: local_args: 
key=['.$key.'] value=['.(string)$value.']<br>'; }
!                               if ($debug_widget) { echo 'b: feed_args: 
key=['.$key.'] value=['.(string)$feed_args[$key].']<br>'; }
!                               if ((isset($feed_args[$key]))
!                               && ($feed_args[$key] != $value))
!                               {
!                                       if (($key == 'mailsvr_stream')
!                                       && ($feed_args[$key] == ''))
!                                       {
!                                               // do nothing, keep the default 
value, can not over write a good default stream with an empty value
!                                               if ($debug_widget) { echo '* 
keeping default [mailsvr_stream] value, can not override with a blank 
string<br>'; }
!                                       }
!                                       else
!                                       {
!                                               // we have a specified arg that 
should replace the default value
!                                               if ($debug_widget) { echo '*** 
override default value of ['.$local_args[$key] .'] with feed_args['.$key.'] of 
['.(string)$feed_args[$key].']<br>'; }
!                                               $local_args[$key] = 
$feed_args[$key];
!                                       }
!                               }
!                       }
!                       reset($local_args);
!                       @reset($feed_args);
!               }
!               // at this point, local_args[] has anything that was passed in 
the feed_args[]
!               if ($debug_widget) { echo 'FINAL Listbox Local 
Args:<br>'.serialize($local_args).'<br>'; }
!               
!               $item_tags = '';
!               
!               // we need the loop to include the default account AS WELL AS 
the extra accounts
!               for ($x=0; $x < count($this->extra_and_default_acounts); $x++)
!               {
!                       $this_acctnum = 
$this->extra_and_default_acounts[$x]['acctnum'];
!                       $this_status = 
$this->extra_and_default_acounts[$x]['status'];
!                       if ($this_status != 'enabled')
!                       {
!                               // Do Nothing, This account is not in use
!                       }
!                       else
!                       {
!                               // get the actual list of folders we are going 
to put into the combobox
!                               $folder_list = 
$this->get_folder_list($this_acctnum);
!                               if ($debug_widget) { echo 'folders_mega_listbox 
$folder_list for $this_acctnum ['.$this_acctnum.'] DUMP<pre>'; 
print_r($folder_list); echo '</pre>'; }
!                               // NNTP = BORKED CODE!!!  (ignore for now) ...
!                               if ($this->get_arg_value('newsmode', 
$this_acctnum))
!                               {
!                                       while($pref = 
each($GLOBALS['phpgw_info']['user']['preferences']['nntp']))
!                                       {
!                                               
$GLOBALS['phpgw']->db->query('SELECT name FROM newsgroups WHERE con='.$pref[0]);
!                                               
while($GLOBALS['phpgw']->db->next_record())
!                                               {
!                                                       $item_tags .= '<option 
value="' . urlencode($GLOBALS['phpgw']->db->f('name')) . '">' . 
$GLOBALS['phpgw']->db->f('name')
!                                                         . '</option>';
!                                               }
!                                       }
!                                       break;
!                               }
!                               // ... back to working code
!                               
!                               // iterate thru the folder list, building the 
HTML tags using that data
!                               for ($i=0; $i<count($folder_list);$i++)
!                               {
!                                       $folder_long = 
$folder_list[$i]['folder_long'];
!                                       $folder_short = 
$folder_list[$i]['folder_short'];
!                                       // yes we need $folder_acctnum to help 
make the "folder ball", yes I know it *should* be the same as $this_acctnum
!                                       $folder_acctnum = 
$folder_list[$i]['acctnum'];
!                                       // this logic determines if the 
combobox should be initialized with certain folder already selected
!                                       // we use "folder short" as the 
comparator because that way at least we know we are comparing syntatic-ally 
similar items
!                                       if (($folder_short == 
$this->get_folder_short($local_args['pre_select_folder'], 
$local_args['pre_select_folder_acctnum']))
!                                       && ($folder_acctnum == 
$local_args['pre_select_folder_acctnum']))
!                                       {
!                                               $sel = ' selected';
!                                       }
!                                       else
!                                       {
!                                               $sel = '';
!                                       }
!                                       // this logic determines we should not 
include a certain folder in the combobox list
!                                       if ($folder_short != 
$this->get_folder_short($local_args['skip_folder']))
!                                       {
!                                               // we need to make value="X" 
imitate URI type data, so we can embed the acctnum data 
!                                               // for the folder in there with 
folder name, whereas normally option value="X" can only 
!                                               // hold no nore than one data 
item as limited by BOTH html and php 's treatment of a combobox                 
                  
!                                               
!                                               $option_value =  
'&'.$local_args['folder_key_name'].'='.$this->prep_folder_out($folder_long)
!                                                               
.'&'.$local_args['acctnum_key_name'].'='.$folder_acctnum;
!                                                               
!                                               $text_blurb = 
'['.$folder_acctnum.'] '.$folder_short;
!                                               
!                                               $item_tags .= '<option 
value="'.$option_value.'"'.$sel.'>'.$text_blurb.'</option>'."\r\n";
!                                       }
!                               }
!                       }
!               }
!               // now $item_tags contains the internal (i.e. "option" items) 
folder list for this "select" combobox widget
!               
!               // ----  add the HTML tags that surround this internal list 
data  ----
!               if ((isset($local_args['on_change']))
!               && ($local_args['on_change'] != ''))
!               {
!                       $on_change_tag = 
'onChange="'.$local_args['on_change'].'"';
!               }
!               else
!               {
!                       $on_change_tag = '';
!               }
!               
!               // the widget_name with "_fake_uri" tells the script what to do 
with this data
!               $listbox_widget =
!                        '<select name="'.$local_args['widget_name'].'" 
'.$on_change_tag.'>'
!                               .'<option 
value="">'.$local_args['first_line_txt'].' '
!                               . $item_tags
!                       .'</select>';
!               // return a pre-built HTML listbox (selectbox) widget
!               return $listbox_widget;
!       }
!       
!       
        // ---- Messages Sort Order Start and Msgnum  -----
        function fill_sort_order_start_msgnum()
***************
*** 400,406 ****
        function all_ex_accounts_listbox($feed_args)
        {
!               // $this->num_ex_accounts
!               // $this->defined_ex_accounts
!               // $this->enabled_ex_accounts
                
                if(!$feed_args)
--- 561,566 ----
        function all_ex_accounts_listbox($feed_args)
        {
!               // $this->ex_accounts_count
!               // $this->extra_accounts
                
                if(!$feed_args)
***************
*** 418,422 ****
                        'folder_key_name'       => 'folder',
                        'acctnum_key_name'      => 'acctnum',
!                       'on_change'             => 'document.acctbox.submit()'
                );              
                // loop thru $local_args[], replacing defaults with any args 
specified in $feed_args[]
--- 578,586 ----
                        'folder_key_name'       => 'folder',
                        'acctnum_key_name'      => 'acctnum',
!                       'on_change'                     => 
'document.acctbox.submit()',
!                       'is_multiple'           => False,
!                       'multiple_rows'         => '4',
!                       'show_status_is'        => 'enabled,disabled',
!                       'pre_select_multi'      => (string)$acctnum
                );              
                // loop thru $local_args[], replacing defaults with any args 
specified in $feed_args[]
***************
*** 437,441 ****
                                if ($debug_widget) { echo '* b: feed_args: 
key=['.$key.'] value=['.(string)$feed_args[$key].']<br>'; }
                                if ((isset($feed_args[$key]))
!                               && ($feed_args[$key] != $value))
                                {
                                        // we have a specified arg that should 
replace the default value
--- 601,606 ----
                                if ($debug_widget) { echo '* b: feed_args: 
key=['.$key.'] value=['.(string)$feed_args[$key].']<br>'; }
                                if ((isset($feed_args[$key]))
!                               //&& ($feed_args[$key] != $value))
!                               && ((string)$feed_args[$key] != (string)$value))
                                {
                                        // we have a specified arg that should 
replace the default value
***************
*** 452,501 ****
                $item_tags = '';
                
-               // this logic determines if the combobox should be initialized 
with certain account already selected
-               if ((string)$local_args['pre_select_acctnum'] == '0')
-               {
-                       $sel = ' selected';
-               }
-               else
-               {
-                       $sel = '';
-               }
-               
-               // add the default email account, account number 0
-               // this fake_uri data will be converted to fldball data on 
submit processing
-               $option_value =  '&'.$local_args['folder_key_name'].'=INBOX'
-                               .'&'.$local_args['acctnum_key_name'].'=0';
-               //$option_text = lang('default account').' '.lang('as').' 
&quot;'.$this->get_pref_value('fullname', 0).'&quot;';
-               //$option_text = 
lang('default').'&nbsp;&nbsp;'.$this->get_pref_value('fullname', 0);
-               $option_text = 
lang('default:').'&nbsp;&nbsp;'.$this->get_pref_value('fullname', 0);
-               
-               $item_tags .= '<option 
value="'.$option_value.'"'.$sel.'>'.$option_text.'</option>'."\r\n";
-               
                // iterate thru the ex_accounts list, building the HTML tags 
using that data
!               for ($i=0; $i < count($this->defined_ex_accounts); $i++)
                {
!                       // the option values below are in the form of embedded 
fake_uri
!                       $this_acctnum = $this->defined_ex_accounts[$i];
!                       // is this account "enabled" ?
!                       // array_search_ex($needle='', $haystack='', 
$strict=False)
!                       $enabled = $this->array_search_ex($this_acctnum, 
$this->enabled_ex_accounts);
!                       // note: is_bool is in the php3 compat library
!                       // note: array position 0 != boolean false, thus the 
test below
!                       if ((is_bool($enabled))
!                       && ($enabled == False))
                        {
                                // FUTURE: take user to the extra accounts 
management page for this particular account
                                // now: put the user back to the default account
                                $option_value =  
'&'.$local_args['folder_key_name'].'=INBOX'
                                                
.'&'.$local_args['acctnum_key_name'].'=0';
!                               $option_text = lang('account').' 
['.$this_acctnum.'] disabled';
                                
                                // note: a disabled account can not be 
pre-selected
                                $item_tags .= '<option 
value="'.$option_value.'">'.$option_text.'</option>'."\r\n";
                        }
!                       else
                        {
                                // this logic determines if the combobox should 
be initialized with certain account already selected
!                               if ((string)$local_args['pre_select_acctnum'] 
== (string)$this_acctnum)
                                {
                                        $sel = ' selected';
--- 617,652 ----
                $item_tags = '';
                
                // iterate thru the ex_accounts list, building the HTML tags 
using that data
!               for ($i=0; $i < count($this->extra_and_default_acounts); $i++)
                {
!                       $this_acctnum = 
$this->extra_and_default_acounts[$i]['acctnum'];
!                       // is this account "enabled", "disabled", or "empty"
!                       if ((stristr($local_args['show_status_is'], 'disabled'))
!                       && ($this->extra_and_default_acounts[$i]['status'] == 
'disabled'))
                        {
+                               // the option values below are in the form of 
embedded fake_uri
                                // FUTURE: take user to the extra accounts 
management page for this particular account
                                // now: put the user back to the default account
                                $option_value =  
'&'.$local_args['folder_key_name'].'=INBOX'
                                                
.'&'.$local_args['acctnum_key_name'].'=0';
!                               $option_text = lang('account').' 
['.$this_acctnum.'] '.lang('disabled');
                                
                                // note: a disabled account can not be 
pre-selected
                                $item_tags .= '<option 
value="'.$option_value.'">'.$option_text.'</option>'."\r\n";
                        }
!                       elseif ((stristr($local_args['show_status_is'], 
'enabled'))
!                       && ($this->extra_and_default_acounts[$i]['status'] == 
'enabled'))
                        {
                                // this logic determines if the combobox should 
be initialized with certain account already selected
!                               if ((!$local_args['is_multiple'])
!                               && ((string)$local_args['pre_select_acctnum'] 
== (string)$this_acctnum))
!                               {
!                                       $sel = ' selected';
!                               }
!                               elseif ( ($local_args['is_multiple'])
!                               && (    
(strstr((string)$local_args['pre_select_multi'], (string)$this_acctnum))
!                                               || 
($local_args['pre_select_multi'] == $this_acctnum)
!                                       )
!                               )
                                {
                                        $sel = ' selected';
***************
*** 518,521 ****
--- 669,673 ----
                                $item_tags .= '<option 
value="'.$option_value.'"'.$sel.'>'.$option_text.'</option>'."\r\n";
                        }
+                       // if not enabled or disabed, it must be empty, in 
which case we ignore it
                }
                // now $item_tags contains the internal folder list
***************
*** 532,538 ****
                }
                
                // the widget_name with "_fake_uri" tells the script what to do 
with this data
                $listbox_widget =
!                        '<select name="'.$local_args['widget_name'].'" 
'.$on_change_tag.'>'
                                . $item_tags
                        .'</select>';
--- 684,699 ----
                }
                
+               // if this is a multi-selectable scroll box, make the necessary 
tags
+               if (!$local_args['is_multiple'])
+               {
+                       $if_multiple_tags = '';
+               }
+               else
+               {
+                       $if_multiple_tags = 
'size="'.$local_args['multiple_rows'].'" multiple';
+               }
                // the widget_name with "_fake_uri" tells the script what to do 
with this data
                $listbox_widget =
!                        '<select name="'.$local_args['widget_name'].'" 
'.$on_change_tag.' '.$if_multiple_tags.'>'
                                . $item_tags
                        .'</select>';
***************
*** 764,768 ****
                                                                                
        if ($deepest_level < 5) { $deepest_level=5; }
                                                                                
        
!                                                                               
        // get SISTH LEVEL EMBEDDED level part information
                                                                                
        $d5_array_pos = $array_position;
                                                                                
        if ($d5_part['ex_num_subparts'] != $not_set)
--- 925,929 ----
                                                                                
        if ($deepest_level < 5) { $deepest_level=5; }
                                                                                
        
!                                                                               
        // get SIXTH LEVEL EMBEDDED level part information
                                                                                
        $d5_array_pos = $array_position;
                                                                                
        if ($d5_part['ex_num_subparts'] != $not_set)
***************
*** 890,893 ****
--- 1051,1056 ----
                        // however, a base64 part IS an attachment even if it 
has no name, just make one up
                        // also, if "disposition" header = "attachment", same 
thing, it's an attachment, and if no name is in the params, make one up
+                       // note: we do not use "elseif" during this because an 
attachment may be detected in *any* of the following code blocks
+                       // in no particular, nor predictable, order
                        
                        // Fallback / Default: assume No Attachment here
***************
*** 896,900 ****
                        $part_nice[$i]['ex_attachment'] = False;
                        
!                       // Attachment Detection PART1 = if a part has a 
NAME=FOO in the param pairs, then treat as an attachment
                        if (($part_nice[$i]['ex_num_param_pairs'] > 0)
                        && ($part_nice[$i]['ex_attachment'] == False))
--- 1059,1063 ----
                        $part_nice[$i]['ex_attachment'] = False;
                        
!                       // Attachment Detection PART1-A = if a part has a 
NAME=FOO in the param pairs, then treat as an attachment
                        if (($part_nice[$i]['ex_num_param_pairs'] > 0)
                        && ($part_nice[$i]['ex_attachment'] == False))
***************
*** 911,914 ****
--- 1074,1093 ----
                                }
                        }
+                       // Attachment Detection PART1-B = if a part has a 
NAME=FOO in the dparam pairs, then treat as an attachment
+                       if (($part_nice[$i]['ex_num_dparam_pairs'] > 0)
+                       && ($part_nice[$i]['ex_attachment'] == False))
+                       {
+                               for ($p = 0; $p < 
$part_nice[$i]['ex_num_dparam_pairs']; $p++)
+                               {
+                                       if 
(($part_nice[$i]['dparams'][$p]['attribute'] == 'name') 
+                                         && 
($part_nice[$i]['dparams'][$p]['value'] != $not_set))
+                                       {
+                                               $part_nice[$i]['ex_part_name'] 
= $part_nice[$i]['dparams'][$p]['value'];
+                                               $part_nice[$i]['ex_attachment'] 
= True;
+                                               break;
+                                       }
+                               }
+                       }
+                       
                        // Attachment Detection PART2 = if a part has 
encoding=base64 , then treat as an attachment
                        //      eventhough the above code did not find a name 
for the part
***************
*** 949,953 ****
                                        // Digression: why we can't do any more 
then this
                                        // we have no idea of it's name, and 
*maybe* no idea of it's content type
!                                       // (eg. name.gif = image/gif  which is 
"OBVIOUS" even if the mail headers fon't tell us that)
                                        // sometimes the name's extention is 
the only info we have, i.e. ".doc" implies a WORD file
                                        // but we can not do much here because 
we have NO name
--- 1128,1132 ----
                                        // Digression: why we can't do any more 
then this
                                        // we have no idea of it's name, and 
*maybe* no idea of it's content type
!                                       // (eg. name.gif = image/gif  which is 
"OBVIOUS" even if the mail headers don't tell us that)
                                        // sometimes the name's extention is 
the only info we have, i.e. ".doc" implies a WORD file
                                        // but we can not do much here because 
we have NO name
***************
*** 1089,1095 ****
                        // TEMPORARY HACK FOR SOCKET POP3 CLASS - feed it DUMB 
mime part numbers
                        
-                       //$tmp_a = $this->a[$this->acctnum];
-                       //if ((isset($tmp_a['dcom']->imap_builtin))
-                       //&& ($tmp_a['dcom']->imap_builtin == False)
                        if 
((isset($GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->imap_builtin))
                        && 
($GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->imap_builtin == False)
--- 1268,1271 ----
***************
*** 1104,1108 ****
                                $part_nice[$i]['m_part_num_mime'] = 
$part_nice[$i]['ex_mime_number_smart'];
                        }
-                       //$this->a[$this->acctnum] = $tmp_a;
                        
                        // ------  MAKE CLICKABLE HREF TO THIS PART  -------
--- 1280,1283 ----
***************
*** 1157,1160 ****
--- 1332,1341 ----
                        $part_nice['type'] = $part_type;
                }
+               // RFC SAYS TYPE "TEXT" IS *DEFAULT* AND MAY BE *ASSUMED* IN 
THE ABSENCE OF IT BEING SPECIFIED
+               if (($part_nice['type'] == 'unknown')
+               || ($part_nice['type'] == $not_set))
+               {
+                       $part_nice['type'] = 'text';
+               }
                
                // 2: ENCODING
***************
*** 1225,1229 ****
                }
                //13:  ifdparameters : True if the dparameters array exists 
SKIPPED -  ifparameters is more useful (I think)
!               //14:  dparameters : Disposition parameter array SKIPPED -  
parameters is more useful (I think)
                // 15:  ifparameters : True if the parameters array exists 
(SKIP)
                // 16:  parameters : MIME parameters array  - this *may* have 
more than a single attribute / value pair  but I'm not sure
--- 1406,1437 ----
                }
                //13:  ifdparameters : True if the dparameters array exists 
SKIPPED -  ifparameters is more useful (I think)
!               //14:  dparameters : Disposition parameter array
!               // *not* SKIPPED, although parameters is more useful (I think), 
dparameters may sometimes hold an attachment name
!               // ex_num_dparam_pairs defaults to 0 (no dparams)
!               $part_nice['ex_num_dparam_pairs'] = 0;
!               if ( (isset($part->ifdparameters)) && ($part->ifdparameters)
!               && (isset($part->dparameters)) && ($part->dparameters) )
!               {
!                       // Custom/Extra Information (ex_):  ex_num_dparam_pairs
!                       $part_nice['ex_num_dparam_pairs'] = 
count($part->dparameters);
!                       // capture data from all dparam attribute=value pairs
!                       for ($pairs = 0; $pairs < 
$part_nice['ex_num_dparam_pairs']; $pairs++)
!                       {
!                               $part_dparams = $part->dparameters[$pairs];
!                               $part_nice['dparams'][$pairs]['attribute'] = 
$not_set; // default / fallback
!                               if ((isset($part_dparams->attribute) && 
($part_dparams->attribute)))
!                               {
!                                       
$part_nice['dparams'][$pairs]['attribute'] = $part_dparams->attribute;
!                                       
$part_nice['dparams'][$pairs]['attribute'] = 
trim(strtolower($part_nice['dparams'][$pairs]['attribute']));
!                               }
!                               $part_nice['dparams'][$pairs]['value'] = 
$not_set; // default / fallback
!                               if ((isset($part_dparams->value) && 
($part_dparams->value)))
!                               {
!                                       $part_nice['dparams'][$pairs]['value'] 
= $part_dparams->value;
!                                       // stuff like file names should retain 
their case
!                                       
//$part_nice['dparams'][$pairs]['value'] = 
strtolower($part_nice['dparams'][$pairs]['value']);
!                               }
!                       }
!               }
                // 15:  ifparameters : True if the parameters array exists 
(SKIP)
                // 16:  parameters : MIME parameters array  - this *may* have 
more than a single attribute / value pair  but I'm not sure
***************
*** 1835,1843 ****
                        $totaltodisplay = $folder_info['number_all'];
                }
! 
                // keep track of how many loops we've done, for the return 
array, will be advanced to 0 before it's used
                $x = -1;
!               for ($i=$this->get_arg_value('start'); $i < $totaltodisplay; 
$i++)
                {
                        // we use $x to sequentially fill the $msg_list_display 
array
                        $x++;
--- 2043,2060 ----
                        $totaltodisplay = $folder_info['number_all'];
                }
!               
!               if ($this->get_isset_arg('start'))
!               {
!                       $start = $this->get_arg_value('start');
!               }
!               else
!               {
!                       $start = 0;
!               }
                // keep track of how many loops we've done, for the return 
array, will be advanced to 0 before it's used
                $x = -1;
!               for ($i=$start; $i < $totaltodisplay; $i++)
                {
+                       if ($debug_msg_list_display > 2) { echo 'mail_msg: 
get_msg_list_display: $msgball_list['.$i.'] dump:<pre>'; 
print_r($msgball_list[$i]); echo '</pre>'; }
                        // we use $x to sequentially fill the $msg_list_display 
array
                        $x++;
***************
*** 1853,1859 ****
                        // so PHP can build the fetchstructure data (IMAP 
server does this internally)
                        
-                       //$tmp_a = $this->a[$this->acctnum];
-                       //if ((isset($tmp_a['dcom']->imap_builtin))
-                       //&& ($tmp_a['dcom']->imap_builtin == False)
                        if 
((isset($GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->imap_builtin))
                        && 
($GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->imap_builtin == False)
--- 2070,2073 ----
***************
*** 1866,1878 ****
                        {
                                // need Message Information: STRUCTURAL for this
-                               //$msg_structure = 
$this->phpgw_fetchstructure($msgball_list[$i]['msgnum']);
                                $msg_structure = 
$this->phpgw_fetchstructure($msgball_list[$i]);
                                // now examine that msg_struct for signs of an 
attachment
                                $msg_list_display[$x]['has_attachment'] = 
$this->has_real_attachment($msg_structure);
                        }
!                       //$this->a[$this->acctnum] = $tmp_a;
! 
                        // Message Information: THE MESSAGE'S HEADERS ENVELOPE 
DATA
-                       //$hdr_envelope = 
$this->phpgw_header($msgball_list[$i]['msgnum']);
                        $hdr_envelope = $this->phpgw_header($msgball_list[$i]);
                        
--- 2080,2089 ----
                        {
                                // need Message Information: STRUCTURAL for this
                                $msg_structure = 
$this->phpgw_fetchstructure($msgball_list[$i]);
                                // now examine that msg_struct for signs of an 
attachment
                                $msg_list_display[$x]['has_attachment'] = 
$this->has_real_attachment($msg_structure);
                        }
!                       
                        // Message Information: THE MESSAGE'S HEADERS ENVELOPE 
DATA
                        $hdr_envelope = $this->phpgw_header($msgball_list[$i]);
                        
***************
*** 1887,1897 ****
                        $msg_list_display[$x]['subject'] = 
$this->get_subject($hdr_envelope,'');
                        $msg_list_display[$x]['subject_link'] = 
$GLOBALS['phpgw']->link(
!                               
//'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/message.php',
!                               '/index.php',
!                                'menuaction=email.uimessage.message'
!                               .'&'.$msgball_list[$i]['uri']
!                               .'&sort='.$this->get_arg_value('sort')
!                               .'&order='.$this->get_arg_value('order')
!                               .'&start='.$this->get_arg_value('start'));
                        
                        // SIZE
--- 2098,2107 ----
                        $msg_list_display[$x]['subject'] = 
$this->get_subject($hdr_envelope,'');
                        $msg_list_display[$x]['subject_link'] = 
$GLOBALS['phpgw']->link(
!                                                       '/index.php',
!                                                        
'menuaction=email.uimessage.message'
!                                                       
.'&'.$msgball_list[$i]['uri']
!                                                       
.'&sort='.$this->get_arg_value('sort')
!                                                       
.'&order='.$this->get_arg_value('order')
!                                                       
.'&start='.$this->get_arg_value('start'));
                        
                        // SIZE
***************
*** 1916,1919 ****
--- 2126,2132 ----
                                $msg_list_display[$x]['is_unseen'] = False;
                        }
+                       
+                       // FLAGS array with all IMAP flags, for utility 
purposes, such as appending and preserving these flags
+                       $msg_list_display[$x]['flags'] = 
$this->make_flags_str($hdr_envelope);
  
                        // FROM and REPLY TO  HANDLING
***************
*** 2030,2034 ****
                        $msg_list_display[$x]['from_link'] = 
$GLOBALS['phpgw']->link(
                                                                
'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/compose.php',
-                                                               // 
'folder='.$this->prep_folder_out('')
                                                                 
$msgball_list[$i]['uri']
                                                                
.'&sort='.$this->get_arg_value('sort')
--- 2243,2246 ----
***************
*** 2062,2065 ****
--- 2274,2280 ----
                                $msg_list_display[$x]['msg_date'] = 
ereg_replace("^.* -", '', $msg_date_time);
                        }
+                       // *raw* date for utility purposes, such as appending 
and specifying a date
+                       // php built in append does not let you specify the 
data during an append
+                       //$msg_list_display[$x]['msg_date_raw'] = 
$hdr_envelope->udate;
                }
                if ($debug_msg_list_display > 2) { echo 'mail_msg: 
get_msg_list_display: exiting $msg_list_display[] dump:<pre>'; 
print_r($msg_list_display); echo '</pre>'; }

Index: class.mail_msg_wrappers.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.mail_msg_wrappers.inc.php,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -C2 -r1.23 -r1.23.2.1
*** class.mail_msg_wrappers.inc.php     12 Jan 2002 10:02:27 -0000      1.23
--- class.mail_msg_wrappers.inc.php     14 Feb 2002 06:42:44 -0000      1.23.2.1
***************
*** 70,78 ****
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        
!                       //$tmp_a = $this->a[$this->acctnum];
!                       //$retval = 
$tmp_a['dcom']->fetchstructure($mailsvr_stream, $msgball['msgnum']);
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchstructure($mailsvr_stream, 
$msgball['msgnum']);
!                       //$this->a[$this->acctnum] = $tmp_a;
!                       return $retval;
                }
                
--- 70,74 ----
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchstructure($mailsvr_stream, 
$msgball['msgnum']);
                }
                
***************
*** 101,109 ****
                        
                        // Message Information: THE MESSAGE'S HEADERS RETURNED 
AS A STRUCTURE
!                       //$tmp_a = $this->a[$this->acctnum];
!                       //$retval = $tmp_a['dcom']->header($mailsvr_stream, 
$msgball['msgnum']);
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->header($mailsvr_stream, 
$msgball['msgnum']);
!                       //$this->a[$this->acctnum] = $tmp_a;
!                       return $retval;
                }
                
--- 97,101 ----
                        
                        // Message Information: THE MESSAGE'S HEADERS RETURNED 
AS A STRUCTURE
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->header($mailsvr_stream, 
$msgball['msgnum']);
                }
                
***************
*** 124,134 ****
                
                        // Message Information: THE MESSAGE'S HEADERS RETURNED 
RAW (no processing)
!                       //$tmp_a = $this->a[$this->acctnum];
!                       //$retval = 
$tmp_a['dcom']->fetchheader($mailsvr_stream, $msgball['msgnum']);
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchheader($mailsvr_stream, 
$msgball['msgnum']);
!                       //$this->a[$this->acctnum] = $tmp_a;
!                       return $retval;
                }
        
                function phpgw_get_flag($flag='')
                {
--- 116,153 ----
                
                        // Message Information: THE MESSAGE'S HEADERS RETURNED 
RAW (no processing)
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchheader($mailsvr_stream, 
$msgball['msgnum']);
                }
        
+               /*!
+               @function all_headers_in_folder
+               @abstract wrapper for IMAP_HEADERS, phpgw supplies the 
nedessary stream arg and mail_dcom reference
+               @param $fldball : array[folder] : string ; array[acctnum] : int
+               @result returns the php IMAP_HEADERS data, php manual says:
+               function.imap-headers.php
+               Returns headers for all messages in a mailbox 
+               Returns an array of string formatted with header info. One 
element per mail message
+               @discussion = = = = USELESS FUNCTION = = = = 
+               returns array of strings, each string is extremely truncated
+               partial contents of date, from, and subject, also includes the 
msg size in chars
+               */
+               function all_headers_in_folder($fldball='')
+               {
+                       if (!(isset($fldball))
+                       || ((string)$fldball == ''))
+                       {
+                               $msgball = $this->get_arg_value('fldball');
+                       }
+                       $acctnum = $fldball['acctnum'];
+                       if (!(isset($acctnum))
+                       || ((string)$acctnum == ''))
+                       {
+                               $acctnum = $this->get_acctnum();
+                       }
+                       $this->ensure_stream_and_folder($fldball, 
'all_headers_in_folder');
+                       $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
+                       
+                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->headers($mailsvr_stream);
+               }
+               
                function phpgw_get_flag($flag='')
                {
***************
*** 140,152 ****
                        else
                        {
!                               //$tmp_a = $this->a[$this->acctnum];
!                               //$retval = 
$tmp_a['dcom']->get_flag($this->get_arg_value('mailsvr_stream'),$this->get_arg_value('["msgball"]["msgnum"]'),$flag);
!                               $retval = 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->get_flag($this->get_arg_value('mailsvr_stream'),$this->get_arg_value('["msgball"]["msgnum"]'),$flag);
!                               //$this->a[$this->acctnum] = $tmp_a;
!                               return $retval;
                        }
                }
                
-               //FIXME: msgball
        // ====  Functions For Getting A Message Or A Part (MIME Part) Of A 
Message  ====
                function phpgw_body($msgball='')
--- 159,166 ----
                        else
                        {
!                               return 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->get_flag($this->get_arg_value('mailsvr_stream'),$this->get_arg_value('["msgball"]["msgnum"]'),$flag);
                        }
                }
                
        // ====  Functions For Getting A Message Or A Part (MIME Part) Of A 
Message  ====
                function phpgw_body($msgball='')
***************
*** 164,176 ****
                        }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->get_body($mailsvr_stream, 
$msgball['msgnum']);
!                       return $retval;
                }
                
-               //FIXME: msgball
-               //function phpgw_fetchbody($part_num_mime='', $flags='')
-               //{
-               //      return 
$this->a[$this->acctnum]['dcom']->fetchbody($this->get_arg_value('mailsvr_stream'),
 $this->get_arg_value('msgnum'), $part_num_mime, $flags);
-               //}
                function phpgw_fetchbody($msgball='', $flags='')
                {
--- 178,184 ----
                        }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->get_body($mailsvr_stream, 
$msgball['msgnum']);
                }
                
                function phpgw_fetchbody($msgball='', $flags='')
                {
***************
*** 193,227 ****
                        return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchbody($mailsvr_stream, $msgnum, 
$part_no, $flags);
                }
-               /*
-               function phpgw_fetchbody($msgball='', $part_num_mime='', 
$flags='')
-               {
-                       $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream');
-                       $msgnum = $msgball['msgnum'];
-                       $part_no = $msgball['part_no'];
-                       return 
$this->a[$this->acctnum]['dcom']->fetchbody($mailsvr_stream, $msgnum, $part_no, 
$flags);
-               }
-               */
-               /*
-               function phpgw_fetchbody($msgball='', $part_num_mime='', 
$flags='')
-               {
-                       if (!(isset($msgball))
-                       || ((string)$msgball == ''))
-                       {
-                               $msgball = $this->get_arg_value('msgball');
-                       }
-                       $acctnum = $msgball['acctnum'];
-                       if (!(isset($acctnum))
-                       || ((string)$acctnum == ''))
-                       {
-                               $acctnum = $this->get_acctnum();
-                       }
-                       $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
-                       
-                       //return 
$this->a[$acctnum]['dcom']->fetchbody($mailsvr_stream, $msgball['msgnum'], 
$part_num_mime, $flags);
-                       //return 
$this->a[$this->acctnum]['dcom']->fetchbody($this->get_arg_value('mailsvr_stream'),
 $this->get_arg_value('msgnum'), $part_num_mime, $flags);
-                       //return $this->a[$acctnum      
]['dcom']->fetchbody($mailsvr_stream, $msgball['msgnum'], $part_num_mime, 
$flags);
-                       return 
$this->a[$this->acctnum]['dcom']->fetchbody($mailsvr_stream, 
$msgball['msgnum'], $part_num_mime, $flags);
-               }
-               */
                
                
--- 201,204 ----
***************
*** 238,249 ****
                The data communications object (class mail_dcom) is supplied by 
the class
                */
!               function get_msgball_list($acctnum='')
                {
!                       if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
                        {
                                $acctnum = $this->get_acctnum();
                        }
!               
                        // try to restore "msgball_list" from saved session 
data store
                        $cached_msgball_list = 
$this->read_session_cache_item('msgball_list', $acctnum);
--- 215,245 ----
                The data communications object (class mail_dcom) is supplied by 
the class
                */
!               function get_msgball_list($acctnum='', $folder='')
                {
!                       $debug = 0;
!                       if ($debug > 0) { echo 
'mail_msg(wrappers).get_msgball_list:  ENTERING $acctnum ['.$acctnum.'] ; 
$folder ['.$folder.'] <br>'; }
!                       // IF specifying a folder, as a filter search may do, 
we need to ensure stream and folder
!                       if ((isset($acctnum))
!                       && ((string)$acctnum != '')
!                       && (isset($folder))
!                       && ((string)$folder != ''))
!                       {
!                               // SPECIAL HANDLING, typical message viewing 
would not need to specify folder
!                               // DO NOT SPECIFY FOLDER unless you *really* 
know what you are doing
!                               // typically "best" folder and acctnum are 
obtained during begin request
!                               // right now only specialized filter searching 
requires tp specify a folder
!                               $fake_fldball = array();
!                               $fake_fldball['acctnum'] = $acctnum;
!                               $fake_fldball['folder'] = $folder;
!                               $this->ensure_stream_and_folder($fake_fldball, 
'get_msgball_list');
!                               // ok, so now we KNOW the stream exists and 
folder value is what we need for this desired account
!                       }
!                       elseif ((!isset($acctnum))
                        || ((string)$acctnum == ''))
                        {
                                $acctnum = $this->get_acctnum();
                        }
!                       // as I said above, rare to specify folder, if it 
wasn;t handled above, forget about it
!                       
                        // try to restore "msgball_list" from saved session 
data store
                        $cached_msgball_list = 
$this->read_session_cache_item('msgball_list', $acctnum);
***************
*** 301,307 ****
                
                // ALIAS for get_folder_status_info() , for backward 
compatibility
!               function new_message_check()
                {
!                       return $this->get_folder_status_info();
                }
                
--- 297,303 ----
                
                // ALIAS for get_folder_status_info() , for backward 
compatibility
!               function new_message_check($fldball='')
                {
!                       return $this->get_folder_status_info($fldball='');
                }
                
***************
*** 430,437 ****
                }
  
!               function phpgw_server_last_error()
                {
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->server_last_error();
!                       return $retval;
                }
                
--- 426,437 ----
                }
  
!               function phpgw_server_last_error($acctnum='')
                {
!                       if ((!isset($acctnum))
!                       || ((string)$acctnum == ''))
!                       {
!                               $acctnum = $this->get_acctnum();
!                       }
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->server_last_error();
                }
                
***************
*** 444,456 ****
                        }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->noop_ping_test($mailsvr_stream);
!                       return $retval;
                }
                
!               function phpgw_search($criteria,$flags='')
                {
!                       $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream');
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->i_search($mailsvr_stream,$criteria,$flags);
!                       return $retval;
                }
                
--- 444,476 ----
                        }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->noop_ping_test($mailsvr_stream);
                }
                
!               function phpgw_search($fldball='', $criteria='', $flags='')
                {
!                       $acctnum = (int)$fldball['acctnum'];
!                       if ((!isset($acctnum))
!                       || ((string)$acctnum == ''))
!                       {
!                               $acctnum = $this->get_acctnum();
!                       }
!                       $folder = $fldball['folder'];
!                       // if folder is blank, we *should* assume INBOX because 
filters always search the INBOX
!                       if ((!isset($folder))
!                       || ((string)$folder == ''))
!                       {
!                               $folder = 'INBOX';
!                       }
!                       // Make Sure Stream Exists
!                       // multiple accounts means one stream may be open but 
another may not
!                       // "ensure_stream_and_folder" will verify for us, 
!                       $fake_fldball = array();
!                       $fake_fldball['acctnum'] = $acctnum;
!                       $fake_fldball['folder'] = $folder;
!                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_search');
!                       $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!                       
!                       // now we have the stream and the desired folder open
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->i_search($mailsvr_stream,$criteria,$flags);
                }
                
***************
*** 460,465 ****
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $folder = $target_fldball['folder'];
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->createmailbox($mailsvr_stream, $folder);
!                       return $retval;
                }
                
--- 480,484 ----
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $folder = $target_fldball['folder'];
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->createmailbox($mailsvr_stream, $folder);
                }
                
***************
*** 469,474 ****
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $folder = $target_fldball['folder'];
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->deletemailbox($mailsvr_stream, $folder);
!                       return $retval;
                }
                
--- 488,492 ----
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $folder = $target_fldball['folder'];
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->deletemailbox($mailsvr_stream, $folder);
                }
                
***************
*** 479,491 ****
                        $folder_old = $source_fldball['folder'];
                        $folder_new = $target_fldball['folder'];
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->renamemailbox($mailsvr_stream, 
$folder_old, $folder_new);
!                       return $retval;
                }
                
!               function phpgw_append($folder = "Sent", $message, $flags=0)
                {
                        //$debug_append = True;
                        $debug_append = False;
!               
                        if ($debug_append) { echo 'append: folder: 
'.$folder.'<br>'; }
                        
--- 497,530 ----
                        $folder_old = $source_fldball['folder'];
                        $folder_new = $target_fldball['folder'];
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->renamemailbox($mailsvr_stream, 
$folder_old, $folder_new);
!               }
! 
!               function phpgw_listmailbox($ref,$pattern,$acctnum)
!               {
!                       if (!(isset($acctnum))
!                       || ((string)$acctnum == ''))
!                       {
!                               $acctnum = $this->get_acctnum();
!                       }
!                       // Make Sure Stream Exists
!                       // multiple accounts means one stream may be open but 
another may not
!                       // "ensure_stream_and_folder" will verify for us, 
!                       // folder logged into does not matter for listmailbox, 
so leave it blank
!                       $fake_fldball = array();
!                       $fake_fldball['acctnum'] = $acctnum;
!                       $fake_fldball['folder'] = '';
!                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_listmailbox');
!                       $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!                       
!                       // ... so stream exists, do the transaction ...
!                       //echo '<b>phpgw_listmailbox</b>: about to call 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->listmailbox($mailsvr_stream['.$mailsvr_stream.'],$ref['.$ref.'],
 $pattern['.$pattern.']); <br>';
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,$ref,$pattern);
                }
                
!               function phpgw_append($folder="Sent", $message, $flags=0)
                {
                        //$debug_append = True;
                        $debug_append = False;
!                       
                        if ($debug_append) { echo 'append: folder: 
'.$folder.'<br>'; }
                        
***************
*** 551,556 ****
                        $this->expire_session_cache_item('msgball_list');
                        
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->mail_move($this->get_arg_value('mailsvr_stream'),
 $msg_list, $mailbox);
!                       return $retval;
                }
                
--- 590,594 ----
                        $this->expire_session_cache_item('msgball_list');
                        
!                       return 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->mail_move($this->get_arg_value('mailsvr_stream'),
 $msg_list, $mailbox);
                }
                
***************
*** 580,584 ****
                        return $retval;
                }
!               
                function phpgw_expunge($acctnum='')
                {
--- 618,732 ----
                        return $retval;
                }
! 
!               function industrial_interacct_mail_move($mov_msgball='', 
$to_fldball='')
!               {
!                       // Note: Only call this function with ONE msgball at a 
time, i.e. NOT a list of msgballs
!                       // INTERACCOUNT -OR- SAME ACCOUNT ?
!                       $debug_move = 0;
!                       //$debug_move = 3;
!                       if ($debug_move > 2) { echo 
'bofilters.run_single_filter: $to_fldball DUMP:<pre>'; print_r($to_fldball); 
echo "</pre>\r\n"; }
!                       // --- Establist account numbers ----
!                       $mov_msgball['acctnum'] = (int)$mov_msgball['acctnum'];
!                       if (!(isset($mov_msgball['acctnum']))
!                       || ((string)$mov_msgball['acctnum'] == ''))
!                       {
!                               $mov_msgball['acctnum'] = $this->get_acctnum();
!                       }
!                       $to_fldball['acctnum'] = (int)$to_fldball['acctnum'];
!                       if (!(isset($to_fldball['acctnum']))
!                       || ((string)$to_fldball['acctnum'] == ''))
!                       {
!                               $to_fldball['acctnum'] = $this->get_acctnum();
!                       }
!                       
!                       // Are the acctnums the same?
!                       if ((string)$mov_msgball['acctnum'] == 
(string)$to_fldball['acctnum'])
!                       {
!                               // SAME ACCOUNT MAIL MOVE
!                               
!                               $common_acctnum = $mov_msgball['acctnum'];
!                               if ($debug_move > 1) { echo 
'mail_msg(_wrappers): industrial_interacct_mail_move: SAME ACCOUNT MOVE 
$common_acctnum: '.$common_acctnum.' $mailsvr_stream: '.$mailsvr_stream.' 
$msgnum: '.$msgnum.' $mailsvr_callstr: '.$mailsvr_callstr.' $mailbox: 
'.$mailbox.'<br>'; }
!                               
$this->expire_session_cache_item('msgball_list', $common_acctnum);
!                               // we need to SELECT the folder the message is 
being moved FROM
!                               $mov_msgball['folder'] = 
urldecode($mov_msgball['folder']);
!                               $this->ensure_stream_and_folder($mov_msgball, 
'industrial_interacct_mail_move');
!                               $mov_msgball['msgnum'] = 
(string)$mov_msgball['msgnum'];
!                               $to_fldball['folder'] = 
urldecode($to_fldball['folder']);
!                               $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $common_acctnum);
!                               if ($debug_move > 1) { echo 
'mail_msg(_wrappers): industrial_interacct_mail_move: 
$GLOBALS[phpgw_dcom_'.$common_acctnum.']->dcom->mail_move('.serialize($mailsvr_stream).'
 ,'.serialize($mov_msgball['msgnum']).', 
'.serialize($to_fldball['folder']).')<br>'; }
!                               $did_move = 
$GLOBALS['phpgw_dcom_'.$common_acctnum]->dcom->mail_move($mailsvr_stream 
,$mov_msgball['msgnum'], $to_fldball['folder']);
!                               if (!$did_move)
!                               {
!                                       return False;
!                               }
!                               else
!                               {
!                                       return 
$this->phpgw_expunge($mov_msgball['acctnum']);
!                               }
!                       }
!                       else
!                       {
!                               // DIFFERENT ACCOUNT MAIL MOVE
!                               
!                               if ($debug_move > 1) { echo 
'mail_msg(_wrappers): industrial_interacct_mail_move: Different ACCOUNT MOVE 
$common_acctnum: '.$common_acctnum.' $mailsvr_stream: '.$mailsvr_stream.' 
$msgnum: '.$msgnum.' $mailsvr_callstr: '.$mailsvr_callstr.' $mailbox: 
'.$mailbox.'<br>'; }
!                               $good_to_go = False;
!                               // delete session msg array data thAt is now 
stale
!                               
$this->expire_session_cache_item('msgball_list', $mov_msgball['acctnum']);
!                               $mov_msgball['folder'] = 
urldecode($mov_msgball['folder']);
!                               // Make Sure Stream Exists
!                               // multiple accounts means one stream may be 
open but another may not
!                               // "ensure_stream_and_folder" will verify for 
us, 
!                               $this->ensure_stream_and_folder($mov_msgball, 
'industrial_interacct_mail_move');
!                               // GET MESSAGE FLAGS (before you get the mgs, 
so unseen/seen is not tainted by our grab)
!                               $hdr_envelope = 
$this->phpgw_header($mov_msgball);
!                               $mov_msgball['flags'] = 
$this->make_flags_str($hdr_envelope);
!                               // GET THE MESSAGE
!                               // part_no 0 only used to get the headers
!                               $mov_msgball['part_no'] = 0;
!                               // (a)  the headers, specify part_no 0
!                               //$moving_message = 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($mov_msgball);
!                               $moving_message = 
$this->phpgw_fetchbody($mov_msgball);
!                               // (b) the body, plus a CRLF, reuse 
headers_msgball b/c "phpgw_body" cares not about part_no
!                               //$moving_message .= 
$GLOBALS['phpgw']->msg->phpgw_body($mov_msgball)."\r\n";
!                               $moving_message .= 
$this->phpgw_body($mov_msgball)."\r\n";
!                               $good_to_go = (strlen($moving_message) > 3);
!                               if (!$good_to_go)
!                               {
!                                       return False;
!                               }
!                               
!                               // APPEND TO TARGET FOLDER
!                               // delete session msg array data thAt is now 
stale
!                               
$this->expire_session_cache_item('msgball_list', $to_fldball['acctnum']);
!                               $to_fldball['folder'] = 
urldecode($to_fldball['folder']);
!                               // TEMP (MUST add this back!!!) append does NOT 
require we open the target folder, only requires a stream
!                               $remember_to_fldball = $to_fldball['folder'];
!                               $to_fldball['folder'] = '';
!                               $this->ensure_stream_and_folder($to_fldball, 
'industrial_interacct_mail_move');
!                               $mailsvr_callstr = 
$this->get_arg_value('mailsvr_callstr', $to_fldball['acctnum']);
!                               $to_mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $to_fldball['acctnum']);
!                               $to_fldball['folder'] = $remember_to_fldball;
!                               $good_to_go = 
$GLOBALS['phpgw_dcom_'.$to_fldball['acctnum']]->dcom->append($to_mailsvr_stream,
 $mailsvr_callstr.$to_fldball['folder'], $moving_message, 
$mov_msgball['flags']);
!                               if (!$good_to_go)
!                               {
!                                       return False;
!                               }
!                               // DELETE and EXPUNGE from FROM FOLDER
!                               $from_mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $mov_msgball['acctnum']);
!                               $good_to_go = 
$GLOBALS['phpgw_dcom_'.$mov_msgball['acctnum']]->dcom->delete($from_mailsvr_stream,
 $mov_msgball['msgnum']);
!                               if (!$good_to_go)
!                               {
!                                       return False;
!                               }
!                               //$good_to_go = 
$GLOBALS['phpgw']->msg->phpgw_expunge($mov_msgball['acctnum']);
!                               $good_to_go = 
$this->phpgw_expunge($mov_msgball['acctnum']);
!                               if (!$good_to_go)
!                               {
!                                       return False;
!                               }
!                               return True;
!                       }
!               }
!       
                function phpgw_expunge($acctnum='')
                {
***************
*** 952,956 ****
                
                /*!
!               @function get_best_acctnum_and_set_it
                @abstract search a variety of vars to find a legitimate account 
number, fallsback to $this->get_acctnum
                @param $args_array ARRAY that was passed to ->begin_request, 
pass that into here if possible, it is a primary source
--- 1100,1104 ----
                
                /*!
!               @function get_best_acctnum
                @abstract search a variety of vars to find a legitimate account 
number, fallsback to $this->get_acctnum
                @param $args_array ARRAY that was passed to ->begin_request, 
pass that into here if possible, it is a primary source
***************
*** 958,990 ****
                Note: these are NOT the "internal args"
                @param $force_feed_acctnum INTEGER if for some reason you want 
to force an account number (DEPRECIATED)
!               @result integer, mostt legitimate account number that was 
obtained
                @discussion ?
                @author Angles
                @access Private
                */
!               function get_best_acctnum_and_set_it($args_array='', 
$got_args='', $force_feed_acctnum='')
                {
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
searching_for_acctnum: ENTERING, param $force_feed_acctnum 
['.$force_feed_acctnum.'] ; parm DUMP $args_array[] then $got_args[] 
dumps:<pre>'; print_r($args_array);  print_r($got_args); echo '</pre>'; }
                        
                        // ---  which email account do are these args intended 
to apply to  ----
                        // ORDER OF PREFERENCE for determining account num: 
just look at the code, it has comments
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
searching_for_acctnum: "what acctnum to use": searching...: <br>'; }
                        // initialize
                        $acctnum = '';
                        
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
searching_for_acctnum: get acctnum from feed args if possible<br>'; }
                        $found_acctnum = False;
                        while(list($key,$value) = each($args_array))
                        {
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: (acctnum search) this loop feed arg : 
['.$key.'] => ['.serialize($args_array[$key]).'] <br>'; }
                                // try to find feed acctnum value
                                if ($key == 'fldball')
                                {
                                        $fldball = $args_array[$key];
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) $args_array passed in 
$fldball[] : '.serialize($fldball).'<br>'; }
                                        $acctnum = (int)$fldball['acctnum'];
                                        
                                        // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) ACCTNUM from 
$args_array fldball : ['.$acctnum.']<br>'; }
                                        $found_acctnum = True;
                                        break;
--- 1106,1138 ----
                Note: these are NOT the "internal args"
                @param $force_feed_acctnum INTEGER if for some reason you want 
to force an account number (DEPRECIATED)
!               @result integer, most legitimate account number that was 
obtained
                @discussion ?
                @author Angles
                @access Private
                */
!               function get_best_acctnum($args_array='', $got_args='', 
$force_feed_acctnum='')
                {
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
get_best_acctnum: ENTERING, param $force_feed_acctnum ['.$force_feed_acctnum.'] 
; parm DUMP $args_array[] then $got_args[] dumps:<pre>'; print_r($args_array);  
print_r($got_args); echo '</pre>'; }
                        
                        // ---  which email account do are these args intended 
to apply to  ----
                        // ORDER OF PREFERENCE for determining account num: 
just look at the code, it has comments
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
get_best_acctnum: "what acctnum to use": searching...: <br>'; }
                        // initialize
                        $acctnum = '';
                        
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
get_best_acctnum: get acctnum from feed args if possible<br>'; }
                        $found_acctnum = False;
                        while(list($key,$value) = each($args_array))
                        {
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_acctnum: (acctnum search) this loop feed arg : ['.$key.'] 
=> ['.serialize($args_array[$key]).'] <br>'; }
                                // try to find feed acctnum value
                                if ($key == 'fldball')
                                {
                                        $fldball = $args_array[$key];
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: get_best_acctnum: (acctnum search) $args_array passed in 
$fldball[] : '.serialize($fldball).'<br>'; }
                                        $acctnum = (int)$fldball['acctnum'];
                                        
                                        // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: get_best_acctnum: (acctnum search) ACCTNUM from $args_array 
fldball : ['.$acctnum.']<br>'; }
                                        $found_acctnum = True;
                                        break;
***************
*** 993,1000 ****
                                {
                                        $msgball = $args_array[$key];
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) $args_array passed in 
$msgball[] : '.serialize($msgball).'<br>'; }
                                        $acctnum = (int)$msgball['acctnum'];
                                        // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) ACCTNUM from 
$args_array msgball : ['.$acctnum.']<br>'; }
                                        $found_acctnum = True;
                                        break;
--- 1141,1148 ----
                                {
                                        $msgball = $args_array[$key];
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: get_best_acctnum: (acctnum search) $args_array passed in 
$msgball[] : '.serialize($msgball).'<br>'; }
                                        $acctnum = (int)$msgball['acctnum'];
                                        // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: get_best_acctnum: (acctnum search) ACCTNUM from $args_array 
msgball : ['.$acctnum.']<br>'; }
                                        $found_acctnum = True;
                                        break;
***************
*** 1002,1009 ****
                                elseif ($key == 'acctnum')
                                {
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) $args_array passed in 
"acctnum" : '.serialize($args_array[$key]).'<br>'; }
                                        $acctnum = (int)$args_array[$key];
                                        // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) ACCTNUM from 
$args_array "acctnum" feed args : ['.$acctnum.']<br>'; }
                                        $found_acctnum = True;
                                        break;
--- 1150,1157 ----
                                elseif ($key == 'acctnum')
                                {
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: get_best_acctnum: (acctnum search) $args_array passed in 
"acctnum" : '.serialize($args_array[$key]).'<br>'; }
                                        $acctnum = (int)$args_array[$key];
                                        // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: get_best_acctnum: (acctnum search) ACCTNUM from $args_array 
"acctnum" feed args : ['.$acctnum.']<br>'; }
                                        $found_acctnum = True;
                                        break;
***************
*** 1014,1024 ****
                        {
                                // SET THE ACCTNUM AND RETURN IT
!                               if ($this->debug_args_input_flow > 0) { echo 
'mail_msg: searching_for_acctnum: (from $args_array) * * * *SETTING CLASS 
ACCTNUM* * * * by calling $this->set_acctnum('.serialize($acctnum).')<br>'; }
                                $this->set_acctnum($acctnum);
!                               if ($this->debug_args_input_flow > 0) { echo 
'mail_msg: searching_for_acctnum: LEAVING early, $args_array had the data, 
returning $acctnum ['.serialize($acctnum).']<br>'; }
                                return $acctnum;
                        }
                        
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
searching_for_acctnum: "what acctnum to use": continue searching...: <br>'; }
                        
                        // ok, now we need to broaden the search for a legit 
account number
--- 1162,1172 ----
                        {
                                // SET THE ACCTNUM AND RETURN IT
!                               if ($this->debug_args_input_flow > 0) { echo 
'mail_msg: get_best_acctnum: (from $args_array) * * * *SETTING CLASS ACCTNUM* * 
* * by calling $this->set_acctnum('.serialize($acctnum).')<br>'; }
                                $this->set_acctnum($acctnum);
!                               if ($this->debug_args_input_flow > 0) { echo 
'mail_msg: get_best_acctnum: LEAVING early, $args_array had the data, returning 
$acctnum ['.serialize($acctnum).']<br>'; }
                                return $acctnum;
                        }
                        
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
get_best_acctnum: "what acctnum to use": continue searching...: <br>'; }
                        
                        // ok, now we need to broaden the search for a legit 
account number
***************
*** 1026,1030 ****
                        && ((string)$force_feed_acctnum != ''))
                        {
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use function 
param $force_feed_acctnum=['.serialize($force_feed_acctnum).']<br>'; }
                                $acctnum = (int)$force_feed_acctnum;
                        }
--- 1174,1178 ----
                        && ((string)$force_feed_acctnum != ''))
                        {
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_acctnum: "what acctnum to use": will use function param 
$force_feed_acctnum=['.serialize($force_feed_acctnum).']<br>'; }
                                $acctnum = (int)$force_feed_acctnum;
                        }
***************
*** 1036,1040 ****
                                // make sure this is an integer
                                $got_args['msgball']['acctnum'] = $acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[msgball][acctnum] : 
['.serialize($got_args['msgball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['fldball']['acctnum']))
--- 1184,1188 ----
                                // make sure this is an integer
                                $got_args['msgball']['acctnum'] = $acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[msgball][acctnum] : 
['.serialize($got_args['msgball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['fldball']['acctnum']))
***************
*** 1045,1049 ****
                                // make sure this is an integer
                                $got_args['fldball']['acctnum'] = $acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[fldball][acctnum] : 
['.serialize($got_args['fldball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['source_fldball']['acctnum']))
--- 1193,1197 ----
                                // make sure this is an integer
                                $got_args['fldball']['acctnum'] = $acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[fldball][acctnum] : 
['.serialize($got_args['fldball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['source_fldball']['acctnum']))
***************
*** 1054,1058 ****
                                // make sure this is an integer
                                $got_args['source_fldball']['acctnum'] = 
$acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[source_fldball][acctnum] : 
['.serialize($got_args['source_fldball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['delmov_list'][0]['acctnum']))
--- 1202,1206 ----
                                // make sure this is an integer
                                $got_args['source_fldball']['acctnum'] = 
$acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[source_fldball][acctnum] : 
['.serialize($got_args['source_fldball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['delmov_list'][0]['acctnum']))
***************
*** 1062,1066 ****
                                // also, we will need to open the particular 
folder where the msg is localted
                                $acctnum = 
(int)$got_args['delmov_list'][0]['acctnum'];
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[delmov_list][0][acctnum] : 
['.serialize($got_args['delmov_list'][0]['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['target_fldball']['acctnum']))
--- 1210,1214 ----
                                // also, we will need to open the particular 
folder where the msg is localted
                                $acctnum = 
(int)$got_args['delmov_list'][0]['acctnum'];
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[delmov_list][0][acctnum] : 
['.serialize($got_args['delmov_list'][0]['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['target_fldball']['acctnum']))
***************
*** 1074,1078 ****
                                // make sure this is an integer
                                $got_args['target_fldball']['acctnum'] = 
$acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[target_fldball][acctnum] : 
['.serialize($got_args['target_fldball']['acctnum']).']<br>'; }
                        }
                        else
--- 1222,1226 ----
                                // make sure this is an integer
                                $got_args['target_fldball']['acctnum'] = 
$acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[target_fldball][acctnum] : 
['.serialize($got_args['target_fldball']['acctnum']).']<br>'; }
                        }
                        else
***************
*** 1085,1096 ****
                                // True means "return a default value, NOT 
boolean false, if $this->acctnum is not set
                                $acctnum = $this->get_acctnum(True);
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": NO *incoming* acctnum 
specified, called $this->get_acctnum(True), got: 
['.serialize($acctnum).']<br>'; }
                        }
                        
                        // SET THE ACCTNUM WITH THE "BEST VALUE" WE COULD FIND
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
searching_for_acctnum: * * * *SETTING CLASS ACCTNUM* * * * by calling 
$this->set_acctnum('.serialize($acctnum).')<br>'; }
!                       $this->set_acctnum($acctnum);
                        
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
searching_for_acctnum: LEAVING, returning $acctnum 
['.serialize($acctnum).']<br>'; }
                        return $acctnum;
                }
--- 1233,1245 ----
                                // True means "return a default value, NOT 
boolean false, if $this->acctnum is not set
                                $acctnum = $this->get_acctnum(True);
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_acctnum: "what acctnum to use": NO *incoming* acctnum 
specified, called $this->get_acctnum(True), got: 
['.serialize($acctnum).']<br>'; }
                        }
                        
                        // SET THE ACCTNUM WITH THE "BEST VALUE" WE COULD FIND
!                       // DEPRECIATED - we no longer set it here
!                       //if ($this->debug_args_input_flow > 0) { echo 
'mail_msg: get_best_acctnum: * * * *SETTING CLASS ACCTNUM* * * * by calling 
$this->set_acctnum('.serialize($acctnum).')<br>'; }
!                       //$this->set_acctnum($acctnum);
                        
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
get_best_acctnum: LEAVING, returning $acctnum ['.serialize($acctnum).']<br>'; }
                        return $acctnum;
                }
***************
*** 1383,1387 ****
                                        // ----  set the data in appsession  
----
                                        // we use folder_info for validity 
testing of data "stale" or not when we retrieve the cached data later
!                                       $folder_info = 
$this->get_folder_status_info();
                                        // make the structure for the data
                                        $meta_data = Array();
--- 1532,1539 ----
                                        // ----  set the data in appsession  
----
                                        // we use folder_info for validity 
testing of data "stale" or not when we retrieve the cached data later
!                                       $fldball = array();
!                                       $fldball['acctnum'] = $acctnum;
!                                       $fldball['folder'] = 
$this->get_arg_value('folder', $acctnum);
!                                       $folder_info = 
$this->get_folder_status_info($fldball);
                                        // make the structure for the data
                                        $meta_data = Array();
***************
*** 1464,1468 ****
                                        if ($this->debug_session_caching > 1) { 
echo 'mail_msg: read_session_cache_item: handler exists for $data_name 
['.$data_name.']<br>'; }
                                        // folder_info used to test validity 
(stale or not) of the cached msgball_list data
!                                       $folder_info = 
$this->get_folder_status_info();
                                        
                                        // VERIFY this cached data is still 
valid
--- 1616,1623 ----
                                        if ($this->debug_session_caching > 1) { 
echo 'mail_msg: read_session_cache_item: handler exists for $data_name 
['.$data_name.']<br>'; }
                                        // folder_info used to test validity 
(stale or not) of the cached msgball_list data
!                                       $fldball = array();
!                                       $fldball['acctnum'] = $acctnum;
!                                       $fldball['folder'] = 
$this->get_arg_value('folder', $acctnum);
!                                       $folder_info = 
$this->get_folder_status_info($fldball);
                                        
                                        // VERIFY this cached data is still 
valid

Index: class.uicompose.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.uicompose.inc.php,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -r1.1 -r1.1.2.1
*** class.uicompose.inc.php     8 Jan 2002 15:06:03 -0000       1.1
--- class.uicompose.inc.php     14 Feb 2002 06:42:44 -0000      1.1.2.1
***************
*** 86,89 ****
--- 86,90 ----
                                'to_box_value'          => 
$this->bo->xi['to_box_value'],
                                'cc_box_value'          => 
$this->bo->xi['cc_box_value'],
+                               'bcc_box_value'         => 
$this->bo->xi['bcc_box_value'],
                                'subj_box_value'        => 
$this->bo->xi['subject'],
                                'body_box_value'        => 
$this->bo->xi['body'],
***************
*** 105,108 ****
--- 106,111 ----
                                'cc_box_desc'           => 
$this->bo->xi['cc_box_desc'],
                                'cc_box_name'           => 
$this->bo->xi['cc_box_name'],
+                               'bcc_box_desc'          => 
$this->bo->xi['bcc_box_desc'],
+                               'bcc_box_name'          => 
$this->bo->xi['bcc_box_name'],
                                'subj_box_desc'         => 
$this->bo->xi['subj_box_desc'],
                                'subj_box_name'         => 
$this->bo->xi['subj_box_name'],

Index: class.uimessage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.uimessage.inc.php,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -r1.2 -r1.2.2.1
*** class.uimessage.inc.php     3 Jan 2002 22:40:16 -0000       1.2
--- class.uimessage.inc.php     14 Feb 2002 06:42:44 -0000      1.2.2.1
***************
*** 102,105 ****
--- 102,147 ----
                        }
                        
+                       //  ----  TOOL BAR / MENU BAR ----
+                       
$GLOBALS['phpgw']->template->set_var('accounts_label',$this->bo->xi['accounts_label']);
+                       
$GLOBALS['phpgw']->template->set_var('ctrl_bar_font',$this->bo->xi['ctrl_bar_font']);
+                       
$GLOBALS['phpgw']->template->set_var('ctrl_bar_font_size',$this->bo->xi['ctrl_bar_font_size']);
+                       
$GLOBALS['phpgw']->template->set_var('ctrl_bar_back1',$this->bo->xi['ctrl_bar_back1']);
+                       // ---- account switchbox  ----
+                       
$GLOBALS['phpgw']->template->set_var('acctbox_listbox',$this->bo->xi['acctbox_listbox']);
+                       
$GLOBALS['phpgw']->template->set_var('acctbox_frm_name',$this->bo->xi['acctbox_frm_name']);
+                       
$GLOBALS['phpgw']->template->set_var('acctbox_action',$this->bo->xi['acctbox_action']);
+                       // ---- Move Message Box  ----
+                       
$GLOBALS['phpgw']->template->set_var('move_current_sort',$this->bo->xi['move_current_sort']);
+                       
$GLOBALS['phpgw']->template->set_var('move_current_order',$this->bo->xi['move_current_order']);
+                       
$GLOBALS['phpgw']->template->set_var('move_current_start',$this->bo->xi['move_current_start']);
+                       
$GLOBALS['phpgw']->template->set_var('mlist_checkbox_name',$this->bo->xi['mlist_checkbox_name']);
+                       
$GLOBALS['phpgw']->template->set_var('mlist_embedded_uri',$this->bo->xi['mlist_embedded_uri']);
+                       
$GLOBALS['phpgw']->template->set_var('frm_delmov_action',$this->bo->xi['frm_delmov_action']);
+                       
$GLOBALS['phpgw']->template->set_var('frm_delmov_name',$this->bo->xi['frm_delmov_name']);
+                       
$GLOBALS['phpgw']->template->set_var('delmov_listbox',$this->bo->xi['delmov_listbox']);
+                       
$GLOBALS['phpgw']->template->set_var('move_postmove_goto_name',$this->bo->xi['move_postmove_goto_name']);
+                       
$GLOBALS['phpgw']->template->set_var('move_postmove_goto_value',$this->bo->xi['move_postmove_goto_value']);
+               
+               /*
+               ok      acctbox_frm_name
+               ok      acctbox_action
+               ok      ctrl_bar_back1
+               ok      acctbox_listbox
+               ok      ctrl_bar_font
+               ok      ctrl_bar_font_size
+               ok      accounts_label
+                       
+               ok      frm_delmov_name
+               ok      frm_delmov_action
+               ok      current_sort
+               ok      current_order
+               ok      current_start
+               ok      mlist_checkbox_name
+               ok      mlist_embedded_uri
+               ok      delmov_listbox
+               */      
+                       
+                       
+                       
                        
$GLOBALS['phpgw']->template->set_var('ilnk_prev_msg',$this->bo->xi['ilnk_prev_msg']);
                        
$GLOBALS['phpgw']->template->set_var('ilnk_next_msg',$this->bo->xi['ilnk_next_msg']);
***************
*** 185,188 ****
--- 227,231 ----
                        
$GLOBALS['phpgw']->template->set_var('view_option',$this->bo->xi['view_option']);
                        
$GLOBALS['phpgw']->template->set_var('view_headers_href',$this->bo->xi['view_headers_href']);
+                       
$GLOBALS['phpgw']->template->set_var('view_raw_message_href',$this->bo->xi['view_raw_message_href']);
                        
                        // -----  SHOW MESSAGE  -------

Index: class.uipreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.uipreferences.inc.php,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -C2 -r1.9.2.1 -r1.9.2.2
*** class.uipreferences.inc.php 16 Jan 2002 10:41:16 -0000      1.9.2.1
--- class.uipreferences.inc.php 14 Feb 2002 06:42:44 -0000      1.9.2.2
***************
*** 18,22 ****
                var $public_functions = array(
                        'preferences' => True,
!                       'ex_accounts' => True
                );
  
--- 18,23 ----
                var $public_functions = array(
                        'preferences' => True,
!                       'ex_accounts_edit' => True,
!                       'ex_accounts_list' => True
                );
  
***************
*** 25,30 ****
                var $theme;
                var $prefs;
!               //var $debug = True;
!               var $debug = False;
  
  
--- 26,31 ----
                var $theme;
                var $prefs;
!               var $debug = 0;
!               //var $debug = 3;
  
  
***************
*** 64,67 ****
--- 65,69 ----
                function create_prefs_block($feed_prefs='')
                {
+                       if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: ENTERING, $this->bo->account_group: 
['.$this->bo->account_group.']; $this->bo->acctnum: 
['.$this->bo->acctnum.']<br>'; }
                        $return_block = '';
                        if(!$feed_prefs)
***************
*** 71,74 ****
--- 73,77 ----
                        if (count($feed_prefs) == 0)
                        {
+                               if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: LEAVING early, $feed_prefs param was 
empty<br>'; }
                                return $return_block;
                        }
***************
*** 82,86 ****
                        {
                                // the existing prefs are for en ectra email 
account
!                               //$actual_user_prefs = 
$this->prefs['ex_accounts'][$this->bo->acctnum];
                                $temp_prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences('', 
$this->bo->acctnum);
                                $actual_user_prefs = $temp_prefs['email'];
--- 85,91 ----
                        {
                                // the existing prefs are for en ectra email 
account
!                               if ($this->debug > 1) { echo 
'email.uipreferences.create_prefs_block: ('.$this->bo->account_group.') get 
user prefs from DB by calling 
$GLOBALS[phpgw]->preferences->create_email_preferences(\'\', 
'.$this->bo->acctnum.')<br>'; }
!                               //by calling this function with a specific 
acctnum, we get back fully procecessed prefs data from the DB
!                               // for the that acctnum
                                $temp_prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences('', 
$this->bo->acctnum);
                                $actual_user_prefs = $temp_prefs['email'];
***************
*** 89,95 ****
                        {
                                // default email account, top level data
                                $actual_user_prefs = $this->prefs;
                        }
!                       if ($this->debug) { echo 
'email.bopreferences.create_prefs_block: $this->bo->account_group: 
['.$this->bo->account_group.'] ; $this->bo->acctnum: ['.$this->bo->acctnum.'] ; 
$actual_user_prefs dump:<pre>'; print_r($actual_user_prefs); echo '</pre>'; }
                        
                        $c_prefs = count($feed_prefs);
--- 94,101 ----
                        {
                                // default email account, top level data
+                               if ($this->debug > 1) { echo 
'email.uipreferences.create_prefs_block: ('.$this->bo->account_group.') for 
default account, top level prefs already processed<br>'; }
                                $actual_user_prefs = $this->prefs;
                        }
!                       if ($this->debug > 2) { echo 
'email.uipreferences.create_prefs_block: $this->bo->account_group: 
['.$this->bo->account_group.'] ; $this->bo->acctnum: ['.$this->bo->acctnum.'] ; 
$actual_user_prefs dump:<pre>'; print_r($actual_user_prefs); echo '</pre>'; }
                        
                        $c_prefs = count($feed_prefs);
***************
*** 98,101 ****
--- 104,108 ----
                        {
                                $this_item = $feed_prefs[$i];
+                               if ($this->debug > 2) { echo '** loop ['.$i.'] 
**: email.uipreferences.create_prefs_block: $this_item = $feed_prefs['.$i.'] = 
[<code>'.serialize($this_item).'</code>] ; $this_item DUMP <pre>'; 
print_r($this_item); echo '</pre>'; }
                                
                                // ---- do not show logic  ----
***************
*** 107,110 ****
--- 114,118 ----
                                        // continue is used within looping 
structures to skip the rest of the current loop 
                                        // iteration and continue execution at 
the beginning of the next iteration
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because it is 
not applicable to the default account<br>'; }
                                        continue;
                                }
***************
*** 113,116 ****
--- 121,125 ----
                                {
                                        // we are not supposed to show this 
item for extra accounts, skip this pref item
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because it is 
not applicable to the extra accounts<br>'; }
                                        continue;
                                }
***************
*** 119,126 ****
--- 128,137 ----
                                        // this item has been depreciated or 
otherwise no longer is being used
                                        // we are not supposed to show this 
item, skip this pref item
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: skip showing this item because 
"INACTIVE" is in $this_item[type] : ['.$this_item['type'].']<br>'; }
                                        continue;
                                }
                                
                                // ----  ok to show this, continue...  ----
+                               if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block:  ... this item passed skip test, so it 
should be displayed ...<br>'; }
                                $back_color = 
$this->nextmatchs->alternate_row_color($back_color);
                                
***************
*** 135,159 ****
                                if ($this->bo->account_group == 'default')
                                {
                                        
$GLOBALS['phpgw']->template->set_var('pref_id', $this_item['id']);
                                }
                                else
                                {
!                                       // modify the items id in the html form 
so it contains info about thich acctnum it applies to
!                                       //$html_pref_id = 
'1['.$this_item['id'].']';
!                                       $html_pref_id = 
'1['.$this_item['id'].']';
                                        
$GLOBALS['phpgw']->template->set_var('pref_id', $html_pref_id);
                                }
                                
-                               // DEBUG
-                               // echo 'pref item loop ['.$i.']:  &nbsp; '; 
var_dump($this_item); echo '<br><br>';
-                               
                                // we don't want to show a hidden value
                                if (!stristr($this_item['write_props'], 
'hidden'))
                                {
!                                       $this_item_value = 
$actual_user_prefs[$this_item['id']];
                                }
                                else
                                {
                                        // if the data is hidden (ex. a 
password), we do not show the value (obviously)
                                        $this_item_value = '';
                                        // tell user we are hiding the value 
(that's whay the box is empty)
--- 146,184 ----
                                if ($this->bo->account_group == 'default')
                                {
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: html post array $key for this item is 
$this_item[id]: '.$this_item['id'].'<br>'; }
                                        
$GLOBALS['phpgw']->template->set_var('pref_id', $this_item['id']);
                                }
                                else
                                {
!                                       // modify the HTTP_POST_VARS[*key*] key 
in the html form so it contains info about thich acctnum it applies to
!                                       // we do this only for Extra Accounts, 
prefix the ""id" with the acctnum
!                                       // so the submitted prefs are then 
array based, wit the acctnum being the top level array item
!                                       // and the pref item "id"'s being child 
elements of that acctnum
!                                       $html_pref_id = 
$this->bo->acctnum.'['.$this_item['id'].']';
!                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: html post array $key for this item is 
$html_pref_id: '.$html_pref_id.'<br>'; }
                                        
$GLOBALS['phpgw']->template->set_var('pref_id', $html_pref_id);
                                }
                                
                                // we don't want to show a hidden value
                                if (!stristr($this_item['write_props'], 
'hidden'))
                                {
!                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: obtain $this_item_value, because 
"hidden" is not in $this_item[write_props]<br>'; }
!                                       // "user strings" may have quotes and 
stuff that need to be encoded b4 we display it
!                                       if ($this_item['type'] == 'user_string')
!                                       {
!                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] == "user string" , 
before htmlspecialchars_encode: 
[<code>'.$actual_user_prefs[$this_item['id']].'</code>]<br>'; }
!                                               $this_item_value = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($actual_user_prefs[$this_item['id']]);
!                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] == "user string" , 
after htmlspecialchars_encode: [<code>'.$this_item_value.'</code>]<br>'; }
!                                       }
!                                       else
!                                       {
!                                               $this_item_value = 
$actual_user_prefs[$this_item['id']];
!                                               if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] NOT a "user string" 
, so NO htmlspecialchars_encode required: $this_item_value: 
[<code>'.$this_item_value.'</code>]<br>'; }
!                                       }
                                }
                                else
                                {
                                        // if the data is hidden (ex. a 
password), we do not show the value (obviously)
+                                       if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: HIDDEN $this_item_value should be empty 
string, this "hidden" is in $this_item[write_props]<br>'; }
                                        $this_item_value = '';
                                        // tell user we are hiding the value 
(that's whay the box is empty)
***************
*** 161,164 ****
--- 186,190 ----
                                        
$GLOBALS['phpgw']->template->set_var('lang_blurb', 
$prev_lang_blurb.'&nbsp('.lang('hidden').')');
                                }
+                               if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: after processing, $this_item_value: 
[<code>'.serialize($this_item_value).'</code>] ; $this_item DUMP <pre>'; 
print_r($this_item); echo '</pre>'; }
                                
                                // ** possible widget are: **
***************
*** 170,174 ****
                                if ($this_item['widget'] == 'textarea')
                                {
!                                       $this_item_value = 
$actual_user_prefs[$this_item['id']];
                                        
$GLOBALS['phpgw']->template->set_var('pref_value', $this_item_value);
                                        
$GLOBALS['phpgw']->template->parse('V_tr_textarea','B_tr_textarea');
--- 196,200 ----
                                if ($this_item['widget'] == 'textarea')
                                {
!                                       //$this_item_value = 
$actual_user_prefs[$this_item['id']];
                                        
$GLOBALS['phpgw']->template->set_var('pref_value', $this_item_value);
                                        
$GLOBALS['phpgw']->template->parse('V_tr_textarea','B_tr_textarea');
***************
*** 242,245 ****
--- 268,272 ----
                                $return_block .= $done_widget;
                        }
+                       if ($this->debug > 0 ) { echo 
'email.uipreferences.create_prefs_block: LEAVING, returning $return_block if 
widgets<br>'; }
                        return $return_block;
                }
***************
*** 254,258 ****
--- 281,288 ----
                {
                        // this tells "create_prefs_block" that we are dealing 
with the default email account
+                       if ($this->debug > 0) { echo 
'email.uipreferences.preferences: ENTERING, this function *should* only be 
called for the default email account prefs submission<br>'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to set $this->bo->account_group<br>'; }
                        $this->bo->account_group = 'default';
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: just set $this->bo->account_group to 
['.$this->bo->account_group.']<br>'; }
                        
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
***************
*** 295,306 ****
                        
                        // this will fill the $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays
                        $this->bo->init_available_prefs();                      
                        
!                       // DEBUG
!                       if ($this->debug)
!                       {
!                               $this->bo->debug_dump_prefs();
!                               //return;
!                       }
                        
                        // initialize a local var to hold the cumulative main 
block data
--- 325,332 ----
                        
                        // this will fill the $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: calling $this->bo->init_available_prefs() to 
init $this->bo->std_prefs[] and cust_prefs[]  "schema" arrays<br>'; }
                        $this->bo->init_available_prefs();                      
                        
!                       if ($this->debug > 3) { echo 
'email.uipreferences.preferences: initiated schema dump:'; 
$this->bo->debug_dump_prefs(); }
                        
                        // initialize a local var to hold the cumulative main 
block data
***************
*** 309,313 ****
                        // ---  Standars Prefs  ---
                        // section title for standars prefs
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
lang('Standard').' '.lang('E-Mail preferences'));
                        // parse the block,
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
--- 335,339 ----
                        // ---  Standars Prefs  ---
                        // section title for standars prefs
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
lang('Standard E-Mail preferences'));
                        // parse the block,
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
***************
*** 317,320 ****
--- 343,347 ----
                        $prefs_ui_rows .= $done_widget;
                        // generate Std Prefs HTML Block
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to generate the html for standard email 
prefs block<br>'; }
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->std_prefs);
                        
***************
*** 326,334 ****
                        
                        // ---  Custom Prefs  ---
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
lang('Custom').' '.lang('E-Mail preferences'));
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
                        $done_widget = 
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');  
                        $prefs_ui_rows .= $done_widget;
                        // generate Custom Prefs HTML Block
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->cust_prefs);
                        
--- 353,362 ----
                        
                        // ---  Custom Prefs  ---
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
lang('Custom E-Mail preferences'));
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
                        $done_widget = 
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');  
                        $prefs_ui_rows .= $done_widget;
                        // generate Custom Prefs HTML Block
+                       if ($this->debug > 1) { echo 
'email.uipreferences.preferences: about to generate the html for custom email 
prefs block<br>'; }
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->cust_prefs);
                        
***************
*** 349,367 ****
                        
                        // output the template
                        
$GLOBALS['phpgw']->template->pfp('out','T_prefs_ui_out');
                }
                
                /*!
!               @function ex_accounts
                @abstract call this function to display the typical UI html 
page Extra Email Accounts Preferences
                @author Angles, skeeter
                @access Public
                */
!               function ex_accounts()
                {
                        // this tells "create_prefs_block" that we are dealing 
with the extra email accounts
                        $this->bo->account_group = 'extra_accounts';
!                       // FIXME: need a real way to determine this
!                       $this->bo->acctnum = 1;
                        
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
--- 377,403 ----
                        
                        // output the template
+                       if ($this->debug > 0) { echo 
'email.uipreferences.preferences: LEAVING, about to output the template<br>'; }
                        
$GLOBALS['phpgw']->template->pfp('out','T_prefs_ui_out');
                }
                
                /*!
!               @function ex_accounts_edit
                @abstract call this function to display the typical UI html 
page Extra Email Accounts Preferences
                @author Angles, skeeter
                @access Public
                */
!               function ex_accounts_edit()
                {
                        // this tells "create_prefs_block" that we are dealing 
with the extra email accounts
+                       if ($this->debug > 0) { echo 
'email.uipreferences.ex_accounts_edit: ENTERING, this function *should* only be 
called for the EXTRA email account prefs submission<br>'; }
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to set 
$this->bo->account_group<br>'; }
                        $this->bo->account_group = 'extra_accounts';
!                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: just set $this->bo->account_group to 
['.$this->bo->account_group.']<br>'; }
!                       
!                       // obtain the acctnum for the extra email account we 
are dealing with here
!                       $acctnum = $this->bo->obtain_ex_acctnum();
!                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: $this->bo->obtain_ex_acctnum() returns 
['.serialize($acctnum).']<br>'; }
!                       $this->bo->acctnum = $acctnum;
!                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: we just set $this->bo->acctnum to 
['.serialize($this->bo->acctnum).']<br>'; }
                        
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
***************
*** 385,396 ****
                        
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_checkbox','V_tr_checkbox');
                        
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_submit_btn_only','V_submit_btn_only');
!                       
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_submit_and_delete_btns','V_submit_and_delete_btns');
                        
                        $var = Array(
                                'pref_errors'           => '',
!                               'page_title'            => lang('E-Mail 
preferences'),
                                'form_action'           => 
$GLOBALS['phpgw']->link('/index.php',
                                        Array(
!                                               'menuaction'    => 
'email.bopreferences.ex_accounts'
                                        )
                                ),
--- 421,432 ----
                        
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_checkbox','V_tr_checkbox');
                        
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_submit_btn_only','V_submit_btn_only');
!                       
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_submit_and_cancel_btns','V_submit_and_cancel_btns');
                        
                        $var = Array(
                                'pref_errors'           => '',
!                               'page_title'            => lang('E-Mail Extra 
Accounts'),
                                'form_action'           => 
$GLOBALS['phpgw']->link('/index.php',
                                        Array(
!                                               'menuaction'    => 
'email.bopreferences.ex_accounts_edit'
                                        )
                                ),
***************
*** 399,419 ****
                                'right_col_width'       => '50%',
                                'checked_flag'          => 'True',
                                // this says we are submitting extra acount 
pref data
                                'btn_submit_name'       => 
$this->bo->submit_token_extra_accounts,
                                'btn_submit_value'      => lang('submit'),
!                               'btn_delete_name'       => 
$this->bo->submit_token_delete_ex_account,
!                               'btn_delete_value'      => lang('delete 
account')
                        );
                        $GLOBALS['phpgw']->template->set_var($var);
                        
                        // this will fill the $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays
                        $this->bo->init_available_prefs();                      
                        
!                       // DEBUG
!                       if ($this->debug)
!                       {
!                               $this->bo->debug_dump_prefs();
!                               //return;
!                       }
                        
                        // initialize a local var to hold the cumulative main 
block data
--- 435,458 ----
                                'right_col_width'       => '50%',
                                'checked_flag'          => 'True',
+                               'ex_acctnum_varname'    => 'ex_acctnum',
+                               'ex_acctnum_value'      => $this->bo->acctnum,
                                // this says we are submitting extra acount 
pref data
                                'btn_submit_name'       => 
$this->bo->submit_token_extra_accounts,
                                'btn_submit_value'      => lang('submit'),
!                               'btn_cancel_name'       => 'cancel',
!                               'btn_cancel_value'      => lang('cancel'),
!                               'btn_cancel_url'        => 
$GLOBALS['phpgw']->link('/index.php',
!                                       Array(
!                                               'menuaction'    => 
'email.uipreferences.ex_accounts_list'
!                                       )
!                               )
                        );
                        $GLOBALS['phpgw']->template->set_var($var);
                        
                        // this will fill the $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: calling 
$this->bo->init_available_prefs() to init $this->bo->std_prefs[] and 
cust_prefs[]  "schema" arrays<br>'; }
                        $this->bo->init_available_prefs();                      
                        
!                       if ($this->debug > 3) { echo 
'email.uipreferences.ex_accounts_edit: initiated schema dump:'; 
$this->bo->debug_dump_prefs(); }
                        
                        // initialize a local var to hold the cumulative main 
block data
***************
*** 422,426 ****
                        // ---  Extra Account Pref Items  ---
                        // section title
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
'*** '.lang('Extra E-Mail Account').' *** '.lang('Number.' 
.$this->bo->acctnum));
                        // parse the block,
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
--- 461,465 ----
                        // ---  Extra Account Pref Items  ---
                        // section title
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
'*** '.lang('E-Mail Extra Account').' *** '.lang('Number').' 
'.$this->bo->acctnum);
                        // parse the block,
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
***************
*** 435,438 ****
--- 474,478 ----
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
                        // get the parsed data and put into a local variable
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to generate the html for standard 
email prefs block<br>'; }
                        $done_widget = 
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');  
                        // add the finished widget row to the main block 
variable
***************
*** 442,454 ****
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->std_prefs);
                        
!                       // ---  Custom Prefs are MANDATORY for extra accounts 
---
!                       /*
!                       // instructions: leave anything blank gives the default 
value
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
lang('For these items, fill only what is different from your default E-Mail 
preferences'));
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
                        $done_widget = 
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');  
                        $prefs_ui_rows .= $done_widget;
-                       */
                        // generate Custom Prefs HTML Block
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->cust_prefs);
                        
--- 482,497 ----
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->std_prefs);
                        
!                       // ---  Custom Prefs  ---
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
lang('Custom E-Mail Settings').' &#040;'.lang('required').'&#041;');
!                       
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
!                       $done_widget = 
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');  
!                       $prefs_ui_rows .= $done_widget;
!                       // ---  Custom Prefs INSTRUCTIONS ---
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
lang('fill in as much as you can'));
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
                        $done_widget = 
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');  
                        $prefs_ui_rows .= $done_widget;
                        // generate Custom Prefs HTML Block
+                       if ($this->debug > 1) { echo 
'email.uipreferences.ex_accounts_edit: about to generate the html for custom 
email prefs block<br>'; }
                        $prefs_ui_rows .= 
$this->create_prefs_block($this->bo->cust_prefs);
                        
***************
*** 464,475 ****
                        
                        // Submit Button with Delete Account Data button
!                       
$GLOBALS['phpgw']->template->parse('V_submit_and_delete_btns','B_submit_and_delete_btns');
!                       $submit_btn_row = 
$GLOBALS['phpgw']->template->get_var('V_submit_and_delete_btns');     
                        $GLOBALS['phpgw']->template->set_var('submit_btn_row', 
$submit_btn_row);
                        
                        // output the template
                        
$GLOBALS['phpgw']->template->pfp('out','T_prefs_ui_out');
                }
                
        }
  ?>
--- 507,607 ----
                        
                        // Submit Button with Delete Account Data button
!                       
$GLOBALS['phpgw']->template->parse('V_submit_and_cancel_btns','B_submit_and_cancel_btns');
!                       $submit_btn_row = 
$GLOBALS['phpgw']->template->get_var('V_submit_and_cancel_btns');     
                        $GLOBALS['phpgw']->template->set_var('submit_btn_row', 
$submit_btn_row);
                        
                        // output the template
+                       if ($this->debug > 0) { echo 
'email.uipreferences.ex_accounts_edit: LEAVING, about to output the 
template<br>'; }
                        
$GLOBALS['phpgw']->template->pfp('out','T_prefs_ui_out');
                }
                
+               
+               function ex_accounts_list()
+               {
+                       unset($GLOBALS['phpgw_info']['flags']['noheader']);
+                       unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+                       $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+                       $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
+                       $GLOBALS['phpgw']->common->phpgw_header();
+                       
+                       $GLOBALS['phpgw']->template->set_file(
+                               Array(
+                                       'T_prefs_ex_accounts'   => 
'class_prefs_ex_accounts.tpl'
+                               )
+                       );
+                       
$GLOBALS['phpgw']->template->set_block('T_prefs_ex_accounts','B_accts_list','V_accts_list');
+                       
+                       $var = Array(
+                               'pref_errors'           => '',
+                               'font'                          => 
$this->theme['font'],
+                               'tr_titles_color'       => 
$this->theme['th_bg'],
+                               'page_title'            => lang('E-Mail Extra 
Accounts List'),
+                               'account_name_header' => lang('Account User 
Name'),
+                               'lang_status'           => lang('Status'),
+                               'lang_go_there'         => lang('Read Mail'),
+                               'lang_edit'                     => lang('Edit'),
+                               'lang_delete'           => lang('Delete')
+                       );
+                       $GLOBALS['phpgw']->template->set_var($var);
+                       
+                       $acctount_list = array();
+                       $acctount_list = $this->bo->ex_accounts_list();
+                       
+                       // here's what we get back
+                       //$acctount_list[$X]['acctnum']
+                       //$acctount_list[$X]['status']
+                       //$acctount_list[$X]['display_string']
+                       //$acctount_list[$X]['go_there_url']
+                       //$acctount_list[$X]['go_there_href']
+                       //$acctount_list[$X]['edit_url']
+                       //$acctount_list[$X]['edit_href']
+                       //$acctount_list[$X]['delete_url']
+                       //$acctount_list[$X]['delete_href']
+                       
+                       if ($this->debug) { echo 'email: 
uipreferences.ex_accounts_list: $acctount_list dump<pre>'; 
print_r($acctount_list); echo '</pre>'; }
+                       
+                       $tr_color = $this->theme['row_off'];
+                       $loops = count($acctount_list);
+                       if ($loops == 0)
+                       {
+                               $nothing = '&nbsp;';
+                               $tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
+                               
$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
+                               
$GLOBALS['phpgw']->template->set_var('indentity',$nothing);
+                               
$GLOBALS['phpgw']->template->set_var('status',$nothing);
+                               
$GLOBALS['phpgw']->template->set_var('go_there_href',$nothing);
+                               
$GLOBALS['phpgw']->template->set_var('edit_href',$nothing);
+                               
$GLOBALS['phpgw']->template->set_var('delete_href',$nothing);
+                               
$GLOBALS['phpgw']->template->parse('V_accts_list','B_accts_list');
+                       }
+                       else
+                       {
+                               for($i=0; $i < $loops; $i++)
+                               {
+                                       $tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
+                                       
$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
+                                       
$GLOBALS['phpgw']->template->set_var('indentity',$acctount_list[$i]['display_string']);
+                                       
$GLOBALS['phpgw']->template->set_var('status',$acctount_list[$i]['status']);
+                                       
$GLOBALS['phpgw']->template->set_var('go_there_href',$acctount_list[$i]['go_there_href']);
+                                       
$GLOBALS['phpgw']->template->set_var('edit_href',$acctount_list[$i]['edit_href']);
+                                       
$GLOBALS['phpgw']->template->set_var('delete_href',$acctount_list[$i]['delete_href']);
+                                       
$GLOBALS['phpgw']->template->parse('V_accts_list','B_accts_list', True);
+                               }
+                       }
+                       $add_new_acct_url = $GLOBALS['phpgw']->link(
+                                                                       
'/index.php',
+                                                                        
'menuaction=email.uipreferences.ex_accounts_edit'
+                                                                       
.'&ex_acctnum='.$this->bo->add_new_account_token);
+                       $add_new_acct_href = '<a 
href="'.$add_new_acct_url.'">'.lang('New Account').'</a>';
+                       
$GLOBALS['phpgw']->template->set_var('add_new_acct_href',$add_new_acct_href);
+                       
+                       $done_url = $GLOBALS['phpgw']->link(
+                                                                       
'/preferences/index.php');
+                       $done_href = '<a 
href="'.$done_url.'">'.lang('Done').'</a>';
+                       
$GLOBALS['phpgw']->template->set_var('done_href',$done_href);
+                       
+                       // output the template
+                       
$GLOBALS['phpgw']->template->pfp('out','T_prefs_ex_accounts');
+               }
        }
  ?>

Index: hook_home.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/hook_home.inc.php,v
retrieving revision 1.48
retrieving revision 1.48.2.1
diff -C2 -r1.48 -r1.48.2.1
*** hook_home.inc.php   3 Jan 2002 22:40:16 -0000       1.48
--- hook_home.inc.php   14 Feb 2002 06:42:44 -0000      1.48.2.1
***************
*** 91,99 ****
                                );
                        }
                        // ADD FOLDER LISTBOX TO HOME PAGE (Needs to be 
TEMPLATED)
                        // Does This Mailbox Support Folders (i.e. more than 
just INBOX)?
                        if 
($GLOBALS['phpgw']->msg->get_mailsvr_supports_folders() == False)
                        {
!                               $extra_data = '';
                        }
                        else
--- 91,111 ----
                                );
                        }
+                       
+                       // COMPOSE NEW email link
+                       $compose_link = $GLOBALS['phpgw']->link(
+                                                               '/index.php',
+                                                                
'menuaction=email.uicompose.compose'
+                                                               // this data 
tells us where to return to after sending a message
+                                                               // since we 
started from home page, send can not (at this time) take us back there
+                                                               // so instead 
take user to INBOX for the default account (acctnum 0) after clicking the send 
button
+                                                               
.'&fldball[folder]=INBOX'
+                                                               
.'&fldball[acctnum]=0');
+                       $compose_href = '<a 
href="'.$compose_link.'">'.lang('Compose New').'</a>'."\r\n";
+                       
                        // ADD FOLDER LISTBOX TO HOME PAGE (Needs to be 
TEMPLATED)
                        // Does This Mailbox Support Folders (i.e. more than 
just INBOX)?
                        if 
($GLOBALS['phpgw']->msg->get_mailsvr_supports_folders() == False)
                        {
!                               $extra_data = '&nbsp; &nbsp;'.$compose_href;
                        }
                        else
***************
*** 118,122 ****
                                $switchbox_listbox = 
$GLOBALS['phpgw']->msg->all_folders_listbox($feed_args);
                                // make it another TR we can insert into the 
home page portal object
!                               // and surround it in FORM tage so the submit 
will work
                                $switchbox_action = $GLOBALS['phpgw']->link(
                                                                '/index.php',
--- 130,134 ----
                                $switchbox_listbox = 
$GLOBALS['phpgw']->msg->all_folders_listbox($feed_args);
                                // make it another TR we can insert into the 
home page portal object
!                               // and surround it in FORM tags so the submit 
will work
                                $switchbox_action = $GLOBALS['phpgw']->link(
                                                                '/index.php',
***************
*** 125,129 ****
                                        '<form name="switchbox" 
action="'.$switchbox_action.'" method="post">'."\r\n"
                                                .'<td align="left">'."\r\n"
!                                                       .'&nbsp;<strong>E-Mail 
Folders:</strong>&nbsp;'.$switchbox_listbox
                                                .'</td>'."\r\n"
                                        .'</form>'."\r\n";
--- 137,142 ----
                                        '<form name="switchbox" 
action="'.$switchbox_action.'" method="post">'."\r\n"
                                                .'<td align="left">'."\r\n"
!                                                       
.'&nbsp;<strong>'.lang('E-Mail 
Folders').':</strong>&nbsp;'.$switchbox_listbox."\r\n"
!                                                       .'&nbsp; 
&nbsp;'.$compose_href."\r\n"
                                                .'</td>'."\r\n"
                                        .'</form>'."\r\n";
***************
*** 163,167 ****
                }
  
!               // output the portalbox and (if applicable) the folders listbox 
below it
                echo "\r\n".'<!-- start Mailbox info -->'."\r\n"
                        .$portalbox->draw($extra_data)
--- 176,180 ----
                }
  
!               // output the portalbox and below it (1) the folders listbox 
(if applicable) and (2) Compose New mail link
                echo "\r\n".'<!-- start Mailbox info -->'."\r\n"
                        .$portalbox->draw($extra_data)

Index: hook_notifywindow.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/hook_notifywindow.inc.php,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -C2 -r1.7.2.1 -r1.7.2.2
*** hook_notifywindow.inc.php   11 Feb 2002 21:18:35 -0000      1.7.2.1
--- hook_notifywindow.inc.php   14 Feb 2002 06:42:44 -0000      1.7.2.2
***************
*** 71,84 ****
                        echo '  </script>'."\n";
                        echo "\r\n" . '<tr><td align="left"><!-- Mailbox info 
X10 -->' . "\r\n";
- /*                    echo '<script language="JavaScript">'.chr(13).chr(10);
-                       echo '<!-- Activate Cloaking Device'.chr(13).chr(10);
-                       echo '  funtion CheckEmail()'.chr(13).chr(10);
-                       echo '  {'.chr(13).chr(10);
-                       echo '          
window.opener.document.location.href="'.$GLOBALS['phpgw']->link("../email/").'";'.chr(13).chr(10);
-                       echo '  }'.chr(13).chr(10);
-                       echo '//-->'.chr(13).chr(10);
-                       echo '</script>'.chr(13).chr(10); */
-                       //echo '<font color="FFFFFF">EMail';
-                       //echo ($str ? ' - <A href="JavaScript:CheckEmail();">' 
. $str . '</A>' : '') . '</font>';
                        echo lang("EMail").' - <a 
href="JavaScript:CheckEmail();">'.$inbox_data['alert_string'].'</a>';
                        //echo '</font>';
--- 71,74 ----
***************
*** 87,92 ****
  
        }
-       
-       // is this still needed?
-       //$GLOBALS['phpgw_info']['server']['app_inc'] = $tmp_app_inc;
  ?>
--- 77,79 ----

Index: hook_preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/hook_preferences.inc.php,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** hook_preferences.inc.php    10 Jan 2002 10:04:41 -0000      1.9
--- hook_preferences.inc.php    14 Feb 2002 06:42:44 -0000      1.9.2.1
***************
*** 17,21 ****
        $file = Array(
                'E-Mail Preferences'    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uipreferences.preferences'),
!               'Extra E-Mail Accounts' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uipreferences.ex_accounts')
        );
  //Do not modify below this line
--- 17,21 ----
        $file = Array(
                'E-Mail Preferences'    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uipreferences.preferences'),
!               'Extra E-Mail Accounts' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uipreferences.ex_accounts_list')
        );
  //Do not modify below this line




reply via email to

[Prev in Thread] Current Thread [Next in Thread]