From 05f89bc89f484492ba258ba40382db8856c9cc81 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 19 Oct 2023 13:53:29 +0000 Subject: [PATCH] Bug 35107: Show type disclaimer value and date in request details Test plan, k-t-d: 1) Install FreeForm and BLDSS backends, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev-plus.sh) 2) Set ILLModuleDisclaimerByType system preference , visit: /cgi-bin/koha/admin/preferences.pl?tab=interlibrary_loans#interlibrary_loans_Workflow 3) Copy the example code, click the 'Click to edit' link to open the text area, and paste the example yaml: all: text: |

HTML title

This is an HTML paragraph

This is another HTML paragraph

av_category_code: YES_NO article: text: copyright text for all article type requests av_category_code: YES_NO bypass: 1 4) Create a new FreeForm request, visit: /cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm 5) Set type 'Book', put'9780822370451' in ISBN, put '42' in the cardnumber, and pick a library 6) You should now be in the type disclaimer stage, click 'Submit' 7) Notice the disclaimer value and date are displayed under 'Details from supplier' 8) Click the top 'Switch provider' button and pick BLDSS 9) You should get one result, click the 'Request BLL01018665793' link to finish the migration 10) You should now be in the ILL table, click the request that was just migrated to BLDSS 11) Notice the type disclaimer information is no longer visible 12) Apply patch, restart plack: koha-plack --restart kohadev 13) Refresh the BLDSS request, the information should now be visible in the 'Request details' section Signed-off-by: Richard Bridgen Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer --- Koha/Illrequest.pm | 30 +++++++++++++++++++ .../prog/en/modules/ill/ill-requests.tt | 10 +++++++ 2 files changed, 40 insertions(+) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index b4c8057d57..b6413113bc 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -1103,6 +1103,36 @@ sub get_type { return $attr->value; }; +=head3 get_type_disclaimer_value + + my $type = $abstract->get_type_disclaimer_value(); + +Return the value submitted in the type disclaimer workflow stage + +=cut + +sub get_type_disclaimer_value { + my ($self) = @_; + my $attr = $self->illrequestattributes->find( { type => 'type_disclaimer_value' } ); + return if !$attr; + return $attr->value; +} + +=head3 get_type_disclaimer_date + + my $type = $abstract->type_disclaimer_date(); + +Return the time the disclaimer was submitted in the type disclaimer workflow stage + +=cut + +sub get_type_disclaimer_date { + my ($self) = @_; + my $attr = $self->illrequestattributes->find( { type => 'type_disclaimer_date' } ); + return if !$attr; + return $attr->value; +} + #### Illrequests Imports =head3 check_limits diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 1ae4f9b2cf..d63a1cb49c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -692,6 +692,16 @@ [% type = request.get_type %] [% IF type %][% type | html %][% ELSE %]N/A[% END %] +
  • + Type disclaimer value: + [% type_disclaimer_value = request.get_type_disclaimer_value %] + [% IF type_disclaimer_value %][% type_disclaimer_value | html %][% ELSE %]N/A[% END %] +
  • +
  • + Type disclaimer date: + [% type_disclaimer_date = request.get_type_disclaimer_date %] + [% IF type_disclaimer_date %][% type_disclaimer_date | html %][% ELSE %]N/A[% END %] +
  • Cost: [% IF request.cost %][% request.cost | $Price %][% ELSE %]N/A[% END %] -- 2.39.5