Skip to content

Commit 39056cc

Browse files
authored
Merge pull request #113 from ebsco/koha-2105-linking-issues
Update to correct linking issues with title links
2 parents 4a96d79 + b7c7a49 commit 39056cc

8 files changed

Lines changed: 19 additions & 17 deletions

File tree

Koha/Plugin/EDS.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use Modern::Perl;
44
use base qw(Koha::Plugins::Base);
55
use C4::Context;
66
use Encode qw(encode);
7+
use URI::Escape;
78
use C4::Members;
89
use C4::Auth;
910
use Cwd qw( abs_path );
@@ -30,10 +31,10 @@ $PluginDir = $PluginDir.'/Koha/Plugin/EDS';
3031

3132
################# DO NOT TOUCH - CONTROLLED BY build.py
3233
our $MAJOR_VERSION = "21.05";
33-
our $SUB_VERSION = "001";
34+
our $SUB_VERSION = "002";
3435
our $VERSION = $MAJOR_VERSION . "" . $SUB_VERSION;
3536
our $SHA_ADD = "https://widgets.ebscohost.com/prod/api/koha/sha/1711.json";
36-
our $DATE_UPDATE = '2021-08-17';
37+
our $DATE_UPDATE = '2021-10-12';
3738
######################################################
3839

3940
## Here is our metadata, some keys are required, some are optional
@@ -136,6 +137,7 @@ sub configure {
136137
defaultparams => ($cgi->param('defaultparams')?$cgi->param('defaultparams'):"-"),
137138
autocomplete_mode => ($cgi->param('autocomplete_mode')?$cgi->param('autocomplete_mode'):"-"),
138139
autocomplete => ($cgi->param('autocomplete')?$cgi->param('autocomplete'):"-"),
140+
PLUGIN_HTTP_PATH => $self->get_plugin_http_path(),
139141
}
140142
);
141143

@@ -375,8 +377,6 @@ sub SetupTool {
375377
customjs =>\@customJSContent,
376378
jsstate =>$customJS,
377379
plugin_dir =>$PluginDir,
378-
PLUGIN_HTTP_PATH => $self->get_plugin_http_path(),
379-
380380
);
381381

382382
print $cgi->header();
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- DO NOT TOUCH THIS FILE - controlled by build.py -->
33
<kohaplugin>
4-
<latestversion>21.05.001</latestversion>
4+
<latestversion>21.05.002</latestversion>
55
<download>https://github.com/ebsco/edsapi-koha-plugin</download>
6-
<lastupdated>2021/08/17</lastupdated>
6+
<lastupdated>2021/10/12</lastupdated>
77
<releasenotes>
8-
<release version="21.05.001" date="2021/08/17">
9-
<note id="1" author="mabrahamson@ebsco.com">Compatibility updates for 21.05.</note>
8+
<release version="21.05.002" date="2021/10/12">
9+
<note id="1" author="mabrahamson@ebsco.com">Fixes issues with link generation.</note>
1010
</release>
1111
</releasenotes>
1212
</kohaplugin>

Koha/Plugin/EDS/bootstrap/modules/eds-results.tt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
66
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
77
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
8-
98
[% IF firstPage %]
109
[% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
1110
[% SET RecordedBooksEnabled = Koha.Preference('RecordedBooksLibraryID') && Koha.Preference('RecordedBooksClientSecret') %]
@@ -299,13 +298,13 @@
299298
<span class="label">[% EDSLANG.eds_results_TT_links %] </span>
300299
[% FOREACH CUSTOMLINK IN RECORD.FullText.Text.Availability %]
301300

302-
<a class="html-customlink" target="_blank" href="eds-detail.pl?q=Retrieve?an=[% ResultRecordId %]|dbid=[%RECORD.Header.DbId%]&fulltext=html" title="[% CUSTOMLINK.MouseOverText %]">
301+
<a class="html-customlink" target="_blank" href="[% PLUGIN_HTTP_PATH %]/opac/eds-detail.pl?q=Retrieve?an=[% ResultRecordId %]|dbid=[%RECORD.Header.DbId%]&fulltext=html" title="[% CUSTOMLINK.MouseOverText %]">
303302
[% EDSLANG.eds_results_TT_links_html %]
304303
</a>
305304
[% END %]
306305
[% FOREACH CUSTOMLINK IN RECORD.FullText.Links %]
307306

308-
<a class="[% CUSTOMLINK.Type %]" target="_blank" href="eds-detail.pl?q=Retrieve?an=[% RECORD.Header.An %]|dbid=[%RECORD.Header.DbId%]&fulltext=[% CUSTOMLINK.Type %]" title="[% CUSTOMLINK.MouseOverText %]" style="height: 16px; display: inline-block;">
307+
<a class="[% CUSTOMLINK.Type %]" target="_blank" href="[% PLUGIN_HTTP_PATH %]/opac/eds-detail.pl?q=Retrieve?an=[% RECORD.Header.An %]|dbid=[%RECORD.Header.DbId%]&fulltext=[% CUSTOMLINK.Type %]" title="[% CUSTOMLINK.MouseOverText %]" style="height: 16px; display: inline-block;">
309308
[% IF CUSTOMLINK.Type == 'pdflink' %][% EDSLANG.eds_results_TT_links_pdf %]
310309
[% ELSIF CUSTOMLINK.Type == 'ebook-pdf' %][% EDSLANG.eds_results_TT_links_ebook %]
311310
[% ELSE %][% CUSTOMLINK.Type %][% END %]

Koha/Plugin/EDS/js/EDSScript.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ edsConfig.defaultparams = "[% defaultparams %]";
3636
edsConfig.autocomplete = "[% autocomplete %]";
3737
edsConfig.autocomplete_mode = "[% autocomplete_mode %]";
3838
edsConfig.edsprofileid = "[% edsprofileid %]";
39-
39+
edsConfig.pluginhttppath = "[% PLUGIN_HTTP_PATH %]";
4040
// Adv search settings
4141
var searchBlockCount = 3;
4242

4343
// DO NOT TOUCH - controlled by build.py
44-
var versionEDSKoha = "21.05001";
44+
var versionEDSKoha = "21.05002";
4545
///////////////////////////////////////
4646

4747
if (document.title == "") {

Koha/Plugin/EDS/opac/eds-search.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@
244244
OPACResultsSidebar => C4::Context->preference('OPACResultsSidebar'),
245245
expanders =>$EDSInfo->{AvailableSearchCriteria}->{AvailableExpanders},
246246
guestTrack =>$GuestTracker,
247+
PLUGIN_HTTP_PATH => $EDSConfig->{pluginhttppath},
247248
);
248249

249250
my $casAuthentication = C4::Context->preference('casAuthentication');

Koha/Plugin/EDS/opac/templates/eds-methods.tt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ my $input = new CGI;
3636
my $dbh = C4::Context->dbh;
3737

3838

39-
our ( $edsusername, $edsprofileid, $edspassword, $edscustomerid, $defaultsearch, $cookieexpiry, $cataloguedbid, $catalogueanprefix, $authtoken, $logerrors, $iprange, $edsinfo, $lastedsinfoupdate, $defaultparams, $defaultEDSQuery, $SessionToken, $GuestTracker, $autocomplete, $autocomplete_mode)="";
39+
our ( $edsusername, $edsprofileid, $edspassword, $edscustomerid, $defaultsearch, $cookieexpiry, $cataloguedbid, $catalogueanprefix, $authtoken, $logerrors, $iprange, $edsinfo, $lastedsinfoupdate, $defaultparams, $defaultEDSQuery, $SessionToken, $GuestTracker, $autocomplete, $autocomplete_mode, $pluginhttppath)="";
4040

4141
our $PluginClass='Koha::Plugin::EDS';
4242
our $table='plugin_data';
@@ -90,6 +90,7 @@ $catalogueanprefix = "[% catalogueanprefix %]";
9090
$authtoken = "[% authtoken %]";
9191
$logerrors = "[% logerrors %]";
9292
$iprange = "[% iprange %]";
93+
$pluginhttppath = qq([% PLUGIN_HTTP_PATH %]);
9394
$edsinfo = Encode::encode('UTF-8',qq([% edsinfo %]));
9495
#$edsinfo =~ s/\\\\//g;
9596
print STDERR "IN METHOD, EDSINFO IS ".$edsinfo;
@@ -266,7 +267,8 @@ sub EDSGetConfiguration
266267
'autocomplete_mode' => $autocomplete_mode,
267268
'edsusername' => $edsusername,
268269
'edsprofileid' => $edsprofileid,
269-
'edspassword' => $edspassword
270+
'edspassword' => $edspassword,
271+
'pluginhttppath' => $pluginhttppath,
270272
);
271273
my $JSONConfig = encode_json \%ConfigArray;
272274
#my $JSONConfig = encode_json '{"defaultsearch":"'.$defaultsearch.'","logerrors":"'.$logerrors.'","iprange":"'.$iprange.'","cookieexpiry":"'.$cookieexpiry.'","cataloguedbid":"'.$cataloguedbid.'","catalogueanprefix":"'.$catalogueanprefix.'","defaultparams":"'.$defaultparams.'","autocomplete": "'.$autocomplete.'", "autocomplete_mode": "'.$autocomplete_mode.'", "edsusername":"'.$edsusername.'", "edsprofileid":"'.$edsprofileid.'", "edspassword":"'.$edspassword.'"}';

version.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"MajorVersion": "21.05",
3-
"MinorVersion": "001",
3+
"MinorVersion": "002",
44
"ReleaseNotes": [
55
{
66
"author": "mabrahamson@ebsco.com",
7-
"note": "Compatibility updates for 21.05."
7+
"note": "Fixes issues with link generation."
88
}
99
],
1010
"ShaAdd": "https://widgets.ebscohost.com/prod/api/koha/sha/1711.json"

0 commit comments

Comments
 (0)