_transfer: function(actID)
{
- var newFolder, tmbox;
+ var newFolder, target, tmbox;
if (this.anySelected()) {
+ target = $F('targetMailbox1');
tmbox = $('targetMbox');
- tmbox.setValue($F('targetMailbox1'));
+ tmbox.setValue(target);
// Check for a mailbox actually being selected.
- if ($F(tmbox) == "\0create") {
+ if (target == "\0create") {
newFolder = prompt(IMP.text.newfolder, '');
if (newFolder != null && newFolder != '') {
$('newMbox').setValue(1);
tmbox.setValue(newFolder);
this.submit(actID);
}
+ } else if (target.empty()) {
+ alert(IMP.text.target_mbox);
+ } else if (target.startsWith("\0notepad_") ||
+ target.startsWith("\0tasklist_")) {
+ this.actIDconfirm = actID;
+ IMPDialog.display({
+ cancel_text: IMP.text.no,
+ form_id: 'RB_ImpMailboxConfirm',
+ noinput: true,
+ ok_text: IMP.text.yes,
+ text: IMP.text.moveconfirm
+ });
} else {
- if ($F(tmbox) == '') {
- alert(IMP.text.target_mbox);
- } else {
- this.submit(actID);
- }
+ this.submit(actID);
}
} else {
alert(IMP.text.mailbox_selectone);
});
document.observe('IMPDialog:onClick', function(e) {
- if (e.element().identify() == 'RB_ImpMailbox') {
+ switch (e.element().identify()) {
+ case 'RB_ImpMailbox':
window.location = this.lastclick;
+ break;
+
+ case 'RB_ImpMailboxConfirm':
+ this.submit(this.actIDconfirm);
+ break;
}
}.bindAsEventListener(ImpMailbox));
_transfer: function(actID)
{
- var newFolder, tmbox = $('targetMbox');
- tmbox.setValue($F('target1'));
+ var newFolder,
+ target = $F('target1'),
+ tmbox = $('targetMbox');
+
+ tmbox.setValue(target);
// Check for a mailbox actually being selected.
- if ($F(tmbox) == "\0create") {
+ if (target == "\0create") {
newFolder = window.prompt(IMP.text.newfolder, '');
if (newFolder != null && newFolder != '') {
$('newMbox').setValue(1);
tmbox.setValue(newFolder);
this.submit(actID);
}
+ } else if (target.empty()) {
+ window.alert(IMP.text.target_mbox);
+ } else if (target.startsWith("\0notepad_") ||
+ target.startsWith("\0tasklist_")) {
+ this.actIDconfirm = actID;
+ IMPDialog.display({
+ cancel_text: IMP.text.no,
+ form_id: 'RB_ImpMessageConfirm',
+ noinput: true,
+ ok_text: IMP.text.yes,
+ text: IMP.text.moveconfirm
+ });
} else {
- if (!$F(tmbox)) {
- window.alert(IMP.text.target_mbox);
- } else {
- this.submit(actID);
- }
+ this.submit(actID);
}
},
};
document.observe('dom:loaded', ImpMessage.onDomLoad.bind(ImpMessage));
+
+document.observe('IMPDialog:onClick', function(e) {
+ switch (e.element().identify()) {
+ case 'RB_ImpMessageConfirm':
+ this.submit(this.actIDconfirm);
+ break;
+ }
+}.bindAsEventListener(ImpMessage));
? $imp_search->createSearchID($search_mbox)
: null;
-horde::addInlineScript(array(
+Horde::addInlineScript(array(
'ImpMailbox.unread = ' . intval($unread)
));
Horde::addScriptFile('effects.js', 'horde');
Horde::addScriptFile('imp.js', 'imp');
Horde::addScriptFile('message.js', 'imp');
+
+if ($conf['tasklist']['use_notepad'] || $conf['tasklist']['use_tasklist']) {
+ Horde::addScriptFile('dialog.js', 'imp');
+ Horde::addScriptFile('redbox.js', 'horde');
+}
+
IMP::prepareMenu();
Horde::noDnsPrefetch();
'login_password' => _("Please provide your password."),
/* Strings used in multiple pages. */
+ 'moveconfirm' => _("Are you sure you want to move the message(s)? (Some message information might get lost, like message headers, text formatting or attachments!)"),
'spam_report' => _("Are you sure you wish to report this message as spam?"),
'notspam_report' => _("Are you sure you wish to report this message as innocent?"),
'newfolder' => _("You are copying/moving to a new folder.") . "\n" . _("Please enter a name for the new folder:") . "\n",