View | Details | Raw Unified | Return to bug 9468
Collapse All | Expand All

(-)a/C4/Koha.pm (-2 / +7 lines)
Lines 187-197 build a HTML select with the following code : Link Here
187
187
188
sub GetSupportList{
188
sub GetSupportList{
189
	my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
189
	my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
190
191
	my $hidden_item_types = join( ',', map{ qq{'$_'} } split(qq{ }, C4::Context->preference("SuggestionsHideItemTypes") ) );
192
	my $hide_sql = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{};
193
190
	if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {  
194
	if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {  
191
		my $query = qq|
195
		my $query = qq|
192
			SELECT *
196
			SELECT *
193
			FROM   itemtypes
197
			FROM itemtypes
194
			order by description
198
			$hide_sql
199
			ORDER BY description
195
		|;
200
		|;
196
		my $sth = C4::Context->dbh->prepare($query);
201
		my $sth = C4::Context->dbh->prepare($query);
197
		$sth->execute;
202
		$sth->execute;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 419-421 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
419
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo');
419
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo');
420
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short');
420
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short');
421
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
421
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
422
INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SuggestionsHideItemTypes', '', 'Item types to hide from the purchase suggestion forms, delimited by spaces', 'free' );
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 6655-6660 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6655
    SetVersion($DBversion);
6655
    SetVersion($DBversion);
6656
}
6656
}
6657
6657
6658
$DBversion = "3.11.00.XXX";
6659
if ( CheckVersion($DBversion) ) {
6660
   $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SuggestionsHideItemTypes', '', 'Item types to hide from the purchase suggestion forms, delimited by spaces', 'free' )");
6661
   print "Upgrade to $DBversion done (Bug 9468 - Add ability to hide items from purchase suggestions forms)\n";
6662
   SetVersion ($DBversion);
6663
}
6664
6658
=head1 FUNCTIONS
6665
=head1 FUNCTIONS
6659
6666
6660
=head2 TableExists($table)
6667
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +5 lines)
Lines 346-351 OPAC: Link Here
346
                  no: "Don't allow"
346
                  no: "Don't allow"
347
            - patrons to make purchase suggestions on the OPAC.
347
            - patrons to make purchase suggestions on the OPAC.
348
        -
348
        -
349
            - "Do not show the following item types for purchase suggestions:"
350
            - pref: SuggestionsHideItemTypes
351
              class: multi
352
            - "(separate item types with spaces)"
353
        -
349
            - pref: reviewson
354
            - pref: reviewson
350
              choices:
355
              choices:
351
                  yes: Allow
356
                  yes: Allow
352
- 

Return to bug 9468