Browse Source

Bug 20799: (QA follow-up) Move syspref check

This patch moves the syspref check into the controller to save a DB
query if the module is not enabled.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

JD - amended patch: removing trailing parenthesis in the IF statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Martin Renvoize 4 years ago
committed by Jonathan Druart
parent
commit
3b9c0f338b
  1. 5
      catalogue/detail.pl
  2. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

5
catalogue/detail.pl

@ -540,7 +540,10 @@ my $holds = $biblio->holds;
$template->param( holdcount => $holds->count );
# Check if there are any ILL requests connected to the biblio
my $illrequests = Koha::Illrequests->search({ biblio_id => $biblionumber });
my $illrequests =
C4::Context->preference('ILLModule')
? Koha::Illrequests->search( { biblio_id => $biblionumber } )
: [];
$template->param( illrequests => $illrequests );
my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');

2
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

@ -128,7 +128,7 @@
</span>
[% END %]
[% IF ( Koha.Preference( 'ILLModule' ) && illrequests.count ) %]
[% IF illrequests.count %]
<span class="results_summary">
<span class="label">ILL requests:</span>
[% IF CAN_user_ill %]

Loading…
Cancel
Save