lkasejf. It's the weekend.
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 31 Aug 2012 21:31:43 +0000 (17:31 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 21 Sep 2012 15:06:59 +0000 (11:06 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/templates/url_verify/select_urls.tt2
Open-ILS/web/js/dojo/openils/URLVerify/SelectURLs.js
Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js
Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js

index 9359226..65b2939 100644 (file)
@@ -9458,12 +9458,14 @@ SELECT  usr,
             <field reporter:label="Page" name="page" reporter:datatype="text"/>
             <field reporter:label="Query" name="query" reporter:datatype="text"/>
             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
+            <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
         </fields>
 
         <links>
             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" /><!-- surprise! -->
             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
+            <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
         </links>
 
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
index b3985d9..525bd45 100644 (file)
@@ -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 @@
                 <th field="isbn" fpath="item.target_biblio_record_entry.simple_record.isbn" _visible="false"></th>
                 <th field="issn" fpath="item.target_biblio_record_entry.simple_record.issn" _visible="false"></th>
                 <th field="bib_id" fpath="item.target_biblio_record_entry.id" _visible="false"></th>
+                <th field="verifications" fpath="verifications.id" ffilter="true">Verifications</th>
             </tr>
         </thead>
     </table>
index b8992ac..b4c6de1 100644 (file)
@@ -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(
index d0b6f3d..900f125 100644 (file)
@@ -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}"
index f968ddc..1bb4a92 100644 (file)
@@ -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));
             }
         }
     );