Added progress bar and pause and continue functionality to rearrange

This commit is contained in:
Tim Almdal
2009-04-21 06:04:03 +00:00
parent 201e8cdf70
commit c94fc344e8
4 changed files with 39 additions and 30 deletions

View File

@@ -28,13 +28,10 @@ class organize_task_Core {
try {
$stop = $context["position"] + $context["batch"];
$sql = "";
for (; $context["position"] < $stop; $context["position"]++ ) {
$id = $context["items"][$context["position"]];
$sql .= "Update {items} set weight = {$context["position"]} where id=$id;";
}
if (!empty($sql)) {
$db = Database::instance()->query($sql);
Database::instance()
->query("Update {items} set weight = {$context["position"]} where id=$id;");
}
$task->state = "success";
} catch(Exception $e) {