1) Change the processing so the server_add start task can return done = 1

if there are no eligible files selected
2) Change the javascript to handle this condition and show a pop up
This commit is contained in:
Tim Almdal
2009-04-23 21:42:34 +00:00
parent 465182e58f
commit 7bd44b22e2
3 changed files with 23 additions and 1 deletions
@@ -85,6 +85,15 @@ class Server_Add_Controller extends Controller {
}
}
if ($total_count == 0) {
print json_encode(array("result" => "success",
"url" => "",
"task" => array(
"id" => -1, "done" => 1, "percent_complete" => 100,
"status" => t("No Eligible files, import cancelled"))));
return;
}
$task_def = Task_Definition::factory()
->callback("server_add_task::add_from_server")
->description(t("Add photos or movies from the local server"))