forked from science-ation/science-ation
Add ability to cancel emails in the queue to be sent
This commit is contained in:
parent
e077912d9e
commit
d8375c0c5f
@ -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";
|
||||
|
@ -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 />";
|
||||
|
@ -1 +1 @@
|
||||
161
|
||||
162
|
||||
|
1
db/db.update.162.sql
Normal file
1
db/db.update.162.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE `emailqueue_recipients` CHANGE `result` `result` ENUM( 'ok', 'failed', 'cancelled', 'bounced' ) NULL DEFAULT NULL;
|
Loading…
x
Reference in New Issue
Block a user