summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/addressbook/import.inc7
-rw-r--r--program/steps/mail/autocomplete.inc5
-rw-r--r--program/steps/mail/compose.inc63
-rw-r--r--program/steps/mail/func.inc5
-rw-r--r--program/steps/mail/import.inc2
-rw-r--r--program/steps/mail/search.inc1
-rw-r--r--program/steps/settings/func.inc9
7 files changed, 49 insertions, 43 deletions
diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index 33e473242..5dee5c06a 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -308,10 +308,11 @@ function rcmail_import_buttons($attrib)
$out = $OUTPUT->button(array('command' => 'list', 'prop' => $target, 'label' => 'done') + $attrib);
}
else {
- $out = $OUTPUT->button(array('command' => 'list', 'label' => 'cancel') + $attrib);
- $out .= ' ';
+ $cancel = $OUTPUT->button(array('command' => 'list', 'label' => 'cancel') + $attrib);
$attrib['class'] = trim($attrib['class'] . ' mainaction');
- $out .= $OUTPUT->button(array('command' => 'import', 'label' => 'import') + $attrib);
+ $out = $OUTPUT->button(array('command' => 'import', 'label' => 'import') + $attrib);
+ $out .= ' ';
+ $out .= $cancel;
}
return $out;
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index c15de92cf..20cf94084 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -90,7 +90,7 @@ if (!empty($book_types) && strlen($search)) {
// skip duplicates
if (!in_array($contact, $contacts)) {
- $contacts[] = $contact;
+ $contacts[] = array('name' => $contact, 'type' => $sql_arr['_type']);
$sort_keys[] = sprintf('%s %03d', $sql_arr['name'] , $idx++);
if (count($contacts) >= $MAXNUM) {
@@ -118,7 +118,7 @@ if (!empty($book_types) && strlen($search)) {
if ($group_prop['email']) {
$idx = 0;
foreach ((array)$group_prop['email'] as $email) {
- $contacts[] = format_email_recipient($email, $group['name']);
+ $contacts[] = array('name' => format_email_recipient($email, $group['name']), 'type' => 'group');
$sort_keys[] = sprintf('%s %03d', $group['name'] , $idx++);
if (count($contacts) >= $MAXNUM) {
@@ -131,6 +131,7 @@ if (!empty($book_types) && strlen($search)) {
$sort_keys[] = $group['name'];
$contacts[] = array(
'name' => $group['name'] . ' (' . intval($result->count) . ')',
+ 'type' => 'group',
'id' => $group['ID'],
'source' => $id
);
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 8504d026c..46280292e 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -62,36 +62,6 @@ if (!is_array($COMPOSE)) {
rcmail_process_compose_params($COMPOSE);
- // add attachments listed by message_compose hook
- if (is_array($plugin['attachments'])) {
- foreach ($plugin['attachments'] as $attach) {
- // we have structured data
- if (is_array($attach)) {
- $attachment = $attach;
- }
- // only a file path is given
- else {
- $filename = basename($attach);
- $attachment = array(
- 'group' => $COMPOSE_ID,
- 'name' => $filename,
- 'mimetype' => rcube_mime::file_content_type($attach, $filename),
- 'path' => $attach,
- );
- }
-
- // save attachment if valid
- if (($attachment['data'] && $attachment['name']) || ($attachment['path'] && file_exists($attachment['path']))) {
- $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
- }
-
- if ($attachment['status'] && !$attachment['abort']) {
- unset($attachment['data'], $attachment['status'], $attachment['abort']);
- $COMPOSE['attachments'][$attachment['id']] = $attachment;
- }
- }
- }
-
// check if folder for saving sent messages exists and is subscribed (#1486802)
if ($sent_folder = $COMPOSE['param']['sent_mbox']) {
rcmail_check_sent_folder($sent_folder, true);
@@ -111,7 +81,8 @@ $OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubj
'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage',
'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'uploadingmany',
'fileuploaderror', 'sendmessage', 'savenewresponse', 'responsename', 'responsetext', 'save',
- 'savingresponse', 'restoresavedcomposedata', 'restoremessage', 'delete', 'restore', 'ignore');
+ 'savingresponse', 'restoresavedcomposedata', 'restoremessage', 'delete', 'restore', 'ignore',
+ 'selectimportfile');
$OUTPUT->set_pagetitle($RCMAIL->gettext('compose'));
@@ -498,6 +469,36 @@ function rcmail_process_compose_params(&$COMPOSE)
// pipe compose parameters thru plugins
$plugin = $RCMAIL->plugins->exec_hook('message_compose', $COMPOSE);
$COMPOSE['param'] = array_merge($COMPOSE['param'], $plugin['param']);
+
+ // add attachments listed by message_compose hook
+ if (is_array($plugin['attachments'])) {
+ foreach ($plugin['attachments'] as $attach) {
+ // we have structured data
+ if (is_array($attach)) {
+ $attachment = $attach;
+ }
+ // only a file path is given
+ else {
+ $filename = basename($attach);
+ $attachment = array(
+ 'group' => $COMPOSE_ID,
+ 'name' => $filename,
+ 'mimetype' => rcube_mime::file_content_type($attach, $filename),
+ 'path' => $attach,
+ );
+ }
+
+ // save attachment if valid
+ if (($attachment['data'] && $attachment['name']) || ($attachment['path'] && file_exists($attachment['path']))) {
+ $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
+ }
+
+ if ($attachment['status'] && !$attachment['abort']) {
+ unset($attachment['data'], $attachment['status'], $attachment['abort']);
+ $COMPOSE['attachments'][$attachment['id']] = $attachment;
+ }
+ }
+ }
}
function rcmail_compose_headers($attrib)
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 9d7aa30cf..072ee716c 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -37,7 +37,7 @@ if (!empty($_GET['_page'])) {
$a_threading = $RCMAIL->config->get('message_threading', array());
$message_sort_col = $RCMAIL->config->get('message_sort_col');
-$message_sort_order = $RCMAIL->config->get('message_sort_col');
+$message_sort_order = $RCMAIL->config->get('message_sort_order');
// set default sort col/order to session
if (!isset($_SESSION['sort_col'])) {
@@ -124,7 +124,7 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
if (!$OUTPUT->ajax_call) {
$OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',
'movingmessage', 'copyingmessage', 'deletingmessage', 'markingmessage',
- 'copy', 'move', 'quota', 'replyall', 'replylist', 'importwait');
+ 'copy', 'move', 'quota', 'replyall', 'replylist');
}
$pagetitle = $RCMAIL->localize_foldername($RCMAIL->storage->mod_folder($mbox_name), true);
@@ -2070,6 +2070,7 @@ function rcmail_message_import_form($attrib = array())
$content);
$RCMAIL->output->add_gui_object('importform', $attrib['id'].'Frm');
+ $RCMAIL->output->add_label('selectimportfile','importwait');
return html::div($attrib, $out);
}
diff --git a/program/steps/mail/import.inc b/program/steps/mail/import.inc
index 4f822e0e4..5a74feb9f 100644
--- a/program/steps/mail/import.inc
+++ b/program/steps/mail/import.inc
@@ -34,7 +34,6 @@ if (is_array($_FILES['_file'])) {
list($mtype_primary,) = explode('/', rcube_mime::file_content_type($filepath, $_FILES['_file']['name'][$i], $_FILES['_file']['type'][$i]));
if (!in_array($mtype_primary, array('text','message'))) {
- $OUTPUT->show_message('importmessageerror', 'error');
continue;
}
@@ -46,7 +45,6 @@ if (is_array($_FILES['_file'])) {
while ($line !== false && trim($line) == '');
if (!preg_match('/^From\s+-/', $line) && !preg_match('/^[a-z-_]+:\s+.+/i', $line)) {
- $OUTPUT->show_message('importmessageerror', 'error');
continue;
}
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index a80887254..ba8b124a3 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -37,6 +37,7 @@ $filter = rcube_utils::get_input_value('_filter', rcube_utils::INPUT_GET);
$headers = rcube_utils::get_input_value('_headers', rcube_utils::INPUT_GET);
$subject = array();
+$filter = trim($filter);
$search_request = md5($mbox.$filter.$str);
// add list filter string
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 7c36df3b1..307be8c8e 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -376,13 +376,16 @@ function rcmail_user_prefs($current = null)
if ($current) {
$product_name = $RCMAIL->config->get('product_name', 'Roundcube Webmail');
$RCMAIL->output->add_script(sprintf("%s.check_protocol_handler('%s', '#mailtoprotohandler');",
- rcmail_output::JS_OBJECT_NAME, rcube::JQ($product_name)), 'foot');
+ rcmail_output::JS_OBJECT_NAME, rcube::JQ($product_name)), 'docready');
}
$blocks['browser']['options']['mailtoprotohandler'] = array(
'content' => html::a(array(
- 'href' => '#',
- 'id' => 'mailtoprotohandler'), rcube::Q($RCMAIL->gettext('mailtoprotohandler'))),
+ 'href' => '#',
+ 'id' => 'mailtoprotohandler'
+ ),
+ rcube::Q($RCMAIL->gettext('mailtoprotohandler'))) .
+ html::span('mailtoprotohandler-status', ''),
);
break;