Fixed typo and Dijit issue with ternary operator
authorYamil Suarez <yamil@yamil.com>
Thu, 25 Sep 2014 18:11:26 +0000 (14:11 -0400)
committerYamil Suarez <yamil@yamil.com>
Thu, 25 Sep 2014 18:15:07 +0000 (14:15 -0400)
Signed-off-by: Yamil Suarez <yamil@yamil.com>
Open-ILS/src/templates/cat/authority/list.tt2
Open-ILS/web/js/ui/default/cat/authority/list.js

index 36204a1..7a355d9 100644 (file)
@@ -34,7 +34,7 @@
     </span>
     <span style="white-space: nowrap;">
         <label for="searchOrNot">[% l('Search instead of browse: ') %]</label>
-        <input type="checkbox" name="searchOrNot" value="1" dojoType="dijit.form.Checkbox" id="searchOrNot"/>
+        <input type="checkbox" name="searchOrNot" value="1" dojoType="dijit.form.CheckBox" id="searchOrNot"/>
     </span>
 <!-- Not currently useful - see authOUListInit() above -->
 <!--    <label for="authOU">[% l('Library: ') %]</label><select dojoType="openils.widget.OrgUnitFilteringSelect" id="authOU" name="authOU" searchAttr="shortname" labelAttr="shortname"></select> -->
index 01bdb65..8c33223 100644 (file)
@@ -1,4 +1,5 @@
 dojo.require('dijit.Dialog');
+dojo.require('dijit.form.CheckBox');
 dojo.require('dijit.form.Button');
 dojo.require('dijit.form.DropDownButton');
 dojo.require('dijit.form.FilteringSelect');
@@ -375,15 +376,18 @@ function displayRecords(parms) {
 
     dojo.query("#authlist-div").query("div").orphan();
 
+    var search_type = dijit.byId('searchOrNot').attr('checked') ? '.search' : ''; 
     var url = '/opac/extras/browse/marcxml/authority.'
         + dijit.byId('authAxis').attr('value')
-        + dijit.byId('searchOrNot').attr('checked') ? '.search' : ''
-        // + '/' + dijit.byId('authOU').attr('value')
+        + search_type
+       // + '/' + dijit.byId('authOU').attr('value')
         + '/1' // replace with preceding line if OUs gain some meaning
         + '/' + encodeURIComponent(dijit.byId('authTerm').attr('value'))
         + '/' + dijit.byId('authPage').attr('value')
         + '/' + '20' // 20 results per page
     ;
+alert(url);
+alert(dijit.byId('searchOrNot').attr('checked'));
     dojo.xhrGet({"url":url, "handleAs":"xml", "content":{"format":"marcxml"}, "preventCache": true, "load":displayAuthorities });
 }