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>
$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');
</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 %]