From aad03b73410af7db365c48fc65d19f95486ee460 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 19 Oct 2023 14:13:48 +0000 Subject: [PATCH] Bug 35108: Hide empty fields on ILL manage request page Optionally empty fields are: orderid, biblio_id, batch, type, type_disclaimer_value, type_disclaimer_date, cost, price_paid, notesstaff, notesopac. 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) Create a new FreeForm request, visit: /cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm 5) Set type 'Book', put '42' in the cardnumber, and pick a library. Click 'create'. 6) Notice how there is a lot of unnecessary empty field entries 7) Apply patch, restart plack (koha-plack --restart kohadev) 8) Refresh the page, notice all the empty fields entries are no longer displayed Signed-off-by: David Nind Signed-off-by: Martin Renvoize --- .../prog/en/modules/ill/ill-requests.tt | 113 ++++++++++-------- 1 file changed, 64 insertions(+), 49 deletions(-) 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 f79bcfb1d4f..38b41ed774e 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 @@ -640,10 +640,12 @@

Details from library

    -
  1. - Order ID: - [% IF request.orderid %][% request.orderid | html %][% ELSE %]N/A[% END %] -
  2. + [% IF request.orderid %] +
  3. + Order ID: + [% request.orderid | html %] +
  4. + [% END %]
  5. Patron: [% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %] @@ -651,15 +653,12 @@ [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %]
  6. - -
  7. - Bibliographic record ID: - [% IF request.biblio_id %] + [% IF request.biblio_id %] +
  8. + Bibliographic record ID: [% request.biblio_id | html %] - [% ELSE %] - N/A - [% END %] -
  9. + + [% END %]
  10. Library: [% Branches.GetName(request.branchcode) | html %] @@ -676,58 +675,74 @@ [% END %]
  11. [% IF request.ill_batch > 0 %] -
  12. - Batch: - - [% request.ill_batch.name | html %] - -
  13. +
  14. + Batch: + + [% request.ill_batch.name | html %] + +
  15. [% END %]
  16. Last updated: [% request.updated | $KohaDates with_hours => 1 %]
  17. -
  18. - Request type: - [% type = request.get_type %] - [% IF type %][% type | html %][% ELSE %]N/A[% END %] -
  19. -
  20. - Type disclaimer value: - [% type_disclaimer_value = request.get_type_disclaimer_value %] - [% IF type_disclaimer_value %][% type_disclaimer_value | html %][% ELSE %]N/A[% END %] -
  21. -
  22. - Type disclaimer date: - [% type_disclaimer_date = request.get_type_disclaimer_date %] - [% IF type_disclaimer_date %][% type_disclaimer_date | $KohaDates with_hours => 1 %][% ELSE %]N/A[% END %] -
  23. -
  24. - Cost: - [% IF request.cost %][% request.cost | $Price %][% ELSE %]N/A[% END %] -
  25. -
  26. - Price paid: - [% IF request.price_paid %][% request.price_paid | $Price %][% ELSE %]N/A[% END %] -
  27. -
  28. - Staff notes: -

    [% request.notesstaff | html %]

    -
  29. -
  30. - Notes: -

    [% request.notesopac | html %]

    -
  31. + [% type = request.get_type %] + [% IF type %] +
  32. + Request type: + [% type | html %] +
  33. + [% END %] + [% type_disclaimer_value = request.get_type_disclaimer_value %] + [% IF type_disclaimer_value %] +
  34. + Type disclaimer value: + [% type_disclaimer_value | html %] +
  35. + [% END %] + [% type_disclaimer_date = request.get_type_disclaimer_date %] + [% IF type_disclaimer_date %] +
  36. + Type disclaimer date: + [% type_disclaimer_date | $KohaDates with_hours => 1 %] +
  37. + [% END %] + [% IF request.cost %] +
  38. + Cost: + [% request.cost | $Price %] +
  39. + [% END %] + [% IF request.price_paid %] +
  40. + Price paid: + [% request.price_paid | $Price %] +
  41. + [% END %] + [% IF request.notesstaff %] +
  42. + Staff notes: +

    [% request.notesstaff | html %]

    +
  43. + [% END %] + [% IF request.notesopac %] +
  44. + Notes: +

    [% request.notesopac | html %]

    +
  45. + [% END %]

Details from supplier ([% request.backend | html %])

    [% FOREACH meta IN request.metadata %] + [% IF meta.value %]
  1. [% meta.key.replace('_',' ') | html %]: [% meta.value | html %]
  2. + [% END %] [% END %]
-- 2.39.2