Numeric search mostly works (except for item barcode)
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 27 Jul 2011 17:05:02 +0000 (13:05 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 27 Jul 2011 17:05:02 +0000 (13:05 -0400)
Expert search is next

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXY.data.config.metabib_field.lccn.sql [new file with mode: 0644]
Open-ILS/web/css/skin/default/opac/style.css
Open-ILS/web/templates/default/opac/advanced.tt2
Open-ILS/web/templates/default/opac/parts/advanced/expert.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/parts/advanced/numeric.tt2 [new file with mode: 0644]

index a23cf3d..fe5074e 100644 (file)
@@ -88,7 +88,9 @@ sub load {
         $path =~ /opac\/my(opac\/lists|list)/;
 
     return $self->load_simple("home") if $path =~ m|opac/home|;
-    return $self->load_simple("advanced") if $path =~ m|opac/advanced|;
+    return $self->load_simple("advanced") if
+        $path =~ m:opac/(advanced|numeric|expert):;
+
     return $self->load_rresults if $path =~ m|opac/results|;
     return $self->load_record if $path =~ m|opac/record|;
 
index 61197f7..366b457 100644 (file)
@@ -96,7 +96,8 @@ INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath )
 INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
     (27, 'identifier', 'bibid', oils_i18n_gettext(27, 'Internal ID', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='901']/marc:subfield[@code='c']$$ );
 INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, search_field, facet_field) VALUES
-    (28, 'identifier', 'authority_id', oils_i18n_gettext(28, 'Authority Record ID', 'cmf', 'label'), 'marcxml', '//marc:datafield/marc:subfield[@code="0"]', FALSE, TRUE);
+    (28, 'identifier', 'authority_id', oils_i18n_gettext(28, 'Authority Record ID', 'cmf', 'label'), 'marcxml', '//marc:datafield/marc:subfield[@code="0"]', FALSE, TRUE),
+    (29, 'identifier', 'lccn', oils_i18n_gettext(29, 'LCCN', 'cmf', 'label'), 'marcxml', '//marc:datafield[@tag="010"]/marc:subfield[@code="a"]', TRUE, FALSE) ;
 
 SELECT SETVAL('config.metabib_field_id_seq'::TEXT, (SELECT MAX(id) FROM config.metabib_field), TRUE);
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXY.data.config.metabib_field.lccn.sql b/Open-ILS/src/sql/Pg/upgrade/XXXY.data.config.metabib_field.lccn.sql
new file mode 100644 (file)
index 0000000..5e33cf3
--- /dev/null
@@ -0,0 +1,14 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXY', :eg_version);
+
+INSERT INTO config.metabib_field (
+    id, field_class, name, label, xpath, weight, format,
+    search_field, facet_field
+) VALUES (
+    29, 'identifier', 'lccn', oils_i18n_gettext(29, 'LCCN', 'cmf', 'label'),
+    '//marc:datafield[@tag="010"]/marc:subfield[@code="a"]', 1,
+    'marcxml', TRUE, FALSE
+);
+
+COMMIT;
index ae2098d..6ea13c5 100644 (file)
@@ -288,18 +288,27 @@ div.select-wrapper:hover {
 
 #adv_search {
        width:156px;
-       background:url('/images/adv_search_on.gif') no-repeat bottom;
+       background:url('/images/adv_search_off.gif') no-repeat bottom;
+}
+#adv_search.on {
+       background: url('/images/adv_search_on.gif') no-repeat bottom !important;
 }
 
 #num_search {
        width:156px;
        background:url('/images/num_search_off.gif') no-repeat bottom;
 }
+#num_search.on {
+       background: url('/images/num_search_on.gif') no-repeat bottom !important;
+}
 
 #expert_search {
        width:156px;
        background:url('/images/expert_search_off.gif') no-repeat bottom;
 }
+#expert_search.on {
+       background: url('/images/expert_search_on.gif') no-repeat bottom !important;
+}
 
 #acct_tabs, #acct_fines_tabs {
        height:33px;
index 5c953a3..e752636 100644 (file)
@@ -1,21 +1,28 @@
 [%  PROCESS "default/opac/parts/header.tt2";
     WRAPPER "default/opac/parts/base.tt2";
     INCLUDE "default/opac/parts/topnav.tt2";
-    ctx.page_title = l("Advanced Search") %]
+    ctx.page_title = l("Advanced Search");
+    pane = CGI.param("pane") || "advanced" %]
     <div id="search-wrapper">
         [% INCLUDE "default/opac/parts/printnav.tt2" %]
         <div id="adv_search_parent">
             <div id="adv_search_tabs">
-                <a href="#" alt="[% l('Advanced Search') %]" id="adv_search"></a>
-<!--                <a href="#" alt="[% l('Numeric Search') %]" id="num_search"></a>
-                    <a href="#" alt="[% l('Expert Search') %]" id="expert_search"></a> -->
+                <a href="?pane=advanced" alt="[% l('Advanced Search') %]" [% IF pane == 'advanced' %]class="on" [% END %]id="adv_search"></a>
+                <a href="?pane=numeric" alt="[% l('Numeric Search') %]" [% IF pane == 'numeric' %]class="on" [% END %]id="num_search"></a>
+                <a href="?pane=expert" alt="[% l('Expert Search') %]" [% IF pane == 'expert' %]class="on" [% END %]id="expert_search"></a>
             </div>
         </div>
     </div>
     <div id="content-wrapper">
         <div id="main-content">
             <div class="advanced_div">
+            [% IF pane == 'advanced' %]
             [% INCLUDE "default/opac/parts/advanced/search.tt2" %]
+            [% ELSIF pane == 'numeric' %]
+            [% INCLUDE "default/opac/parts/advanced/numeric.tt2" %]
+            [% ELSIF pane == 'expert' %]
+            [% INCLUDE "default/opac/parts/advanced/expert.tt2" %]
+            [% END %]
             </div>
             <div class="common-full-pad"></div>        
         </div>
diff --git a/Open-ILS/web/templates/default/opac/parts/advanced/expert.tt2 b/Open-ILS/web/templates/default/opac/parts/advanced/expert.tt2
new file mode 100644 (file)
index 0000000..35b11ab
--- /dev/null
@@ -0,0 +1,3 @@
+<!-- <form id="adv_search_form" action="[% ctx.opac_root %]/results" method="GET"> -->
+    <div class="header_middle">[% l("Expert Search") %]</div>
+<!-- </form> -->
diff --git a/Open-ILS/web/templates/default/opac/parts/advanced/numeric.tt2 b/Open-ILS/web/templates/default/opac/parts/advanced/numeric.tt2
new file mode 100644 (file)
index 0000000..8835a5c
--- /dev/null
@@ -0,0 +1,26 @@
+<form id="adv_search_form" action="[% ctx.opac_root %]/results" method="GET">
+    <div class="header_middle">[% l("Numeric Search") %]</div>
+    <input type="hidden" name="contains" value="contains" />
+    <table>
+        <tr>
+            <td>
+                <select name="qtype">
+                    <option value="identifier|isbn">[% l('ISBN') %]</option>
+                    <option value="identifier|issn">[% l('ISSN') %]</option>
+                    <option value="identifier|bib_cn">[% l('Call Number') %]</option>
+                    <option value="identifier|lccn">[% l('LCCN') %]</option>
+                    <option value="identifier|tcn">[% l('TCN') %]</option>
+                    <option disabled="disabled" value="item_barcode">[% l('Item Barcode') %]</option>[%# XXX have to implement special logic for this later %]
+                </select>
+            </td>
+            <td>
+                <input type="text" name="query" size="16" />
+            </td>
+        </tr>
+        <tr>
+            <td colspan="2" align="right">
+                <input type="image" alt="[% l('Search') %]"
+                    src="[% ctx.media_prefix %]/images/search_btn.gif" />
+            </td>
+    </table>
+</form>