Beginnings for the big session kick-off UI. Not yet functional.
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 17 Aug 2012 22:58:03 +0000 (18:58 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 21 Sep 2012 15:06:57 +0000 (11:06 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/URLVerify.pm
Open-ILS/src/templates/url_verify/create_session.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/url_verify/create_session.js [new file with mode: 0644]

index 0d6df0c..1305f88 100644 (file)
@@ -672,6 +672,7 @@ sub session_perform_search {
 
     # XXX TODO, if the following search takes too long, the caller of our method
     # can time out
+    # XXX TODO keep doing this to page over the whole result set
     my $search_results = $U->simplereq(
         "open-ils.search", "open-ils.search.biblio.multiclass.query.staff",
         {}, $session->search
diff --git a/Open-ILS/src/templates/url_verify/create_session.tt2 b/Open-ILS/src/templates/url_verify/create_session.tt2
new file mode 100644 (file)
index 0000000..df0a61c
--- /dev/null
@@ -0,0 +1,106 @@
+[% WRAPPER base.tt2 %]
+[% ctx.page_title = "Link Checker - Create Session" %]
+<script type="text/javascript">
+    dojo.require("dijit.form.Button");
+    dojo.require("dijit.form.CheckBox");
+    dojo.require("dijit.form.TextBox");
+    dojo.require("openils.Util");
+    dojo.require("openils.widget.OrgUnitFilteringSelect");
+    dojo.require("openils.widget.ProgressDialog");
+</script>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/url_verify/create_session.js"></script>
+<style type="text/css">
+    #uv-search { width: 20em; }
+</style>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane"
+         layoutAlign="top" class="oils-header-panel">
+        <div> [% ctx.page_title %] </div>
+        <div>
+            <button dojoType="dijit.form.Button"
+                onClick="alert('XXX do something');">[% l('XXX Clone Existing') %]</button>
+        </div>
+    </div>
+<!--    <div class="oils-acq-basic-roomy">
+        <label for="org_selector">[% l('Show events at and below') %]:</label>
+        <select
+            id="org_selector" jsId="org_selector"
+            dojoType="openils.widget.OrgUnitFilteringSelect"
+            searchAttr="name" labelAttr="name">
+        </select>
+    </div> -->
+    <div>
+        <table>
+            <tr>
+                <th>
+                    <label for="uv-session-name">[% l("Sesssion name:") %]</label>
+                </th>
+                <td>
+                    <input dojoType="dijit.form.TextBox"
+                        id="uv-session-name" jsId="uv_session_name" />
+                </td>
+            </tr>
+
+            <tr>
+                <th>
+                    <label for="org-selector">[% l('Search scope:') %]</label>
+                </th>
+                <td>
+                    <select id="org-selector" jsId="org_selector"
+                        dojoType="openils.widget.OrgUnitFilteringSelect"
+                        searchAttr="name" labelAttr="name"> </select>
+                    <span class="note">[% l("This will only be used if your search doesn't contain a hand-entered filter such as site(BR1)") %]</span>
+                </td>
+            </tr>
+
+            <!-- XXX TODO I bet we want a depth selector here too -->
+
+            <tr>
+                <th>
+                    <label for="uv-search">[% l('Search:') %]</label>
+                </th>
+                <td>
+                    <input dojoType="dijit.form.TextBox" id="uv-search"
+                        jsId="uv_search" />
+                </td>
+            </tr>
+
+            <!-- XXX TODO multiselect from saved searches here -->
+
+            <tr>
+                <th>
+                    <label for="no-url-selection">[% l('Process immediately?') %]</label>
+                </th>
+                <td>
+                    <input dojoType="dijit.form.CheckBox" id="no-url-selection"
+                        jsId="no_url_selection" />
+                </td>
+            </tr>
+
+            <tr>
+                <th>
+                    [% l('Tags and subfields with URLs:') %]
+                </th>
+                <td>
+                    <div id="uv-tags-and-subfields">
+                    </div>
+                    <div class="tag-and-subfield-add-another">
+                        [% l("Tag") %]
+                        <input type="text" size="4" maxlength="3" />
+                        [% l("Subfield(s)") %]
+                        <input type="text" size="20" />
+                        <a href="javascript:create_session.tag_and_subfields.add();">[% l('Add') %]
+                    </div>
+                </td>
+            </tr>
+        </table>
+
+        <div>
+            <button dojoType="dijit.form.Button"
+                onClick="create_session.begin();">[% l('Begin') %]</button>
+
+        </div>
+    </div>
+</div>
+<div dojoType="openils.widget.ProgressDialog" jsId="progress_dialog"></div>
+[% END %]
diff --git a/Open-ILS/web/js/ui/default/url_verify/create_session.js b/Open-ILS/web/js/ui/default/url_verify/create_session.js
new file mode 100644 (file)
index 0000000..450963d
--- /dev/null
@@ -0,0 +1,58 @@
+var create_session = {};
+
+(function() {
+    create_session.begin = function() {
+        alert("XXX TODO implement");
+    }
+
+    function TagAndSubfieldsMgr(container_id) {
+        var self = this;
+
+        this.container_id = container_id;
+        this.counter = 0;
+
+        this.read_new = function() {
+            var controls = dojo.query(".tag-and-subfield-add-another input");
+
+            return {
+                "tag": controls[0].value,
+                "subfields": openils.Util.uniqueElements(
+                    controls[1].value.replace(/[^0-9a-z]/g, "").split("")
+                ).sort().join("")
+            };
+        };
+
+        this.add = function() {
+            var newdata = this.read_new();
+            var newid = "t-and-s-row-" + String(this.counter++);
+            var div = dojo.create(
+                "div", {
+                    "id": newid,
+                    "innerHTML": "<span class='t-and-s-tag'>" +
+                        newdata.tag +
+                        "</span> \u2021<span class='t-and-s-subfields'>" +
+                        newdata.subfields + "</span>"
+                }, this.container_id, "last"
+            );
+            dojo.create(
+                "a", {
+                    "href": "javascript:void(0);",
+                    "onclick": function() {
+                        var me = dojo.byId(newid);
+                        me.parentNode.removeChild(me);
+                    },
+                    "innerHTML": "[X]" /* XXX i18n */
+                }, div, "last"
+            );
+
+            this.counter++;
+        };
+
+        this.get_all = function() {
+        };
+    }
+
+    create_session.tag_and_subfields =
+        new TagAndSubfieldsMgr("uv-tags-and-subfields");
+
+}());