Our users really don't like the way the Compose-in-new-window feature
works. When they hit send or save or cancel (Quicksave plugin
installed) or "save draft", they want the window to go away unless there
was an actual error. They don't want to see another compose window or
(as sometimes happens) an extra message list.
I've done patches for the Quicksave plugin and for src/compose.php in
the current stable cvs, which fix this.
--
Bruce
--- setup.orig 2002-11-12 17:49:52.000000000 +0000
+++ setup.php 2002-11-12 17:55:42.000000000 +0000
@@ -62,10 +62,14 @@
{
// we need this to send us back to the right mailbox or message ;)
- global $mailbox, $sort, $reply_id, $forward_id;
+ global $mailbox, $sort, $reply_id, $forward_id, $compose_new_win;
+ // if they're composing in a new window...
+ if ( $compose_new_win == '1' ) {
+ $quick_save_return_url = '::CLOSE::';
+ }
// if they're forwarding an email...
- if ( $forward_id > 0 )
+ elseif ( $forward_id > 0 )
{
$quick_save_return_url = 'read_body.php'
. '?passed_id=' . $forward_id
@@ -216,7 +220,14 @@
{
document.QSstopsign.mailsent.value = 1;
QuickSave_clear_storage();
- document.location = message_list;
+ if ( message_list == "::CLOSE::" )
+ {
+ return window.close();
+ }
+ else
+ {
+ document.location = message_list;
+ }
}
return true;
--- compose.orig 2002-11-12 18:12:58.000000000 +0000
+++ compose.php 2002-11-12 18:12:24.000000000 +0000
@@ -661,10 +661,20 @@
}
if ($saved_draft == 'yes') {
- echo '<BR><CENTER><B>'. _("Draft Saved").'</CENTER></B>';
+ if ($compose_new_win == '1') {
+ echo '<script language="javascript" type="text/javascript"> alert("'.
+ _("Draft Saved").
+ '"); window.close();</script>';
+ } else {
+ echo '<BR><CENTER><B>'. _("Draft Saved").'</CENTER></B>';
+ }
}
if ($mail_sent == 'yes') {
- echo '<BR><CENTER><B>'. _("Your Message has been sent").'</CENTER></B>';
+ if ($compose_new_win == '1') {
+ echo '<script language="javascript" type="text/javascript">
+window.close();</script>';
+ } else {
+ echo '<BR><CENTER><B>'. _("Your Message has been sent").'</CENTER></B>';
+ }
}
echo '<TABLE WIDTH="100%" ALIGN=center CELLSPACING=0 BORDER=0>' . "\n";
if ($compose_new_win == '1') {