diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-23 21:42:34 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-23 21:42:34 +0000 |
commit | 7bd44b22e296b7145750c26183c1c9d1bdf6497b (patch) | |
tree | a43d27f32dce5d5c74a2c5f494f84876f2daac6e /modules/server_add/controllers/server_add.php | |
parent | 465182e58f7cd2cd087bdc59e4a4dd2f89694e9f (diff) |
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
Diffstat (limited to 'modules/server_add/controllers/server_add.php')
-rw-r--r-- | modules/server_add/controllers/server_add.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 85b0b4ec..4a1a8e2d 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -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")) |