diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-03-09 07:45:38 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-09 07:45:38 +0000 |
commit | 7aea8f0385862ff1aa7f28c98fce32b2d2631811 (patch) | |
tree | 47386115127d98c01eebefab1f8c086ffba7a199 | |
parent | e37faa0008df38088a55932786955e68ee1f955f (diff) |
Add a 'cancel all' link too
-rw-r--r-- | core/controllers/admin_maintenance.php | 10 | ||||
-rw-r--r-- | core/views/admin_maintenance.html.php | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/core/controllers/admin_maintenance.php b/core/controllers/admin_maintenance.php index 80403906..482e64c2 100644 --- a/core/controllers/admin_maintenance.php +++ b/core/controllers/admin_maintenance.php @@ -102,6 +102,16 @@ class Admin_Maintenance_Controller extends Admin_Controller { url::redirect("admin/maintenance"); } + public function cancel_running_tasks() { + access::verify_csrf(); + Database::instance()->update( + "tasks", + array("done" => 1, "state" => "cancelled"), + array("done" => 0)); + message::success(t("All running tasks cancelled")); + url::redirect("admin/maintenance"); + } + /** * Remove a task. * @param string $task_id diff --git a/core/views/admin_maintenance.html.php b/core/views/admin_maintenance.html.php index e3afb9f5..21638c6b 100644 --- a/core/views/admin_maintenance.html.php +++ b/core/views/admin_maintenance.html.php @@ -41,6 +41,7 @@ <? if ($running_tasks->count()): ?> <div id="gRunningTasks"> <h2> <?= t("Running Tasks") ?> </h2> + <a href="<?= url::site("admin/maintenance/cancel_running_tasks?csrf=$csrf") ?>"><?= t("cancel all") ?></a> <table> <tr> |