Redesign of the identities settings + add config option to disable multiple identities

release-0.6
thomascube 16 years ago
parent 3e1e775083
commit f645ce169e

@ -1,6 +1,11 @@
CHANGELOG RoundCube Webmail
---------------------------
2008/09/15 (thomasb)
----------
- Redesign of the identities settings (#1484042)
- Add config option to disable creation/deletion of identities (#1484498)
2008/09/15 (alec)
----------
- Added 'sendmail_delay' option to restrict messages sending interval (#1484491)

@ -298,6 +298,9 @@ $rcmail_config['address_book_type'] = 'sql';
// don't allow these settings to be overriden by the user
$rcmail_config['dont_override'] = array();
// allow users to add and delete sender identities
$rcmail_config['multiple_identities'] = true;
// try to load host-specific configuration
// see http://trac.roundcube.net/wiki/Howto_Config for more details
$rcmail_config['include_host_config'] = false;

@ -106,6 +106,28 @@ class rcube_template extends rcube_html_page
$this->pagetitle = $title;
}
/**
* Getter for the current page title
*
* @return string The page title
*/
public function get_pagetitle()
{
if (!empty($this->pagetitle)) {
$title = $this->pagetitle;
}
else if ($this->env['task'] == 'login') {
$title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name'])));
}
else {
$title = ucfirst($this->env['task']);
}
return $title;
}
/**
* Set skin
*/
@ -357,13 +379,7 @@ class rcube_template extends rcube_html_page
implode(',', $args)
);
}
// add command to set page title
if ($this->ajax_call && !empty($this->pagetitle)) {
$out .= sprintf(
"this.set_pagetitle('%s');\n",
JQ((!empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : '') . $this->pagetitle)
);
}
return $out;
}
@ -455,13 +471,13 @@ class rcube_template extends rcube_html_page
$condition = preg_replace(
array(
'/session:([a-z0-9_]+)/i',
'/config:([a-z0-9_]+)/i',
'/config:([a-z0-9_]+)(:([a-z0-9_]+))?/i',
'/env:([a-z0-9_]+)/i',
'/request:([a-z0-9_]+)/ie'
),
array(
"\$_SESSION['\\1']",
"\$this->config['\\1']",
"\$this->app->config->get('\\1',get_boolean('\\3'))",
"\$this->env['\\1']",
"get_input_value('\\1', RCUVE_INPUT_GPC)"
),
@ -591,20 +607,12 @@ class rcube_template extends rcube_html_page
}
return $ver;
}
if ($object=='steptitle') {
return Q($this->get_pagetitle());
}
if ($object=='pagetitle') {
$task = $this->env['task'];
$title = !empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : '';
if (!empty($this->pagetitle)) {
$title .= $this->pagetitle;
}
else if ($task == 'login') {
$title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name'])));
}
else {
$title .= ucfirst($task);
}
$title .= $this->get_pagetitle();
return Q($title);
}
break;

@ -295,8 +295,10 @@ function rcube_webmail()
case 'settings':
this.enable_command('preferences', 'identities', 'save', 'folders', true);
if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity')
this.enable_command('edit', 'add', 'delete', true);
if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity') {
this.enable_command('add', 'delete', this.env.multiple_identities);
this.enable_command('edit', true);
}
if (this.env.action=='edit-identity' || this.env.action=='add-identity')
this.enable_command('save', true);

@ -85,5 +85,6 @@ $messages['addresswriterror'] = 'Das gewählte Adressbuch kann nicht verändert
$messages['importwait'] = 'Daten werden importiert, bitte warten...';
$messages['importerror'] = 'Import fehlgeschlagen! Die hochgeladene Datei ist nicht im vCard-Format.';
$messages['importconfirm'] = '<b>Es wurden $inserted Adressen erfolgreich importiert und $skipped bestehende Einträge übersprungen</b>:<p><em>$names</em></p>';
$messages['opnotpermitted'] = 'Operation nicht erlaubt!';
?>

@ -85,5 +85,6 @@ $messages['addresswriterror'] = 'Das ausgewählte Adressbuch kann nicht verände
$messages['importwait'] = 'Daten werden importiert, bitte warten...';
$messages['importerror'] = 'Import fehlgeschlagen! Die hochgeladene Datei ist nicht im vCard-Format.';
$messages['importconfirm'] = 'Es wurden $inserted Adressen erfolgreich importiert und $skipped bestehende Einträge übersprungen:$names';
$messages['opnotpermitted'] = 'Operation nicht erlaubt!';
?>

@ -86,5 +86,6 @@ $messages['addresswriterror'] = 'The selected address book is not writeable';
$messages['importwait'] = 'Importing, please wait...';
$messages['importerror'] = 'Import failed! The uploaded file is not a valid vCard file.';
$messages['importconfirm'] = '<b>Successfully imported $inserted contacts, $skipped existing entries skipped</b>:<p><em>$names</em></p>';
$messages['opnotpermitted'] = 'Operation not permitted!';
?>

@ -21,15 +21,18 @@
if (($ids = get_input_value('_iid', RCUBE_INPUT_GET)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $ids))
{
if ($USER->delete_identity($ids))
{
$OUTPUT->show_message('deletedsuccessfully', 'confirmation');
if ($RCMAIL->config->get('multiple_identities', true)) {
if ($USER->delete_identity($ids)) {
$OUTPUT->show_message('deletedsuccessfully', 'confirmation');
}
else {
$OUTPUT->show_message('nodeletelastidentity', 'error');
}
}
else
{
$OUTPUT->show_message('nodeletelastidentity', 'error');
else {
$OUTPUT->show_message('opnotpermitted', 'error');
}
// send response
if ($OUTPUT->ajax_call)
$OUTPUT->send();

@ -21,14 +21,18 @@
$OUTPUT->set_pagetitle(rcube_label('identities'));
if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity')
{
if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') {
$IDENTITY_RECORD = $USER->get_identity(get_input_value('_iid', RCUBE_INPUT_GPC));
if (is_array($IDENTITY_RECORD))
$OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']);
}
}
else if (!$RCMAIL->config->get('multiple_identities', true)) {
$OUTPUT->show_message('opnotpermitted', 'error');
// go to identities page
rcmail_overwrite_action('identities');
return;
}
$OUTPUT->include_script('list.js');
@ -136,6 +140,8 @@ function rcube_identity_form($attrib)
$OUTPUT->add_handler('identityform', 'rcube_identity_form');
$OUTPUT->set_pagetitle(rcube_label(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem')));
if ($RCMAIL->action=='add-identity' && $OUTPUT->template_exists('addidentity'))
$OUTPUT->send('addidentity');

@ -301,7 +301,7 @@ function rcmail_identities_list($attrib)
$attrib['id'] = 'rcmIdentitiesList';
// define list of cols to be displayed
$a_show_cols = array('name', 'email', 'organization', 'reply-to');
$a_show_cols = array('name', 'email');
// create XHTML table
$out = rcube_table_output($attrib, $USER->list_identities(), $a_show_cols, 'identity_id');
@ -366,6 +366,7 @@ function rcmail_get_skins()
return $skins;
}
$OUTPUT->set_env('multiple_identities', $RCMAIL->config->get('multiple_identities', true));
// register UI objects
$OUTPUT->add_handlers(array(

@ -77,7 +77,7 @@ if ($_POST['_iid'])
}
// insert a new identity record
else
else if ($RCMAIL->config->get('multiple_identities', true))
{
if ($insert_id = $USER->insert_identity($save_data))
{
@ -96,6 +96,8 @@ else
return;
}
}
else
$OUTPUT->show_message('opnotpermitted', 'error');
// mark all other identities as 'not-default'

@ -6,12 +6,12 @@
position: absolute;
top: 50px;
left: 220px;
right: 60px;
right: 40px;
height: 22px;
border-bottom: 1px solid #999999;
white-space: nowrap;
/* css hack for IE */
width: expression((parseInt(document.documentElement.clientWidth)-280)+'px');
width: expression((parseInt(document.documentElement.clientWidth)-260)+'px');
}
span.tablink,
@ -87,16 +87,42 @@ span.tablink-selected a
background-color: #FFFFA6;
}
#identities-table
#identities-list
{
width: 600px;
bottom: 60px;
width: 420px;
border: 1px solid #999999;
}
#listbuttons
{
position: absolute;
left: 20px;
bottom: 18px;
}
#identities-table
{
width: 420px;
table-layout: fixed;
background-color: #F9F9F9;
}
#identities-table tbody td
{
cursor: default;
overflow: hidden;
text-overflow: ellipsis;
}
#identities-table thead td.name
{
width: 55%;
}
#identities-table thead td.email
{
width: 45%;
}
#identity-frame
@ -108,9 +134,16 @@ span.tablink-selected a
#identity-details
{
margin-top: 30px;
width: 600px;
position: absolute;
top: 95px;
left: 450px;
right: 40px;
bottom: 60px;
border: 1px solid #999999;
overflow: auto;
/* css hack for IE */
width: expression((parseInt(document.documentElement.clientWidth)-490)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-160)+'px');
}
#identity-details table td.title

@ -1,36 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/settings.css" />
</head>
<body>
<roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" />
<roundcube:include file="/includes/settingstabs.html" />
<div id="identities-list">
<roundcube:object name="identitiesList" id="identities-table" class="records-table" cellspacing="0" summary="Identities list" editIcon="" />
<p><roundcube:button command="add" type="input" label="newidentity" class="button" /></p>
<div id="identity-details">
<div id="identity-title"><roundcube:label name="newidentity" /></div>
<div style="padding:15px;">
<roundcube:object name="identityform" size="40" />
<p><br />
<roundcube:button command="save" type="input" class="button" label="save" />
</p>
</div>
</div>
</div>
<roundcube:include file="/includes/settingscripts.html" />
</body>
</html>

@ -14,22 +14,24 @@
<div id="identities-list">
<roundcube:object name="identitiesList" id="identities-table" class="records-table" cellspacing="0" summary="Identities list" editIcon="" />
</div>
<p><roundcube:button command="add" type="input" label="newidentity" class="button" /></p>
<p id="listbuttons">
<roundcube:button command="add" type="input" label="newidentity" class="button" condition="config:multiple_identities:true" />
</p>
<div id="identity-details">
<div id="identity-title"><roundcube:label name="edititem" /></div>
<div id="identity-title"><roundcube:object name="steptitle" /></div>
<div style="padding:15px;">
<roundcube:object name="identityform" size="40" />
<p><br />
<roundcube:button command="delete" type="input" class="button" label="delete" />&nbsp;
<roundcube:button command="delete" type="input" class="button" label="delete" condition="env:action=='edit-identity'&&config:multiple_identities:true" style="margin-right:0.5em" />
<roundcube:button command="save" type="input" class="button mainaction" label="save" />
</p>
</div>
</div>
</div>
<roundcube:include file="/includes/settingscripts.html" />

@ -13,8 +13,16 @@
<div id="identities-list">
<roundcube:object name="identitiesList" id="identities-table" class="records-table" cellspacing="0" summary="Identities list" editIcon="" />
</div>
<p id="listbuttons">
<roundcube:button command="add" type="input" label="newidentity" class="button" condition="config:multiple_identities:true" />
</p>
<p><roundcube:button command="add" type="input" label="newidentity" class="button" /></p>
<div id="identity-details">
<div style="margin:10px auto; text-align:center">
<img src="/images/rcube_watermark.png" width="245" height="245" alt="RoundCube" />
</div>
</div>
<roundcube:include file="/includes/settingscripts.html" />

Loading…
Cancel
Save