Bug 33014: Improve serial searches

This patch adds a new include for the serials 'advanced search' and
uses that include on the serials home and serials search pages. It also
adds some extra options ( Call number, publisher, vendor ) to the
search included in the header.

To test:
1. Apply patch
2. Go to the serials module and notice the main page now has an
   'advanced search' form. Make sure it works.
3. After doing a search you'll be taken to serials-search.pl. Make sure
   the search forms in the side bar and in the header look good and work
   right.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Lucas Gass 2023-02-23 16:42:36 +00:00 committed by Tomas Cohen Arazi
parent b26d2fa578
commit 9e61dc8009
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
4 changed files with 87 additions and 136 deletions

View file

@ -0,0 +1,64 @@
[% PROCESS 'html_helpers.inc' %]
<div id="advsearch" style="padding-bottom:3em;">
<form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
[% IF brief %]
<fieldset class="brief">
[% ELSE %]
<fieldset class="rows">
[% END%]
<legend>Search subscriptions</legend>
<ol>
<li>
<label for="issn">ISSN:</label>
<input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
</li>
<li>
<label for="title">Title:</label>
<input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
</li>
[% IF ( marcflavour == "UNIMARC" ) %]
<li>
<label for="ean">EAN:</label>
<input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
</li>
[% END %]
<li class="local">
<label for="callnumber">Call number:</label>
<input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
</li>
<li>
<label for="publisher">Publisher:</label>
<input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
</li>
<li class="local">
<label for="bookseller">Vendor:</label>
<input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
</li>
<li class="local">
<label for="branch">Library:</label>
<select id="branch" name="branch_filter">
<option value="">All</option>
[%# FIXME Should not we filter the libraries? %]
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
</select>
</li>
<li class="local">
<label for="location">Location:</label>
[% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
</li>
<li class="local">
<label for="to">Expires before:</label>
<input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | html %]" size="10" maxlength="10" class="flatpickr" />
</li>
[% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
</ol>
<input type="hidden" name="searched" value="1" />
[% IF ( mana ) %]
<input type="hidden" name="mana" value="1" />
[% END %]
<fieldset class="action">
<input type="submit" class="btn btn-primary" value="Search" />
</fieldset>
</fieldset> <!-- /.rows -->
</form>
</div> <!-- /#advsearch -->

View file

@ -21,9 +21,27 @@
[% END %]
<input type="text" class="form-control" placeholder="Title" size="11" name="title_filter" id="title_filter" value="[% title_filter | html %]" />
<button type="button" class="form-extra-content-toggle"><i class="fa fa-sliders"></i></button>
</span>
<button type="submit"><i class="fa fa-arrow-right"></i></button>
<div class="form-extra-content">
<div>
<label for="callnumber_filter">Call number:</label>
<input class="form-control" type="text" id="callnumber_filter" name="callnumber_filter" placeholder="Call number" value="[% callnumber_filter | html %]">
</div>
<div>
<label for="publisher_filter">Publisher:</label>
<input class="form-control" type="text" id="publisher_filter" name="publisher_filter" placeholder="Publisher" value="[% publisher_filter | html %]">
</div>
<div>
<label for="bookseller_filter">Vendor:</label>
<input class="form-control" type="text" id="bookseller_filter" name="bookseller_filter" placeholder="Vendor" value="[% bookseller_filter | html %]">
</div>
<div>
<a href="/cgi-bin/koha/serials/serials-search.pl">Advanced search</a>
</div>
</div>
</form>
</div>

View file

@ -2,6 +2,7 @@
[% USE Asset %]
[% USE KohaDates %]
[% USE Koha %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Serials [% biblionumber | html %] &rsaquo; Koha</title>
@ -35,7 +36,7 @@
[% INCLUDE 'serials-toolbar.inc' %]
<h1>Serials</h1>
[% INCLUDE 'serials-advsearch.inc' %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
@ -48,6 +49,7 @@
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% Asset.js("js/serials-toolbar.js") | $raw %]
<script>
var subscriptionid = "[% subscriptionid | html %]";

View file

@ -247,65 +247,7 @@
[% END %]
[% UNLESS ( done_searched ) %]
<div id="advsearch" style="padding-bottom:3em;">
<form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
<fieldset class="rows">
<legend>Search subscriptions</legend>
<ol>
<li>
<label for="issn">ISSN:</label>
<input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
</li>
<li>
<label for="title">Title:</label>
<input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
</li>
[% IF ( marcflavour == "UNIMARC" ) %]
<li>
<label for="ean">EAN:</label>
<input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
</li>
[% END %]
<li class="local">
<label for="callnumber">Call number:</label>
<input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
</li>
<li>
<label for="publisher">Publisher:</label>
<input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
</li>
<li class="local">
<label for="bookseller">Vendor:</label>
<input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
</li>
<li class="local">
<label for="branch">Library:</label>
<select id="branch" name="branch_filter">
<option value="">All</option>
[%# FIXME Should not we filter the libraries? %]
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
</select>
</li>
<li class="local">
<label for="location">Location:</label>
[% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
</li>
<li class="local">
<label for="to">Expires before:</label>
<input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | html %]" size="10" maxlength="10" class="flatpickr" />
</li>
[% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
</ol>
<input type="hidden" name="searched" value="1" />
[% IF ( mana ) %]
<input type="hidden" name="mana" value="1" />
[% END %]
<fieldset class="action">
<input type="submit" class="btn btn-primary" value="Search" />
</fieldset>
</fieldset> <!-- /.rows -->
</form>
</div> <!-- /#advsearch -->
[% INCLUDE 'serials-advsearch.inc' %]
[% END # /UNLESS ( done_searched )%]
[% IF ( done_searched ) %]
@ -364,82 +306,7 @@
[% INCLUDE 'serials-menu.inc' %]
[% IF ( done_searched ) %]
[% UNLESS ( mana ) %]
<div id="advsearch">
<form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
<fieldset class="brief">
<h4>Search subscriptions</h4>
<ol>
<li>
<label for="issn">ISSN:</label>
<input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
</li>
<li>
<label for="title">Title:</label>
<input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
</li>
[% IF ( marcflavour == "UNIMARC" ) %]
<li>
<label for="ean">EAN:</label>
<input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
</li>
[% END %]
<li>
<label for="callnumber">Call number:</label>
<input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
</li>
<li>
<label for="publisher">Publisher:</label>
<input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
</li>
<li>
<label for="bookseller">Vendor:</label>
<input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
</li>
<li>
<label for="branch">Library:</label>
<select id="branch" name="branch_filter">
<option value="">All</option>
[%# FIXME Should not we filter the libraries? %]
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
</select>
</li>
<li>
<label for="location">Location:</label>
[% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
</li>
<li>
<label for="to">Expires before:</label>
<input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | html %]" size="10" maxlength="10" class="flatpickr" />
</li>
[% FOR field IN additional_fields_for_subscription %]
<li>
<label for="additional_field_[% field.id | html %]ID"> [% field.name | html %]: </label>
[% IF field.authorised_value_category %]
<select id="additional_field_[% field.id | html %]" name="additional_field_[% field.id | html %]">
<option value="">All</option>
[% FOREACH av IN AuthorisedValues.GetAuthValueDropbox(field.authorised_value_category) %]
[% IF av.authorised_value == additional_field_filters.${field.id} %]
<option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html %]</option>
[% ELSE %]
<option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
<input id="additional_field_[% field.id | html %]" type="text" value="[% additional_field_filters.${field.id} | html %]" name="additional_field_[% field.id | html %]" />
[% END %]
</li>
[% END %]
</ol>
<input type="hidden" name="searched" value="1" />
<fieldset class="action">
<input type="submit" class="btn btn-primary" value="Search" />
</fieldset>
</fieldset> <!-- /.brief -->
</form>
</div> <!-- /#advsearch -->
[% INCLUDE 'serials-advsearch.inc' brief=1 %]
[% END # / UNLESS ( mana ) %]
[% END # / IF ( done_searched ) %]
</aside>