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.12,1.13 class


From: Angelo Tony Puglisi <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.boaction.inc.php,1.12,1.13 class.bomessage.inc.php,1.6,1.7 class.mail_msg_base.inc.php,1.62,1.63 class.uimessage.inc.php,1.3,1.4
Date: Tue, 15 Jan 2002 02:40:39 -0500

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

Modified Files:
        class.boaction.inc.php class.bomessage.inc.php 
        class.mail_msg_base.inc.php class.uimessage.inc.php 
Log Message:
fix what message to goto after a msg move from the uimessage page

Index: class.boaction.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.boaction.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.boaction.inc.php      14 Jan 2002 20:51:37 -0000      1.12
--- class.boaction.inc.php      15 Jan 2002 07:40:36 -0000      1.13
***************
*** 102,148 ****
                                
                                $delmov_list = 
$GLOBALS['phpgw']->msg->get_arg_value('delmov_list');
-                               
-                               // were we called by uimessage, if so, then 
treat the post-move navigation like a "delete_single_msg"
-                               if ((isset($delmov_list[0]['called_by']))
-                               && ($delmov_list[0]['called_by'] == 
'uimessage'))
-                               {
-                                       // BEFORE we move, if there is no mext 
message, then we will go back to index page
-                                       $nav_data = 
$GLOBALS['phpgw']->msg->prev_next_navigation();
-                                       if ($this->debug > 2) { echo 
'emai.boaction.delmov: move single *called by uimessage*: pre-move $nav_data[] 
dump <pre>: '; print_r($nav_data); echo '</pre>'; }
-                                       // ----  "Go To Previous Message" 
Handling  -----
-                                       // this is actually a little broken 
when moving a single message when called by uimessage
-                                       // this is a workaround the almost 
works, it takes you to the message you looked a 1 message ago
-                                       // whereas I think you should go to the 
next message, but next_msg data is not passed by prev_next_navigation when
-                                       // we're called by uimessage, this also 
means that with one message left in the folder *after* the move, this code
-                                       // thinks the folder is empty and takes 
us to uiindex *for the same folder* though, so at lease the user knows
-                                       // there's a mail left in that folder
-                                       // FUTURE: pass these insrustions from 
hidden data obtained from uimessage when prev_next_navigation is more accurate
-                                       if (($nav_data['prev_msg'] != $not_set)
-                                       && ((string)$nav_data['lowest_left'] != 
'0') 
-                                       && ((string)$nav_data['highest_right'] 
!= '0'))
-                                       {
-                                               $this->redirect_to = 
$GLOBALS['phpgw']->link(
-                                                       '/index.php',
-                                                        
'menuaction=email.uimessage.message'
-                                                       
.'&'.$nav_data['prev_msg']['msgball']['uri']
-                                                       
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
-                                                       
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
-                                                       
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
-                                       }
-                                       else
-                                       {
-                                               // go back to index page
-                                               $this->redirect_to = 
$GLOBALS['phpgw']->link(
-                                                       '/index.php',
-                                                        
'menuaction=email.uiindex.index'
-                                                       
.'&fldball[folder]='.$GLOBALS['phpgw']->msg->prep_folder_out($delmov_list[0]['folder'])
-                                                       
.'&fldball[acctnum]='.(int)$delmov_list[0]['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'));
-                                       }
-                                       if ($this->debug > 1) { echo 
'emai.boaction.delmov: move single *called by uimessage*: pre-move 
determination of $this->redirect_to : ['.$this->redirect_to.']<br>'; }
-                               }
-                               
                                $to_fldball = 
$GLOBALS['phpgw']->msg->get_arg_value('to_fldball');
                                $to_fldball['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_in($to_fldball['folder']);
--- 102,105 ----
***************
*** 183,191 ****
                                // report folder messages were moved to
                                $tf = 
$GLOBALS['phpgw']->msg->prep_folder_out($to_fldball['folder']);
!                               // folder we should go back to
!                               if ((isset($delmov_list[0]['called_by']))
!                               && ($delmov_list[0]['called_by'] == 
'uimessage'))
                                {
!                                       // we already figured this out before 
the move
                                }
                                else
--- 140,156 ----
                                // 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
***************
*** 214,217 ****
--- 179,183 ----
                                                '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

Index: class.bomessage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bomessage.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.bomessage.inc.php     14 Jan 2002 20:51:37 -0000      1.6
--- class.bomessage.inc.php     15 Jan 2002 07:40:36 -0000      1.7
***************
*** 136,143 ****
                        $this->xi['ctrl_bar_font_size'] =  '-1';
                        $this->xi['ctrl_bar_back1'] = 
$GLOBALS['phpgw_info']['theme']['row_on'];
-                       // pass on (preserve these valus) after the message move
-                       $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');
                        // ---- account switchbox  ----
                        // make a HTML comobox used to switch accounts
--- 136,139 ----
***************
*** 168,180 ****
                        // ---- Move Message Box  ----
                        // borrow code from boindex and uiindex for this 
functionality
!                       $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';
                        $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';
                        $this->xi['mailsvr_supports_folders'] = 
$GLOBALS['phpgw']->msg->get_mailsvr_supports_folders();
                        if ($this->xi['mailsvr_supports_folders'])
--- 164,188 ----
                        // ---- 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'])
***************
*** 304,308 ****
                        $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'];
--- 312,345 ----
                        $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'];

Index: class.mail_msg_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_base.inc.php,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -r1.62 -r1.63
*** class.mail_msg_base.inc.php 14 Jan 2002 20:51:37 -0000      1.62
--- class.mail_msg_base.inc.php 15 Jan 2002 07:40:36 -0000      1.63
***************
*** 164,168 ****
                        'to_fldball_fake_uri',
                        'to_fldball',
!                       
                        // === SORT/ORDER/START === 
                        // if sort,order, and start are sometimes passed as 
GPC's, if not, default prefs are used
--- 164,170 ----
                        'to_fldball_fake_uri',
                        'to_fldball',
!                       // when moving a message while viewing it in the 
uimessage page, this var will be passed
!                       // telling us what to show the user after we do the 
move, it will be a URI string that begins with "menuaction"
!                       'move_postmove_goto',
                        // === SORT/ORDER/START === 
                        // if sort,order, and start are sometimes passed as 
GPC's, if not, default prefs are used

Index: class.uimessage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uimessage.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.uimessage.inc.php     14 Jan 2002 20:51:38 -0000      1.3
--- class.uimessage.inc.php     15 Jan 2002 07:40:36 -0000      1.4
***************
*** 107,113 ****
                        
$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']);
-                       
$GLOBALS['phpgw']->template->set_var('current_sort',$this->bo->xi['current_sort']);
-                       
$GLOBALS['phpgw']->template->set_var('current_order',$this->bo->xi['current_order']);
-                       
$GLOBALS['phpgw']->template->set_var('current_start',$this->bo->xi['current_start']);
                        // ---- account switchbox  ----
                        
$GLOBALS['phpgw']->template->set_var('acctbox_listbox',$this->bo->xi['acctbox_listbox']);
--- 107,110 ----
***************
*** 115,118 ****
--- 112,118 ----
                        
$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']);
***************
*** 120,124 ****
                        
$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']);
!                       
                
                /*
--- 120,125 ----
                        
$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']);
                
                /*




reply via email to

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