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

(-)a/C4/Koha.pm (-2 / +7 lines)
Lines 188-198 build a HTML select with the following code : Link Here
188
188
189
sub GetSupportList{
189
sub GetSupportList{
190
	my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
190
	my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
191
192
     my $hidden_item_types = join( ',', map{ qq{'$_'} } split(qq{ }, C4::Context->preference("SuggestionsHideItemTypes") ) );
193
       my $hide_sql = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{};
194
191
	if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {  
195
	if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {  
192
		my $query = qq|
196
		my $query = qq|
193
			SELECT *
197
			SELECT *
194
			FROM   itemtypes
198
                   FROM itemtypes
195
			order by description
199
                 $hide_sql
200
                      ORDER BY description
196
		|;
201
		|;
197
		my $sth = C4::Context->dbh->prepare($query);
202
		my $sth = C4::Context->dbh->prepare($query);
198
		$sth->execute;
203
		$sth->execute;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 358-363 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
358
('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)','Free'),
358
('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)','Free'),
359
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
359
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
360
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
360
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
361
('SuggestionsHideItemTypes', '', 'Item types to hide from the purchase suggestion forms, delimited by spaces', 'free' ),
361
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
362
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
362
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
363
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
363
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
364
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 7743-7748 if(CheckVersion($DBversion)) { Link Here
7743
    SetVersion($DBversion);
7743
    SetVersion($DBversion);
7744
}
7744
}
7745
7745
7746
$DBversion = "3.13.00.XXX";
7747
if ( CheckVersion($DBversion) ) {
7748
   $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SuggestionsHideItemTypes', '', 'Item types to hide from the purchase suggestion forms, delimited by spaces', 'free' )");
7749
   print "Upgrade to $DBversion done (Bug 9468 - Add ability to hide items from purchase suggestions forms)\n";
7750
   SetVersion ($DBversion);
7751
}
7752
7746
=head1 FUNCTIONS
7753
=head1 FUNCTIONS
7747
7754
7748
=head2 TableExists($table)
7755
=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