Bugzilla – Attachment 110549 Details for
Bug 26503
Allow to limit on standing orders in acquisition advanced search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26503: Add limit for standing orders to acq advanced search
Bug-26503-Add-limit-for-standing-orders-to-acq-adv.patch (text/plain), 16.00 KB, created by
David Nind
on 2020-09-22 12:50:33 UTC
(
hide
)
Description:
Bug 26503: Add limit for standing orders to acq advanced search
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-09-22 12:50:33 UTC
Size:
16.00 KB
patch
obsolete
>From 29d4a6421192c22502610d4ca951d621e12ea859 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Tue, 22 Sep 2020 00:32:51 +0200 >Subject: [PATCH] Bug 26503: Add limit for standing orders to acq advanced > search > >This allows to filter on standing orders on the acq advanced search >checkbox. For this purpose a new checkbox is shown behind the order >status search option. > >As both not yet ordered and standing orders have the status >'new' or partially received internally, this seems like a good >placement as it will help distinguish these cases clearly. > >new + standing order = standing order, but nothing received yet >partially received + standing order = active standing order >all status + standing order = all standing orders > >To test: >- Create some baskets with at least one order, some 'standing' and > others not >- In the top toolbar choose tab Orders search > Advanced search >- Make some searches with and without the new 'Standing order' option >- Verify the right orders are found >- In the search results standing orders will now show with the > status + (standing order). > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Acquisition.pm | 9 ++ > acqui/histsearch.pl | 1 + > .../prog/en/includes/filter-orders.inc | 6 + > .../prog/en/modules/acqui/histsearch.tt | 1 + > .../bootstrap/en/xslt/MARC21slimUtils.xsl | 175 +++++++++++++++++++++ > 5 files changed, 192 insertions(+) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 3aff14d667..6fabf465c7 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2093,6 +2093,7 @@ params: > budget > orderstatus (note that orderstatus '' will retrieve orders > of any status except cancelled) >+ is_standing > managing_library > biblionumber > get_canceled_order (if set to a true value, cancelled orders will >@@ -2116,6 +2117,7 @@ returns: > 'quantityreceived' => undef, > 'title' => 'The Adventures of Huckleberry Finn', > 'managing_library' => 'CPL' >+ 'is_standing' => '1' > } > > =cut >@@ -2136,6 +2138,7 @@ sub GetHistory { > my $basketgroupname = $params{basketgroupname}; > my $budget = $params{budget}; > my $orderstatus = $params{orderstatus}; >+ my $is_standing = $params{is_standing}; > my $biblionumber = $params{biblionumber}; > my $get_canceled_order = $params{get_canceled_order} || 0; > my $ordernumber = $params{ordernumber}; >@@ -2176,6 +2179,7 @@ sub GetHistory { > aqbasket.basketname, > aqbasket.basketgroupid, > aqbasket.authorisedby, >+ aqbasket.is_standing, > concat( borrowers.firstname,' ',borrowers.surname) AS authorisedbyname, > branch as managing_library, > aqbasketgroups.name as groupname, >@@ -2269,6 +2273,11 @@ sub GetHistory { > push @query_params, "$orderstatus"; > } > >+ if ( $is_standing ) { >+ $query .= " AND is_standing = ? "; >+ push @query_params, $is_standing; >+ } >+ > if ($basket) { > if ($basket =~ m/^\d+$/) { > $query .= " AND aqorders.basketno = ? "; >diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl >index 64802dddaa..aa0187ab9c 100755 >--- a/acqui/histsearch.pl >+++ b/acqui/histsearch.pl >@@ -85,6 +85,7 @@ my $filters = { > booksellerinvoicenumber => scalar $input->param('booksellerinvoicenumber'), > budget => scalar $input->param('budget'), > orderstatus => scalar $input->param('orderstatus'), >+ is_standing => scalar $input->param('is_standing'), > ordernumber => scalar $input->param('ordernumber'), > search_children_too => scalar $input->param('search_children_too'), > created_by => [ $input->multi_param('created_by') ], >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >index 7011692637..8e343b0117 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >@@ -75,6 +75,12 @@ > <option value="cancelled">Cancelled</option> > [% END %] > </select> >+ [% IF filters.is_standing %] >+ <input type="checkbox" name="is_standing" id="is_standing" value="1" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="is_standing" id="is_standing" value="1" /> >+ [% END %] >+ <label class="yesno" for="search_children_too">Standing order</label> > </li> > <li> > <label for="fund">Fund: </label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >index e4f0f2fe45..67daf85bdd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >@@ -67,6 +67,7 @@ > [% CASE 'complete' %]Received > [% CASE 'cancelled' %]Cancelled > [% END %] >+ [% IF order.is_standing %](standing order)[% END %] > </td> > <td><a href="basket.pl?basketno=[% order.basketno | uri %]">[% order.basketname | html %] ([% order.basketno | html %])</a></td> > <td>[% order.authorisedbyname | html %]</td> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >index bc8b4f75f9..a7410d5eb3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >@@ -361,6 +361,181 @@ > </xsl:if> > </xsl:template> > >+ <xsl:template name="show-series"> >+ <xsl:param name="searchurl"/> >+ <xsl:param name="UseControlNumber"/> >+ <xsl:param name="UseAuthoritiesForTracings"/> >+ <!-- Series --> >+ <xsl:if test="marc:datafield[@tag=440 or @tag=490]"> >+ <span class="results_summary series"><span class="label">Series: </span> >+ <!-- 440 --> >+ <xsl:for-each select="marc:datafield[@tag=440]"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">av</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </a> >+ <xsl:call-template name="part"/> >+ <xsl:if test="marc:subfield[@code='v']"> >+ <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" /> >+ </xsl:if> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:if test="../marc:datafield[@tag=490][@ind1!=1]"> >+ <span class="separator"> | </span> >+ </xsl:if> >+ </xsl:when> >+ <xsl:otherwise><span class="separator"> | </span></xsl:otherwise> >+ </xsl:choose> >+ </xsl:for-each> >+ >+ <!-- 490 Series not traced, Ind1 = 0 --> >+ <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </a> >+ <xsl:call-template name="part"/> >+ <xsl:if test="marc:subfield[@code='v']"> >+ <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" /> >+ </xsl:if> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:if test="../marc:datafield[@tag=490][@ind1=1]"> >+ <span class="separator"> | </span> >+ </xsl:if> >+ </xsl:when> >+ <xsl:otherwise><span class="separator"> | </span></xsl:otherwise> >+ </xsl:choose> >+ </xsl:for-each> >+ <!-- 490 Series traced, Ind1 = 1 --> >+ <xsl:if test="marc:datafield[@tag=490][@ind1=1]"> >+ <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811]"> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/>"&q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </a> >+ <xsl:call-template name="part"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:text>: </xsl:text> >+ <xsl:value-of select="marc:subfield[@code='v']" /> >+ <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >+ </xsl:for-each> >+ >+ <xsl:for-each select="marc:datafield[@tag=830]"> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </a> >+ <xsl:call-template name="part"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:if test="marc:subfield[@code='v']"> >+ <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" /> >+ </xsl:if> >+ <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >+ </xsl:for-each> >+ </xsl:if> >+ >+ </span> >+ </xsl:if> >+ </xsl:template> >+ >+ <xsl:template name="part"> >+ <xsl:variable name="partNumber"> >+ <xsl:call-template name="specialSubfieldSelect"> >+ <xsl:with-param name="axis">n</xsl:with-param> >+ <xsl:with-param name="anyCodes">n</xsl:with-param> >+ <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param> >+ </xsl:call-template> >+ </xsl:variable> >+ <xsl:variable name="partName"> >+ <xsl:call-template name="specialSubfieldSelect"> >+ <xsl:with-param name="axis">p</xsl:with-param> >+ <xsl:with-param name="anyCodes">p</xsl:with-param> >+ <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param> >+ </xsl:call-template> >+ </xsl:variable> >+ <xsl:if test="string-length(normalize-space($partNumber))"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString" select="$partNumber"/> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="string-length(normalize-space($partName))"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString" select="$partName"/> >+ </xsl:call-template> >+ </xsl:if> >+ </xsl:template> >+ > </xsl:stylesheet> > > <!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp. >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26503
:
110521
|
110522
|
110549
|
110550
|
111431
|
111432
|
111433
|
111434
|
111483