phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api class.base.php, 1.1.1.1.2.18, 1.1.1.1.2.19 class.


From: Joseph Engo <address@hidden>
Subject: [Phpgroupware-cvs] api class.base.php, 1.1.1.1.2.18, 1.1.1.1.2.19 class.phpgw.php, 1.1.1.1.2.28, 1.1.1.1.2.29 starter.inc.php, 1.1.1.1.2.18, 1.1.1.1.2.19
Date: Mon, 03 Nov 2003 14:50:01 +0000

Update of /cvsroot/phpgroupware/api
In directory subversions:/tmp/cvs-serv10693/api

Modified Files:
      Tag: proposal-branch
        class.base.php class.phpgw.php starter.inc.php 
Log Message:
More work on op history and state caching ... there are a few issues with it 
right now


Index: starter.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/starter.inc.php,v
retrieving revision 1.1.1.1.2.18
retrieving revision 1.1.1.1.2.19
diff -C2 -d -r1.1.1.1.2.18 -r1.1.1.1.2.19
*** starter.inc.php     3 Nov 2003 12:16:11 -0000       1.1.1.1.2.18
--- starter.inc.php     3 Nov 2003 14:49:59 -0000       1.1.1.1.2.19
***************
*** 216,220 ****
                $GLOBALS['performance_timer']->start($methodname);              
        
                $result = ExecMethod($methodname,$inputs);
!               if 
(isset($GLOBALS['phpgw_session']['form_state_values'][$methodname]))
                {
                        $result['form_state_values'] = 
$GLOBALS['phpgw_session']['form_state_values'][$methodname];
--- 216,220 ----
                $GLOBALS['performance_timer']->start($methodname);              
        
                $result = ExecMethod($methodname,$inputs);
!               if 
(isset($GLOBALS['phpgw_session']['form_state_values'][$methodname]) && ! 
isset($result['form_state_values']))
                {
                        $result['form_state_values'] = 
$GLOBALS['phpgw_session']['form_state_values'][$methodname];

Index: class.base.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/class.base.php,v
retrieving revision 1.1.1.1.2.18
retrieving revision 1.1.1.1.2.19
diff -C2 -d -r1.1.1.1.2.18 -r1.1.1.1.2.19
*** class.base.php      3 Nov 2003 13:20:36 -0000       1.1.1.1.2.18
--- class.base.php      3 Nov 2003 14:49:58 -0000       1.1.1.1.2.19
***************
*** 120,123 ****
--- 120,125 ----
  
                        
$GLOBALS['phpgw_session']['form_state_values'][$GLOBALS['phpgw_data']['api']['prevop']]
 = $params;
+ 
+                       return 
$this->op_history_redirect(count($GLOBALS['phpgw_session']['phpgw_data']['op_history'])
 - 2,'False');
                }
  
***************
*** 132,137 ****
                        }
  
                        
$GLOBALS['phpgw_session']['form_state_values'][$GLOBALS['phpgw_data']['api']['prevop']]
 = array();
!                       return 
ExecMethod($GLOBALS['phpgw_data']['api']['prevop'],'',False);
                }
  
--- 134,166 ----
                        }
  
+                       $loc_data = 
$GLOBALS['phpgw_session']['phpgw_data']['op_history'][count($GLOBALS['phpgw_session']['phpgw_data']['op_history'])
 - 1];
+                       if (! $loc_data['title'])
+                       {
+                               $GLOBALS['msgbox']->add(lang('History on this 
operation not valid or expired'),__LINE__,__FILE__, 'warning');
+                               return;
+                       }
+ 
+                       if ($loc_data['op'] != 
$GLOBALS['phpgw_data']['api']['prevop'])
+                       {
+                               $all_history = 
$GLOBALS['phpgw_session']['phpgw_data']['op_history'];
+                               krsort($all_history);
+ 
+                               foreach ($all_history as $key => $values)
+                               {
+                                       if ($values['op'] == 
$GLOBALS['phpgw_data']['api']['prevop'])
+                                       {
+                                               $loc_data = $values;
+                                       }
+                               }
+                               //echo $loc_data['op'] . '-' . 
$GLOBALS['phpgw_data']['api']['prevop'];
+                               //print_r($loc_data);
+                       }
+ 
+                       $result = 
ExecMethod($loc_data['op'],$loc_data['data'],False);
+ 
                        
$GLOBALS['phpgw_session']['form_state_values'][$GLOBALS['phpgw_data']['api']['prevop']]
 = array();
!                       return $result;
! 
! //                    return 
$this->op_history_redirect(count($GLOBALS['phpgw_session']['phpgw_data']['op_history'])
 - 1,'False');
                }
  
***************
*** 170,175 ****
--- 199,214 ----
                        $args = new safe_args();
                        $args->set('position_id','##REQUIRD##','int');
+                       $args->set('set_state_values','##NOTSET##','any');
                        $args = $args->get(func_get_args(),__LINE__,__FILE__);
  
+                       if ($args['set_state_values'] == 'False')
+                       {
+                               $args['set_state_values'] = False;
+                       }
+                       else
+                       {
+                               $args['set_state_values'] = True;
+                       }
+ 
                        $loc_data = 
$GLOBALS['phpgw_session']['phpgw_data']['op_history'][$args['position_id']];
                        if (! $loc_data['title'])
***************
*** 186,190 ****
                        }
  
!                       return ExecMethod($loc_data['op'],$loc_data['data'], 
False);
                }
  
--- 225,240 ----
                        }
  
!                       $result = array();
!                       $result = ExecMethod($loc_data['op'],$loc_data['data'], 
False);
! 
!                       if ($args['set_state_values'])
!                       {
!                               if 
(isset($GLOBALS['phpgw_session']['form_state_values'][$loc_data['op']]))
!                               {
!                                       $result['form_state_values'] = 
$GLOBALS['phpgw_session']['form_state_values'][$loc_data['op']];
!                               }
!                       }
! 
!                       return $result;
                }
  

Index: class.phpgw.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/class.phpgw.php,v
retrieving revision 1.1.1.1.2.28
retrieving revision 1.1.1.1.2.29
diff -C2 -d -r1.1.1.1.2.28 -r1.1.1.1.2.29
*** class.phpgw.php     3 Nov 2003 13:27:38 -0000       1.1.1.1.2.28
--- class.phpgw.php     3 Nov 2003 14:49:59 -0000       1.1.1.1.2.29
***************
*** 274,278 ****
  
                        // Don't add login, or if the last op is a duplicate
!                       if ($GLOBALS['phpgw_data']['api']['op'] != 
'api.base.login' && 
$GLOBALS['phpgw_session']['phpgw_data']['op_history'][count($GLOBALS['phpgw_session']['phpgw_data']['op_history'])
 - 1]['op'] != $GLOBALS['phpgw_data']['api']['op'])
                        {
                                list($appname,$classname,$method) = 
explode(".",$GLOBALS['phpgw_data']['api']['op']);
--- 274,281 ----
  
                        // Don't add login, or if the last op is a duplicate
!                       if ($GLOBALS['phpgw_data']['api']['op'] != 
'api.base.login'
!                               && $GLOBALS['phpgw_data']['api']['op'] != 
'api.base.form_clear'
!                               && $GLOBALS['phpgw_data']['api']['op'] != 
'api.base.form_pause'
!                               && 
$GLOBALS['phpgw_session']['phpgw_data']['op_history'][count($GLOBALS['phpgw_session']['phpgw_data']['op_history'])
 - 1]['op'] != $GLOBALS['phpgw_data']['api']['op'])
                        {
                                list($appname,$classname,$method) = 
explode(".",$GLOBALS['phpgw_data']['api']['op']);





reply via email to

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