From ad6ccfe402ff60cdd80206ace265942ac3a7f341 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Fri, 31 Aug 2012 17:31:43 -0400 Subject: [PATCH] lkasejf. It's the weekend. Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/examples/fm_IDL.xml | 2 ++ Open-ILS/src/templates/url_verify/select_urls.tt2 | 2 ++ .../web/js/dojo/openils/URLVerify/SelectURLs.js | 37 ++++++++++++++-------- .../web/js/dojo/openils/URLVerify/nls/URLVerify.js | 3 +- .../web/js/dojo/openils/widget/FlattenerGrid.js | 12 +++++-- 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 9359226bd6..65b2939431 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -9458,12 +9458,14 @@ SELECT usr, + + diff --git a/Open-ILS/src/templates/url_verify/select_urls.tt2 b/Open-ILS/src/templates/url_verify/select_urls.tt2 index b3985d95ef..525bd45d57 100644 --- a/Open-ILS/src/templates/url_verify/select_urls.tt2 +++ b/Open-ILS/src/templates/url_verify/select_urls.tt2 @@ -44,6 +44,7 @@ editOnEnter="false" autoFieldFields="null" autoCoreFields="true" + autoCoreFieldsFilter="true" autoCoreFieldsUnsorted="true" fetchLock="true" mapExtras="{session_id: {path: 'item.session.id', filter: true}}" @@ -56,6 +57,7 @@ + Verifications diff --git a/Open-ILS/web/js/dojo/openils/URLVerify/SelectURLs.js b/Open-ILS/web/js/dojo/openils/URLVerify/SelectURLs.js index b8992ac3f8..b4c6de1e38 100644 --- a/Open-ILS/web/js/dojo/openils/URLVerify/SelectURLs.js +++ b/Open-ILS/web/js/dojo/openils/URLVerify/SelectURLs.js @@ -25,11 +25,14 @@ if (!dojo._hasResource["openils.URLVerify.SelectURLs"]) { module.grid = grid; - module.grid.attr("query", {"session_id": module.session_id}); + module.grid.setBaseQuery({"session_id": module.session_id}); + module.grid.refresh(); // Alternative to grid.refresh() once filter is set up //module.grid.fetchLock = false; //module.grid.filterUi.doApply(); + + module.progress_dialog = progress_dialog; }; module.verify_selected = function() { @@ -38,9 +41,14 @@ if (!dojo._hasResource["openils.URLVerify.SelectURLs"]) { 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 + */ + module.clear_attempt_display(); - progress_dialog.attr("title", localeStrings.VERIFICATION_BEGIN); - progress_dialog.show(); + module.progress_dialog.attr("title", localeStrings.VERIFICATION_DIALOG); + module.progress_dialog.show(); fieldmapper.standardRequest( ["open-ils.url_verify", "open-ils.url_verify.session.verify"], { @@ -52,14 +60,7 @@ if (!dojo._hasResource["openils.URLVerify.SelectURLs"]) { "async": true, "onresponse": function(r) { if (r = openils.Util.readResponse(r)) { - progress_dialog.attr( - "title", - dojo.string.substitute( - localeStrings.VERIFICATION_PROGRESS, - [r.total_processed] - ) - ); - progress_dialog.update({ + module.progress_dialog.update({ "maximum": r.url_count, "progress": r.total_excluding_redirects }); @@ -67,11 +68,16 @@ if (!dojo._hasResource["openils.URLVerify.SelectURLs"]) { if (r.attempt) module.update_attempt_display(r.attempt); } + }, + "oncomplete": function() { + module.progress_dialog.attr( + "title", localeStrings.REDIRECTING + ); + module.progress_dialog.show(true); + console.error("would redirect here XXX TODO"); // XXX TODO } } ) - - module.grid.getSelectedIDs(); }; module.clear_attempt_display = function() { @@ -80,6 +86,11 @@ if (!dojo._hasResource["openils.URLVerify.SelectURLs"]) { dojo.empty(dojo.byId("url-verify-attempt-finish")); }; + /* This gives the user a way to know the verification attempt + * information for the theoretical purposes of restarting it + * later, although we don't give them a way to do that yet, and + * when we do, it really shouldn't involve the user remembering + * an ID number. */ module.update_attempt_display = function(attempt) { dojo.byId("url-verify-attempt-id").innerHTML = dojo.string.substitute( diff --git a/Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js b/Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js index d0b6f3de7d..900f125fec 100644 --- a/Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js +++ b/Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js @@ -7,8 +7,7 @@ "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.", - "VERIFICATION_BEGIN": "Verifying URLs. This can take a moment ...", - "VERIFICATION_PROGRESS": "Verifying URLs: ${0} URLs processed ...", + "VERIFICATION_DIALOG": "Verifying URLs ...", "VERIFICATION_ATTEMPT_ID": "Last verification attempt ID: ${0}", "VERIFICATION_ATTEMPT_START": "Attempt start time: ${0}", "VERIFICATION_ATTEMPT_FINISH": "Attempt finish time: ${0}" diff --git a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js index f968ddc8f3..1bb4a92de8 100644 --- a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js @@ -18,6 +18,7 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) { "columnPersistKey": null, "autoCoreFields": false, "autoCoreFieldsUnsorted": false, + "autoCoreFieldsFilter": false, "autoFieldFields": null, "showLoadFilter": false, /* use FlattenerFilter(Dialog|Pane) */ "filterAlwaysInDiv": null, /* use FlattenerFilterPane and put its @@ -325,8 +326,8 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) { cell_list.push({ "field": f.name, "name": f.label, - "fsort": true /*, - "_visible": false */ + "fsort": true, + "ffilter": this.autoCoreFieldsFilter }); } ); @@ -915,6 +916,13 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) { this.getSelectedIDs(); this.print(null, null, id_blob); + }, + + "setBaseQuery": function(query) { /* sets a persistent query + that always gets mixed in + with whatever you do in the + filter dialog */ + this._baseQuery = dojo.clone(this.attr("query", query)); } } ); -- 2.11.0