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

(-)a/C4/Koha.pm (-2 / +7 lines)
Lines 189-199 build a HTML select with the following code : Link Here
189
189
190
sub GetSupportList{
190
sub GetSupportList{
191
	my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
191
	my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
192
193
     my $hidden_item_types = join( ',', map{ qq{'$_'} } split(qq{ }, C4::Context->preference("SuggestionsHideItemTypes") ) );
194
       my $hide_sql = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{};
195
192
	if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {  
196
	if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {  
193
		my $query = qq|
197
		my $query = qq|
194
			SELECT *
198
			SELECT *
195
			FROM   itemtypes
199
                   FROM itemtypes
196
			order by description
200
                 $hide_sql
201
                      ORDER BY description
197
		|;
202
		|;
198
		my $sth = C4::Context->dbh->prepare($query);
203
		my $sth = C4::Context->dbh->prepare($query);
199
		$sth->execute;
204
		$sth->execute;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 427-429 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
427
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');
427
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');
428
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
428
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
430
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 7010-7015 CREATE TABLE IF NOT EXISTS borrower_files ( Link Here
7010
    SetVersion($DBversion);
7010
    SetVersion($DBversion);
7011
}
7011
}
7012
7012
7013
$DBversion = "3.13.00.XXX";
7014
if ( CheckVersion($DBversion) ) {
7015
   $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SuggestionsHideItemTypes', '', 'Item types to hide from the purchase suggestion forms, delimited by spaces', 'free' )");
7016
   print "Upgrade to $DBversion done (Bug 9468 - Add ability to hide items from purchase suggestions forms)\n";
7017
   SetVersion ($DBversion);
7018
}
7019
7013
=head1 FUNCTIONS
7020
=head1 FUNCTIONS
7014
7021
7015
=head2 TableExists($table)
7022
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +5 lines)
Lines 356-361 OPAC: Link Here
356
                  no: "Don't allow"
356
                  no: "Don't allow"
357
            - patrons to make purchase suggestions on the OPAC.
357
            - patrons to make purchase suggestions on the OPAC.
358
        -
358
        -
359
            - "Do not show the following item types for purchase suggestions:"
360
            - pref: SuggestionsHideItemTypes
361
              class: multi
362
            - "(separate item types with spaces)"
363
        -
359
            - pref: reviewson
364
            - pref: reviewson
360
              choices:
365
              choices:
361
                  yes: Allow
366
                  yes: Allow
362
- 

Return to bug 9468