summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-12-03 16:54:12 +0000
committerthomascube <thomas@roundcube.net>2005-12-03 16:54:12 +0000
commit1cded85790206afe084e1baff371c543711b2b18 (patch)
treeb050fb89707e048df5f30f500faad792962a1e81 /program/steps/settings
parent5bc8cb662fc3bcda9aa641b7a5e88c0b81dd63d6 (diff)
Re-design of caching (new database table added\!); some bugfixes; Postgres support
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/delete_identity.inc2
-rw-r--r--program/steps/settings/edit_identity.inc5
-rw-r--r--program/steps/settings/func.inc4
-rw-r--r--program/steps/settings/manage_folders.inc15
-rw-r--r--program/steps/settings/save_identity.inc12
5 files changed, 24 insertions, 14 deletions
diff --git a/program/steps/settings/delete_identity.inc b/program/steps/settings/delete_identity.inc
index 3bca860b3..b8f9f526c 100644
--- a/program/steps/settings/delete_identity.inc
+++ b/program/steps/settings/delete_identity.inc
@@ -24,7 +24,7 @@ $REMOTE_REQUEST = $_GET['_remote'] ? TRUE : FALSE;
if ($_GET['_iid'])
{
$DB->query("UPDATE ".get_table_name('identities')."
- SET del='1'
+ SET del=1
WHERE user_id=?
AND identity_id IN (".$_GET['_iid'].")",
$_SESSION['user_id']);
diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc
index 6649c209a..07cd8fa02 100644
--- a/program/steps/settings/edit_identity.inc
+++ b/program/steps/settings/edit_identity.inc
@@ -25,7 +25,7 @@ if (($_GET['_iid'] || $_POST['_iid']) && $_action=='edit-identity')
$DB->query("SELECT * FROM ".get_table_name('identities')."
WHERE identity_id=?
AND user_id=?
- AND del<>'1'",
+ AND del<>1",
$id,
$_SESSION['user_id']);
@@ -63,7 +63,8 @@ function rcube_identity_form($attrib)
'organization' => array('type' => 'text'),
'reply-to' => array('type' => 'text', 'label' => 'replyto'),
'bcc' => array('type' => 'text'),
- 'default' => array('type' => 'checkbox', 'label' => 'setdefault'));
+ 'signature' => array('type' => 'textarea'),
+ 'standard' => array('type' => 'checkbox', 'label' => 'setdefault'));
// a specific part is requested
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 01b692395..b33f8d434 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -146,9 +146,9 @@ function rcmail_identities_list($attrib)
// get contacts from DB
$sql_result = $DB->query("SELECT * FROM ".get_table_name('identities')."
- WHERE del<>'1'
+ WHERE del<>1
AND user_id=?
- ORDER BY ".$DB->quoteIdentifier('default')." DESC, name ASC",
+ ORDER BY standard DESC, name ASC",
$_SESSION['user_id']);
diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc
index 04b2a461e..33d83dfff 100644
--- a/program/steps/settings/manage_folders.inc
+++ b/program/steps/settings/manage_folders.inc
@@ -69,10 +69,15 @@ else if ($_action=='create-folder')
else if ($_action=='delete-folder')
{
if (strlen($_GET['_mboxes']))
- $IMAP->delete_mailbox(explode(',', $_GET['_mboxes']));
+ $deleted = $IMAP->delete_mailbox(explode(',', $_GET['_mboxes']));
- if ($_GET['_remote'])
- rcube_remote_response('// deleted');
+ if ($_GET['_remote'] && $deleted)
+ rcube_remote_response(sprintf("this.remove_folder_row('%s')", rep_specialchars_output($_GET['_mboxes'], 'js')));
+ else if ($_GET['_remote'])
+ {
+ $commands = show_message('errorsaving', 'error');
+ rcube_remote_response($commands);
+ }
}
@@ -174,5 +179,9 @@ function rcube_create_folder_form($attrib)
}
+// add some labels to client
+rcube_add_label('deletefolderconfirm');
+
+
parse_template('managefolders');
?> \ No newline at end of file
diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc
index 2e42987bf..dc61b7875 100644
--- a/program/steps/settings/save_identity.inc
+++ b/program/steps/settings/save_identity.inc
@@ -19,7 +19,7 @@
*/
-$a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'default');
+$a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature');
// check input
@@ -51,7 +51,7 @@ if ($_POST['_iid'])
SET ".join(', ', $a_write_sql)."
WHERE identity_id=?
AND user_id=?
- AND del<>'1'",
+ AND del<>1",
$_POST['_iid'],
$_SESSION['user_id']);
@@ -64,10 +64,10 @@ if ($_POST['_iid'])
// mark all other identities as 'not-default'
$DB->query("UPDATE ".get_table_name('identities')."
- SET ".$DB->quoteIdentifier('default')."='0'
+ SET ".$DB->quoteIdentifier('standard')."='0'
WHERE user_id=?
AND identity_id<>?
- AND del<>'1'",
+ AND del<>1",
$_SESSION['user_id'],
$_POST['_iid']);
@@ -106,8 +106,8 @@ else
(user_id, ".join(', ', $a_insert_cols).")
VALUES (?, ".join(', ', $a_insert_values).")",
$_SESSION['user_id']);
-
- $insert_id = $DB->insert_id();
+
+ $insert_id = $DB->insert_id(get_sequence_name('identities'));
}
if ($insert_id)