Bugzilla – Attachment 19086 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 items from purchase suggestions forms
Bug-9468---Add-ability-to-hide-items-from-purchase.patch (text/plain), 4.18 KB, created by
Kyle M Hall (khall)
on 2013-06-17 17:46:34 UTC
(
hide
)
Description:
Bug 9468 - Add ability to hide items from purchase suggestions forms
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-06-17 17:46:34 UTC
Size:
4.18 KB
patch
obsolete
>From f384bcf4c0d531d7206609fa13a67d91a1d578b1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 23 Jan 2013 14:23:08 -0500 >Subject: [PATCH] Bug 9468 - Add ability to hide items from purchase suggestions forms > >Test Plan: >1) Apply patch >2) Run updatedatabase.pl >3) Add some itemtypes to the new system pref SuggestionsHideItemTypes >4) Make a purchase suggestion >5) Verify those item types set in SuggestionsHideItemTypes do not appear > in the pulldown menu for "Item type" > >Signed-off-by: Frederic Durand <frederic.durand@unilim.fr> >--- > C4/Koha.pm | 9 +++++++-- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ > 4 files changed, 20 insertions(+), 2 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 9976995..9918b7d 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -189,11 +189,16 @@ build a HTML select with the following code : > > sub GetSupportList{ > my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); >+ >+ 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{}; >+ > if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { > my $query = qq| > SELECT * >- FROM itemtypes >- order by description >+ FROM itemtypes >+ $hide_sql >+ ORDER BY description > |; > my $sth = C4::Context->dbh->prepare($query); > $sth->execute; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index fbd0387..2780f6a 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -427,3 +427,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo'); > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); >+INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SuggestionsHideItemTypes', '', 'Item types to hide from the purchase suggestion forms, delimited by spaces', 'free' ); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 5963d24..c86dbdf 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7010,6 +7010,13 @@ CREATE TABLE IF NOT EXISTS borrower_files ( > SetVersion($DBversion); > } > >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SuggestionsHideItemTypes', '', 'Item types to hide from the purchase suggestion forms, delimited by spaces', 'free' )"); >+ print "Upgrade to $DBversion done (Bug 9468 - Add ability to hide items from purchase suggestions forms)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 90295ef..6489567 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -356,6 +356,11 @@ OPAC: > no: "Don't allow" > - patrons to make purchase suggestions on the OPAC. > - >+ - "Do not show the following item types for purchase suggestions:" >+ - pref: SuggestionsHideItemTypes >+ class: multi >+ - "(separate item types with spaces)" >+ - > - pref: reviewson > choices: > yes: Allow >-- >1.7.2.5
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