Fix subscription checkbox state on error in folder subscribe/unsubscribe action (#5243)

pull/5754/head
Aleksander Machniak 9 years ago
parent 533af8784e
commit 92df79b37b

@ -18,6 +18,7 @@ CHANGELOG Roundcube Webmail
- Fix handling of --delete argument in moduserprefs.sh script (#5296)
- Workaround PHP issue by calling closelog() on script shutdown when using log_driver=syslog (#5289)
- Fix so upgrade script makes sure program/lib directory does not contain old libraries (#5287)
- Fix subscription checkbox state on error in folder subscribe/unsubscribe action (#5243)
RELEASE 1.2.0
-------------

@ -6856,6 +6856,14 @@ function rcube_webmail()
$('input[name="_subscribed[]"]:first', row).prop('disabled', true);
};
// resets state of subscription checkbox (e.g. on error)
this.reset_subscription = function(folder, state)
{
var row = this.subscription_list.get_item(folder, true);
if (row)
$('input[name="_subscribed[]"]:first', row).prop('checked', state);
};
this.folder_size = function(folder)
{
var lock = this.set_busy(true, 'loading');

@ -50,8 +50,10 @@ if ($RCMAIL->action == 'subscribe') {
$OUTPUT->show_message('foldersubscribed', 'confirmation');
}
else
else {
$RCMAIL->display_server_error('errorsaving');
$OUTPUT->command('reset_subscription', $mbox, false);
}
}
}
// unsubscribe mailbox
@ -60,10 +62,14 @@ else if ($RCMAIL->action == 'unsubscribe') {
if (strlen($mbox)) {
$result = $STORAGE->unsubscribe(array($mbox));
if ($result)
if ($result) {
$OUTPUT->show_message('folderunsubscribed', 'confirmation');
else
}
else {
$RCMAIL->display_server_error('errorsaving');
$OUTPUT->command('reset_subscription', $mbox, true);
}
}
}
// delete an existing mailbox

Loading…
Cancel
Save