Verify-all now means all-matching-my-search-terms, not necessarily all-in-uvs
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 11 Sep 2012 03:03:34 +0000 (23:03 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 21 Sep 2012 15:07:00 +0000 (11:07 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/web/js/dojo/openils/FlattenerStore.js
Open-ILS/web/js/dojo/openils/URLVerify/SelectURLs.js
Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js

index b7452f5..d36100c 100644 (file)
@@ -414,13 +414,8 @@ if (!dojo._hasResource["openils.FlattenerStore"]) {
                     }
                 );
 
-                if (typeof req.onComplete == "function") {
-                    console.debug(
-                        "here goes onComplete, with " + obj + " and " +
-                        dojo.toJson(req)
-                    );
+                if (typeof req.onComplete == "function")
                     req.onComplete.call(callback_scope, obj, req);
-                }
             };
 
             var process_error = dojo.hitch(
index 8c1cde9..60c2dc3 100644 (file)
@@ -37,26 +37,37 @@ if (!dojo._hasResource["openils.URLVerify.SelectURLs"]) {
     };
 
     module.verify_selected = function() {
-        var really_everything = false;
-
         if (module.grid.getSelectedItems().length < 1) {
             alert(localeStrings.NOTHING_SELECTED);
             return;
         }
 
-        if (module.grid.everythingSeemsSelected())
-            really_everything = confirm(localeStrings.VERIFY_ALL);
-
-        /* XXX TODO really_everything needs to change from meaning every
-         * URL belonging to the session to every URL matching grid filter
-         * terms
-         */
-
-        openils.URLVerify.Verify.go(
-            module.session_id,
-            really_everything ? null : module.grid.getSelectedIDs(),
-            module.progress_dialog
-        );
+        if (module.grid.everythingSeemsSelected() &&
+            confirm(localeStrings.VERIFY_ALL)) {
+            /* If we're here, the user wants to verify all URLs matching
+             * the grid's current filters. We need to reach down to the
+             * grid's store to do a special fetch to get all those IDs. */
+
+            module.grid.store.fetch({
+                "query": dojo.clone(module.grid.query),
+                "queryOptions": {"all": true},
+                "onComplete": function(rows) {
+                    openils.URLVerify.Verify.go(
+                        module.session_id,
+                        dojo.map(rows, function(row) { return row.id; }),
+                        module.progress_dialog
+                    );
+                }
+            });
+        } else {
+            /* If we're here, the user wants to verify just the rows he
+             * specifically selected with the checkboxes. */
+            openils.URLVerify.Verify.go(
+                module.session_id,
+                module.grid.getSelectedIDs(),
+                module.progress_dialog
+            );
+        }
     };
 
 }());
index 16a8cf3..03bbd7c 100644 (file)
@@ -3,10 +3,10 @@
     "SAVING_TAGS": "Saving tag/subfield selectors ...",
     "PERFORMING_SEARCH": "Performing search ...",
     "EXTRACTING_URLS": "Extracting URLs ...",
-    "NEED_UVUS": "You must add some tag and subfield combinations",
+    "NEED_UVUS": "You must add some tag and subfield combinations.",
     "REDIRECTING": "Loading next interface ...",
     "INTERFACE_SETUP": "Setting up interface ...",
-    "VERIFY_ALL": "Click 'OK' to verify ALL the URLs found in this session.  Click 'Cancel' if the selected, visible URLs are the only ones you want verified.",
+    "VERIFY_ALL": "Click 'OK' to verify ALL the URLs that belong to this session and match all your search terms.  Click 'Cancel' if the selected, visible URLs are the only ones you want verified.",
     "VERIFICATION_DIALOG": "Verifying URLs ...",
     "VERIFICATION_ATTEMPT_ID": "Verification attempt ID: ${0}",
     "NOTHING_SELECTED": "No rows are selected, so no action will be taken."