Bug 19605: Add support for ILL backends as plugins
authorPedro Amorim <pedro.amorim@ptfs-europe.com>
Mon, 30 Oct 2023 12:14:04 +0000 (11:14 -0100)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 19 Apr 2024 17:54:40 +0000 (19:54 +0200)
commit37935c7284bd8424f3ad57bdcc5c79da73daa495
treee2bc367e15a15425eaf27ef0e7ba31c63eefab9b
parent513657b09a00934009f77adaf2c31fdea98ecce7
Bug 19605: Add support for ILL backends as plugins

This is designed to maintain existing functionality of loading ILL
backends through the backend_dir config (default Koha/Illbackends/).

A check for a plugin of a given backend name takes precedence over a
backend of the same name loaded the old way through backend_dir, this
means that if this happens, the backend plugin is used and NOT the
backend present in backend_dir.

Old backend_dir backends AND new backend plugins coexist.

Test plan, k-t-d:
1) Enable ILLModule and install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) Install the plugin ILL backend example .kpz located at:
https://github.com/ammopt/koha-ill-backend-plugin/releases/tag/1.0.0
3) koha-plack --restart kohadev
4) Visit ILL requests:
/cgi-bin/koha/ill/ill-requests.pl
5) Click "+ New ILL request". Notice it lists 'FreeForm' and
   'PluginBackend'
6) Click 'PluginBackend'. Enter a '123' in pubmedid, '42' in cardnumber
   and pick a library. Click 'Marke request'
7) Notice the request is created successfully.
8) Visit plugins:
/cgi-bin/koha/plugins/plugins-home.pl
9) Click "View plugin by class". Pick "ill backend plugins". Notice the
   correct plugin is listed.
10) Click "configure" on the ILL backend plugin. Notice it's a normal
    plugin configuration page

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Koha/Illrequest.pm
Koha/Illrequest/Config.pm