phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: email/inc class.boindex.inc.php,1.24,1.25 class.


From: Angelo Tony Puglisi <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.boindex.inc.php,1.24,1.25 class.bopreferences.inc.php,1.14,1.15 class.uipreferences.inc.php,1.12,1.13
Date: Mon, 21 Jan 2002 17:54:58 -0500

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

Modified Files:
        class.boindex.inc.php class.bopreferences.inc.php 
        class.uipreferences.inc.php 
Log Message:
stabalize preference and extra account preference handling

Index: class.boindex.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.boindex.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** class.boindex.inc.php       18 Jan 2002 23:15:52 -0000      1.24
--- class.boindex.inc.php       21 Jan 2002 22:54:56 -0000      1.25
***************
*** 134,140 ****
                                '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'),
--- 134,140 ----
                                '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'),
***************
*** 414,419 ****
                        $this->xi['email_prefs_link'] = $GLOBALS['phpgw']->link(
                                                                '/index.php',
!                                                                
'menuaction=email.uipreferences.preferences'
!                                                               
.'&ex_acctnum='.$GLOBALS['phpgw']->msg->get_acctnum());
                        
                        $this->xi['filters_link'] = $GLOBALS['phpgw']->link(
--- 414,418 ----
                        $this->xi['email_prefs_link'] = $GLOBALS['phpgw']->link(
                                                                '/index.php',
!                                                                
'menuaction=email.uipreferences.preferences');
                        
                        $this->xi['filters_link'] = $GLOBALS['phpgw']->link(

Index: class.bopreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.bopreferences.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.bopreferences.inc.php 21 Jan 2002 05:28:05 -0000      1.14
--- class.bopreferences.inc.php 21 Jan 2002 22:54:56 -0000      1.15
***************
*** 312,316 ****
                                'type'          => 'exists',
                                'widget'        => 'checkbox',
!                               'accts_usage'   => 'default, extra_accounts',
                                'write_props'   => 'group_master',
                                'lang_blurb'    => lang('Use custom settings'),
--- 312,317 ----
                                'type'          => 'exists',
                                'widget'        => 'checkbox',
!                               //'accts_usage' => 'default, extra_accounts',
!                               'accts_usage'   => 'default',
                                'write_props'   => 'group_master',
                                'lang_blurb'    => lang('Use custom settings'),
***************
*** 543,547 ****
                                
                                // ==== ACCTNUM ====
-                               // figure out how to really detect this - FIXME
                                if ((!isset($this->acctnum))
                                || ((string)$this->acctnum == ''))
--- 544,547 ----
***************
*** 574,578 ****
                                        }
                                }
!                               // custom prefs are MANDATORY for extra email 
accounts
                                $loops = count($this->cust_prefs);              
                
                                for($i=0;$i<$loops;$i++)
--- 574,578 ----
                                        }
                                }
!                               // custom prefs
                                $loops = count($this->cust_prefs);              
                
                                for($i=0;$i<$loops;$i++)
***************
*** 598,677 ****
                                        }
                                }
-                               
-                               
-                               /*
-                               // DEPRECIATED CODE - THE ABOVE LOOPS REPLACE 
THE BELOW "MANUAL" CODE
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['email_sig']))
-                               {
-                                       $this->args['email_sig'] = 
$GLOBALS['HTTP_POST_VARS']['email_sig'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['default_sorting']))
-                               {
-                                       $this->args['default_sorting'] = 
$GLOBALS['HTTP_POST_VARS']['default_sorting'];
-                               }
-                               if (isset($GLOBALS['HTTP_POST_VARS']['layout']))
-                               {
-                                       $this->args['layout'] = 
$GLOBALS['HTTP_POST_VARS']['layout'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['show_addresses']))
-                               {
-                                       $this->args['show_addresses'] = 
$GLOBALS['HTTP_POST_VARS']['show_addresses'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['mainscreen_showmail']))
-                               {
-                                       $this->args['mainscreen_showmail'] = 
$GLOBALS['HTTP_POST_VARS']['mainscreen_showmail'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['use_trash_folder']))
-                               {
-                                       $this->args['use_trash_folder'] = 
$GLOBALS['HTTP_POST_VARS']['use_trash_folder'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['trash_folder_name']))
-                               {
-                                       $this->args['trash_folder_name'] = 
$GLOBALS['HTTP_POST_VARS']['trash_folder_name'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['use_sent_folder']))
-                               {
-                                       $this->args['use_sent_folder'] = 
$GLOBALS['HTTP_POST_VARS']['use_sent_folder'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['sent_folder_name']))
-                               {
-                                       $this->args['sent_folder_name'] = 
$GLOBALS['HTTP_POST_VARS']['sent_folder_name'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['enable_utf7'])) {
-                                       $this->args['enable_utf7'] = 
$GLOBALS['HTTP_POST_VARS']['enable_utf7'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['use_custom_settings']))
-                               {
-                                       $this->args['use_custom_settings'] = 
$GLOBALS['HTTP_POST_VARS']['use_custom_settings'];
-                               }
-                               if (isset($GLOBALS['HTTP_POST_VARS']['userid']))
-                               {
-                                       $this->args['userid'] = 
$GLOBALS['HTTP_POST_VARS']['userid'];
-                               }
-                               if (isset($GLOBALS['HTTP_POST_VARS']['passwd']))
-                               {
-                                       $this->args['passwd'] = 
$GLOBALS['HTTP_POST_VARS']['passwd'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['address']))
-                               {
-                                       $this->args['address'] = 
$GLOBALS['HTTP_POST_VARS']['address'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['mail_server']))
-                               {
-                                       $this->args['mail_server'] = 
$GLOBALS['HTTP_POST_VARS']['mail_server'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['mail_server_type']))
-                               {
-                                       $this->args['mail_server_type'] = 
$GLOBALS['HTTP_POST_VARS']['mail_server_type'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['imap_server_type']))
-                               {
-                                       $this->args['imap_server_type'] = 
$GLOBALS['HTTP_POST_VARS']['imap_server_type'];
-                               }
-                               if 
(isset($GLOBALS['HTTP_POST_VARS']['mail_folder']))
-                               {
-                                       $this->args['mail_folder'] = 
$GLOBALS['HTTP_POST_VARS']['mail_folder'];
-                               }
-                               */
                        }
                }
--- 598,601 ----
***************
*** 733,737 ****
                                        // 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_set_prefs > 1) { echo 
'email: bopreferences: process_submitted_prefs: _SKIP_ this item 
['.$this_pref['id'].'], it does not apply to the default email account<br>'; }
                                        continue;
                                }
--- 657,661 ----
                                        // 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_set_prefs > 1) { echo 
'email: bopreferences: process_submitted_prefs: _SKIP_ this item 
["'.$this_pref['id'].'"], it does not apply to the default email account<br>'; }
                                        continue;
                                }
***************
*** 743,747 ****
                                        // nothing submitted for this 
preference item
                                        // OR an empty string was submitted for 
this pref item
!                                       if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_submitted_prefs: submitted_pref for 
['.$this_pref['id'].'] not set or empty string<br>'; }
                                        if (stristr($this_pref['write_props'], 
'empty_no_delete'))
                                        {
--- 667,671 ----
                                        // nothing submitted for this 
preference item
                                        // OR an empty string was submitted for 
this pref item
!                                       if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_submitted_prefs: submitted_pref for 
["'.$this_pref['id'].'"] not set or empty string<br>'; }
                                        if (stristr($this_pref['write_props'], 
'empty_no_delete'))
                                        {
***************
*** 751,755 ****
                                                // but it does not matter here, 
because we do not touch this items value at all.
                                                // Typical Usage: passwords
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: no change to repository for empty or blank 
['.$this_pref['id'].'] because of "empty_no_delete"<br>'; }
                                        }
                                        elseif 
(stristr($this_pref['write_props'], 'empty_string_ok'))
--- 675,679 ----
                                                // but it does not matter here, 
because we do not touch this items value at all.
                                                // Typical Usage: passwords
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: no change to repository for empty or blank 
["'.$this_pref['id'].'"] because of "empty_no_delete"<br>'; }
                                        }
                                        elseif 
(stristr($this_pref['write_props'], 'empty_string_ok'))
***************
*** 759,763 ****
                                                // whereas most other prefs are 
simply deleted from the repository if value is empty
                                                // Typical Usage: email sig, 
UWash Mail Folder
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: save empty string to repository for 
['.$this_pref['id'].'] because of "empty_string_ok"<br>'; }
                                                // a) as always, delete the 
pref before we assign a value
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this_pref['id']);
--- 683,687 ----
                                                // whereas most other prefs are 
simply deleted from the repository if value is empty
                                                // Typical Usage: email sig, 
UWash Mail Folder
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: save empty string to repository for 
["'.$this_pref['id'].'"] because of "empty_string_ok"<br>'; }
                                                // a) as always, delete the 
pref before we assign a value
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this_pref['id']);
***************
*** 768,772 ****
                                        {
                                                // just delete it from the 
preferences repository
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: deleting empty or blank pref 
['.$this_pref['id'].'] from the repository<br>'; }
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this_pref['id']);
                                        }
--- 692,696 ----
                                        {
                                                // just delete it from the 
preferences repository
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: deleting empty or blank pref 
["'.$this_pref['id'].'"] from the repository<br>'; }
                                                
$GLOBALS['phpgw']->preferences->delete('email',$this_pref['id']);
                                        }
***************
*** 818,822 ****
                                                $processed_pref = 
$submitted_pref;
                                        }
!                                       if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_submitted_prefs: about to assign pref 
['.$this_pref['id'].'] this value, post processing (if any): 
<pre>'.$GLOBALS['phpgw']->strip_html($processed_pref).'</pre><br>'."\r\n"; }
                                        
                                        // a) as always, delete the pref before 
we assign a value
--- 742,746 ----
                                                $processed_pref = 
$submitted_pref;
                                        }
!                                       if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_submitted_prefs: about to assign pref 
["'.$this_pref['id'].'"] this value, post processing (if any): 
<pre>'.$GLOBALS['phpgw']->strip_html($processed_pref).'</pre><br>'."\r\n"; }
                                        
                                        // a) as always, delete the pref before 
we assign a value
***************
*** 1078,1082 ****
                        
                        // ==== ACCTNUM ====
-                       // figure out how to really detect this - FIXME
                        if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences: process_ex_accounts_submitted_prefs: pre discovery 
$this->acctnum : ['.serialize($this->acctnum).']<br>'; }
                        if ((!isset($this->acctnum))
--- 1002,1005 ----
***************
*** 1089,1095 ****
                        for($i=0;$i<$c_prefs;$i++)
                        {
!                               if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences: process_ex_accounts_submitted_prefs: inside preferences loop 
['.$i.']<br>'; }
                                
                                $this_pref = $prefs_set[$i];
                                
                                // ----  skip this item logic  ----
--- 1012,1019 ----
                        for($i=0;$i<$c_prefs;$i++)
                        {
!                               if ($this->debug_set_prefs > 1) { echo ' <b>* 
(next loop) *</b> email: bopreferences: process_ex_accounts_submitted_prefs: 
inside preferences loop ['.$i.']<br>'; }
                                
                                $this_pref = $prefs_set[$i];
+                               if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences: process_ex_accounts_submitted_prefs: $this_pref = 
$prefs_set['.$i.'] : $this_pref DUMP:<pre>'; print_r($prefs_set[$i]); echo 
'</pre>'; }
                                
                                // ----  skip this item logic  ----
***************
*** 1100,1104 ****
                                        // 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_set_prefs > 1) { echo 
'email: bopreferences: process_ex_accounts_submitted_prefs: _SKIP_ this item 
['.$this_pref['id'].'], it does not apply to Extra Email Accounts <br>'; }
                                        continue;
                                }
--- 1024,1028 ----
                                        // 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_set_prefs > 1) { echo 
'email: bopreferences: process_ex_accounts_submitted_prefs: _SKIP_ this item 
["'.$this_pref['id'].'"], it does not apply to Extra Email Accounts <br>'; }
                                        continue;
                                }
***************
*** 1110,1114 ****
                                        // nothing submitted for this 
preference item
                                        // OR an empty string was submitted for 
this pref item
!                                       if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_ex_accounts_submitted_prefs: submitted_pref for 
['.$this_pref['id'].'] not set or empty string<br>'; }
                                        if (stristr($this_pref['write_props'], 
'empty_no_delete'))
                                        {
--- 1034,1038 ----
                                        // nothing submitted for this 
preference item
                                        // OR an empty string was submitted for 
this pref item
!                                       if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_ex_accounts_submitted_prefs: submitted_pref for 
["'.$this_pref['id'].'"] not set or empty string<br>'; }
                                        if (stristr($this_pref['write_props'], 
'empty_no_delete'))
                                        {
***************
*** 1118,1122 ****
                                                // but it does not matter here, 
because we do not touch this items value at all.
                                                // Typical Usage: passwords
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: process_ex_accounts_submitted_prefs: no change to 
repository for empty or blank ['.$this_pref['id'].'] because of 
"empty_no_delete"<br>'; }
                                        }
                                        elseif 
(stristr($this_pref['write_props'], 'empty_string_ok'))
--- 1042,1046 ----
                                                // but it does not matter here, 
because we do not touch this items value at all.
                                                // Typical Usage: passwords
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: process_ex_accounts_submitted_prefs: no change to 
repository for empty or blank ["'.$this_pref['id'].'"] because of 
"empty_no_delete"<br>'; }
                                        }
                                        elseif 
(stristr($this_pref['write_props'], 'empty_string_ok'))
***************
*** 1126,1132 ****
                                                // whereas most other prefs are 
simply deleted from the repository if value is empty
                                                // Typical Usage: email sig, 
UWash Mail Folder
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences process_ex_accounts_submitted_prefs: save empty 
string to repository for ['.$this_pref['id'].'] because of 
"empty_string_ok"<br>'; }
                                                // a) as always, delete the 
pref before we assign a value
!                                               $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']['.$this_pref['id'].']';
                                                if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences process_ex_accounts_submitted_prefs: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
                                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
--- 1050,1056 ----
                                                // whereas most other prefs are 
simply deleted from the repository if value is empty
                                                // Typical Usage: email sig, 
UWash Mail Folder
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences process_ex_accounts_submitted_prefs: save empty 
string to repository for ["'.$this_pref['id'].'"] because of 
"empty_string_ok"<br>'; }
                                                // a) as always, delete the 
pref before we assign a value
!                                               $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this_pref['id'].'"]';
                                                if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences process_ex_accounts_submitted_prefs: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
                                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
***************
*** 1138,1143 ****
                                        {
                                                // just delete it from the 
preferences repository
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: process_ex_accounts_submitted_prefs deleting 
empty or blank pref ['.$this_pref['id'].'] from the repository<br>'; }
!                                               $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']['.$this_pref['id'].']';
                                                if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: process_ex_accounts_submitted_prefs: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
                                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
--- 1062,1067 ----
                                        {
                                                // just delete it from the 
preferences repository
!                                               if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: process_ex_accounts_submitted_prefs deleting 
empty or blank pref ["'.$this_pref['id'].'"] from the repository<br>'; }
!                                               $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this_pref['id'].'"]';
                                                if ($this->debug_set_prefs > 1) 
{ echo 'email: bopreferences: process_ex_accounts_submitted_prefs: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
                                                
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
***************
*** 1150,1154 ****
                                        // init a var to hold the processed 
submitted_pref
                                        $processed_pref = '';
!                                       if ($this->debug_set_prefs > 1) { echo 
'* * ** email: bopreferences: process_ex_accounts_submitted_prefs:  
submitted_pref: ['.$submitted_pref.']<br>'; }
                                        
                                        // most "user_string"s need special 
processing before they can go into the repository
--- 1074,1078 ----
                                        // init a var to hold the processed 
submitted_pref
                                        $processed_pref = '';
!                                       if ($this->debug_set_prefs > 1) { echo 
'* * email: bopreferences: process_ex_accounts_submitted_prefs:  
submitted_pref: ['.$submitted_pref.']<br>'; }
                                        
                                        // most "user_string"s need special 
processing before they can go into the repository
***************
*** 1190,1197 ****
                                                $processed_pref = 
$submitted_pref;
                                        }
!                                       if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_ex_accounts_submitted_prefs: about to assign 
pref ['.$this_pref['id'].'] this value, post processing (if any): 
<pre>'.$GLOBALS['phpgw']->strip_html($processed_pref).'</pre><br>'."\r\n"; }
                                        
                                        // a) as always, delete the pref before 
we assign a value
!                                       $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']['.$this_pref['id'].']';
                                        if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences process_ex_accounts_submitted_prefs: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
                                        
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
--- 1114,1121 ----
                                                $processed_pref = 
$submitted_pref;
                                        }
!                                       if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_ex_accounts_submitted_prefs: about to assign 
pref ["'.$this_pref['id'].'"] this value, post processing (if any): 
<pre>'.$GLOBALS['phpgw']->strip_html($processed_pref).'</pre><br>'."\r\n"; }
                                        
                                        // a) as always, delete the pref before 
we assign a value
!                                       $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this_pref['id'].'"]';
                                        if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences process_ex_accounts_submitted_prefs: using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
                                        
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
***************
*** 1199,1203 ****
                                        if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_ex_accounts_submitted_prefs: using 
preferences->add_struct("email", $pref_struct_str, $processed_pref) which will 
eval $pref_struct_str='.$pref_struct_str.'<br>'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$processed_pref);
!                                       // TEST: sort that array, by key, so 
the integer array heys go from lowest to hightest
                                        
ksort($GLOBALS['phpgw']->preferences->data['email']['ex_accounts']);
                                }
--- 1123,1127 ----
                                        if ($this->debug_set_prefs > 1) { echo 
'email: bopreferences: process_ex_accounts_submitted_prefs: using 
preferences->add_struct("email", $pref_struct_str, $processed_pref) which will 
eval $pref_struct_str='.$pref_struct_str.'<br>'; }
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$processed_pref);
!                                       // SORT THAT ARRAY by key, so the 
integer array heys go from lowest to hightest
                                        
ksort($GLOBALS['phpgw']->preferences->data['email']['ex_accounts']);
                                }
***************
*** 1244,1248 ****
                                // let the code below this block know we 
actually did something that requires saving the repository
                                $actually_did_something = True;
-                               
//@reset($GLOBALS['phpgw']->preferences->prefs['ex_accounts']);
                        }
                        
--- 1168,1171 ----
***************
*** 1298,1305 ****
                        
                        // ==== ACCTNUM ====
-                       // figure out how to really detect this - FIXME
                        // this tells people that we are dealing with the extra 
email accounts
                        $this->account_group = 'extra_accounts';
-                       // FIXME: need a real way to determine this
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
--- 1221,1226 ----
***************
*** 1334,1338 ****
                                //set_magic_quotes_runtime(0);
                                
!                               // constructor will initialize 
$GLOBALS['phpgw']->msg
                                
                                // ---  Process Standard Prefs  ---
--- 1255,1259 ----
                                //set_magic_quotes_runtime(0);
                                
!                               // constructor will (has taken care of) 
initialize $GLOBALS['phpgw']->msg
                                
                                // ---  Process Standard Prefs  ---
***************
*** 1341,1353 ****
                                
                                // ---  Process Custom Prefs  ---
!                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): about to 
process_ex_accounts_submitted_prefs Custom Prefs, which are MANDARORY for extra 
email accounts<br>'; }
                                
$this->process_ex_accounts_submitted_prefs($this->cust_prefs);
                                
                                if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences.ex_accounts_edit: $GLOBALS[phpgw]->preferences->data dump<pre>'; 
print_r($GLOBALS['phpgw']->preferences->data); echo '</pre>'; }
-                               // debug
-                               
//unset($GLOBALS['phpgw']->preferences->data['email']['ex_accounts'][0]);
-                               // make the array in ascending order
-                               
//sort($GLOBALS['phpgw']->preferences->data['email']['ex_accounts']);
-                               
//reset($GLOBALS['phpgw']->preferences->data['email']['ex_accounts']);
                        }
                                
--- 1262,1300 ----
                                
                                // ---  Process Custom Prefs  ---
!                               // CUSTOM PREFS ARE MANDATORY! FOR EXTRA 
ACCOUNTS
!                               // first, delete whatever value was there for 
"use custom settings" (during pre-release, at times this actually was an 
option, make sure it's gone grom the db)
!                               $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this->cust_prefs[0]['id'].'"]';
!                               if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences.ex_accounts_edit(): "use_custom_settings" pref, delete it, 
reference it by 
["ex_accounts"][$this->acctnum]["$this->cust_prefs[0][id]"]<br>'; }
!                               if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences.ex_accounts_edit(): using preferences->delete_struct("email", 
$pref_struct_str) which will eval $pref_struct_str='.$pref_struct_str.'<br>'; }
!                               
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
! 
!                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): about to 
process_ex_accounts_submitted_prefs Custom Prefs, which are MANDATORY for extra 
email accounts<br>'; }
                                
$this->process_ex_accounts_submitted_prefs($this->cust_prefs);
                                
+                               /*
+                               // ---  Process Custom Prefs  ---
+                               // if they were not mandatory, but that does 
not work
+                               if ($this->debug_set_prefs > 1) { echo 
'email.bopreferences.ex_accounts_edit(): 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.ex_accounts_edit(): custom prefs are in use<br>'; }
+                                       
$this->process_ex_accounts_submitted_prefs($this->cust_prefs);
+                               }
+                               else
+                               {
+                                       // 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.ex_accounts_edit(): custom prefs NOT in use, deleting 
them<br>'; }
+                                       for($i=0;$i<$c_prefs;$i++)
+                                       {
+                                               $pref_struct_str = 
'["ex_accounts"]['.$this->acctnum.']["'.$this->cust_prefs[$i]['id'].'"]';
+                                               if ($this->debug_set_prefs > 1) 
{ echo ' ** (looping) email: bopreferences.ex_accounts_edit(): using 
preferences->delete_struct("email", $pref_struct_str) which will eval 
$pref_struct_str='.$pref_struct_str.'<br>'; }
+                                               
$GLOBALS['phpgw']->preferences->delete_struct('email',$pref_struct_str);
+                                       }
+                               }
+                               */
+                               
                                if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences.ex_accounts_edit: $GLOBALS[phpgw]->preferences->data dump<pre>'; 
print_r($GLOBALS['phpgw']->preferences->data); echo '</pre>'; }
                        }
                                

Index: class.uipreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.uipreferences.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.uipreferences.inc.php 21 Jan 2002 05:28:05 -0000      1.12
--- class.uipreferences.inc.php 21 Jan 2002 22:54:56 -0000      1.13
***************
*** 453,457 ****
                        
                        // ---  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');  
--- 453,462 ----
                        
                        // ---  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');  




reply via email to

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