[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: email/inc class.boindex.inc.php,1.17,1.18 class.
From: |
Angelo Tony Puglisi <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: email/inc class.boindex.inc.php,1.17,1.18 class.bopreferences.inc.php,1.9,1.10 class.bosend.inc.php,1.5,1.6 class.mail_msg_base.inc.php,1.56,1.57 class.mail_msg_display.inc.php,1.28,1.29 class.uiindex.inc.php,1.14,1.15 class.uipreferences.inc.php,1.7,1.8 hook_preferences.inc.php,1.8,1.9 |
Date: |
Thu, 10 Jan 2002 05:04:45 -0500 |
Update of /cvsroot/phpgroupware//email/inc
In directory subversions:/tmp/cvs-serv25006/email/inc
Modified Files:
class.boindex.inc.php class.bopreferences.inc.php
class.bosend.inc.php class.mail_msg_base.inc.php
class.mail_msg_display.inc.php class.uiindex.inc.php
class.uipreferences.inc.php hook_preferences.inc.php
Log Message:
first pass at multiple email accounts support
Index: class.boindex.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.boindex.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** class.boindex.inc.php 8 Jan 2002 15:06:03 -0000 1.17
--- class.boindex.inc.php 10 Jan 2002 10:04:41 -0000 1.18
***************
*** 385,389 ****
$this->xi['accounts_link'] = $GLOBALS['phpgw']->link(
'/index.php',
!
'menuaction=email.uiindex.index');
$this->xi['ctrl_bar_back1'] =
$GLOBALS['phpgw_info']['theme']['row_on'];
--- 385,423 ----
$this->xi['accounts_link'] = $GLOBALS['phpgw']->link(
'/index.php',
!
'menuaction=email.uipreferences.ex_accounts'
! .'&acctnum=1');
! $this->xi['accounts_href'] = '<a
href="'.$this->xi['accounts_link'].'">'.$this->xi['accounts_txt'].'</a>';
!
! // by now we have an acctnum!
! if ((string)$GLOBALS['phpgw']->msg->get_acctnum() ==
'0')
! {
! $this->xi['ctrl_bar_current_acctnum'] =
'default';
! }
! else
! {
! $this->xi['ctrl_bar_current_acctnum'] = 'extra
'.(string)$GLOBALS['phpgw']->msg->get_acctnum();
! }
!
! $this->xi['ctrl_bar_acct_0_link'] =
$GLOBALS['phpgw']->link(
! '/index.php',
!
'menuaction=email.uiindex.index'
! // going to the
folder list page, we only need log into the INBOX folder
!
.'&fldball[folder]=INBOX'
!
.'&fldball[acctnum]=0'
! .'&sort='
! .'&order='
! .'&start=');
! $this->xi['ctrl_bar_acct_0_link'] = '<a
href="'.$this->xi['ctrl_bar_acct_0_link'].'">'.'goto default'.'</a>';
!
! $this->xi['ctrl_bar_acct_1_link'] =
$GLOBALS['phpgw']->link(
! '/index.php',
!
'menuaction=email.uiindex.index'
! // going to the
folder list page, we only need log into the INBOX folder
!
.'&fldball[folder]=INBOX'
!
.'&fldball[acctnum]=1'
! .'&sort='
! .'&order='
! .'&start=');
! $this->xi['ctrl_bar_acct_1_link'] = '<a
href="'.$this->xi['ctrl_bar_acct_1_link'].'">'.'goto extra 1'.'</a>';
$this->xi['ctrl_bar_back1'] =
$GLOBALS['phpgw_info']['theme']['row_on'];
Index: class.bopreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bopreferences.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.bopreferences.inc.php 4 Jan 2002 06:21:16 -0000 1.9
--- class.bopreferences.inc.php 10 Jan 2002 10:04:41 -0000 1.10
***************
*** 19,29 ****
'preferences' => True,
'init_available_prefs' => True,
! 'grab_set_prefs' => True
);
- //var $email_base='';
var $not_set='-1';
var $std_prefs=array();
var $cust_prefs=array();
var $submit_token='submit_prefs';
// were we called from phpgroupware ("phpgw")or externally via
xml-rpc ("xmlrpc")
var $caller='phpgw';
--- 19,36 ----
'preferences' => True,
'init_available_prefs' => True,
! 'grab_set_prefs' => True,
! 'ex_accounts' => True
);
var $not_set='-1';
var $std_prefs=array();
var $cust_prefs=array();
var $submit_token='submit_prefs';
+ var $submit_token_extra_accounts='submit_prefs_extra_accounts';
+ var
$submit_token_delete_ex_account='submit_prefs_delete_ex_account';
+
+ // possible values: "default" or "extra_accounts"
+ var $account_group = 'default';
+ var $acctnum = 0;
+
// were we called from phpgroupware ("phpgw")or externally via
xml-rpc ("xmlrpc")
var $caller='phpgw';
***************
*** 68,74 ****
--- 75,104 ----
$i = 0;
$this->std_prefs[$i] = Array(
+ 'id' => 'ex_account_enabled',
+ 'type' => 'exists',
+ 'widget' => 'checkbox',
+ 'accts_usage' => 'extra_accounts',
+ 'write_props' => '',
+ 'lang_blurb' => lang('enable this email
account'),
+ 'init_default' => 'set_or_not,not_set',
+ 'values' => array()
+ );
+ $i++;
+ $this->std_prefs[$i] = Array(
+ 'id' => 'fullname',
+ 'type' => 'user_string',
+ 'widget' => 'textbox',
+ 'accts_usage' => 'extra_accounts',
+ 'write_props' => '',
+ 'lang_blurb' => lang('Your full name'),
+ 'init_default' =>
'varEVAL,$GLOBALS["phpgw_info"]["user"]["fullname"];',
+ 'values' => array()
+ );
+ $i++;
+ $this->std_prefs[$i] = Array(
'id' => 'email_sig',
'type' => 'user_string',
'widget' => 'textarea',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => 'empty_string_ok',
'lang_blurb' => lang('email signature'),
***************
*** 83,86 ****
--- 113,117 ----
'type' => 'known_string',
'widget' => 'combobox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
'lang_blurb' => lang('Default sorting
order'),
***************
*** 96,99 ****
--- 127,131 ----
'type' => 'known_string',
'widget' => 'combobox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
'lang_blurb' => lang('Message List Layout'),
***************
*** 109,112 ****
--- 141,145 ----
'type' => 'known_string',
'widget' => 'combobox',
+ 'accts_usage' => 'default',
'write_props' => '',
'lang_blurb' => lang('Show sender\'s email
address with name'),
***************
*** 122,126 ****
--- 155,161 ----
'id' => 'mainscreen_showmail',
'type' => 'exists',
+ 'accts_usage' => 'default',
'widget' => 'checkbox',
+ 'accts_usage' => 'default',
'write_props' => '',
'lang_blurb' => lang('show new messages on
main screen'),
***************
*** 133,136 ****
--- 168,172 ----
'type' => 'exists',
'widget' => 'checkbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
//'lang_blurb' => lang('Deleted messages saved
to folder:'),
***************
*** 145,148 ****
--- 181,185 ----
'type' => 'user_string',
'widget' => 'textbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
//'lang_blurb' => lang('Deleted messages
folder name'),
***************
*** 156,159 ****
--- 193,197 ----
'type' => 'exists',
'widget' => 'checkbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
//'lang_blurb' => lang('Sent messages saved to
folder:'),
***************
*** 168,171 ****
--- 206,210 ----
'type' => 'user_string',
'widget' => 'textbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
//'lang_blurb' => lang('Sent messages folder
name'),
***************
*** 204,212 ****
);
*/
$i++;
$this->std_prefs[$i] = Array(
'id' => 'cache_data',
! 'type' => 'exists',
'widget' => 'checkbox',
'write_props' => '',
'lang_blurb' => lang('cache server data
whenever possible'),
--- 243,253 ----
);
*/
+ // this item has been phased out, not used at the moment
$i++;
$this->std_prefs[$i] = Array(
'id' => 'cache_data',
! 'type' => 'exists, INACTIVE',
'widget' => 'checkbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
'lang_blurb' => lang('cache server data
whenever possible'),
***************
*** 219,222 ****
--- 260,264 ----
'type' => 'exists',
'widget' => 'checkbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
'lang_blurb' => lang('enable UTF-7 encoded
folder names'),
***************
*** 232,235 ****
--- 274,278 ----
'type' => 'exists',
'widget' => 'checkbox',
+ 'accts_usage' => 'default',
'write_props' => 'group_master',
'lang_blurb' => lang('Use custom settings'),
***************
*** 242,245 ****
--- 285,289 ----
'type' => 'user_string',
'widget' => 'textbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => 'no_db_defang',
'lang_blurb' => lang('Email Account Name'),
***************
*** 253,256 ****
--- 297,301 ----
'type' => 'user_string',
'widget' => 'passwordbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => 'password, hidden,
encrypted, empty_no_delete',
'lang_blurb' => lang('Email Password'),
***************
*** 263,266 ****
--- 308,312 ----
'type' => 'user_string',
'widget' => 'textbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => 'no_db_defang',
'lang_blurb' => lang('Email address'),
***************
*** 274,277 ****
--- 320,324 ----
'type' => 'user_string',
'widget' => 'textbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => 'no_db_defang',
'lang_blurb' => lang('Mail Server'),
***************
*** 284,287 ****
--- 331,335 ----
'type' => 'known_string',
'widget' => 'combobox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => 'no_db_defang',
'lang_blurb' => lang('Mail Server type'),
***************
*** 299,302 ****
--- 347,351 ----
'type' => 'known_string',
'widget' => 'combobox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => '',
'lang_blurb' => lang('IMAP Server Type') .'
- ' .lang('If Applicable'),
***************
*** 313,316 ****
--- 362,366 ----
'type' => 'user_string',
'widget' => 'textbox',
+ 'accts_usage' => 'default, extra_accounts',
'write_props' => 'empty_string_ok,
no_db_defang',
'lang_blurb' => lang('U-Wash Mail Folder').'
- ' .lang('If Applicable'),
***************
*** 391,397 ****
// data, instead of $GLOBALS['HTTP_POST_VARS'].
// HOWEVER, do not attempt to grab data if the
"submit_prefs" GPC submit_token variable is not present
if
(isset($GLOBALS['HTTP_POST_VARS'][$this->submit_token]))
{
! if ($this->debug_set_prefs) { echo
'email.bopreferences: INSIDE grab_set_prefs_args_gpc<br>'; }
//$this->args['submit_prefs'] =
$GLOBALS['HTTP_POST_VARS']['submit_prefs'];
--- 441,449 ----
// data, instead of $GLOBALS['HTTP_POST_VARS'].
// HOWEVER, do not attempt to grab data if the
"submit_prefs" GPC submit_token variable is not present
+
+ // ---- DEFAULT EMAIL ACCOUNT ----
if
(isset($GLOBALS['HTTP_POST_VARS'][$this->submit_token]))
{
! if ($this->debug_set_prefs) { echo
'email.bopreferences: INSIDE grab_set_prefs_args_gpc for Default Email Account
data<br>'; }
//$this->args['submit_prefs'] =
$GLOBALS['HTTP_POST_VARS']['submit_prefs'];
***************
*** 401,410 ****
for($i=0;$i<$loops;$i++)
{
! $this_pref_name =
$this->std_prefs[$i]['id'];
! if ($this->debug_set_prefs) { echo ' *
* (std pref) $this_pref_name: '.$this_pref_name.'<br>'; }
! if ($this->debug_set_prefs) { echo ' *
* (std pref) $GLOBALS[HTTP_POST_VARS][$this_pref_name]:
'.$GLOBALS['HTTP_POST_VARS'][$this_pref_name].'<br>'; }
! if
(isset($GLOBALS['HTTP_POST_VARS'][$this_pref_name]))
{
! $this->args[$this_pref_name] =
$GLOBALS['HTTP_POST_VARS'][$this_pref_name];
}
}
--- 453,473 ----
for($i=0;$i<$loops;$i++)
{
! // ---- skip this item logic ----
! // we are ONLY concerned with items
that apply to the default email account
! // existence of $this->submit_token
indicates this data is intended for the default email account
! if
(!stristr($this->std_prefs[$i]['accts_usage'], 'default'))
{
! if ($this->debug_set_prefs) {
echo ' * * (std pref) _SKIP_ this item ['.$this->std_prefs[$i]['id'].'], it
does not apply to the default email account<br>'; }
! }
! else
! {
! // ok, we have a pref item that
applies to the default email account
! $this_pref_name =
$this->std_prefs[$i]['id'];
! if ($this->debug_set_prefs) {
echo ' * * (std pref) $this_pref_name: '.$this_pref_name.'<br>'; }
! if ($this->debug_set_prefs) {
echo ' * * (std pref) $GLOBALS[HTTP_POST_VARS][$this_pref_name]:
'.$GLOBALS['HTTP_POST_VARS'][$this_pref_name].'<br>'; }
! if
(isset($GLOBALS['HTTP_POST_VARS'][$this_pref_name]))
! {
!
$this->args[$this_pref_name] = $GLOBALS['HTTP_POST_VARS'][$this_pref_name];
! }
}
}
***************
*** 413,422 ****
for($i=0;$i<$loops;$i++)
{
! $this_pref_name =
$this->cust_prefs[$i]['id'];
! if ($this->debug_set_prefs) { echo ' *
* (cust pref) $this_pref_name: '.$this_pref_name.'<br>'; }
! if ($this->debug_set_prefs) { echo ' *
* (cust pref) $GLOBALS[HTTP_POST_VARS][$this_pref_name]:
'.$GLOBALS['HTTP_POST_VARS'][$this_pref_name].'<br>'; }
! if
(isset($GLOBALS['HTTP_POST_VARS'][$this_pref_name]))
{
! $this->args[$this_pref_name] =
$GLOBALS['HTTP_POST_VARS'][$this_pref_name];
}
}
--- 476,557 ----
for($i=0;$i<$loops;$i++)
{
! // ---- skip this item logic ----
! // we are ONLY concerned with items
that apply to the default email account
! // existence of $this->submit_token
indicates this data is intended for the default email account
! if
(!stristr($this->cust_prefs[$i]['accts_usage'], 'default'))
! {
! if ($this->debug_set_prefs) {
echo ' * * (cust pref) _SKIP_ this item ['.$this->cust_prefs[$i]['id'].'], it
does not apply to the default email account<br>'; }
! }
! else
{
! // ok, we have a pref item that
applies to the default email account
! $this_pref_name =
$this->cust_prefs[$i]['id'];
! if ($this->debug_set_prefs) {
echo ' * * (cust pref) $this_pref_name: '.$this_pref_name.'<br>'; }
! if ($this->debug_set_prefs) {
echo ' * * (cust pref) $GLOBALS[HTTP_POST_VARS][$this_pref_name]:
'.$GLOBALS['HTTP_POST_VARS'][$this_pref_name].'<br>'; }
! if
(isset($GLOBALS['HTTP_POST_VARS'][$this_pref_name]))
! {
!
$this->args[$this_pref_name] = $GLOBALS['HTTP_POST_VARS'][$this_pref_name];
! }
! }
! }
! }
! // ---- EXTRA EMAIL ACCOUNTS ----
! elseif
(isset($GLOBALS['HTTP_POST_VARS'][$this->submit_token_extra_accounts]))
! {
! if ($this->debug_set_prefs) { echo
'email.bopreferences: INSIDE grab_set_prefs_args_gpc for EXTRA EMAIL ACCOUNTS
data<br>'; }
!
! //$this->args['submit_prefs'] =
$GLOBALS['HTTP_POST_VARS']['submit_prefs'];
! $this->args[$this->submit_token_extra_accounts]
= $GLOBALS['HTTP_POST_VARS'][$this->submit_token_extra_accounts];
!
! // ==== ACCTNUM ====
! // figure out how to really detect this - FIXME
! $this->acctnum = '1';
!
! // standard prefs
! $loops = count($this->std_prefs);
! for($i=0;$i<$loops;$i++)
! {
! // ---- skip this item logic ----
! // we are ONLY concerned with items
that apply to EXTRA email accounts
! // existence of
"$this->submit_token_extra_accounts" indicates this data is intended for
! // extra email accounts
! if
(!stristr($this->std_prefs[$i]['accts_usage'], 'extra_accounts'))
! {
! if ($this->debug_set_prefs) {
echo ' * * (std pref) _SKIP_ this item ['.$this->std_prefs[$i]['id'].'], it
does not apply to extra email accounts<br>'; }
! }
! else
! {
! // ok, we have a pref item that
applies to the default email account
! $this_pref_name =
$this->std_prefs[$i]['id'];
! if ($this->debug_set_prefs) {
echo ' * * (std pref) $this_pref_name: '.$this_pref_name.'<br>'; }
! if ($this->debug_set_prefs) {
echo ' * * (std pref)
$GLOBALS[HTTP_POST_VARS][$this->acctnum('.$this->acctnum.')][$this_pref_name('.$this_pref_name.')]:
['.$GLOBALS['HTTP_POST_VARS'][$this->acctnum][$this_pref_name].']<br>'; }
! if
(isset($GLOBALS['HTTP_POST_VARS'][$this->acctnum][$this_pref_name]))
! {
!
$this->args[$this->acctnum][$this_pref_name] =
$GLOBALS['HTTP_POST_VARS'][$this->acctnum][$this_pref_name];
! }
! }
! }
! // custom prefs are MANDATORY for extra email
accounts
! $loops = count($this->cust_prefs);
! for($i=0;$i<$loops;$i++)
! {
! // ---- skip this item logic ----
! // we are ONLY concerned with items
that apply to EXTRA email accounts
! // existence of
"$this->submit_token_extra_accounts" indicates this data is intended for
! // extra email accounts
! if
(!stristr($this->cust_prefs[$i]['accts_usage'], 'extra_accounts'))
! {
! if ($this->debug_set_prefs) {
echo ' * * (cust pref) _SKIP_ this item ['.$this->cust_prefs[$i]['id'].'], it
does not apply to extra email accounts<br>'; }
! }
! else
! {
! // ok, we have a pref item that
applies to extra email accounts
! $this_pref_name =
$this->cust_prefs[$i]['id'];
! if ($this->debug_set_prefs) {
echo ' * * (cust pref) $this_pref_name: '.$this_pref_name.'<br>'; }
! if ($this->debug_set_prefs) {
echo ' * * (cust pref)
$GLOBALS[HTTP_POST_VARS][$this->acctnum('.$this->acctnum.')][$this_pref_name('.$this_pref_name.')]:
['.$GLOBALS['HTTP_POST_VARS'][$this->acctnum][$this_pref_name].']<br>'; }
! if
(isset($GLOBALS['HTTP_POST_VARS'][$this->acctnum][$this_pref_name]))
! {
!
$this->args[$this->acctnum][$this_pref_name] =
$GLOBALS['HTTP_POST_VARS'][$this->acctnum][$this_pref_name];
! }
}
}
***************
*** 547,550 ****
--- 682,699 ----
$this_pref = $prefs_set[$i];
+
+ // ---- skip this item logic ----
+ // we are ONLY concerned with items that apply
to the default email account
+ // extra email accounts are handled elsewhere
+ if (!stristr($this_pref['accts_usage'] ,
'default'))
+ {
+ // we are not supposed to show this
item for the default account, skip this pref item
+ // 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) { echo
'email: bopreferences: process_submitted_prefs: _SKIP_ this item
['.$this_pref['id'].'], it does not apply to the default email account<br>'; }
+ continue;
+ }
+
+ // ---- ok, this item is relevant to the
default email account ----
if ((!isset($this->args[$this_pref['id']]))
|| (trim($this->args[$this_pref['id']]) == ''))
***************
*** 889,891 ****
--- 1038,1314 ----
*/
}
+
+
+ /*!
+ @function process_ex_account_submitted_prefs
+ @abstract Extra Email Accounts Process incoming submitted
prefs, process the data, and save to repository
+ @author Angles
+ @access Private
+ */
+ function process_ex_accounts_submitted_prefs($prefs_set='')
+ {
+ // basicly, copy and paste the real
"process_submitted_prefs" and tweak for extra_accounts applicablility
+ if(!$prefs_set)
+ {
+ $prefs_set=array();
+ }
+ $c_prefs = count($prefs_set);
+ if ($c_prefs == 0)
+ {
+ if ($this->debug_set_prefs) { echo 'email:
bopreferences: process_ex_accounts_submitted_prefs: empty array, no prefs set
supplied, exiting<br>'; }
+ return False;
+ }
+
+ // ==== ACCTNUM ====
+ // figure out how to really detect this - FIXME
+ $this->acctnum = '1';
+
+ for($i=0;$i<$c_prefs;$i++)
+ {
+ if ($this->debug_set_prefs) { echo 'email:
bopreferences: process_ex_accounts_submitted_prefs: inside preferences loop
['.$i.']<br>'; }
+
+ $this_pref = $prefs_set[$i];
+
+ // ---- skip this item logic ----
+ // we are ONLY concerned with items that apply
to the extra email accounts
+ if (!stristr($this_pref['accts_usage'] ,
'extra_accounts'))
+ {
+ // we are not supposed to handle this
item for the extra email accounts, skip this pref item
+ // 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) { echo
'email: bopreferences: process_ex_accounts_submitted_prefs: _SKIP_ this item
['.$this_pref['id'].'], it does not apply to Extra Email Accounts <br>'; }
+ continue;
+ }
+
+ // ---- ok, this item is relevant to extra
email accounts ----
+ if
((!isset($this->args[$this->acctnum][$this_pref['id']]))
+ ||
(trim($this->args[$this->acctnum][$this_pref['id']]) == ''))
+ {
+ // nothing submitted for this
preference item
+ // OR an empty string was submitted for
this pref item
+ if ($this->debug_set_prefs) { 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'))
+ {
+ // DO NOT DELETE
+ // "empty_no_delete" means keep
the existing pref un-molested, as-is, no change
+ // note there may or may not
actually be an existing value in the prefs table
+ // but it does not matter here,
because we do not touch this items value at all.
+ // Typical Usage: passwords
+ if ($this->debug_set_prefs) {
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'))
+ {
+ // "empty_string_ok" means a
blank string "" IS a VALID pref value
+ // i.e. this pref can take an
empty string as a valid value
+ // 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) {
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) {
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);
+ // b) now assign a blank string
value
+ if ($this->debug_set_prefs) {
echo 'email: bopreferences: process_ex_accounts_submitted_prefs: using
preferences->add_struct("email", $pref_struct_str, \'\') which will eval
$pref_struct_str='.$pref_struct_str.'<br>'; }
+
$GLOBALS['phpgw']->preferences->add_struct('email',$pref_struct_str,'');
+ }
+ else
+ {
+ // just delete it from the
preferences repository
+ if ($this->debug_set_prefs) {
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) {
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);
+ }
+ }
+ else
+ {
+ // --- we have real data submitted for
this preference item ---
+ $submitted_pref =
$this->args[$this->acctnum][$this_pref['id']];
+ // init a var to hold the processed
submitted_pref
+ $processed_pref = '';
+ if ($this->debug_set_prefs) { 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
+ if ($this_pref['type'] == 'user_string')
+ {
+ if
(stristr($this_pref['write_props'], 'no_db_defang'))
+ {
+ // typical
"user_string" needs to strip any slashes
+ // that PHP
"magic_quotes_gpc"may have added
+ $processed_pref =
$GLOBALS['phpgw']->msg->stripslashes_gpc($submitted_pref);
+ // most "user_string"
items require pre-processing before going into
+ // the repository
(strip slashes, html encode, encrypt, etc...)
+ // we call this
database "de-fanging", remove database unfriendly chars
+ // currenty defanging
is handled by "mail_msg_obj->html_quotes_encode"
+ // EXCEPT when
"no_db_defang" is in "write_props"
+ $processed_pref =
$submitted_pref;
+ }
+ elseif
(stristr($this_pref['write_props'], 'encrypted'))
+ {
+ // certain data
(passwords) should be encrypted before going into the repository
+ // "user_string"s to be
"encrypted" do NOT get "html_quotes_encode"
+ // before going into
the encryption routine
+ $processed_pref =
$GLOBALS['phpgw']->msg->stripslashes_gpc($submitted_pref);
+ $processed_pref =
$GLOBALS['phpgw']->msg->encrypt_email_passwd($processed_pref);
+ }
+ else
+ {
+ // typical
"user_string" needs to strip any slashes
+ // that PHP
"magic_quotes_gpc"may have added
+ $processed_pref =
$GLOBALS['phpgw']->msg->stripslashes_gpc($submitted_pref);
+ // and this is a _LAME_
way to make the value "database friendly"
+ // because slashes and
quotes will FRY the whole preferences repository
+ $processed_pref =
$GLOBALS['phpgw']->msg->html_quotes_encode($processed_pref);
+ }
+ }
+ else
+ {
+ // all other data needs no
special processing before going into the repository
+ $processed_pref =
$submitted_pref;
+ }
+ if ($this->debug_set_prefs) { 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) { 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);
+ // b) now assign that processed data to
this pref item in the repository
+ if ($this->debug_set_prefs) { 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);
+ }
+ }
+ // since we apparently did process some prefs data,
return True
+ return True;
+ }
+
+ /*
+ @function ex_accounts
+ @abstract Extra Email Account Data process submitted prefs. It
makes use of other class functions
+ some of which should not be called directly, call this function
in menuaction.
+ @author Angles
+ @access Public
+ */
+ function ex_accounts($acctnum='')
+ {
+ if ($this->debug_set_prefs) { echo
'email.bopreferences.ex_accounts ENTERING <br>'; }
+ if ($this->debug_set_prefs) { echo 'email:
bopreferences.ex_accounts: $GLOBALS[HTTP_POST_VARS] dump<pre>';
print_r($GLOBALS['HTTP_POST_VARS']); echo '</pre>'; }
+
+ // ==== 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
+ $this->acctnum = 1;
+
+ $actually_did_something = False;
+
+ // --- Delete This Extra Account? ----
+ if
(isset($GLOBALS['HTTP_POST_VARS'][$this->submit_token_delete_ex_account]))
+ {
+ // we have been requested to delete this Extra
Email Account data
+ if ($this->debug_set_prefs) { echo 'email:
bopreferences.ex_accounts: $this->submit_token_delete_ex_account exists:
['.$this->submit_token_delete_ex_account.'] so delete this account, prelim
$this->acctnum: ['.$this->acctnum.']<br>'; }
+ // delete the pref
+ $pref_struct_str =
'["ex_accounts"]['.$this->acctnum.']';
+ if ($this->debug_set_prefs) { echo 'email:
bopreferences.ex_accounts: 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) { echo 'email:
bopreferences.ex_accounts: $GLOBALS[phpgw]->preferences->data dump<pre>';
print_r($GLOBALS['phpgw']->preferences->data); echo '</pre>'; }
+ // let the code below this block know we
actually did something that requires saving the repository
+ $actually_did_something = True;
+ }
+ else
+ {
+ // --- Add/Modify Email Extra Account Prefs?
----
+
+ // 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) { echo
'email.bopreferences.ex_accounts(): just passed this->grab_set_prefs<br>'; }
+
+ // ---- HANDLE SETING PREFERENCE -------
+ if
(isset($this->args[$this->submit_token_extra_accounts]))
+ {
+ // let the code below this block know
we actually did something that requires saving the repository
+ $actually_did_something = True;
+
+ // is set_magic_quotes_runtime(0) done
here or somewhere else
+ //set_magic_quotes_runtime(0);
+ /*
+ @capability: initialize class mail_msg
object but do not login
+ @discussion: we need mail_msg fully
initialized to set prefs, but we
+ do not need class_dcom, nor do we need
to login, this is how to do it:
+ 1) create the mail_msg object
+ 2) initialize simple "begin_request"
args array holder variable
+ setting prefs does not require a login,
in fact you may not yet be able to login
+ "do_login" = False is the only
"request_args_array" element we need to set
+ 3) begin the class mail_msg transaction
request with "begin_request"
+ even though we are not logging in, the
will initialize the class
+ 4) set the prefs
+ 5) call "end_request"
+ */
+ if (is_object($GLOBALS['phpgw']->msg))
+ {
+ if ($this->debug_set_prefs) {
echo 'email.bopreferences.ex_accounts: is_object test: $GLOBALS[phpgw]->msg is
already set, do not create again<br>'; }
+ }
+ else
+ {
+ if ($this->debug_set_prefs) {
echo 'email.bopreferences.ex_accounts: is_object test: $GLOBALS[phpgw]->msg is
NOT set, creating mail_msg object<br>'; }
+ $GLOBALS['phpgw']->msg =
CreateObject("email.mail_msg");
+ }
+
+ //$this->email_base =
CreateObject("email.mail_msg");
+ $request_args = Array(
+ 'do_login' => False
+ );
+
$GLOBALS['phpgw']->msg->begin_request($request_args);
+
+ // --- Process Standard Prefs ---
+ if ($this->debug_set_prefs) { echo
'email.bopreferences.ex_accounts(): about to
process_ex_accounts_submitted_prefs Standard Prefs<br>'; }
+
$this->process_ex_accounts_submitted_prefs($this->std_prefs);
+
+ // --- Process Custom Prefs ---
+ if ($this->debug_set_prefs) { echo
'email.bopreferences.ex_accounts(): 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) { echo
'email: bopreferences.ex_accounts: $GLOBALS[phpgw]->preferences->data
dump<pre>'; print_r($GLOBALS['phpgw']->preferences->data); echo '</pre>'; }
+ }
+ }
+
+ // DONE processing prefs, SAVE to the Repository
+ if (!$actually_did_something)
+ {
+ // nothing happened above that requires saving
the repository
+ if ($this->debug_set_prefs) { echo
'email.bopreferences.ex_accounts(): nothing happened that requires
save_repository,
$actually_did_something='.serialize($actually_did_something).'<br>'; }
+ }
+ elseif ($this->debug_set_prefs)
+ {
+ // we actually did something that requires
saving repository, but are we in debug mode
+ echo 'email.bopreferences.ex_accounts():
*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))
+ {
+ $GLOBALS['phpgw']->msg->end_request();
+ }
+ // redirect user back to main preferences page
+ if ($this->debug_set_prefs)
+ {
+ echo 'email.bopreferences.ex_accounts():
*debug* skipping Header redirection<br>';
+ }
+ else
+ {
+ Header('Location: ' .
$GLOBALS['phpgw']->link('/preferences/index.php'));
+ }
+ }
+
}
+ ?>
\ No newline at end of file
Index: class.bosend.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bosend.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.bosend.inc.php 8 Jan 2002 15:06:03 -0000 1.5
--- class.bosend.inc.php 10 Jan 2002 10:04:41 -0000 1.6
***************
*** 108,112 ****
$not_set = $GLOBALS['phpgw']->msg->not_set;
! $msgball =
$GLOBALS['phpgw']->msg->get_pref_value('msgball');
// ------- Init Array Structure For Outgoing Mail
-----------
--- 108,112 ----
$not_set = $GLOBALS['phpgw']->msg->not_set;
! $msgball =
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
// ------- Init Array Structure For Outgoing Mail
-----------
***************
*** 208,212 ****
else
{
! $from_name =
$GLOBALS['phpgw_info']['user']['fullname'];
$from_address =
$GLOBALS['phpgw']->msg->get_pref_value('address');
$from_assembled = '"'.$from_name.'"
<'.$from_address.'>';
--- 208,213 ----
else
{
! $from_name =
$GLOBALS['phpgw']->msg->get_pref_value('fullname');
! //$from_name =
$GLOBALS['phpgw_info']['user']['fullname'];
$from_address =
$GLOBALS['phpgw']->msg->get_pref_value('address');
$from_assembled = '"'.$from_name.'"
<'.$from_address.'>';
Index: class.mail_msg_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_base.inc.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** class.mail_msg_base.inc.php 9 Jan 2002 10:55:29 -0000 1.56
--- class.mail_msg_base.inc.php 10 Jan 2002 10:04:41 -0000 1.57
***************
*** 680,684 ****
$GLOBALS['phpgw_info']['user']['preferences'] = $tmp_prefs;
// for our use, put prefs in a class var to be accessed thru
OOP-style access calls in mail_msg_wrapper
! $this->set_pref_array($tmp_prefs['email']);
// clear the temp var
$tmp_prefs = array();
--- 680,692 ----
$GLOBALS['phpgw_info']['user']['preferences'] = $tmp_prefs;
// for our use, put prefs in a class var to be accessed thru
OOP-style access calls in mail_msg_wrapper
! // since we know these prefs to be the top level prefs, force
them into acctnum 0
! $this->set_pref_array($tmp_prefs['email'], 0);
!
! // TEMP - STUFF EXTRA ACCT #1 WHERE IT BELONGS
! // run thru the create prefs function requesting this
particular acctnum
! $tmp_prefs = array();
! $tmp_prefs =
$GLOBALS['phpgw']->preferences->create_email_preferences('', 1);
! $this->set_pref_array($tmp_prefs['email'], 1);
!
// clear the temp var
$tmp_prefs = array();
***************
*** 1251,1256 ****
// we *may* need this data later
$mailsvr_stream = $this->get_arg_value('mailsvr_stream',
$acctnum);
! $server_str = $this->get_arg_value('mailsvr_callstr', $acctnum);
! if ($this->debug_args_special_handlers > 1) { echo 'mail_msg:
get_mailsvr_namespace: got these for later use: $mailsvr_stream:
['.$mailsvr_stream.'] ; $server_str: ['.$server_str.']<br>'; }
if (($this->get_pref_value('imap_server_type', $acctnum) ==
'UW-Maildir')
--- 1259,1264 ----
// we *may* need this data later
$mailsvr_stream = $this->get_arg_value('mailsvr_stream',
$acctnum);
! $mailsvr_callstr = $this->get_arg_value('mailsvr_callstr',
$acctnum);
! if ($this->debug_args_special_handlers > 1) { echo 'mail_msg:
get_mailsvr_namespace: got these for later use: $mailsvr_stream:
['.$mailsvr_stream.'] ; $mailsvr_callstr: ['.$mailsvr_callstr.']<br>'; }
if (($this->get_pref_value('imap_server_type', $acctnum) ==
'UW-Maildir')
***************
*** 1295,1301 ****
// see http://www.faqs.org/rfcs/rfc2060.html section
6.3.8 (which is not entirely clear on this)
// FIXME: abstract this class dcom call in
mail_msg_wrappers
! if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_mailsvr_namespace: issuing:
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->listmailbox('.$mailsvr_stream.',
'.$server_str.', %)'.'<br>'; }
! $name_space =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$server_str, '%');
if ($this->debug_args_special_handlers > 2) { echo
'mail_msg: get_mailsvr_namespace: raw $name_space dump<pre>';
print_r($name_space); echo '</pre>'; }
--- 1303,1309 ----
// see http://www.faqs.org/rfcs/rfc2060.html section
6.3.8 (which is not entirely clear on this)
// FIXME: abstract this class dcom call in
mail_msg_wrappers
! if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_mailsvr_namespace: issuing:
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->listmailbox('.$mailsvr_stream.',
'.$mailsvr_callstr.', %)'.'<br>'; }
! $name_space =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$mailsvr_callstr, '%');
if ($this->debug_args_special_handlers > 2) { echo
'mail_msg: get_mailsvr_namespace: raw $name_space dump<pre>';
print_r($name_space); echo '</pre>'; }
***************
*** 1605,1611 ****
}
! if ($this->debug_args_special_handlers > 2) { echo 'mail_msg:
get_folder_list: $$this->_direct_access_arg_value(folder_list, '.$acctnum.')
dump:<pre>'; print_r($this->_direct_access_arg_value('folder_list', $acctnum));
echo '</pre>'; }
!
! $mailsvr_stream = $this->get_arg_value('mailsvr_stream',
$acctnum);
// check if class dcom reports that the folder list has changed
--- 1613,1617 ----
}
! if ($this->debug_args_special_handlers > 2) { echo 'mail_msg:
get_folder_list: $$this->_direct_access_arg_value(folder_list, '.$acctnum.')
dump:<pre>'; print_r($this->_direct_access_arg_value('folder_list', $acctnum));
echo '</pre>'; }
// check if class dcom reports that the folder list has changed
***************
*** 1723,1727 ****
// Establish Email Server Connectivity Information
! $server_str = $this->get_arg_value('mailsvr_callstr', $acctnum);
$name_space = $this->get_arg_value('mailsvr_namespace',
$acctnum);
$delimiter = $this->get_arg_value('mailsvr_delimiter',
$acctnum);
--- 1729,1734 ----
// Establish Email Server Connectivity Information
! $mailsvr_stream = $this->get_arg_value('mailsvr_stream',
$acctnum);
! $mailsvr_callstr = $this->get_arg_value('mailsvr_callstr',
$acctnum);
$name_space = $this->get_arg_value('mailsvr_namespace',
$acctnum);
$delimiter = $this->get_arg_value('mailsvr_delimiter',
$acctnum);
***************
*** 1742,1746 ****
// UWash will consider it relative to the mailuser's
$HOME property as with "emails/*" (DOES THIS WORK ON ALL PLATFORMS??)
// BUT we use <tilde><slash> "~/" if no namespace is
given
! $mailboxes =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$server_str, "$name_space" ."$delimiter" ."*");
// UWASH IMAP returns information in this format:
// {SERVER_NAME:PORT}FOLDERNAME
--- 1749,1753 ----
// UWash will consider it relative to the mailuser's
$HOME property as with "emails/*" (DOES THIS WORK ON ALL PLATFORMS??)
// BUT we use <tilde><slash> "~/" if no namespace is
given
! $mailboxes =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$mailsvr_callstr, "$name_space" ."$delimiter" ."*");
// UWASH IMAP returns information in this format:
// {SERVER_NAME:PORT}FOLDERNAME
***************
*** 1757,1765 ****
// so - it's safe to include the delimiter here, but
the INBOX will not be included in the list
// this is typically the ONLY TIME you would ever *not*
use the delimiter between the namespace and what comes after it
! //$mailboxes =
$this->a[$acctnum]['dcom']->listmailbox($mailsvr_stream, $server_str,
"$name_space" ."*");
// UPDATED information of this issue: to get shared
folders included in the return, better NOT include the "." delimiter
// example: Cyrus does not like anything but a "*" as
the pattern IF you want shared folders returned.
! //$mailboxes =
$tmp_a['dcom']->listmailbox($mailsvr_stream, $server_str, "*");
! $mailboxes =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$server_str, "*");
// returns information in this format:
// {SERVER_NAME:PORT} NAMESPACE DELIMITER FOLDERNAME
--- 1764,1772 ----
// so - it's safe to include the delimiter here, but
the INBOX will not be included in the list
// this is typically the ONLY TIME you would ever *not*
use the delimiter between the namespace and what comes after it
! //$mailboxes =
$this->a[$acctnum]['dcom']->listmailbox($mailsvr_stream, $mailsvr_callstr,
"$name_space" ."*");
// UPDATED information of this issue: to get shared
folders included in the return, better NOT include the "." delimiter
// example: Cyrus does not like anything but a "*" as
the pattern IF you want shared folders returned.
! //$mailboxes =
$tmp_a['dcom']->listmailbox($mailsvr_stream, $mailsvr_callstr, "*");
! $mailboxes =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$mailsvr_callstr, "*");
// returns information in this format:
// {SERVER_NAME:PORT} NAMESPACE DELIMITER FOLDERNAME
***************
*** 1808,1812 ****
if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_folder_list: adding INBOX to mailboxes data<br>'; }
// use the same "fully qualified" folder name format
that "listmailbox" returns, includes the {serverName:port}
! $add_inbox = $server_str.'INBOX';
$next_available = count($mailboxes);
// add it to the $mailboxes array
--- 1815,1819 ----
if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_folder_list: adding INBOX to mailboxes data<br>'; }
// use the same "fully qualified" folder name format
that "listmailbox" returns, includes the {serverName:port}
! $add_inbox = $mailsvr_callstr.'INBOX';
$next_available = count($mailboxes);
// add it to the $mailboxes array
Index: class.mail_msg_display.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_display.inc.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** class.mail_msg_display.inc.php 9 Jan 2002 10:55:29 -0000 1.28
--- class.mail_msg_display.inc.php 10 Jan 2002 10:04:41 -0000 1.29
***************
*** 67,73 ****
$debug_widget = False;
// establish fallback default args
$local_args = Array(
! 'mailsvr_stream' =>
$this->get_arg_value('mailsvr_stream'),
'pre_select_folder' => '',
'skip_folder' => '',
--- 67,75 ----
$debug_widget = False;
+ $acctnum = $this->get_acctnum();
// establish fallback default args
$local_args = Array(
! 'acctnum' => $acctnum,
! 'mailsvr_stream' =>
$this->get_arg_value('mailsvr_stream', $acctnum),
'pre_select_folder' => '',
'skip_folder' => '',
Index: class.uiindex.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uiindex.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.uiindex.inc.php 3 Jan 2002 10:03:28 -0000 1.14
--- class.uiindex.inc.php 10 Jan 2002 10:04:41 -0000 1.15
***************
*** 256,259 ****
--- 256,265 ----
'accounts_txt' =>
$this->bo->xi['accounts_txt'],
'accounts_link' =>
$this->bo->xi['accounts_link'],
+ 'accounts_href' =>
$this->bo->xi['accounts_href'],
+
+ 'ctrl_bar_current_acctnum' =>
$this->bo->xi['ctrl_bar_current_acctnum'],
+ 'ctrl_bar_acct_0_link' =>
$this->bo->xi['ctrl_bar_acct_0_link'],
+ 'ctrl_bar_acct_1_link' =>
$this->bo->xi['ctrl_bar_acct_1_link'],
+
'ctrl_bar_back1' =>
$this->bo->xi['ctrl_bar_back1'],
'sortbox_action' =>
$this->bo->xi['sortbox_action'],
Index: class.uipreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uipreferences.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.uipreferences.inc.php 28 Dec 2001 07:19:36 -0000 1.7
--- class.uipreferences.inc.php 10 Jan 2002 10:04:41 -0000 1.8
***************
*** 1,21 ****
<?php
! /**************************************************************************\
! * phpGroupWare - E-Mail *
! * http://www.phpgroupware.org *
! * Based on Aeromail by Mark Cushman <address@hidden> *
! * http://the.cushman.net/ *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
class uipreferences
{
var $public_functions = array(
! 'preferences' => True
);
--- 1,22 ----
<?php
!
/**************************************************************************\
! * phpGroupWare - E-Mail
*
! * http://www.phpgroupware.org
*
! * Based on Aeromail by Mark Cushman <address@hidden>
*
! * http://the.cushman.net/
*
! * --------------------------------------------
*
! * This program is free software; you can redistribute it and/or modify
it *
! * under the terms of the GNU General Public License as published by
the *
! * Free Software Foundation; either version 2 of the License, or (at
your *
! * option) any later version.
*
!
\**************************************************************************/
!
! /* $Id$ */
!
class uipreferences
{
var $public_functions = array(
! 'preferences' => True,
! 'ex_accounts' => True
);
***************
*** 48,58 ****
this function generates TR's from that data, using elements
"id", "widget", "other_props",
"lang_blurb", and "values" from that array structure. This
function uses that data to fill
! a template block that contatains the requested widget and the
appropriate data. <br>
! Available HTML widgets are: <br>
! * textarea <br>
! * textbox <br>
! * passwordbox <br>
! * combobox <br>
! * checkbox <br>
If prefs data "other_props" contains "hidden", as with password
data, then the actual
preference value is not shown and the "text blurb" is appended
with "(hidden)".
--- 49,59 ----
this function generates TR's from that data, using elements
"id", "widget", "other_props",
"lang_blurb", and "values" from that array structure. This
function uses that data to fill
! a template block that contatains the requested widget and the
appropriate data.
! Available HTML widgets are:
! * textarea
! * textbox
! * passwordbox
! * combobox
! * checkbox
If prefs data "other_props" contains "hidden", as with password
data, then the actual
preference value is not shown and the "text blurb" is appended
with "(hidden)".
***************
*** 72,77 ****
--- 73,96 ----
return $return_block;
}
+
// initialial backcolor, will be alternated between
row_on and row_off
$back_color = $this->theme['row_off'];
+
+ // what existing user preferences data do we use to
retrieve what the user has already saved for a particular pref
+ if (($this->bo->account_group == 'extra_accounts')
+ && (isset($this->bo->acctnum)))
+ {
+ // 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'];
+ }
+ else
+ {
+ // 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);
// --- Prefs Loops ---
***************
*** 79,82 ****
--- 98,126 ----
{
$this_item = $feed_prefs[$i];
+
+ // ---- do not show logic ----
+ // do we show this for "default" account and/or
"extra_accounts"
+ if (($this->bo->account_group == 'default')
+ && (!stristr($this_item['accts_usage'] ,
'default')))
+ {
+ // we are not supposed to show this
item for the default account, skip this pref item
+ // 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
+ continue;
+ }
+ elseif (($this->bo->account_group ==
'extra_accounts')
+ && (!stristr($this_item['accts_usage'] ,
'extra_accounts')))
+ {
+ // we are not supposed to show this
item for extra accounts, skip this pref item
+ continue;
+ }
+ elseif (strstr($this_item['type'] , 'INACTIVE'))
+ {
+ // this item has been depreciated or
otherwise no longer is being used
+ // we are not supposed to show this
item, skip this pref item
+ continue;
+ }
+
+ // ---- ok to show this, continue... ----
$back_color =
$this->nextmatchs->alternate_row_color($back_color);
***************
*** 84,92 ****
'back_color' => $back_color,
'lang_blurb' =>
$this_item['lang_blurb'],
- 'pref_id' => $this_item['id'],
'extra_text' => ''
);
$GLOBALS['phpgw']->template->set_var($var);
// DEBUG
// echo 'pref item loop ['.$i.']: ';
var_dump($this_item); echo '<br><br>';
--- 128,148 ----
'back_color' => $back_color,
'lang_blurb' =>
$this_item['lang_blurb'],
'extra_text' => ''
);
$GLOBALS['phpgw']->template->set_var($var);
+ // this will be the HTTP_POST_VARS[*key*] key
value, the "id" for the submitted pref item
+ if ($this->bo->account_group == 'default')
+ {
+
$GLOBALS['phpgw']->template->set_var('pref_id', $this_item['id']);
+ }
+ else
+ {
+ // modify the items id in the html form
so it contains info about thich acctnum it applies to
+ //$html_pref_id =
'1['.$this_item['id'].']';
+ $html_pref_id =
'1['.$this_item['id'].']';
+
$GLOBALS['phpgw']->template->set_var('pref_id', $html_pref_id);
+ }
+
// DEBUG
// echo 'pref item loop ['.$i.']: ';
var_dump($this_item); echo '<br><br>';
***************
*** 95,99 ****
if (!stristr($this_item['write_props'],
'hidden'))
{
! $this_item_value =
$this->prefs[$this_item['id']];
}
else
--- 151,155 ----
if (!stristr($this_item['write_props'],
'hidden'))
{
! $this_item_value =
$actual_user_prefs[$this_item['id']];
}
else
***************
*** 114,118 ****
if ($this_item['widget'] == 'textarea')
{
! $this_item_value =
$this->prefs[$this_item['id']];
$GLOBALS['phpgw']->template->set_var('pref_value', $this_item_value);
$GLOBALS['phpgw']->template->parse('V_tr_textarea','B_tr_textarea');
--- 170,174 ----
if ($this_item['widget'] == 'textarea')
{
! $this_item_value =
$actual_user_prefs[$this_item['id']];
$GLOBALS['phpgw']->template->set_var('pref_value', $this_item_value);
$GLOBALS['phpgw']->template->parse('V_tr_textarea','B_tr_textarea');
***************
*** 145,149 ****
}
// fill the pref item in
$combo_availables[this_item_value] to " selected"
!
$combo_available[$this->prefs[$this_item['id']]] = ' selected';
// make the combobox HTML tags string
$combobox_html = '';
--- 201,205 ----
}
// fill the pref item in
$combo_availables[this_item_value] to " selected"
!
$combo_available[$actual_user_prefs[$this_item['id']]] = ' selected';
// make the combobox HTML tags string
$combobox_html = '';
***************
*** 163,167 ****
elseif ($this_item['widget'] == 'checkbox')
{
! if
(isset($this->prefs[$this_item['id']]))
{
$this_item_value = 'checked';
--- 219,223 ----
elseif ($this_item['widget'] == 'checkbox')
{
! if
(isset($actual_user_prefs[$this_item['id']]))
{
$this_item_value = 'checked';
***************
*** 197,200 ****
--- 253,259 ----
function preferences()
{
+ // this tells "create_prefs_block" that we are dealing
with the default email account
+ $this->bo->account_group = 'default';
+
unset($GLOBALS['phpgw_info']['flags']['noheader']);
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
***************
*** 216,219 ****
--- 275,279 ----
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_combobox','V_tr_combobox');
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_checkbox','V_tr_checkbox');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_submit_btn_only','V_submit_btn_only');
$var = Array(
***************
*** 282,288 ****
--- 342,475 ----
// put all widget rows data into the template var
$GLOBALS['phpgw']->template->set_var('prefs_ui_rows',
$prefs_ui_rows);
+
+ // Submit Button only
+
$GLOBALS['phpgw']->template->parse('V_submit_btn_only','B_submit_btn_only');
+ $submit_btn_row =
$GLOBALS['phpgw']->template->get_var('V_submit_btn_only');
+ $GLOBALS['phpgw']->template->set_var('submit_btn_row',
$submit_btn_row);
+
// output the template
$GLOBALS['phpgw']->template->pfp('out','T_prefs_ui_out');
}
+
+ /*!
+ @function ex_accounts
+ @abstract call this function to display the typical UI html
page Extra Email Accounts Preferences
+ @author Angles, skeeter
+ @access Public
+ */
+ function ex_accounts()
+ {
+ // this tells "create_prefs_block" that we are dealing
with the extra email accounts
+ $this->bo->account_group = 'extra_accounts';
+ // FIXME: need a real way to determine this
+ $this->bo->acctnum = 1;
+
+ unset($GLOBALS['phpgw_info']['flags']['noheader']);
+ unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+ $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+ $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
+ $GLOBALS['phpgw']->common->phpgw_header();
+
+ $GLOBALS['phpgw']->template->set_file(
+ Array(
+ 'T_prefs_ui_out' =>
'class_prefs_ui.tpl',
+ 'T_pref_blocks' =>
'class_prefs_blocks.tpl'
+ )
+ );
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_blank','V_tr_blank');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_sec_title','V_tr_sec_title');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_textarea','V_tr_textarea');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_textbox','V_tr_textbox');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_passwordbox','V_tr_passwordbox');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_combobox','V_tr_combobox');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_tr_checkbox','V_tr_checkbox');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_submit_btn_only','V_submit_btn_only');
+
$GLOBALS['phpgw']->template->set_block('T_pref_blocks','B_submit_and_delete_btns','V_submit_and_delete_btns');
+
+ $var = Array(
+ 'pref_errors' => '',
+ 'page_title' => lang('E-Mail
preferences'),
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php',
+ Array(
+ 'menuaction' =>
'email.bopreferences.ex_accounts'
+ )
+ ),
+ 'th_bg' =>
$this->theme['th_bg'],
+ 'left_col_width' => '50%',
+ 'right_col_width' => '50%',
+ 'checked_flag' => 'True',
+ // this says we are submitting extra acount
pref data
+ 'btn_submit_name' =>
$this->bo->submit_token_extra_accounts,
+ 'btn_submit_value' => lang('submit'),
+ 'btn_delete_name' =>
$this->bo->submit_token_delete_ex_account,
+ 'btn_delete_value' => lang('delete
account')
+ );
+ $GLOBALS['phpgw']->template->set_var($var);
+
+ // this will fill the $this->bo->std_prefs[] and
cust_prefs[] "schema" arrays
+ $this->bo->init_available_prefs();
+
+ // DEBUG
+ if ($this->debug)
+ {
+ $this->bo->debug_dump_prefs();
+ //return;
+ }
+
+ // initialize a local var to hold the cumulative main
block data
+ $prefs_ui_rows = '';
+
+ // --- Extra Account Pref Items ---
+ // section title
+ $GLOBALS['phpgw']->template->set_var('section_title',
'*** '.lang('Extra E-Mail Account').' *** '.lang('Number '.$this->bo->acctnum));
+ // parse the block,
+
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
+ // get the parsed data and put into a local variable
+ $done_widget =
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');
+ // add the finished widget row to the main block
variable
+ $prefs_ui_rows .= $done_widget;
+
+ // instructions: fill in everything you need
+ $GLOBALS['phpgw']->template->set_var('section_title',
lang('Please fill in everything you need'));
+ // parse the block,
+
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
+ // get the parsed data and put into a local variable
+ $done_widget =
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');
+ // add the finished widget row to the main block
variable
+ $prefs_ui_rows .= $done_widget;
+
+ // generate Std Prefs HTML Block
+ $prefs_ui_rows .=
$this->create_prefs_block($this->bo->std_prefs);
+
+ // --- Custom Prefs are MANDATORY for extra accounts
---
+ /*
+ // instructions: leave anything blank gives the default
value
+ $GLOBALS['phpgw']->template->set_var('section_title',
lang('For these items, fill only what is different from your default E-Mail
preferences'));
+
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
+ $done_widget =
$GLOBALS['phpgw']->template->get_var('V_tr_sec_title');
+ $prefs_ui_rows .= $done_widget;
+ */
+ // generate Custom Prefs HTML Block
+ $prefs_ui_rows .=
$this->create_prefs_block($this->bo->cust_prefs);
+
+ // blank row
+ $GLOBALS['phpgw']->template->set_var('back_color',
$this->theme['bg_color']);
+
$GLOBALS['phpgw']->template->parse('V_tr_blank','B_tr_blank');
+ $done_widget =
$GLOBALS['phpgw']->template->get_var('V_tr_blank');
+ $prefs_ui_rows .= $done_widget;
+
+ // --- Commit HTML Prefs rows to Main Template
+ // put all widget rows data into the template var
+ $GLOBALS['phpgw']->template->set_var('prefs_ui_rows',
$prefs_ui_rows);
+
+ // Submit Button with Delete Account Data button
+
$GLOBALS['phpgw']->template->parse('V_submit_and_delete_btns','B_submit_and_delete_btns');
+ $submit_btn_row =
$GLOBALS['phpgw']->template->get_var('V_submit_and_delete_btns');
+ $GLOBALS['phpgw']->template->set_var('submit_btn_row',
$submit_btn_row);
+
+ // output the template
+
$GLOBALS['phpgw']->template->pfp('out','T_prefs_ui_out');
+ }
+
}
?>
Index: hook_preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/hook_preferences.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** hook_preferences.inc.php 17 Nov 2001 17:17:30 -0000 1.8
--- hook_preferences.inc.php 10 Jan 2002 10:04:41 -0000 1.9
***************
*** 16,20 ****
$title = $appname;
$file = Array(
! 'E-Mail Preferences' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uipreferences.preferences')
);
//Do not modify below this line
--- 16,21 ----
$title = $appname;
$file = Array(
! 'E-Mail Preferences' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uipreferences.preferences'),
! 'Extra E-Mail Accounts' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uipreferences.ex_accounts')
);
//Do not modify below this line
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: email/inc class.boindex.inc.php,1.17,1.18 class.bopreferences.inc.php,1.9,1.10 class.bosend.inc.php,1.5,1.6 class.mail_msg_base.inc.php,1.56,1.57 class.mail_msg_display.inc.php,1.28,1.29 class.uiindex.inc.php,1.14,1.15 class.uipreferences.inc.php,1.7,1.8 hook_preferences.inc.php,1.8,1.9,
Angelo Tony Puglisi <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: email/templates/default class_prefs_blocks.tpl,1.1,1.2 class_prefs_ui.tpl,1.1,1.2 index_main_b0_l2.tpl,1.12,1.13
- Next by Date:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.preferences.inc.php,1.40,1.41
- Previous by thread:
[Phpgroupware-cvs] CVS: email/templates/default class_prefs_blocks.tpl,1.1,1.2 class_prefs_ui.tpl,1.1,1.2 index_main_b0_l2.tpl,1.12,1.13
- Next by thread:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.preferences.inc.php,1.40,1.41
- Index(es):