Skip to content

Commit

Permalink
Updates to plugin target to get code working
Browse files Browse the repository at this point in the history
  • Loading branch information
mmabrahamson committed Aug 16, 2021
1 parent 83c67ea commit 4f3e702
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 49 deletions.
18 changes: 11 additions & 7 deletions Koha/Plugin/EDS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ my ($PluginDir) = grep { -f $_ . "/Koha/Plugin/EDS.pm" } @pluginsdir;
$PluginDir = $PluginDir.'/Koha/Plugin/EDS';

################# DO NOT TOUCH - CONTROLLED BY build.py
our $MAJOR_VERSION = "20.11";
our $SUB_VERSION = "009";
our $MAJOR_VERSION = "21.05";
our $SUB_VERSION = "001";
our $VERSION = $MAJOR_VERSION . "" . $SUB_VERSION;
our $SHA_ADD = "https://widgets.ebscohost.com/prod/api/koha/sha/1711.json";
our $DATE_UPDATE = '2021-08-02';
our $DATE_UPDATE = '2021-08-16';
######################################################

## Here is our metadata, some keys are required, some are optional
Expand Down Expand Up @@ -110,6 +110,7 @@ sub configure {
defaultparams => $self->retrieve_data('defaultparams'),
autocomplete_mode => $self->retrieve_data('autocomplete_mode'),
autocomplete => $self->retrieve_data('autocomplete'),
PLUGIN_HTTP_PATH => $self->get_plugin_http_path(),


);
Expand Down Expand Up @@ -175,7 +176,8 @@ sub update_EDSScript_js {
autocomplete => ($cgi->param('autocomplete')?$cgi->param('autocomplete'):"-"),
authtoken => $cgi->param('authtoken'),
lastedsinfoupdate => $cgi->param('lastedsinfoupdate'),
edsinfo => quotemeta($self->retrieve_data('edsinfo'))
edsinfo => quotemeta($self->retrieve_data('edsinfo')),
PLUGIN_HTTP_PATH => $self->get_plugin_http_path(),
};
#my $pluginsdir = C4::Context->config('pluginsdir');
#my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir;
Expand All @@ -185,8 +187,9 @@ sub update_EDSScript_js {
# push @plugindirs, $plugindir
#}
my $template = Template->new({
INCLUDE_PATH => $PluginDir,
OUTPUT_PATH => $PluginDir
INCLUDE_PATH => $PluginDir,
OUTPUT_PATH => $PluginDir,
PLUGIN_HTTP_PATH => $self->get_plugin_http_path(),
});
$template->process('js/EDSScript.tt',$vars, 'js/EDSScript.js');
$template->process('opac/templates/eds-methods.tt',$vars, 'opac/eds-methods.pl');
Expand Down Expand Up @@ -244,7 +247,7 @@ sub opac_js {
<script>
var defaultSearch="| . $default_search . q|";
</script>
<script src="/plugin/Koha/Plugin/EDS/js/EDSScript.js">
<script src="|. $self->get_plugin_http_path() . q|/js/EDSScript.js">
</script>
|;
}
Expand Down Expand Up @@ -372,6 +375,7 @@ sub SetupTool {
customjs =>\@customJSContent,
jsstate =>$customJS,
plugin_dir =>$PluginDir,
PLUGIN_HTTP_PATH => $self->get_plugin_http_path(),

);

Expand Down
6 changes: 3 additions & 3 deletions Koha/Plugin/EDS/admin/configure.tt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]

<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/plugins/plugins-home.pl">Plugins</a> &rsaquo; EDS API &rsaquo; Configure</div>
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="[% $path %]/plugins-home.pl">Plugins</a> &rsaquo; EDS API &rsaquo; Configure</div>

<div id="doc3">
<div align="right" style="float:right;width:170px"><a href="https://eadmin.ebscohost.com" target="_blank"><img src="https://eadmin.ebscohost.com/eadmin/images/lib/logoAdmin.gif" ></a>
Expand Down Expand Up @@ -234,15 +234,15 @@ function EDSUpdateInfo(){
$('#updateInfoBtn').val('Loading - this page will refresh in 10 seconds. Please wait...');
$('#updateInfoBtn').attr('disabled','disabled');

var updateURL = '[% OPACBaseURL %]/plugin/Koha/Plugin/EDS/opac/eds-raw.pl?q=info';
var updateURL = '[% OPACBaseURL %][% PLUGIN_HTTP_PATH %]/opac/eds-raw.pl?q=info';
console.log(updateURL);
var infoUpdateWindow=window.open(updateURL,'infoUpdateWindow',"width=100, height=10, top=0, left=0");
setTimeout(function(){location.reload();},10000);

}

function GetLocalIP(){
window.open('[% OPACBaseURL %]/plugin/Koha/Plugin/EDS/opac/eds-raw.pl?q=getip','getLocalIP',"width=100, height=10, top=0, left=0");
window.open('[% OPACBaseURL %][% PLUGIN_HTTP_PATH %]/opac/eds-raw.pl?q=getip','getLocalIP',"width=100, height=10, top=0, left=0");
}

</script>
Expand Down
8 changes: 4 additions & 4 deletions Koha/Plugin/EDS/admin/release_notes.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DO NOT TOUCH THIS FILE - controlled by build.py -->
<kohaplugin>
<latestversion>20.11.009</latestversion>
<latestversion>21.05.001</latestversion>
<download>https://github.com/ebsco/edsapi-koha-plugin</download>
<lastupdated>2021/08/02</lastupdated>
<lastupdated>2021/08/16</lastupdated>
<releasenotes>
<release version="20.11.009" date="2021/08/02">
<note id="1" author="mabrahamson@ebsco.com">Updates custom links to work offline.</note>
<release version="21.05.001" date="2021/08/16">
<note id="1" author="mabrahamson@ebsco.com">Compatibility updates for 21.05.</note>
</release>
</releasenotes>
</kohaplugin>
2 changes: 1 addition & 1 deletion Koha/Plugin/EDS/bootstrap/modules/eds-advsearch.tt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<fieldset class="action">
<p>
<input class="btn btn-primary advSB" type="submit" accesskey="s" name="do" title="Search" value="Search">
<a href="/plugin/Koha/Plugin/EDS/opac/eds-search.pl" class="btn btn-default new-search">New search</a>
<a href="[% PLUGIN_HTTP_PATH %]/opac/eds-search.pl" class="btn btn-default new-search">New search</a>
</p>
</fieldset>
<!-- /SEARCH BUTTONS -->
Expand Down
2 changes: 1 addition & 1 deletion Koha/Plugin/EDS/bootstrap/modules/eds-results.tt
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
[% BREAK %]
[% END %]
[% ELSE %]
<a class="title" href="/plugin/Koha/Plugin/EDS/opac/eds-detail.pl?q=Retrieve?an=[% RECORD.Header.An %]|dbid=[%RECORD.Header.DbId%]&resultid=[% RECORD.ResultId %]" title="[% EDSLANG.eds_results_TT_title_attr %]">[% ITEM.Data %]</a>
<a class="title" href="[% PLUGIN_HTTP_PATH %]/opac/eds-detail.pl?q=Retrieve?an=[% RECORD.Header.An %]|dbid=[%RECORD.Header.DbId%]&resultid=[% RECORD.ResultId %]" title="[% EDSLANG.eds_results_TT_title_attr %]">[% ITEM.Data %]</a>
[% END %]
</div>
[% #IMAGE START %]
Expand Down
2 changes: 1 addition & 1 deletion Koha/Plugin/EDS/bootstrap/modules/pfi-results.tt
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
[% BREAK %]
[% END %]
[% ELSE %]
<a class="title" href="/plugin/Koha/Plugin/EDS/opac/eds-detail.pl?q=Retrieve?id=[% RECORD.Header.PublicationId %]|dbid=edspub&resultid=[% RECORD.ResultId %]" title="[% EDSLANG.eds_results_TT_title_attr %]">[% ITEM.Data %]</a>
<a class="title" href="[% PLUGIN_HTTP_PATH %]/opac/eds-detail.pl?q=Retrieve?id=[% RECORD.Header.PublicationId %]|dbid=edspub&resultid=[% RECORD.ResultId %]" title="[% EDSLANG.eds_results_TT_title_attr %]">[% ITEM.Data %]</a>
[% END %]
</div>
[% #IMAGE START %]
Expand Down
Loading

0 comments on commit 4f3e702

Please sign in to comment.