From d5430985a03de5a927b5ccf46ab20f6379bee347 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 29 May 2024 18:08:48 +0000 Subject: [PATCH] Add ability to specify the port CircIT is listening on --- Koha/Plugin/Com/ByWaterSolutions/RFID.pm | 12 +++- .../Com/ByWaterSolutions/RFID/configure.tt | 63 ++++--------------- .../RFID/static_files/rfid.js | 2 +- package.json | 3 +- 4 files changed, 23 insertions(+), 57 deletions(-) diff --git a/Koha/Plugin/Com/ByWaterSolutions/RFID.pm b/Koha/Plugin/Com/ByWaterSolutions/RFID.pm index 2a6ae9d..e471204 100644 --- a/Koha/Plugin/Com/ByWaterSolutions/RFID.pm +++ b/Koha/Plugin/Com/ByWaterSolutions/RFID.pm @@ -48,14 +48,14 @@ sub configure { ## Grab the values we already have for our settings, if any exist $template->param( - SomeSetting => $self->retrieve_data('SomeSetting'), + TechLogicCircItPort => $self->retrieve_data('TechLogicCircItPort'), ); $self->output_html($template->output()); } else { $self->store_data({ - SomeSetting => $cgi->param('SomeSetting'), + TechLogicCircItPort => $cgi->param('TechLogicCircItPort'), }); $self->go_home(); } @@ -79,7 +79,13 @@ sub static_routes { sub intranet_js { my ( $self ) = @_; - return ''; + my $TechLogicCircItPort = $self->retrieve_data('TechLogicCircItPort') || '9201'; + return qq{ + + + }; } 1; diff --git a/Koha/Plugin/Com/ByWaterSolutions/RFID/configure.tt b/Koha/Plugin/Com/ByWaterSolutions/RFID/configure.tt index 9dc906c..14f0857 100644 --- a/Koha/Plugin/Com/ByWaterSolutions/RFID/configure.tt +++ b/Koha/Plugin/Com/ByWaterSolutions/RFID/configure.tt @@ -1,18 +1,16 @@ [% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] - Koha: Kitchen Sink Plugin: Configuration + Koha: RFID Plugin: Configuration [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] - +
- - -

Koha: Kitchen Sink Plugin: Configuration

+

RFID plugin configuration

@@ -20,59 +18,20 @@ - - - -

- - - - -

- - - - -

+

+ + + The port that CircIT is listening on. Defaults to 9201 if blank. +
+
-
- -

-

Upgrade status
- [% IF last_upgraded %] - Plugin was last upgraded on this system on [% last_upgraded | $KohaDates with_hours => 1 %] - [% ELSE %] - Plugin has never been upgraded. - [% END %] -

[% INCLUDE 'intranet-bottom.inc' %] diff --git a/Koha/Plugin/Com/ByWaterSolutions/RFID/static_files/rfid.js b/Koha/Plugin/Com/ByWaterSolutions/RFID/static_files/rfid.js index b5ac95f..d456800 100644 --- a/Koha/Plugin/Com/ByWaterSolutions/RFID/static_files/rfid.js +++ b/Koha/Plugin/Com/ByWaterSolutions/RFID/static_files/rfid.js @@ -1,4 +1,4 @@ -const circit_address = "http://localhost:9201"; +const circit_address = `http://localhost:${TechLogicCircItPort}` || "9201"; const rfid_get_items_url = `${circit_address}/getitems`; // Sometimes we need to halt processing on non-batch pages and continue after the issue has been resolved diff --git a/package.json b/package.json index b4cf978..5cc180c 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "prettier": "3.2.5" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "tidy": "prettier . --write" }, "repository": { "type": "git",