phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: email/inc class.bopreferences.inc.php,1.15,1.16


From: Angelo Tony Puglisi <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.bopreferences.inc.php,1.15,1.16 class.uipreferences.inc.php,1.13,1.14
Date: Tue, 22 Jan 2002 02:33:21 -0500

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

Modified Files:
        class.bopreferences.inc.php class.uipreferences.inc.php 
Log Message:
little fixes for preference saving and displaying for default and extra email 
accounts

Index: class.bopreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bopreferences.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.bopreferences.inc.php 21 Jan 2002 22:54:56 -0000      1.15
--- class.bopreferences.inc.php 22 Jan 2002 07:33:17 -0000      1.16
***************
*** 108,112 ****
                function init_available_prefs()
                {
!                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences: call to init_available_prefs<br>'; }
                        
                        $this->std_prefs = Array();
--- 108,112 ----
                function init_available_prefs()
                {
!                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.init_available_prefs: ENTERING, use debug level 4 for a 
data dump on leaving<br>'; }
                        
                        $this->std_prefs = Array();
***************
*** 407,410 ****
--- 407,412 ----
                                'values'        => array()
                        );
+                       if ($this->debug_set_prefs > 3) { echo 
'email.bopreferences.init_available_prefs: data dump: calling 
debug_dump_prefs<pre>';  $this->debug_dump_prefs(); }
+                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.init_available_prefs: LEAVING<br>'; }
                }
                
***************
*** 763,775 ****
                function preferences()
                {
!                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences: entering preferences()<br>'; }
                        // establish all available prefs for email
                        $this->init_available_prefs();
                        
                        // this will fill $this->args[] array with any 
submitted prefs args
                        $this->grab_set_prefs();
                        
-                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences: preferences(): just passed this->grab_set_prefs<br>'; }
-                       
                        // ----  HANDLE SETING PREFERENCE   -------
                        if (isset($this->args[$this->submit_token]))
--- 765,777 ----
                function preferences()
                {
!                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.preferences(): ENTERING<br>'; }
                        // establish all available prefs for email
+                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.preferences(): about to call 
$this->init_available_prefs()<br>'; }
                        $this->init_available_prefs();
                        
                        // this will fill $this->args[] array with any 
submitted prefs args
+                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.preferences(): about to call $this->grab_set_prefs()<br>'; 
}
                        $this->grab_set_prefs();
                        
                        // ----  HANDLE SETING PREFERENCE   -------
                        if (isset($this->args[$this->submit_token]))
***************
*** 781,793 ****
                                
                                // ---  Process Standard Prefs  ---
!                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences: preferences(): about to process Standard Prefs<br>'; }
                                
$this->process_submitted_prefs($this->std_prefs);
                                
                                // ---  Process Custom Prefs  ---
!                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences: preferences(): about to process Custom Prefs<br>'; }
                                if (isset($this->args['use_custom_settings']))
                                {
                                        // custom settings are in use, process 
them
!                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences: preferences(): custom prefs are in use<br>'; }
                                        
$this->process_submitted_prefs($this->cust_prefs);
                                }
--- 783,795 ----
                                
                                // ---  Process Standard Prefs  ---
!                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.preferences: about to process Standard Prefs<br>'; }
                                
$this->process_submitted_prefs($this->std_prefs);
                                
                                // ---  Process Custom Prefs  ---
!                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.preferences: about to process Custom Prefs<br>'; }
                                if (isset($this->args['use_custom_settings']))
                                {
                                        // custom settings are in use, process 
them
!                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.preferences: custom prefs are in use, calling 
$this->process_submitted_prefs($this->cust_prefs)<br>'; }
                                        
$this->process_submitted_prefs($this->cust_prefs);
                                }
***************
*** 796,802 ****
                                        // custom settings are NOT being used, 
DELETE them from the repository
                                        $c_prefs = count($this->cust_prefs);    
                
!                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences: preferences(): custom prefs NOT in use, deleting 
them<br>'; }
                                        for($i=0;$i<$c_prefs;$i++)
                                        {
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this->cust_prefs[$i]['id']);
                                        }
--- 798,805 ----
                                        // custom settings are NOT being used, 
DELETE them from the repository
                                        $c_prefs = count($this->cust_prefs);    
                
!                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.preferences: custom prefs NOT in use, deleting them<br>'; }
                                        for($i=0;$i<$c_prefs;$i++)
                                        {
+                                               if ($this->debug_set_prefs > 2) 
{ echo ' *(loop)* email.bopreferences: preferences: deleting custom pref 
$this->cust_prefs['.$i.'][id] : ['.$this->cust_prefs[$i]['id'].']<br>'; }
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this->cust_prefs[$i]['id']);
                                        }
***************
*** 806,828 ****
                                if ($this->debug_set_prefs > 1) 
                                {
!                                       echo 'email.bopreferences: *debug* 
skipping save_repository<br>';
                                }
                                else
                                {
                                        
$GLOBALS['phpgw']->preferences->save_repository();
                                }
                                // end the email session
                                $GLOBALS['phpgw']->msg->end_request();
                                // redirect user back to main preferences page
                                if ($this->debug_set_prefs > 1) 
                                {
!                                       echo 'email.bopreferences: *debug* 
skipping Header redirection<br>';
                                }
                                else
                                {
!                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/preferences/index.php'));
                                }
                        }
!                       
                                // DEPRECIATED CODE follows, but do not delete 
yet, it has useful comments.
                                /*
--- 809,848 ----
                                if ($this->debug_set_prefs > 1) 
                                {
!                                       echo 
'email.bopreferences.preferences(): *debug* at ['.$this->debug_set_prefs.'] so 
skipping save_repository<br>';
                                }
                                else
                                {
+                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.preferences(): SAVING REPOSITORY<br>'; }
                                        
$GLOBALS['phpgw']->preferences->save_repository();
                                }
                                // end the email session
                                $GLOBALS['phpgw']->msg->end_request();
+                               
+                               // redirect user back to main preferences page
+                               //if ($this->debug_set_prefs > 1) 
+                               //{
+                               //      echo 
'email.bopreferences.preferences(): *debug* skipping Header redirection<br>';
+                               //}
+                               //else
+                               //{
+                               //      Header('Location: ' . 
$GLOBALS['phpgw']->link('/preferences/index.php'));
+                               //}
+                               
                                // redirect user back to main preferences page
+                               $take_me_to_url = $GLOBALS['phpgw']->link(
+                                                                               
        '/preferences/index.php');
+                       
+                               if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.preferences(): almost LEAVING, about to issue a redirect 
to:<br>'.$take_me_to_url.'<br>'; }
                                if ($this->debug_set_prefs > 1) 
                                {
!                                       echo 
'email.bopreferences.preferences(): LEAVING, *debug* at 
['.$this->debug_set_prefs.'] so skipping Header redirection to: 
['.$take_me_to_url.']<br>';
                                }
                                else
                                {
!                                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.preferences: LEAVING with redirect to: 
<br>'.$take_me_to_url.'<br>'; }
!                                       Header('Location: ' . $take_me_to_url);
                                }
                        }
!                               
                                // DEPRECIATED CODE follows, but do not delete 
yet, it has useful comments.
                                /*
***************
*** 997,1001 ****
                        if ($c_prefs == 0)
                        {
!                               if ($this->debug_set_prefs > 0) { echo 'email: 
bopreferences: process_ex_accounts_submitted_prefs: empty array, no prefs set 
supplied, LEAVING<br>'; }
                                return False;
                        }
--- 1017,1021 ----
                        if ($c_prefs == 0)
                        {
!                               if ($this->debug_set_prefs > 0) { echo 'email: 
bopreferences: process_ex_accounts_submitted_prefs: LEAVING, empty array, no 
prefs set supplied<br>'; }
                                return False;
                        }
***************
*** 1303,1319 ****
                        {
                                // nothing happened above that requires saving 
the repository
!                               if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.ex_accounts_edit(): nothing happened that requires 
save_repository, 
$actually_did_something='.serialize($actually_did_something).'<br>'; }
                        }
!                       elseif ($this->debug_set_prefs > 0) 
                        {
                                // we actually did something that requires 
saving repository, but are we in debug mode
!                               echo 'email.bopreferences.ex_accounts_edit(): 
*debug* skipping save_repository<br>';
!                               
                        }
                        else
                        {
                                // we actually did something that requires 
saving repository, and we have the go-ahead
                                
$GLOBALS['phpgw']->preferences->save_repository();
                        }
                        // end the email session
                        if (is_object($GLOBALS['phpgw']->msg))
--- 1323,1340 ----
                        {
                                // nothing happened above that requires saving 
the repository
!                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): nothing happened that requires 
save_repository, 
$actually_did_something='.serialize($actually_did_something).'<br>'; }
                        }
!                       elseif ($this->debug_set_prefs > 1) 
                        {
                                // we actually did something that requires 
saving repository, but are we in debug mode
!                               echo 'email.bopreferences.ex_accounts_edit(): 
*debug* at ['.$this->debug_set_prefs.'] so skipping save_repository<br>';
                        }
                        else
                        {
                                // we actually did something that requires 
saving repository, and we have the go-ahead
+                               if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.ex_accounts_edit(): SAVING REPOSITORY<br>'; }
                                
$GLOBALS['phpgw']->preferences->save_repository();
                        }
+                       
                        // end the email session
                        if (is_object($GLOBALS['phpgw']->msg))
***************
*** 1321,1336 ****
                                $GLOBALS['phpgw']->msg->end_request();
                        }
                        // redirect user back to main preferences page
!                       if ($this->debug_set_prefs > 0) 
                        {
!                               echo 'email.bopreferences.ex_accounts_edit(): 
*debug* skipping Header redirection<br>';
                        }
                        else
                        {
!                               $take_me_to_url = $GLOBALS['phpgw']->link(
!                                                                               
        '/index.php',
!                                                                               
        'menuaction=email.uipreferences.ex_accounts_list');
!                               
!                               if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.ex_accounts_edit: LEAVING with redirect to: 
['.$take_me_to_url.']<br>'; }
                                Header('Location: ' . $take_me_to_url);
                        }
--- 1342,1359 ----
                                $GLOBALS['phpgw']->msg->end_request();
                        }
+                       
                        // redirect user back to main preferences page
!                       $take_me_to_url = $GLOBALS['phpgw']->link(
!                                                                               
'/index.php',
!                                                                               
'menuaction=email.uipreferences.ex_accounts_list');
!                       
!                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.ex_accounts_edit(): almost LEAVING, about to issue a 
redirect to:<br>'.$take_me_to_url.'<br>'; }
!                       if ($this->debug_set_prefs > 1) 
                        {
!                               echo 'email.bopreferences.ex_accounts_edit(): 
LEAVING, *debug* at ['.$this->debug_set_prefs.'] so skipping Header redirection 
to: ['.$take_me_to_url.']<br>';
                        }
                        else
                        {
!                               if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.ex_accounts_edit: LEAVING with redirect to: 
<br>'.$take_me_to_url.'<br>'; }
                                Header('Location: ' . $take_me_to_url);
                        }
***************
*** 1345,1350 ****
                function ex_accounts_list()
                {
!                       
!                       // ---- BEGIN EX_ACCOUNTS_LIST ----
                        
                        // list accounts, except "empty" ones (show "enabled" 
and "disabled"
--- 1368,1372 ----
                function ex_accounts_list()
                {
!                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.ex_accounts_list: ENTERING<br>'; }
                        
                        // list accounts, except "empty" ones (show "enabled" 
and "disabled"
***************
*** 1387,1391 ****
                                        }
                                        // html encode entities on the fullname 
so it's safe to display in the browser, and prefix with the acctnum
!                                       
$return_list[$next_pos]['display_string'] = '['.$this_acctnum.'] 
'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fullname);
                                        // control action links
                                        $return_list[$next_pos]['edit_url'] = 
$GLOBALS['phpgw']->link(
--- 1409,1419 ----
                                        }
                                        // html encode entities on the fullname 
so it's safe to display in the browser, and prefix with the acctnum
!                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_list: fullname raw: 
<code>'.serialize($fullname).'</code><br>'; }
!                                       $fullname = 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode($fullname);
!                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_list: fullname B: 
<code>'.serialize($fullname).'</code><br>'; }
!                                       $fullname = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fullname);
!                                       if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_list: fullname C: 
<code>'.serialize($fullname).'</code><br>'; }
!                                       
//$return_list[$next_pos]['display_string'] = '['.$this_acctnum.'] 
'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fullname);
!                                       
$return_list[$next_pos]['display_string'] = '['.$this_acctnum.'] '.$fullname;
                                        // control action links
                                        $return_list[$next_pos]['edit_url'] = 
$GLOBALS['phpgw']->link(
***************
*** 1403,1407 ****
                        }
                        if ($this->debug_set_prefs > 2) { echo 
'email.bopreferences.ex_accounts_list: returning $return_list[] : <pre>'; 
print_r($return_list); echo '</pre>'; }
!                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.ex_accounts_list: LEAVING <br>'; }
                        return $return_list;
                }
--- 1431,1435 ----
                        }
                        if ($this->debug_set_prefs > 2) { echo 
'email.bopreferences.ex_accounts_list: returning $return_list[] : <pre>'; 
print_r($return_list); echo '</pre>'; }
!                       if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences.ex_accounts_list: LEAVING, returning $return_list <br>'; }
                        return $return_list;
                }

Index: class.uipreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uipreferences.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** class.uipreferences.inc.php 21 Jan 2002 22:54:56 -0000      1.13
--- class.uipreferences.inc.php 22 Jan 2002 07:33:18 -0000      1.14
***************
*** 26,31 ****
                var $theme;
                var $prefs;
!               //var $debug = True;
!               var $debug = False;
  
  
--- 26,31 ----
                var $theme;
                var $prefs;
!               var $debug = 0;
!               //var $debug = 3;
  
  
***************
*** 65,68 ****
--- 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)
***************
*** 72,75 ****
--- 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;
                        }
***************
*** 83,87 ****
                        {
                                // 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'];
***************
*** 90,96 ****
                        {
                                // 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);
***************
*** 99,102 ****
--- 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  ----
***************
*** 108,111 ****
--- 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;
                                }
***************
*** 114,117 ****
--- 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;
                                }
***************
*** 120,127 ****
--- 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);
                                
***************
*** 136,161 ****
                                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'].']';
                                        $html_pref_id = 
$this->bo->acctnum.'['.$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)
***************
*** 163,166 ****
--- 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: **
***************
*** 172,176 ****
                                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');
***************
*** 244,247 ****
--- 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;
                }
***************
*** 256,260 ****
--- 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']);
***************
*** 297,308 ****
                        
                        // 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
***************
*** 319,322 ****
--- 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);
                        
***************
*** 333,336 ****
--- 358,362 ----
                        $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);
                        
***************
*** 351,354 ****
--- 377,381 ----
                        
                        // 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');
                }
***************
*** 363,370 ****
                {
                        // 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
                        $acctnum = $this->bo->obtain_ex_acctnum();
                        $this->bo->acctnum = $acctnum;
                        
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
--- 390,403 ----
                {
                        // 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']);
***************
*** 418,429 ****
                        
                        // 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
--- 451,458 ----
                        
                        // 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
***************
*** 445,448 ****
--- 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
***************
*** 463,466 ****
--- 493,497 ----
                        $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);
                        
***************
*** 481,484 ****
--- 512,516 ----
                        
                        // 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');
                }




reply via email to

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