use Koha::Acquisition::Orders;
use Koha::Virtualshelves;
use Koha::Patrons;
+use Koha::Plugins;
use Koha::Ratings;
use Koha::Reviews;
+use Try::Tiny;
+
my $query = CGI->new();
my $biblionumber = $query->param('biblionumber') || $query->param('bib') || 0;
anonymous_session => ($borrowernumber) ? 0 : 1
};
+ if ( C4::Context->config("enable_plugins") ) {
+
+ my @plugins = Koha::Plugins->new->GetPlugins({
+ method => 'opac_detail_xslt_variables',
+ });
+
+ if (@plugins) {
+ foreach my $plugin ( @plugins ) {
+ try {
+ my $plugin_variables = $plugin->opac_detail_xslt_variables(
+ {
+ biblio_id => $biblionumber,
+ lang => $lang,
+ patron_id => $borrowernumber
+ }
+ );
+ $variables = { %$variables, %$plugin_variables };
+ }
+ catch {
+ warn "$_";
+ };
+ }
+ }
+ }
+
$template->param(
XSLTBloc => XSLTParse4Display(
$biblionumber, $record, "OPACXSLTDetailsDisplay", 1, undef,
## load Koha modules
use C4::Context;
use List::MoreUtils q/any/;
+use Try::Tiny;
use Data::Dumper; # TODO remove
use Koha::Virtualshelves;
use Koha::Library::Groups;
use Koha::Patrons;
+use Koha::Plugins;
use Koha::SearchFields;
use POSIX qw(ceil floor strftime);
}
my $variables = { anonymous_session => ($borrowernumber) ? 0 : 1 };
+if ( C4::Context->config("enable_plugins") ) {
+
+ my @plugins = Koha::Plugins->new->GetPlugins({
+ method => 'opac_results_xslt_variables',
+ });
+
+ if (@plugins) {
+ foreach my $plugin ( @plugins ) {
+ try {
+ my $plugin_variables = $plugin->opac_results_xslt_variables(
+ {
+ lang => $lang,
+ patron_id => $borrowernumber
+ }
+ );
+ $variables = { %$variables, %$plugin_variables };
+ }
+ catch {
+ warn "$_";
+ };
+ }
+ }
+}
for (my $i=0;$i<@servers;$i++) {
my $server = $servers[$i];