Bug 27296: Return claims should be filtered by default to show unresolved claims
authorOwen Leonard <oleonard@myacpl.org>
Mon, 9 Nov 2020 19:36:22 +0000 (19:36 +0000)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Thu, 17 Feb 2022 20:16:17 +0000 (20:16 +0000)
commit7c07a19be15f9884878b6d327d7ecc28c1abab74
tree49fd16170e422baace2658318b5798891dc9abab
parent7e1e62d69b64c318562306ae15d9cd674e0a1529
Bug 27296: Return claims should be filtered by default to show unresolved claims

This patch modifies the DataTables configuration of the return claims
table on the checkout and patron detail pages. Using the footerCallback
function, the count of resolved and unresolved claims is calculated and
used to filter the list of claims to show only unresolved claims by
default.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- If necessary, Enable claims returned functionality by defining a value
  in the ClaimReturnedLostValue system preference.
- Open for checkout a patron who has items checked out.
- From the table of checkouts, click "Claim returned" for one or more
  items.
  - As you mark items "Clamed returned," the the items should appear
    under the "Claims" tab. The corresonding filter links should be
    updated accordingly, "Show all X claims."
  - Mark one or more claims resolved. As you do so they should disappear
    from the list of claims. The filter links should be updated to
    reflect that there are some resolved and some unresolved claims.
  - Clicking each filter link should trigger the correct filter.
  - Test this process when the count of unresolved claims is zero and
    when the cound of resolved claims is zero.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/checkouts.js for
  translation, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:1086
  msgid "Show 1 claim"
  msgid_plural "Show all {count} claims"
  msgstr[0] ""
  msgstr[1] ""

- Edit the "msgstr" strings however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client and
  repeat the test plan above. The translated strings should appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e6a8a2d624b1c3cf48d2b1d9039f74d18e1324f8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
koha-tmpl/intranet-tmpl/prog/en/includes/patron-return-claims.inc
koha-tmpl/intranet-tmpl/prog/js/checkouts.js