config ui trivial improvements, scratching out a place for a browse UI
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 23 Jun 2011 22:04:28 +0000 (18:04 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 11 Jul 2011 17:48:30 +0000 (13:48 -0400)
15 files changed:
Open-ILS/examples/fm_IDL.xml
Open-ILS/web/Makefile.am
Open-ILS/web/js/ui/default/cat/authority/list.js
Open-ILS/web/opac/common/js/config.js
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/opac/locale/en-US/opac.dtd
Open-ILS/web/opac/skin/default/js/advanced.js
Open-ILS/web/opac/skin/default/js/authbrowse.js [new file with mode: 0644]
Open-ILS/web/opac/skin/default/xml/common/js_common.xml
Open-ILS/web/opac/skin/default/xml/common/sidebar.xml
Open-ILS/web/opac/skin/default/xml/page_authbrowse.xml [new file with mode: 0644]
Open-ILS/web/opac/skin/default/xml/setenv.xml
Open-ILS/web/templates/default/conify/global/cat/authority/thesaurus.tt2
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul

index 052c802..e89d46e 100644 (file)
@@ -1853,7 +1853,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
        <class id="aba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis" oils_persist:tablename="authority.browse_axis" reporter:label="Authority Browse Axis">
                <fields oils_persist:primary="code">
-                       <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
+                       <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
                        <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
                        <field reporter:label="Description" name="description" reporter:datatype="text"/>
                        <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
index 38c7ac8..92d1fd8 100644 (file)
@@ -52,7 +52,7 @@ webcore-install:
        cp @top_srcdir@/Open-ILS/xsl/*.xsl $(DESTDIR)$(XSLDIR)
        cp -r $(DESTDIR)$(WEBDIR)/opac/skin/default/* $(DESTDIR)$(WEBDIR)/opac/skin/craftsman/
        cp -r @top_srcdir@/Open-ILS/web/opac/skin/craftsman/* $(DESTDIR)$(WEBDIR)/opac/skin/craftsman/
-       for i in mresult.xml rresult.xml rdetail.xml advanced.xml myopac.xml cnbrowse.xml; do \
+       for i in mresult.xml rresult.xml rdetail.xml advanced.xml myopac.xml cnbrowse.xml authbrowse.xml; do \
                cd $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/ && rm -f $$i && $(LN_S) index.xml $$i; \
        done
        for i in mresult.xml rresult.xml rdetail.xml advanced.xml myopac.xml cnbrowse.xml; do \
index c602139..591bfb8 100644 (file)
@@ -326,7 +326,7 @@ function displayRecords(parms) {
 
     dojo.query("#authlist-div div").orphan();
 
-    var url = '/opac/extras/browse/marcxml/'
+    var url = '/opac/extras/browse/marcxml/authority.'
         + dijit.byId('authAxis').attr('value')
         // + '/' + dijit.byId('authOU').attr('value')
         + '/1' // replace with preceding line if OUs gain some meaning
index 3c4c52d..21b20fa 100644 (file)
@@ -47,6 +47,8 @@ var PARAM_PUBD_AFTER = 'pda';
 var PARAM_PUBD_BETWEEN = 'pdt';
 var PARAM_PUBD_DURING = 'pdd';
 var PARAM_NOPERSIST_SEARCH = 'nps';
+var PARAM_AUTHORITY_BROWSE_AXIS = "ax";
+var PARAM_AUTHORITY_BROWSE_TERM = "bt";
 
 /* URL param values (see comments above) */
 var TERM;  
@@ -113,6 +115,7 @@ var HOME                    = "home";
 var BBAGS              = "bbags";
 var REQITEMS   = "reqitems";
 var CNBROWSE   = "cnbrowse";
+var AUTHBROWSE = "authbrowse";
 
 /* search type (STYPE) options */
 var STYPE_AUTHOR       = "author";
@@ -225,6 +228,7 @@ config.page[RDETAIL]                = "rdetail.xml";
 config.page[BBAGS]             = "bbags.xml";
 config.page[REQITEMS]  = "reqitems.xml";
 config.page[CNBROWSE]  = "cnbrowse.xml";
+config.page[AUTHBROWSE]        = "authbrowse.xml";
 
 /* themes */
 config.themes = {};
index 9236215..7cbb97d 100644 (file)
 <!ENTITY staff.main.menu.admin.server_admin.authority.control_set.accesskey "C">
 <!ENTITY staff.main.menu.admin.server_admin.authority.browse_axis.label "Browse Axes">
 <!ENTITY staff.main.menu.admin.server_admin.authority.browse_axis.accesskey "B">
+<!ENTITY staff.main.menu.admin.server_admin.authority.thesaurus.label "Thesauri">
+<!ENTITY staff.main.menu.admin.server_admin.authority.thesaurus.accesskey "T">
 
 <!ENTITY staff.main.menu.admin.server_admin.booking.label "Booking">
 <!ENTITY staff.main.menu.admin.server_admin.booking.accesskey "B">
index d5be2c2..e60841d 100644 (file)
@@ -411,6 +411,7 @@ Please see a librarian to renew your account.">
 <!ENTITY sidebar.relevantSeries.headerLabel "Relevant Series">
 <!ENTITY sidebar.relevantReviews.headerLabel "Reviews">
 <!ENTITY sidebar.quick.search "Quick Search">
+<!ENTITY sidebar.authority.browse "Authority Browse">
 <!ENTITY sidebar.copy.not.found "No copy with the requested barcode was found">
 
 <!--   ================================================================= 
@@ -438,6 +439,7 @@ Please see a librarian to renew your account.">
 <!ENTITY opac.title.advanced "Evergreen Advanced Search">
 <!ENTITY opac.title.reqitems "Evergreen Request Items">
 <!ENTITY opac.title.cnbrowse "Evergreen Call Number Browse">
+<!ENTITY opac.title.authbrowse "Evergreen Authority Record Browse">
 
 
 <!ENTITY opac.holds.forMe "Place this hold for myself">
index 0e898e4..d292c7f 100644 (file)
@@ -18,6 +18,7 @@ function advInit() {
        setEnterFunc($('adv_quick_text'), advGenericSearch);
 
        unHideMe($('adv_marc_search_sidebar'));
+       unHideMe($('adv_authority_browse_sidebar'));
 }
 
 
@@ -174,5 +175,13 @@ function advDrawBarcode(r) {
     location.href = buildOPACLink(args);
 }
 
-
+function authBrowseSubmit() {
+    var selector = dojo.byId("authority_browse_axis");
+    var args = {"page": AUTHBROWSE};
+    args[PARAM_AUTHORITY_BROWSE_AXIS] =
+        selector.options[selector.selectedIndex].value;
+    args[PARAM_AUTHORITY_BROWSE_TERM] =
+        dojo.byId("authority_browse_term").value;
+    location.href = buildOPACLink(args);
+}
 
diff --git a/Open-ILS/web/opac/skin/default/js/authbrowse.js b/Open-ILS/web/opac/skin/default/js/authbrowse.js
new file mode 100644 (file)
index 0000000..ea711b3
--- /dev/null
@@ -0,0 +1 @@
+alert("test 1");
index ab8edbb..498e5df 100644 (file)
@@ -5,7 +5,7 @@
     type='text/javascript'></script>
 <!--#else-->
 <script language='javascript'  
-    src='/IDL2js?mvr,bre,aou,aout,pgt,lasso,cmf,cmc,cmsa,cam,cifm,clfm,citm,cblvl,ccs'
+    src='/IDL2js?mvr,bre,aou,aout,pgt,lasso,cmf,cmc,cmsa,cam,cifm,clfm,citm,cblvl,ccs,aba'
     type='text/javascript'></script>
 <!--#endif-->
 
index 39c0a94..e7352a5 100644 (file)
                </div>
        </div>
 
+    <div id='adv_authority_browse_sidebar' style='text-align: center'
+        class='sidebar_chunk hide_me'>
+
+        <hr />
+        <div class='adv_quick_search color_4'>
+            <b>&sidebar.authority.browse;</b>
+        </div>
+
+        <div style="text-align: left">
+            <select id="authority_browse_axis">
+                <!-- there's a supercat method
+                     open-ils.supercat.authority.browse_axis_list to get us 
+                     this list dynamically, but how do we get that with XML
+                     api? or do we? -->
+                <option value="author">Author</option>
+                <option value="subject">Subject</option>
+                <option value="title">Title</option>
+                <option value="topic">Topic</option>
+            </select>
+            <input id="authority_browse_term" />
+        </div>
+
+        <a id="authority_browse_submit" class="classic_link" href="javascript:authBrowseSubmit();">&common.submit;</a>
+    </div>
+
        <div id='adv_marc_search_sidebar' class='sidebar_chunk hide_me' 
                style='text-align:center; margin-top: 20px;'> 
                <hr/>
diff --git a/Open-ILS/web/opac/skin/default/xml/page_authbrowse.xml b/Open-ILS/web/opac/skin/default/xml/page_authbrowse.xml
new file mode 100644 (file)
index 0000000..6dc6ce0
--- /dev/null
@@ -0,0 +1,6 @@
+<div id='canvas_main' class='canvas' style='margin-top: 20px;'>
+       <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/authbrowse.js'></script>
+    Boo.
+</div>
+
+
index e64b270..ac2975d 100644 (file)
@@ -25,6 +25,9 @@
 <!--#elif expr="$DOCUMENT_NAME='reqitems.xml'"-->
        <!--#set var='OILS_TITLE' value='opac.title.reqitems'-->
 
+<!--#elif expr="$DOCUMENT_NAME='authbrowse.xml'"-->
+       <!--#set var='OILS_TITLE' value='opac.title.cnbrowse'-->
+
 <!--#elif expr="$DOCUMENT_NAME='cnbrowse.xml'"-->
        <!--#set var='OILS_TITLE' value='opac.title.cnbrowse'-->
 
index b8f80f7..883cb28 100644 (file)
                 query="{id: '*'}"
                 fmClass="at"
                 editOnEnter="true">
+            <thead>
+                <tr>
+                    <th field="control_set" get="get_control_set"
+                        formatter="format_control_set"></th>
+                </tr>
+            </thead>
         </table>
     </div>
 </div>
         dojo.i18n.getLocalization("openils.authority", "authority");
 
     var cgi, pcrud;
+    var control_set;
+
+    function get_control_set(rowidx, item) {
+        if (item) {
+            /* I'm /sure/ there's a better way to do the following */
+            this._tmp = openils.widget.AutoGrid.defaultGetter;
+            var ordinary = this._tmp(rowidx, item); 
+            delete this._tmp;
+
+            if (control_set) {
+                return ordinary;
+            } else {
+                var id = this.grid.store.getValue(item, "control_set");
+                return {
+                    "id": id, "text": ordinary
+                };
+            }
+        }
+    }
+
+    function format_control_set(f) {
+        if (typeof f == "object") {
+            return '<a href="' + oilsBasePath +
+                '/conify/global/cat/authority/control_set?focus=' + f.id +
+                '">' + f.text + "</a>";
+        } else {
+            return f;
+        }
+
+    }
 
     function my_init() {
-        var control_set;
         var where = {"code": {"!=": null}};
 
         cgi = new openils.CGI();
index e0e1453..5420b7e 100644 (file)
@@ -967,6 +967,10 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) { open_eg_web_page('conify/global/cat/authority/browse_axis', null, event); }
             ],
+            'cmd_server_admin_authority_thesaurus': [
+                ['oncommand'],
+                function(event) { open_eg_web_page('conify/global/cat/authority/thesaurus', null, event); }
+            ],
             'cmd_server_admin_booking_resource': [
                 ['oncommand'],
                 function(event) { open_eg_web_page('conify/global/booking/resource', null, event); }
index 8f59ae8..2218ae8 100644 (file)
              />
 
     <command id="cmd_server_admin_authority_control_set" />
+    <command id="cmd_server_admin_authority_thesaurus" />
     <command id="cmd_server_admin_authority_browse_axis" />
 
     <command id="cmd_server_admin_booking_resource" />
                     <menupopup id="main.menu.admin.server.authority.popup">
                         <menuitem label="&staff.main.menu.admin.server_admin.authority.control_set.label;" command="cmd_server_admin_authority_control_set" accesskey="&staff.main.menu.admin.server_admin.authority.control_set.accesskey;"/>
                         <menuitem label="&staff.main.menu.admin.server_admin.authority.browse_axis.label;" command="cmd_server_admin_authority_browse_axis" accesskey="&staff.main.menu.admin.server_admin.authority.browse_axis.accesskey;"/>
+                        <menuitem label="&staff.main.menu.admin.server_admin.authority.thesaurus.label;" command="cmd_server_admin_authority_thesaurus" accesskey="&staff.main.menu.admin.server_admin.authority.thesaurus.accesskey;"/>
                     </menupopup>
                 </menu>