BUG 14991 Improve consistency of authority search
authorGaetan Boisson <gaetan.boisson@biblibre.com>
Fri, 9 Oct 2015 12:44:44 +0000 (14:44 +0200)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Wed, 30 Dec 2015 04:29:04 +0000 (04:29 +0000)
At the moment we can search authorities from two places: authorities-home.pl and auth_finder.pl (while cataloguing).

The auth_finder.pl page offers searching specifically in the $a of the main heading, while the authorities home page doesn't.

Additionally, the wording and order of the options is different.

authorities-home.pl has:
Search main heading
Search all headings
Keyword search

while auth_finder.pl has:
Main entry ($a only)
Main entry
Anywhere
Heading match

This patch will add some consistency so that both pages offer:
Search main heading ($a only)
Search main heading
Search all headings
Search entire record

Test plan:

- apply patch
- go to authorities home
- check that previous searches are still working
- check that the new ($a only) search is working
- go to auth finder (from cataloguing)
- check that searches are still working
- check that we do have the same wording in both pages and that forms are now consistent

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc

index b1906a9..bb2d3a8 100644 (file)
@@ -121,7 +121,7 @@ function finderjumpfull(page)
                     <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
                 </li>
                 <li>
-                    <label for="mainmainentry">Main entry ($a only): </label>
+                    <label for="mainmainentry">Search main heading ($a only): </label>
                     <input type="hidden" name="marclist" value="mainmainentry" />
                     <input type="hidden" name="and_or" value="and" />
                     <input type="hidden" name="excluding" value="" />
@@ -147,7 +147,7 @@ function finderjumpfull(page)
                 </li>
 
                 <li>
-                    <label for="mainentry">Main entry: </label>
+                    <label for="mainentry">Search main heading: </label>
                     <input type="hidden" name="marclist" value="mainentry" />
                     <input type="hidden" name="and_or" value="and" />
                     <input type="hidden" name="excluding" value="" />
@@ -171,55 +171,54 @@ function finderjumpfull(page)
                     <input id="value_main" style="width:400px;" type="text" name="value_main" value="[% value_main |html %]" />
                     <div id="yvaluecontainermainentry"></div>
                 </li>
-
                 <li>
-                    <label for="marclistanywhere">Anywhere: </label>
-                    <input type="hidden" name="marclist" value="any" />
+                    <label for="marclistheading">Search all headings: </label>
+                    <input type="hidden" name="marclist" value="match" />
                     <input type="hidden" name="and_or" value="and" />
                     <input type="hidden" name="excluding" value="" />
-                    <select name="operator" id="marclistanywhere">
-                        [% IF ( operator_any == 'contains' ) %]
+                    <select name="operator" id="marclistheading">
+                        [% IF ( operator_match == 'contains' ) %]
                         <option value="contains" selected="selected">contains</option>
                         [% ELSE %]
                         <option value="contains">contains</option>
                         [% END %]
-                        [% IF ( operator_any == 'start' ) %]
+                        [% IF ( operator_match == 'start' ) %]
                         <option value="start" selected="selected">starts with</option>
                         [% ELSE %]
                         <option value="start">starts with</option>
                         [% END %]
-                        [% IF ( operator_any == 'is' ) %]
+                        [% IF ( operator_match == 'is' ) %]
                         <option value="is" selected="selected">is exactly</option>
                         [% ELSE %]
                         <option value="is">is exactly</option>
                         [% END %]
                     </select>
-                    <input id="value_any" style="width:400px;" type="text" name="value_any" value="[% value_any |html %]" />
-                    <div id="yvaluecontainermarclist"></div>
+                    <input type="text" name="value_match" value="[% value_match |html %]" />
                 </li>
                 <li>
-                    <label for="marclistheading">Heading match: </label>
-                    <input type="hidden" name="marclist" value="match" />
+                    <label for="marclistanywhere">Search entire record: </label>
+                    <input type="hidden" name="marclist" value="any" />
                     <input type="hidden" name="and_or" value="and" />
                     <input type="hidden" name="excluding" value="" />
-                    <select name="operator" id="marclistheading">
-                        [% IF ( operator_match == 'contains' ) %]
+                    <select name="operator" id="marclistanywhere">
+                        [% IF ( operator_any == 'contains' ) %]
                         <option value="contains" selected="selected">contains</option>
                         [% ELSE %]
                         <option value="contains">contains</option>
                         [% END %]
-                        [% IF ( operator_match == 'start' ) %]
+                        [% IF ( operator_any == 'start' ) %]
                         <option value="start" selected="selected">starts with</option>
                         [% ELSE %]
                         <option value="start">starts with</option>
                         [% END %]
-                        [% IF ( operator_match == 'is' ) %]
+                        [% IF ( operator_any == 'is' ) %]
                         <option value="is" selected="selected">is exactly</option>
                         [% ELSE %]
                         <option value="is">is exactly</option>
                         [% END %]
                     </select>
-                    <input type="text" name="value_match" value="[% value_match |html %]" />
+                    <input id="value_any" style="width:400px;" type="text" name="value_any" value="[% value_any |html %]" />
+                    <div id="yvaluecontainermarclist"></div>
                 </li>
         <li>
         <label for="orderby">Sort by: </label>
index d7ce46d..571e6b0 100644 (file)
 //]]>
 </script>
 <div id="header_search" class="residentsearch">
+    <div id="mainmain_heading" class="residentsearch">
+    <p class="tip">Enter main heading ($a only):</p>
+    <form action="/cgi-bin/koha/authorities/authorities-home.pl" method="get">
+        <input type="hidden" name="op" value="do_search" />
+        <input type="hidden" name="type" value="intranet" />
+        <select name="authtypecode">
+        [% IF (marcflavour == 'UNIMARC' ) %]<option value="">All authority types</option>[% END %]
+        [% FOREACH authtypesloo IN authtypesloop %]
+            [% IF ( authtypesloo.selected ) %]
+            <option value="[% authtypesloo.value %]" selected="selected">[% authtypesloo.authtypetext %]</option>
+            [% ELSE %]
+            <option value="[% authtypesloo.value %]">[% authtypesloo.authtypetext %]</option>
+            [% END %]
+        [% END %]
+        </select>
+        <input type="hidden" name="marclist" value="mainmainentry" />
+        <input type="hidden" name="and_or" value="and" />
+        <input type="hidden" name="excluding" value="" />
+        <select name="operator">
+            [% IF ( operator == 'contains' ) %]
+            <option value="contains" selected="selected">contains</option>
+            [% ELSE %]
+            <option value="contains">contains</option>
+            [% END %]
+            [% IF ( operator == 'start' ) %]
+            <option value="start" selected="selected">starts with</option>
+            [% ELSE %]
+            <option value="start">starts with</option>
+            [% END %]
+            [% IF ( operator == 'is' ) %]
+            <option value="is" selected="selected">is exactly</option>
+            [% ELSE %]
+            <option value="is">is exactly</option>
+            [% END %]
+        </select>
+        <input id="value_mainentry" type="text" name="value" value="[% value | html%]" class="head-searchbox" />
+        <select name="orderby">
+            [% IF ( orderby == 'HeadingAsc' ) %]
+            <option value="HeadingAsc" selected="selected">Heading A-Z</option>
+            [% ELSE %]
+            <option value="HeadingAsc">Heading A-Z</option>
+            [% END %]
+            [% IF ( orderby == 'HeadingDsc' ) %]
+            <option value="HeadingDsc" selected="selected">Heading Z-A</option>
+            [% ELSE %]
+            <option value="HeadingDsc">Heading Z-A</option>
+            [% END %]
+            [% IF ( orderby == '' && op ) %]
+            <option value="" selected="selected">None</option>
+            [% ELSE %]
+            <option value="">None</option>
+            [% END %]
+        </select>
+        <input type="submit" class="submit" value="Submit" />
+    </form>
+    </div>
     <div id="main_heading" class="residentsearch">
-    <p class="tip">Enter authorized heading:</p>
+    <p class="tip">Enter main heading:</p>
     <form action="/cgi-bin/koha/authorities/authorities-home.pl" method="get">
         <input type="hidden" name="op" value="do_search" />
         <input type="hidden" name="type" value="intranet" />
          <input type="submit" class="submit" value="Submit" />
     </form>
     </div>
-    <div id="all_headings" class="residentsearch">
+    <div id="entire_record" class="residentsearch">
     <p class="tip">Enter any authority field:</p>
     <form action="/cgi-bin/koha/authorities/authorities-home.pl" method="get">
         <input type="hidden" name="op" value="do_search" />
     </form>
     </div>
     <ul>
-        <li><a onclick="keep_text(0)" href="#main_heading">Search main heading</a></li>
-        <li><a onclick="keep_text(1)" href="#matchheading_search">Search all headings</a></li>
-        <li><a onclick="keep_text(2)" href="#all_headings">Keyword search</a></li>
+        <li><a onclick="keep_text(0)" href="#mainmain_heading">Search main heading ($a only)</a></li>
+        <li><a onclick="keep_text(1)" href="#main_heading">Search main heading</a></li>
+        <li><a onclick="keep_text(2)" href="#matchheading_search">Search all headings</a></li>
+        <li><a onclick="keep_text(3)" href="#entire_record">Search entire record</a></li>
     </ul>
 </div><!-- /header_search -->
 </div><!-- /gradient -->