Bugzilla – Attachment 22715 Details for
Bug 9468
Add ability to hide itemtypes from purchase suggestions forms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9468 - Add ability to hide itemtypes from purchase suggestions forms - QA Followup
Bug-9468---Add-ability-to-hide-itemtypes-from-purc.patch (text/plain), 2.47 KB, created by
Marcel de Rooy
on 2013-11-04 14:35:10 UTC
(
hide
)
Description:
Bug 9468 - Add ability to hide itemtypes from purchase suggestions forms - QA Followup
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-11-04 14:35:10 UTC
Size:
2.47 KB
patch
obsolete
>From 9bdce4f08217b72cb390d4526973343e737186b8 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 3 Oct 2013 08:18:26 -0400 >Subject: [PATCH] Bug 9468 - Add ability to hide itemtypes from purchase > suggestions forms - QA Followup >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Koha.pm | 20 +++++++++++--------- > opac/opac-suggestions.pl | 2 +- > 2 files changed, 12 insertions(+), 10 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 361ffd5..f0e4a1b 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -187,18 +187,20 @@ build a HTML select with the following code : > =cut > > sub GetSupportList{ >- my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); >+ my ( $params ) = @_; >+ my $use_SuggestionsHideItemTypes = $params->{SuggestionsHideItemTypes}; > >- my $hidden_item_types = join( ',', map{ qq{'$_'} } split(qq{ }, C4::Context->preference("SuggestionsHideItemTypes") ) ); >- my $hide_sql = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{}; >+ my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); > > if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { >- my $query = qq| >- SELECT * >- FROM itemtypes >- $hide_sql >- ORDER BY description >- |; >+ >+ my $where; >+ if ( $use_SuggestionsHideItemTypes ) { >+ my $hidden_item_types = join( ',', map{ qq{'$_'} } split(q{ }, C4::Context->preference("SuggestionsHideItemTypes") ) ); >+ $where = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{}; >+ } >+ >+ my $query = qq{ SELECT * FROM itemtypes $where ORDER BY description }; > my $sth = C4::Context->dbh->prepare($query); > $sth->execute; > return $sth->fetchall_arrayref({}); >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 32b5c3d..aa08775 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -100,7 +100,7 @@ if ( $op eq "delete_confirm" ) { > exit; > } > map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop; >-my $supportlist=GetSupportList(); >+my $supportlist = GetSupportList( { SuggestionsHideItemTypes => 1 } ); > foreach my $support(@$supportlist){ > if ($$support{'imageurl'}){ > $$support{'imageurl'}= getitemtypeimagelocation( 'opac', $$support{'imageurl'} ); >-- >1.7.7.6
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 9468
:
14801
|
16647
|
16674
|
19086
|
21759
|
21760
|
22714
|
22715
|
27932
|
27933
|
27934
|
27935
|
37100
|
37101
|
37102
|
37103
|
38097
|
38163
|
38164
|
38165
|
38166
|
38167
|
38168
|
41822
|
41823
|
41824
|
41825
|
41826
|
41827
|
41828
|
41936
|
41937
|
41938
|
41939
|
41940
|
41941
|
41942
|
41943
|
44504
|
44505
|
44506
|
44507
|
44508
|
44509
|
44510