Add ability to cancel emails in the queue to be sent

This commit is contained in:
james 2010-02-11 15:58:26 +00:00
parent e077912d9e
commit d8375c0c5f
4 changed files with 16 additions and 1 deletions

View File

@ -616,6 +616,14 @@ case "email_get_list":
}
echo "</table>";
exit;
case 'cancel':
if($_GET['cancel']) {
mysql_query("UPDATE emailqueue SET finished=NOW() WHERE id='".intval($_GET['cancel'])."'");
mysql_query("UPDATE emailqueue_recipients SET result='cancelled' WHERE emailqueue_id='".intval($_GET['cancel'])."' AND sent IS NULL AND result IS NULL");
echo "ok";
}
exit;
}
include "communication.inc.php";

View File

@ -48,6 +48,7 @@
echo " <th>".i18n("Progress")."</th>\n";
echo " <th>".i18n("Duration")."</th>\n";
echo " <th>".i18n("ETA")."</th>\n";
echo " <th>".i18n("Cancel")."</th>\n";
echo "</tr>\n";
while($r=mysql_fetch_object($q)) {
@ -73,6 +74,7 @@
echo "Unknown";
}
echo "</td>";
echo "<td><a href=\"#\" onclick=\"return cancelQueue($r->id)\">".i18n("cancel")."</td>";
echo "</tr>\n";
}
echo "</table>";
@ -143,6 +145,10 @@
}
}
function cancelQueue(id) {
$("#debug").load("communication.php?action=cancel&cancel="+id,null,function() { if(!refreshTimeout) refreshStatus(); });
}
</script>
<?
echo "<br />";

View File

@ -1 +1 @@
161
162

1
db/db.update.162.sql Normal file
View File

@ -0,0 +1 @@
ALTER TABLE `emailqueue_recipients` CHANGE `result` `result` ENUM( 'ok', 'failed', 'cancelled', 'bounced' ) NULL DEFAULT NULL;