koha.git
10 months agoBug 34627: CMS pages do not correctly display the opaccredits footer
Owen Leonard [Mon, 28 Aug 2023 10:59:29 +0000 (10:59 +0000)]
Bug 34627: CMS pages do not correctly display the opaccredits footer

This patch corrects the page structure of CMS pages in the OPAC so that
the contents of the footer, including opaccredits, OpacKohaUrl, and the
language selection bar, are displayed correctly.

This patch contains indentation changes, so ignore whitespace when
viewing the diff.

To test you should have these settings:

- OpacKohaUrl enabled in system preferences
- Some content in the opaccredits HTML customization region
- Some content in the OpacNav HTML customization region
- At least one translation installed and enabled
- The opaclanguagesdisplay preference enabled
- The OpacLangSelectorMode set to "only footer" or "both top and footer"

- Apply the patch and go to Tools -> Pages and create a page with the
  display location "OPAC."
- Open the OPAC link for your newly-created page and confirm that the
  page looks correct:
  - The "main" region with the white background should contain the
    breadcrumb navigation, the sidebar OpacNav content, and the contents
    of your CMS page.
  - The opaccredits and OpacKohaUrl content should appear below that
    region.
  - The language selection footer should be at the bottom of the page.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d5dc65867a55045fa32189d177379e70ecf5725)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b12a5fa840c665a0ad2721ef3f3fe3c19a6dd55)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34505: Patron invalid age in search_for_data_inconsistencies.pl skip expired...
Fridolin Somers [Wed, 9 Aug 2023 07:44:24 +0000 (21:44 -1000)]
Bug 34505: Patron invalid age in search_for_data_inconsistencies.pl skip expired patrons

Bug 26311 added patron invalid age in search_for_data_inconsistencies.pl
But this is not relevant for expired patrons, especially in child categories.
Check should skip expired patrons

1) Set a non-expired patron with invalid age
2) Run misc/maintenance/search_for_data_inconsistencies.pl
=> Check you see the patron
3) Edit patron to be expired
4) Run misc/maintenance/search_for_data_inconsistencies.pl
=> Check you do not see the patron

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] If we do not want to test valid age for expired patrons, you should
obviously test expired first. Reversing the order in the test.
Putting it in the search criteria would be nicer but leads to more
complicated code.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c26dff61e729df5c782840dfe29f032c83e0e14b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 22674a7ddfd986e80c7e65c9843f17b610cdcb11)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34356: Make sort order always default to correct column
Lucas Gass [Thu, 17 Aug 2023 17:25:56 +0000 (17:25 +0000)]
Bug 34356: Make sort order always default to correct column

To test:
1- Check out an item to a patron
2- View checkout history, default sort is on 'Date due'
3- Enable RecordStaffUserOnCheckout
4- View checkout history, default sort is on 'Checked out by'
5- Apply patch
6- Table should sort to 'Date due' no matter what the sys pref is set to

Signed-off-by: Jason <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit edad82662cf00e60bf228cd838ae86bdc1f36143)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 80cc0c03aa4b561b7c80d0331c6392b1450dd11e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34386: Fix inconsistencies in Cities and tows page titles, breadcrumbs, and header
Owen Leonard [Fri, 18 Aug 2023 11:43:15 +0000 (11:43 +0000)]
Bug 34386: Fix inconsistencies in Cities and tows page titles, breadcrumbs, and header

This patch updates the cities administration page so that page title,
breadcrumb navigation, and headings are consistent with each other and
with other parts of Koha.

To test, apply the patch and go to Administration -> Cities and towns.
Check each variation of the page to confirm that page title, breadcrumb
navigation, and heading are correct.

- Main page (listing cities)
- New city
- Edit city
- Delete city

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8460158f6bf9596e933c496d86ce0591e1cfe2bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2fb195eedfecbc881eb04261625ffd267ae0c3d5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34379: Fix label of new library group button
Owen Leonard [Fri, 18 Aug 2023 08:52:06 +0000 (08:52 +0000)]
Bug 34379: Fix label of new library group button

This patch corrects the label on the button for creating a new library
group, changing it from "Add group" to "New group" for consistency.

To test, apply the patch and go to Administration -> Library groups.
Confirm that the button is now labeled "New group" and that it
still works to trigger the library group creation modal.

Signed-off-by: Andrew <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 879f7db9e8f835c699ad2a0c8ff9adcb4d7b5d6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e67e3bdf73fae33731bee0488db3b0b3eaceb3ac)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34385: Correct page heading of transport cost matrix page
Owen Leonard [Fri, 18 Aug 2023 11:32:42 +0000 (11:32 +0000)]
Bug 34385: Correct page heading of transport cost matrix page

This patch corrects the main heading on the transport cost matrix page
so that it matches the page title and breadcrumb navigation.

To test, apply the patch and go to Administration -> Transport cost
matrix. Confirm that the page heading reads "Transport cost matrix."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7daaa901b6ec8a0fa6e2b0a8ffb7f9e6befbc5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9c54bee813e5b385719ae5490f2eb30cb6b67322)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 25023: Claims returned dates not formatted according to dateformat preference
Owen Leonard [Fri, 21 Jul 2023 11:38:32 +0000 (11:38 +0000)]
Bug 25023: Claims returned dates not formatted according to dateformat preference

This patch updates the code for rendering the claims returned table on
the checkout and patron detail pages. Now the dates are formatted using
the global js-date-format.inc code.

To test, apply the patch and make sure the claims returned feature is
enabled by setting a value in the ClaimReturnedLostValue system
preference.

- Check out some items to a patron.
- Under the checkouts tab, mark several checkouts as "Claim returned."
- Open the claims tab.
- The dates in the "Created on" column should be formatted according to
  your dateformat system preference.
  - Change the dateformat preference and return to the checkouts page.
    Confirm that the claims tab shows dates formatted correctly.
- The "created on" and "updated on" columns should sort correctly with
  any dateformat setting. You may have to directly modify the dates in
  the database in order to have the right data for testing this.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1156b3683b7231560c18e8001fc97777d007c899)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b72c5e94655f18e2eebaf6fc4df3dc330fda3379)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34219: Allow getAll to receive additional URL parameters
Jonathan Druart [Thu, 6 Jul 2023 14:13:22 +0000 (16:13 +0200)]
Bug 34219: Allow getAll to receive additional URL parameters

It's not possible to pass additional URL parameters. We need it at least for bug 32474.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f1078daf8f496e1b4234acf766578c511ca8aad1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f9dd5e449a5458966d373532fe9eeade82670b1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34331: Use register from userenv if parameter not passed
Nick Clemens [Thu, 24 Aug 2023 12:22:23 +0000 (12:22 +0000)]
Bug 34331: Use register from userenv if parameter not passed

To recreate:
1. Enable the "EnablePointofSale" syspref.
2. Set the "UseCashRegisters" syspref to use.
3. Create 3 new registers (Register A, B and C) with a float amount of $25.
4. Under POS, configure 3 new debit types (i.e. Copies, Earbuds, Friends Donation)
-- You can leave the default amounts blank, or add an amount if desired.
-- Set "Can be manually invoiced?" and "Can be sold?"
5. Under point of sale make a $5 sale of copies under Register A.
6. Under point of sale make a $10 sale of earbuds under Register B.
7. Under point of sale make a $100 sale of Friends Donation under Register C.
8. At circ/set-library.pl set your register to Register A.
9. Go back to POS and view the "Transaction history for Register A" - it shows the correct amount of $5 sold in copies.
10. Go back to circ/set-library.pl and change your register to Register B.
11. Go back to POS and view the "Transaction history for Register B" - it shows the incorrect transaction history. It is showing the transaction history for Register A.
12. Go back to circ/set-library.pl and change your register to Register C.
13. Go back to POS and view the "Transaction history for Register C" - it shows the incorrect transaction history. It is showing the transaction history for Register A.
14. Apply patch, repeat. The correct transactions should now show.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bd28eae578c215f5dc27dae6d4ce262e523f2de4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8103059faf76cf67287b9fc0a872642a759e42ad)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34341: Revert Bug 34072: Holds queue search interface hidden on small screens
Owen Leonard [Mon, 14 Aug 2023 11:49:43 +0000 (11:49 +0000)]
Bug 34341: Revert Bug 34072: Holds queue search interface hidden on small screens

This patch undoes the changes made by 34072 because they have had a more
far-reaching effect than was expected. I have never been able to
reproduce Bug 34072 before the patch.

To test, apply the patch and rebuild the staff interface CSS.

- Go to Circulation -> Holds queue
- Try adjusting the width of the browser window to confirm that it is
  responsive at various widths.
- When the viewport width is below 768 the page layout will adjust, and
  the contents of the sidebar will drop below the table of holds. This
  is consistent with other pages in the staff interface.
- Check that the corrected CSS has resulted in a correction to the
  layout of submit buttons in forms:
  - For example, in Administration -> Cities and towns -> New city.
  - Before the patch there was no padding between the submit button and
    the white fieldset containing the form fields.
  - After the patch the correct padding has been restored.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8d78ba7ff2612f784b97e76d881899b9cb8fa342)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a6e5504affb8b6f90c9322306653a3dc0783e059)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34533: jsdiff library missing from guided reports page
Owen Leonard [Tue, 15 Aug 2023 08:38:20 +0000 (08:38 +0000)]
Bug 34533: jsdiff library missing from guided reports page

This patch restores the inclusion of the jsdiff JS library on the guided
reports page when displaying saved SQL reports. This fixes a JS error in
the browser console when the user tries to use our automatic update on
SQL reports which use an older syntax.

The patch also corrects a problem with svc/convert_report which was
causing an error when trying to display the diff information.

To test, apply the patch and restart services.

- Go to Reports -> Create from SQL.
- Add a report which is based on an older db structure. The example I
  found was:

  SELECT biblionumber,
  ExtractValue(marcxml,'//datafield/@tag/text()[substring(.,1,1) = "5"]') as 'notes'
  FROM biblioitems
  HAVING notes <> ''

- Save the report and go to the list of saved reports. There should be
  an "Update" column in the table, with a message about your newly-added
  report:

  "This report seems obsolete, it uses biblioitems.marcxml field."

- Clicking the "Update SQL" button should trigger a modal window that
  shows the before an after versions of the report. There should be
  no error in the browser console. Unfortunately the diff will not
  display because of a separate bug in svc/convert_report

Signed.off-by: Jessie Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f2be2cedc5e721e715a98b18299c55a0fdfa61d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 13bc2848a1104003e423cad230a741a03ebcf2da)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34565: Label mismatch in MARC21 006 and 008 cataloging plugins
Owen Leonard [Thu, 17 Aug 2023 11:37:30 +0000 (11:37 +0000)]
Bug 34565: Label mismatch in MARC21 006 and 008 cataloging plugins

This patch modifies the JS which builds the table of options for
populating MARC21 fields 006 and 008 when using the cataloging plugin.

To test, apply the patch and go to Cataloging -> New record.

- Click the plugin trigger link next to the 006 input field (you may
  need to click the tag to expand it.
- In the table of input fields, test that clicking the label, e.g. "Type
  of material", "00 - Form of material," etc,  moves focus to the
  corresponding form field.
- Perform the same test on the plugin-popup for field 008.

Signed-off-by: Andrew <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fb48155cc4bdb17935c7d3cd4bdd4e74695d3948)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ae8937fb8d4b545309b2ecf02281f7264c644dde)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 29578: Upgrade the jQuery highlighter plugin
Andreas Roussos [Tue, 21 Feb 2023 19:02:19 +0000 (20:02 +0100)]
Bug 29578: Upgrade the jQuery highlighter plugin

Under certain conditions, the jQuery term highlighter
can break and in the process make the "Highlight" /
"Unhighlight" button disappear altogether. This affects
catalog searches in both the OPAC and the Staff Client,
with UNIMARC-based instances affected the most as the
"Highlight" / "Unhighlight" button disappears if you
perform a specific OPAC search (see Test plan below).

This patch fixes that by upgrading the highlighter
plugin to its latest version for both the OPAC and
the Staff interface. Then, the changes from commit
2e4b574074 (Bug 5844) are applied to the plugin code.
Also, Koha uses "term" instead of "highlight" as the
class name for the <span> highlighting elements, so
the plugin code is modified for that aspect, too.
Finally, the plugin file is renamed to reflect the
version change (v3 -> v5) and all references to the
old filename in the Template files are updated.

Test plan:

0) In a UNIMARC instance, catalogue two books using
   the titles given below (Title subfield = 200$a):

   Book 1: Συλλογής των εν επιτομή τοῖς πάλαι γεωγραφηθέντων
   Book 2: Επιτομή της ιστορίας των Βαλκανικών Πολέμων (1912-1913)

1) OpacHighlightedWords and StaffHighlightedWords
   should both be set to "Highlight".

2) Search the OPAC for "επιτομή των" (without the
   quotes). In the results page, notice that:

   a) You get an Uncaught DOMException error in the
      web browswer's JavaScript Console (press F12):
      "Failed to execute 'splitText' on 'Text': The
      offset 3 is larger than the Text node's length."
   b) the "Highlight" / "Unhighlight" button vanishes
   c) some search terms matches are not highlighted
      (for example "των" in the 2nd Book)

3) Repeat the same search in the Staff interface.
   In the results page, notice that:

   a) You get an Uncaught DOMException error in the
      web browswer's JavaScript Console (press F12):
      "Failed to execute 'splitText' on 'Text': The
      offset 3 is larger than the Text node's length."
   b) Even though some terms are highlighted, the
      button still says "Highlight"
   c) some search terms matches are not highlighted
      (for example "των" in the 2nd Book)

4) Apply this patch.

5) Repeat the searches (you may have to press CTRL-F5
   to reload the JavaScript code). This time the
   "Highlight" / "Unhighlight" button is displayed
   in the OPAC, and all your search terms should be
   highlighted in yellow. Toggling the highlight
   should cause no problems, and there shouldn't be
   any errors logged in your browser's Console.

Signed-off-by: Christian Nelson <christian.nelson@uwasa.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bee56606a6cf6b7f42578ed615d5a333b312d252)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f98e4faee213b2c617ccc040a89542b2f54639c9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 27496: Accessibility: Navigation buttons are poorly described by screen readers
Kevin Carnes [Fri, 18 Aug 2023 11:37:51 +0000 (13:37 +0200)]
Bug 27496: Accessibility: Navigation buttons are poorly described by screen readers

    This patch adds aria-haspopup and aria-expanded attributes to the language
    and welcome user buttons so that screen readers will know that they cause a
    popup menu to be displayed.

    To test:
    1. Use an installation with at least 2 active languages
    2. Log in the OPAC
    3. Use a screen reader (e.g. ChromeVox in Chrome) and use the tab key to
       navigate to the language and welcome user buttons while noticing that
       they are described as "Button collapsed" and "Button", respectively
    4. Alternatively, inspect the buttons and notice that they are missing
       aria-haspopup and aria-expanded attributes
    5. Apply the patch
    6. Observe that these buttons now are described as "Popup button collapsed"
       or that they contain the aria-haspopup and aria-expanded attributes like
       the lists button
    7. Sign off

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0007bf3623a6e58091eb233c95610761ac33a9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c3c0f9eb12a347b32cef6ac76b560cdb1ae3a084)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34509: Use select2 to load vendors on basket creation
Nick Clemens [Wed, 9 Aug 2023 17:39:45 +0000 (17:39 +0000)]
Bug 34509: Use select2 to load vendors on basket creation

This patch moves the dropdown to use select2 and avoids loading all
vendors at page load.

To test:
 1 - Create some extra vendors in your system, ideally over 20
 2 - Search for a vendor in acquisitions
 3 - Click 'New->basket'
 4 - Note the dropdown of all vendors
 5 - Choose a vendor and create a basket
 6 - Apply patch
 7 - Repeat
 8 - Note only a partial list of vendors is loaded
 9 - Search in the dropdown and confirm vendors are returned
10 - Select a vendor and create the basket

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 77ee1ca74317f8e2ffa1a5dcccaffa4081a508da)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f9cd9cca6a87702a4a739550d72adc5ac65332fa)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34434: Terminology: Biblio should be bibliographic
Owen Leonard [Thu, 27 Jul 2023 15:12:12 +0000 (15:12 +0000)]
Bug 34434: Terminology: Biblio should be bibliographic

This patch corrects several more instances where the templates use the
term "biblio" where it should use "bibliographic."

To test, apply the patch and confirm that these instances read
correctly:

- About -> Special thanks... -> Mines Paristech: "bibliographic
  frameworks"
- Acquisitions -> Vendor -> Receive shipments: "Record count" in the
  table of shipments.
- Catalogue -> Bibliographic record details -> Labeled MARC: "Labeled
  MARC record" heading.
- Circulation -> Holds to pull: Error message, "hold has been placed at
  the bibliographic record level."
  * I'm not sure how one can trigger this error message.
- Tools -> Log viewer -> Filter by "Catalog" and "Add": "Bibliographic
  record..." link in the "Object" column.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5749df1e3ab13e80f119652bd4710c8bc313b117)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 25cead0d6766e6b227ce6574589bab612dc372ad)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34436: (QA follow-up) Move spans to surround full text
Katrin Fischer [Tue, 1 Aug 2023 20:43:43 +0000 (20:43 +0000)]
Bug 34436: (QA follow-up) Move spans to surround full text

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad41643d5aa67f7c9755bde439608a63a2750136)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a2ee4312cbbcd9f1364780bd7ab013737722992e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34436: Some breadcrumbs lack <span> for translatability
Owen Leonard [Thu, 27 Jul 2023 16:11:54 +0000 (16:11 +0000)]
Bug 34436: Some breadcrumbs lack <span> for translatability

This patch modifies several templates which were updated recently so
that breadcrumbs markup could be built using template wrappers. The
patch wraps strings in <span> in cases where it is necessary to make
them translatable.

To test, apply the patch and view the following pages to confirm that
the breadcrumbs still show up correctly:

- Administration -> MARC bibliographic framework
  - Add framework
  - Edit framework
  - Delete framework
- Administration -> Share content with Mana KB
- Administration -> Circulation and fine rules
- Authorities ->
  - Add authority
  - Edit authority
- Catalog -> Advanced search
  - Bibliographic detail page
    - Must have EasyAnalyticalRecords enabled.
    - Edit -> Link to host record
- Patrons
- Reports -> Average loan time
- Serials -> Serials home

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8933036742e5484639c2649042102117664ce9c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit edaf57c73ee4048d577dc52d524d2c6b2f3b316d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34345: (QA follow-up) Fix some more occurrences
Katrin Fischer [Mon, 31 Jul 2023 20:15:20 +0000 (20:15 +0000)]
Bug 34345: (QA follow-up) Fix some more occurrences

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 19f9240759103196943228bbbbb3b35e46fa2e56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 876e970f4ef39b01fa745c57fa39a0b0db8c3b9e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34345: 'Circulation and fine rules' vs 'Circulation and fines rules'
Owen Leonard [Mon, 24 Jul 2023 11:11:56 +0000 (11:11 +0000)]
Bug 34345: 'Circulation and fine rules' vs 'Circulation and fines rules'

This patch corrects two instances of the phrase "Circulation and fines
rules" in favor of the more common "Circulation and fine rules" for
consistency's sake.

To test, apply the patch and go to Administration.

- In the description under the "Circulation and fine rules" link it
  should read, "Define circulation and fine rules..."
- Open the Circulation and fine rules page and confirm that the link in
  the sidebar menu is correct.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 452ac93b92045b014ecb7210e673aa30d96a5560)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5c878a6430fe254e67fc94d1a2dc1eda9a0949ac)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoUpdate release notes for 22.11.09 release v22.11.09
Pedro Amorim [Mon, 28 Aug 2023 13:11:34 +0000 (13:11 +0000)]
Update release notes for 22.11.09 release

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoIncrement version for 22.11.09 release
Pedro Amorim [Mon, 28 Aug 2023 13:01:13 +0000 (13:01 +0000)]
Increment version for 22.11.09 release

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoFix translations for Koha 22.11.09
Pedro Amorim [Mon, 28 Aug 2023 12:48:12 +0000 (12:48 +0000)]
Fix translations for Koha 22.11.09

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoTranslation updates for Koha 22.11.09
Koha translators [Mon, 28 Aug 2023 12:17:10 +0000 (09:17 -0300)]
Translation updates for Koha 22.11.09

(cherry picked from commit 1a9b57e55848827d647dbb0e9095d64845ce01c7)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34024: (QA follow-up) Allow pickup location changing for in transit holds
Tomas Cohen Arazi [Tue, 1 Aug 2023 19:40:03 +0000 (16:40 -0300)]
Bug 34024: (QA follow-up) Allow pickup location changing for in transit holds

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a05dff84ebae55b0c02538c2689b9c3eaa6b9484)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7293368dfe508b03180499b16753ef48eaf2a4f6)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34024: Unit tests
Tomas Cohen Arazi [Mon, 31 Jul 2023 17:00:36 +0000 (14:00 -0300)]
Bug 34024: Unit tests

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3870b5a068be06ef4d177b8f0701f6c3d967f431)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 918c6ddb059f5301283f79895620bdb7c8e650b8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34024: Block changing pickup location for found holds
Tomas Cohen Arazi [Mon, 31 Jul 2023 17:26:01 +0000 (14:26 -0300)]
Bug 34024: Block changing pickup location for found holds

This patch adds a check on holds for 'found' statuses. Holds with the
following statuses have special workflows in Koha, and overwritting
their pickup locations yields uncertain scenarios:

* Waiting: the item has probably been put on a special shelve
* In transit: the item is travelling to a new destination, and changing
  the pickup location should include some validations, and probably
  generate some notifications. At least.
* In processing: the item has already been taken out of the shelve for
  some internal processing. Changing the pickup location could interfere
  with this workflow. Overriding this limitation could be introduced
  with care on a separate report.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests don't pass. Holds go through (200) instead of being
rejected (409).
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a1b5bd95341b81deec29493997e824c84849001e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6b2b54151f82d84efab611db25994bc10393dde3)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34193: SSLProtocol enable in use versions and disable deprecated versions
David Cook [Mon, 3 Jul 2023 23:52:53 +0000 (23:52 +0000)]
Bug 34193: SSLProtocol enable in use versions and disable deprecated versions

This patch changes the default SSLProtocol for the Let's Encrypt
HTTPS template, so that it enables in use versions of TLS while
disabling the deprecated versions of TLS.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 58893f4c0b3afdcce752d5d87219f5c161126744)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79be336eeeb48d8227ba613cd5692a34b73fd5b3)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 30846: (follow-up) Unit tests
Hammat Wele [Mon, 27 Feb 2023 14:35:15 +0000 (14:35 +0000)]
Bug 30846: (follow-up) Unit tests

Signed-off-by: Sam Lau <samalau@gmail.com>
Bug 30846: (Fix) Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 13d3e87503232201b4cfae15dd3a8c6e39a6e44b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f5f4f8097720de08a22adb55b28809900163a0da)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 30846: 'If any unavailable' doesn't consider negative notforlan values as unavailable
Hammat Wele [Mon, 23 Jan 2023 15:41:41 +0000 (15:41 +0000)]
Bug 30846: 'If any unavailable' doesn't consider negative notforlan values as unavailable

When we set up a circulation rule where 'On shelf holds allowed' is 'If any unavailable' and we have a record with one 'Ordered' item, we cannot place this item on hold.

This patch allows placing hold on item with negative not for loan values, when using rule with 'On shelf holds allowed' set to 'If any unavailable'

To test:

1. Set up a circulation rule where on shelf holds are not allowed and force the choosing of an item (to facilitate the test)
    1.1. Go to Administration > Circulation and fines rules
    1.2. In the matrix, add a circulation like this
          - Patron category: All
          - Item type: Books
          - Current checkouts allowed: 10
          - Current on-site checkouts allowed: 10
          - Loan period: 21
          - Holds allowed (total): 10
          - Holds allowed (daily): 10
          - Holds per record (count): 10
          - On shelf holds allowed: If any unavailable
          - OPAC item level holds: Force
    1.3. Click Save
2. Create a record with one 'Ordered' item (or any negative value not for loan status)
    2.1. Go to Cataloging
    2.2. Click New record
    2.3. Fill out the mandatory fields (by default in MARC21: 000, 003, 005, 008,  040, 245, and 942 (942 should be set to Books))
    2.4. Click Save
    2.5. Fill out the following item fields
          - Not for loan: Ordered
          - Koha item type: Books
    2.6. Click Add item
    2.7. Click Normal to go to the detailed record
3. Try to place a hold on the 'Ordered' item
    3.1. From the detailed record, click OPAC view: Open in new window.
    --> Note that the 'Place hold' option is not present
4. Add a second 'Available' item
    4.1. Back in the staff interface tab with the detailed record, click New > New item
    4.2. Make sure the item type is set to Books
    4.3. Add a barcode in p
    4.4. Click Add item
5. Try again to place a hold on the 'Ordered' item
    5.1. Go back to the OPAC tab and refresh the page
    --> Note that the 'Place hold' option is still not present
6. Check out the available item to a patron
    6.1. In the staff interface tab, copy the barcode from the available item
    6.2. Go to Patrons
    6.3. Click on Search
    6.4. Click Check out next to one of the patrons
    6.5. Paste the barcode in the box and click Check out
7. Try again to place a hold on the 'Ordered' item
    7.1. Go back to the OPAC tab and refresh the page
    --> Note that the 'Place hold' option is now present
    7.2. Click Place hold
    --> Note that only the checked out item is available to place on hold, if you click Show unholdable items, it will show the Ordered item, but you can't place a hold on it.
8. Apply the patch
9. Go to the OPAC tab and click on the book title right next to 'Place a hold on' checkbox to go back to the record details.
        --> Note that the 'Place hold' option is still present
        9.1. Click Place hold
        --> Note that you can now place a hold on the 'Checked out' or the 'Ordered' item.
10. Check in the item to make it available again
    10.1. In the staff interface tab, click on 'Show checkouts' button
    10.2. Select the Checked out item and click on 'Renew or check in selected items' button.
11. Try again to place a hold on the 'Ordered' item
    11.1. Go back to the OPAC tab and click on the book title right next to 'Place a hold on' checkbox to go back to the record details.
    --> Note that the 'Place hold' option is still present
    11.2. Click Place hold
    --> Note that only the 'Ordered' item is available to place on hold, if you click Show unholdable items, it will show the Available item and you can't place a hold on it.
12. Delete the available item to keep only the Ordered item
    12.1 in the staff interface tab, click on 'Search catalog' and search for the record
    12.2 click on 'Edit' then 'Edit items'
    12.3 Delete the available item
13. Try to place a hold on the remain 'Ordered' item
    13.1 Go back to the OPAC tab and click on the book title right next to 'Place a hold on' checkbox to go back to the record details.
        --> Note that the 'Place hold' option is present
    13.2. Click Place hold
    --> Note that you can place a hold on the Ordered item.

Signed-off-by: Amaury GAU <amaury.gau@bulac.fr>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a09a9264584cd6d50f18f4bbea38622fbd60b8b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e1d7b418222117a0bf159f8a4eee1e61a43d5d3e)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34289: Add missing class to one condition of the checkin template
Owen Leonard [Mon, 17 Jul 2023 16:42:13 +0000 (16:42 +0000)]
Bug 34289: Add missing class to one condition of the checkin template

The markup of the checkin template varies depending on the conditions of
the operation, and in one case the barcode field was missing the
"barcode" class. This patch adds it.

To test, apply the patch and make sure the finesMode system preference
is enabled.

- Go to returns.pl (/cgi-bin/koha/circ/returns.pl)
- Expand the the options so you see 'Forgive overdue charges'.
- Check that box and check in an item
- After checkin, the barcode field should keep the same style it had
  before the transaction.
- Note: The yellow background of the input when the "Forgive" checkbox
  is checked is to be expected.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ff90997001ba10c1c40242107dc0f8f4f9dccac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b88ae2f5d7b93e6494766ff7745d0599c37fa4a0)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32739: (follow-up) QA Cleanup
Martin Renvoize [Tue, 25 Jul 2023 15:28:27 +0000 (16:28 +0100)]
Bug 32739: (follow-up) QA Cleanup

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c90dbcb82e16bee63cda729a0db4c94d8d8a78f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32739: Allow other patron identifier on pwd validation
Tomas Cohen Arazi [Mon, 17 Jul 2023 18:48:20 +0000 (15:48 -0300)]
Bug 32739: Allow other patron identifier on pwd validation

This patch takes a step forward on the password validation endpoint, by
adding  the `identifier` parameter and making it be allowed
to be the patron's `cardnumber` or the `userid`.

The current `userid` only validation option is kept as-is.

The implementation relies on `C4::Auth::checkpw` to query for the
patron.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/password_validation.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 69653a281dcbe2d0d610cbc2be6cc2718b52fca3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32739: Unit tests
Tomas Cohen Arazi [Mon, 17 Jul 2023 18:48:09 +0000 (15:48 -0300)]
Bug 32739: Unit tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 419d1d4fe9e4dae2e98493b81a74b0193104acfd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 30451: DBRev 22.11.08.002
Fridolin Somers [Thu, 17 Aug 2023 18:47:34 +0000 (08:47 -1000)]
Bug 30451: DBRev 22.11.08.002

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bff83490455663852b4ff48eaaf9f52566f3e7dc)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 30451: Update FK constraint on aqorders.subscriptionid
Katrin Fischer [Fri, 21 Jul 2023 14:39:07 +0000 (14:39 +0000)]
Bug 30451: Update FK constraint on aqorders.subscriptionid

This updates the FK constrant from ON DELETE CASCADE to ON DELETE
SET NULL. This means that if a subscription linked to an order is
deleted, we no longer will also delete the order, but we will just
set subscrptinid in the order to NULL. This will avoid data loss
that can cause the budgets/funds not to add up anymore with the
real espenses of the library.

To test:

Preparation:
* Create 2 subscriptions on different records
* Create a new basket
* Use the "order from subscription" functionality to create order
  lines for both of your subscriptions
* Close basket

Without patch:
* Delete the first subscription
* Verify the order line for this subscription is gone from your basket

Apply patch:
* Run database update and restart_all
* Delete the second subscription
* Verify the order line now remained in the basket

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
JD amended patch: perl tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 765d3d85b5b2b2e0711550b5b244d71967a2ee0c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43c55cad8a4a14fccc6112ca327603c07068d0c1)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34343: Update style of fixed footer navbar in Z39.50 searches
Owen Leonard [Mon, 24 Jul 2023 10:36:18 +0000 (10:36 +0000)]
Bug 34343: Update style of fixed footer navbar in Z39.50 searches

We use a Bootstrap fixed navbar in the footer of two pages: the popup
Z39.50 searches in cataloging and authorities. The style of these
footers needs to be udpated for the new staff interface design.

This patch also changes the style of the "cancel" controls in these
footers from links to buttons. The popup window in cataloging has been
adjusted to be the same size as the one in authorities.

To test, apply the batch and rebuild the staff interface CSS.

- Go to Cataloging -> New from Z39.50/SRU.
  - In the popup window, the form should fit comfortably in the window.
  - The footer should be white with a grey border at the top, with
    Bootstrap-styled buttons aligned to the right.
- Perform the same test in Authorities -> New from Z39.50/SRU
- Install and enable an additional translation so that you can confirm
  that the language-selection footer still has the correct style.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ac122f47d18fe527c6c789a664d4c2b401f5e4c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79e8d787a82ca0db01b3a5c9f551b86498f909c9)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 31667: Merge 'tip' and 'hint' classes
Owen Leonard [Tue, 25 Jul 2023 15:32:44 +0000 (15:32 +0000)]
Bug 31667: Merge 'tip' and 'hint' classes

This patch corrects a few instances of the use of the "tip" class and
replaces them with "hint." The patch also removes the class from the
staff interface CSS.

To test, apply the patch and rebuild the staff interface CSS.

- View a patron account and click the "Routing lists" link in the
  left-hand sidebar.
  - On the subscription routing lists page the "Search subscriptions"
    page label should look correct.
- Go to Reports -> Catalog by item type.
  - The "Select none..." hint should be styled correctly.
- The third instance, in the installer, is only visible if you try to
  install Koha using a MySQL user who doesn't have the correct
  privileges, so may be too much trouble to really test. A check of the
  patch should be adequate.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d8054e30fcc8ee402e0e7d96f68bc1b35f41ad4f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c74d7351b59af73b6e3290c5ff8d8c3961aae6ee)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33140: Use facet label value for mouseover text on facet removal link
Andreas Jonsson [Sun, 5 Mar 2023 12:21:34 +0000 (13:21 +0100)]
Bug 33140: Use facet label value for mouseover text on facet removal link

This patch updates the facets includes in both the staff interface and
OPAC so that the title attribute on "remove" links uses the full name
rather than the code of the facet. So, library name instead of
branchcode, collection code description instead of authorized value
code.

To test, apply the patch and perform a search in the staff interface.

- Click a facet in the left-hand sidebar which will return more than one
  result.
  - On the reloaded page there should be a link next to that facet: [X].
    Hovering your mouse over it should show "Remove facet [facet name]"
    e.g. "Remove facet Centerville" instead of "Remove facet CPL"
- Test on library facets, item type facets, and collection code facets.
- Perform the same test in the OPAC.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 01a6b2b63b929d6b367f95919dd72559736cb002)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 75b09126207a91d1314d2676d1fc1ee18c567761)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34305: Account for negative prices on acq details tab
Katrin Fischer [Tue, 18 Jul 2023 14:47:43 +0000 (14:47 +0000)]
Bug 34305: Account for negative prices on acq details tab

The acquisition detail tab shows the estimated cost while
the order is still pending and the actual price, once received.
At least the tool tip on the table header row says so. This
was not working correctly.

To test:
* Create a basket
* Create a new order line with a negative list price (credit)
* Close the basket
* Verify that the price shows correctly in the acquisition details
  tab on the record
* Receive the order and enter a different negative actual price.
* Reload detail view, verify it still shows the estimated price
* Apply patch, restart_all
* Verify now the correct actual price displays
* Create another basket and order line
* Verify while not yet received, it still shows the estimated price

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 758712dc0140bb40cf0254125d006eed6c590b3a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cc21197125b8c4a8d237c5cf41cacbcf55f12422)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34447: Do not export "Actions" columns
Jonathan Druart [Mon, 31 Jul 2023 11:23:53 +0000 (13:23 +0200)]
Bug 34447: Do not export "Actions" columns

In the KohaTable Vue component we should add the noExport class to the actions columns to not export them.

Test plan:
Go to the ERM module, create at least one agreement.
Go to the agreement list view and click "export" to export the table
=> Without this patch the "Actions" column was exported
=> With this patch is no longer there

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 585138f13f42ec76a7d45b44faba70445b27d7b3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 50dfe2be55f22c6f4be429472b6dd5b3a493a8ed)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34435: Remove side effect from get_password_expiry_date
emlam [Thu, 27 Jul 2023 16:36:34 +0000 (16:36 +0000)]
Bug 34435: Remove side effect from get_password_expiry_date

If get_password_expiry_date is passed a DateTime object
as a parameter, it modifies and returns the original
object. This can create possible side effects.

This patch modifies get_password_expiry_date to clone the
DateTime object that it receives as a parameter and
return the modified clone, so that object references can
be passed in safely.

To test:
prove t/db_dependent/Koha/Patron/Category.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dae5607fd184c2e4b19b197cca313aca92975e47)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f067a82e3aa2d45b92415cc6cfb0fea71b0866c2)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34435: Add unit test
Emily Lamancusa [Thu, 27 Jul 2023 16:29:15 +0000 (12:29 -0400)]
Bug 34435: Add unit test

To test:
prove t/db_dependent/Koha/Patron/Category.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 420363258214e2c397ef604c63b13491462ed955)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ef24af8da3bc1221cb952c27aa9fe02c86b6444c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33848: Enabling Coce in the OPAC breaks cover images on bibliographic detail...
Owen Leonard [Fri, 26 May 2023 17:28:50 +0000 (17:28 +0000)]
Bug 33848: Enabling Coce in the OPAC breaks cover images on bibliographic detail page

Bug 32412 added an additional "context" parameter to KOHA.coce.getURL.
The code which pulls a Coce image for the "main" cover image slider
needs to include the correct context parameter for the images to load.

This patch also makes a minor correction to CSS in order to make the
cover image slider "dots" change color to highlight the current slide.

To test, apply the patch and rebuild the OPAC CSS.

- Enable multiple cover image sources in the OPAC including Coce, e.g.
  Amazon, Google, OpenLibrary, etc.
- Search for a title which will match multiple cover image sources. In
  the sample data a search for "Perl" will return good results.
- Note the number of cover images loading for a title in the search
  results.
- View the detail page for that title. There should be the same number
  of covers in the cover image slider.
- Clicking the slider navigation dots should work to show each image,
  and the dot should change color to highlight the current image.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d313f9b963ff0e5187eb19d81ef13231e0add39d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4125aec704464560515fb4f1f083b4cf4705ba30)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33848: Don't remove coce container from template
Jonathan Druart [Wed, 31 May 2023 11:41:26 +0000 (13:41 +0200)]
Bug 33848: Don't remove coce container from template

It's removed from coce.js

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aa8dc28e97d1971e191d5f7d08802257ae98f378)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6cef886164eb3fd792eacffa6a8451bdcc711cec)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33755: Set profile_id and add missing import
Matt Blenkinsop [Mon, 31 Jul 2023 08:52:23 +0000 (08:52 +0000)]
Bug 33755: Set profile_id and add missing import

This patch adds a missed parameter (profile_id) in stage-marc-import.pl and also adds a missing import in the background job for staging marc files. This means that the profile used when importing can now be shown in the import batches table and also in batch details

Test plan:
1) Stage a record for import and make sure to save the import profile you use
2) Import a record using that profile
3) Navigate to Cataloging > Manage staged MARC records
4) In the Profile column, no value will be shown for the staged record
5) Click on the batch, the profile will be missing in this screen as well
6) Apply patch
7) Restart_all
8) Repeat steps 2-5, the profile name should be visible in both places

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 38fc85ade940b732b3565400a0ff41c06a382497)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a0a03cb08bcfb91cd7b12d473acdb16939b2fcd4)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34354: Fix progess typo
Pedro Amorim [Mon, 24 Jul 2023 13:36:02 +0000 (13:36 +0000)]
Bug 34354: Fix progess typo

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2234ecb8c93d3ad2dc0a0f41d46db479c9a05d56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 57ca63cd00db408eea2f032b962be60c6e60e4d8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34493: Fix indenting in search_indexes.inc
Fridolin Somers [Mon, 7 Aug 2023 23:11:14 +0000 (13:11 -1000)]
Bug 34493: Fix indenting in search_indexes.inc

Bug 32683 broke indenting in koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
Not on purpose looks like.

Test plan :
1) Look at changes to validate indenting
2) Run prove xt/tt_valid.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc2dc973f0beca5e30777a465aece074a29682ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 14a46944fffdf0bfd4aaba1a5bd7cca22d7c54b7)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34469: Block editing for received order lines
Katrin Fischer [Fri, 4 Aug 2023 15:13:36 +0000 (15:13 +0000)]
Bug 34469: Block editing for received order lines

When an already received order line is modified/edited,
we experience data loss. Most prominently, we will lose the
linked invoiceid. Therefore we should not allow editing an
order line that was already received. If something needs to be
changed, the receipt should be cancelled first.

To test:
* Create basket as standing order with items added in cataloguing
* Add an order line
* Receive shipment
* Go to the basket summary page, click on 'Modify'
* Change the actual cost
* Save
* Verify that the invoice is now empty
* In the database aqorders.invoiceid will be NULL
* Apply patch
* Receive another shipment for the standing order
* Go back to basket summary page
* Verify the 'Modify' link is no longer present
* Click 'Modify' on the unreceived order line
* Edit the URL parameter odernumber to have the number of an
  already received order line
* Verify you see a nice error message:
  This order cannot be edited, the basket is closed or the order was already received.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4b7490633d2e8bc9ca9a0f60ebec1200ed0b07a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 93e91843276beb48c69576b540f304d2ddec8a32)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34056: Add -api-client suffit to authorised-values API client
Jonathan Druart [Mon, 19 Jun 2023 08:15:20 +0000 (10:15 +0200)]
Bug 34056: Add -api-client suffit to authorised-values API client

In koha-tmpl/intranet-tmpl/prog/js/vue/fetch all files have the -api-client suffix but authorised-values. For consistency we should add it.

Test plan:
Go to the ERM module and confirm that dropdown lists are correctly
filled in with authorised values.
You can also inspect the console and confirm that a GET query to /authorised_value_categories is done

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 813cfe1eec1f6090f715638a774fa755b5ff4788)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bc3ddc56034bdccdb7a1fe308e53da1125846f72)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34365: Add cancellation request flow to DELETE /holds
Tomas Cohen Arazi [Mon, 24 Jul 2023 19:08:50 +0000 (16:08 -0300)]
Bug 34365: Add cancellation request flow to DELETE /holds

This patch adds a new `x-koha-override` header to allow enforcing the
cancellation request flow for waiting holds.

If the hold is not waiting, the header has no effect.

To test:
1. Apply the tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: The endpoint doesn't implement the required logic
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! The endpoint behavior is changed!
5. Sign off :-D

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb224540e223d71f1f494b94ce3442567a1c6664)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e4e145eb4ad61db989395e45dbe082c0df7feff4)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34365: Unit tests
Tomas Cohen Arazi [Mon, 24 Jul 2023 19:08:22 +0000 (16:08 -0300)]
Bug 34365: Unit tests

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2a8c43f975306081ec4f7a218346187bba08585c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ffe0f845688c2e76d11adc1613d1a969e27935ca)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34470: Initialize random seed after spawning a child worker process
Emily Lamancusa [Wed, 9 Aug 2023 16:29:35 +0000 (12:29 -0400)]
Bug 34470: Initialize random seed after spawning a child worker process

When background_jobs_worker.pl spawns a new child process, it needs to
explicitly reinitialize the random seed - otherwise each child process
will inherit the same random seed from the parent process, and any
randomization will produce identical results each time.

This patch adds a call to srand immediately after the fork to
reinitialize the seed. Note that child processes should not call
srand with no parameter anywhere else, as the Perl documentation
indicates that srand should not be called with no parameter more than
once per process.

To test:
1. Apply the logging patch only
2. Set system preferences:
    a. RealTimeHoldsQueue -> Enable
    b. RandomizeHoldsQueueWeight -> in random order
3. Watch the logs for the staff interface
   in ktd:
   ktd --shell
   koha-intra-err
4. Place a hold. Note that the logs display the branch list before and
   after it is randomized.
5. Place some more holds. Note that the branch order after randomization
   is identical each time.
6. Apply both patches and restart_all
7. Repeat steps 3-5.
   -> Note that the branch order before randomization hasn't changed
   -> Note that the branch order after randomization is now different
      each time.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3c64f62c0dca2acf7d7558281e006ef41286771)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1155af8e80434f7793d0111b058dd20ac9c5aef8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34117: Add unit tests
Emily Lamancusa [Thu, 27 Jul 2023 14:33:38 +0000 (14:33 +0000)]
Bug 34117: Add unit tests

To test:
prove t/db_dependent/Koha/Patron/Categories.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ff1430bb4f1203a3d2d9ee8017633c73ff6a3de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 33e046f41cbaa41ee3aea90ba4d619c6fe86507f)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34117: Remove side effect from get_expiry_date
Emily Lamancusa [Thu, 20 Jul 2023 17:41:15 +0000 (13:41 -0400)]
Bug 34117: Remove side effect from get_expiry_date

If get_expiry_date is passed a DateTime object as a parameter,
it modifies and returns the original object. When memberentry.pl
prefills the input fields for duplicating a patron, it passes the
enrollment date object to get_expiry_date. This causes the enrollment
date object to be modified with the expiry date value.

This patch modifies get_expiry_date to clone the DateTime object that it
receives as a parameter and return the clone, so that references to an
enrollment date object can be passed in safely.

To test:
1. Have or make a patron
2. Duplicate that patron
3. Before saving the new patron, scroll down to Registration Date and
   see that it's defaulting to a date in the future.
4. Apply patch and restart_all
5. Try duplicating a patron again
6. Registration Date should correctly set to today

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bba9feff5ca9e1601a38408625cf7ba40b70645f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1628791ca24a44bf07e224f2194f12ebfe60779c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34155: Hide 'Next available' at OPAC when item-level hold is forced
Julian Maurice [Mon, 17 Jul 2023 09:10:07 +0000 (11:10 +0200)]
Bug 34155: Hide 'Next available' at OPAC when item-level hold is forced

This was a regression caused by bug 24860

Test plan:
1. Set up circulation rules so that OPAC users can place holds only on
   specific items ("OPAC item level holds" = "force")
2. Try to place a hold at OPAC. The "Next available item" option should
   not appear.
3. Set "OPAC item level holds" to "allow"
4. Try to place a hold at OPAC. The "Next available item" option should
   appear

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b1bd01a428823e0ed99d7d265dec3606ea3e893)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9916e1853462d293eac5eecbf15184d360d58079)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34269: (QA follow-up) Add missing TT filters
Katrin Fischer [Fri, 14 Jul 2023 09:17:27 +0000 (09:17 +0000)]
Bug 34269: (QA follow-up) Add missing TT filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e211d8b34b8e3755ef254f9677d8c82dc27e0ae1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 741f331e7d0ca7f616bd9b794a428ef3cff01b12)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34269: Convert to using codes in select compares
Martin Renvoize [Thu, 13 Jul 2023 16:01:07 +0000 (17:01 +0100)]
Bug 34269: Convert to using codes in select compares

This patch updates the logic in smart rules to compare option values to
codes as apposed to option texts to value descriptions.

0. Apply patch
1. Install another language in the staff interface
   1. ./translate install xx-XX
   2. Check the box of the language in the 'language' system preference
   3. Refresh
2. Create an item type with a parent
   1. Go to Administration > Item types
   2. Create a new item type or modify an existing one, assigning a parent type
      Example: Create a 'Children's books' itemtypetype
      and assig 'Books' as its parent
   3. Create a third item type with the same description but something added in ():
      Example: 'Children's books (3-5)'
3. Create a circulation rule for the parent type
   Example: All/Books, with 2 checkouts allowed
4. Create a circulation rule for:
   All/All with 3 checkouts allowed
5. In English, click on "Edit" next to the parent type rule (All/Books)
   --> Note that the item type in the bottom row (the modifiable row) is changed to 'Books (All)'
6. Modify the number of checkouts allowed (e.g. 99)
   --> The All/Books rule is modified
7. Switch the interface to the other language
8. Click on "Edit" next to the parent type rule (All/Books)
   --> The All/Books rule is modified
9. Add rules for Children's books and Children's books (3-5)
10. Click on "Edit" next to each rule and change a value
   --> Verify that the changed values are always saved for the correct rule

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0fdb2db51072e10a3f53b1efb9571728560bd64)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 864f4ecba550e4daaa18d8de7ed76a6268436be2)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34452: Restore fund label and 'Update adjustments' button
Katrin Fischer [Fri, 4 Aug 2023 14:29:11 +0000 (14:29 +0000)]
Bug 34452: Restore fund label and 'Update adjustments' button

This patch fixed 2 small and recent regressions:

* The "Update adjustments" button used to always display. It's
  required to save a new first adjustment, but also to save
  changes to existing adjustments edited inline. It now would
  only display after "Add adjustments" was clicked. We retore
  to display it always. (bug 32746)

* We have several "Fund" pull downs on this page, but they are
  for different things and require different labelling.
  "Fund" was changed to "Shipping fund" which matches at the top,
  but doesn't work for the adjustments table and single adjustment
  form. Now we use "Shipping fund" "Fund" and no label in the table
  as the table header covers it there. (bug 33721)

To test.
  * Add a vendor
  * Receive shipment
  * Add invoice and save
  * Click on "Finish receiving"
  * Verify the button "Update adjustments" appears after clicking
    "Add new adjustment"
  * Verify the button is gone after you clicked it and the table shows
  * Change something in the table - no button to save change :(
  * Apply patch
  * Repeat steps, button "Update adjustments" should not always be
    visible.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 72ef65edbe3413027fb877e37929e98cf7fd26fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4ababc2dc8bab31c7083235ee5b866e2f8fd3761)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34059: Add only issues from the branch that is creating the notice
Pedro Amorim [Mon, 19 Jun 2023 14:24:30 +0000 (14:24 +0000)]
Bug 34059: Add only issues from the branch that is creating the notice

Test plan, on k-t-d
1) Go to 'my account' on top right user menu
2) On 'Patron messaging preferences', click 'Edit'
3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save
4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber)
5) On the checkout input bar, enter 39999000001372 and press checkout
7) Go to 'Set library' on top right user menu and pick a different library
8) Repeat step 4), then, on the checkout input, enter 39999000004571 and press checkout
9) Verify that this user now has 2 items checked out, from 2 different libraries at /cgi-bin/koha/circ/circulation.pl?borrowernumber=51
9) Run the following 2 queries to force the due_date to be equal to 'today's' date for both issues:
NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan

UPDATE issues SET date_due = '2023-06-19 23:59:00' where issue_id = 1;
UPDATE issues SET date_due = '2023-06-19 23:59:00' where issue_id = 2;

10) Run the cronjob:
./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch

11) Verify that two DUEDGEST notices were created, one per each library, but both notices contain both issues:
SELECT letter_code, time_queued, content FROM message_queue ORDER BY message_id DESC LIMIT 2;

12) Apply patch, then do 10) and 11) again
13) Verify that each notice only contains the issue for its respective library

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39e6b100cb977f072e6f23a13625e986a31aab97)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bdfe5b3cdebc444c7327280ffcf0e44121d35fca)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34387: (QA follow-up) Fix display of 'Import batches'
Katrin Fischer [Sat, 29 Jul 2023 21:14:39 +0000 (21:14 +0000)]
Bug 34387: (QA follow-up) Fix display of 'Import batches'

Fixes the heading and sidebar display of the 'Import batches'
section.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34387: (follow-up) Minor spelling and quoting fixes
Martin Renvoize [Wed, 26 Jul 2023 06:15:56 +0000 (07:15 +0100)]
Bug 34387: (follow-up) Minor spelling and quoting fixes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34387: Improve API docs naming consistency
Tomas Cohen Arazi [Tue, 25 Jul 2023 18:57:58 +0000 (15:57 -0300)]
Bug 34387: Improve API docs naming consistency

This patch aims to make our API docs be more consistent.
It addresses two particular things:

* There's no consistency on the `tags` used across the spec, and not all
  of them are correctly described and have an `x-displayName` entry.
  More on this later.
* This are not sorted either by some for of grouping, or at least
  alphabetically.

For the former, I did my best trying to harmonize (specially on the ERM
front) with what we do in the rest of the use cases.

For the latter, I opted for sorting everything alphabetically, as a
first step. Hoping someone else could work on grouping things.

To test (ON YOUR HOST MACHINE):
1. On current master run:
   $ cd api/v1/swagger
   $ docker run --rm -v $(pwd):/api --workdir /api redocly/cli \
           build-docs swagger.yaml --output index.html
=> SUCCESS: It doesn't break or anything
2. Open your browser, open the generated api/v1/swagger/index.html file
=> FAIL: The left column has
         * several lower case entries
         * not everything is correctly grouped (ERM? packages?)
         * Things are not sorted. There's an attempt but looks messy
3. Apply this patch
4. Repeat 1 and 2
=> SUCCESS: Things look much better!
5. Sign off :-D

CAVEAT1: I'm not sure why, but import_batches doesn't work. Ideas are
welcome, I'll keep looking for fixes.
CAVEAT2: I don't have enough eHoldings background to weight in, but I
feel like 'ERM eHoldings packages' could just be 'ERM packages'.
Follw-up patches with better ideas are welcome.
CAVEAT3: Patron credits, debits, balance... They could all go in to
'Patrons accounts' or similar. Open to ideas.
CAVEAT4: Old redocly didn't support mapping an endpoint to more than one
target section. Something to explore if we want (for example) to reach
'credits' through the 'Patrons' section but also from 'Accounting'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33978: Adding authority from automatic linker closes imported record
Hammat Wele [Wed, 14 Jun 2023 17:20:00 +0000 (17:20 +0000)]
Bug 33978: Adding authority from automatic linker closes imported record

If you import a record, then create an authority record using the automatic linker, it closes the biblio record. The problem occures when a record is edited in a new tab.

To recreate:

1. Import the example records
   1.1. Download the example records
   1.2. Go to Cataloging > Stage records for import
   1.3. Choose the downloaded file
   1.4. Click Upload file
   1.5. Click Stage for import
   1.6. Click View batch
   1.7. Click Import this batch into the catalog
   1.8. Click View detail of the enqueued job
   1.9. Click Manage imported batch

Correct behaviour:

2. In another tab, search for one of the records (for example, Fafounet)
3. Click Edit > Edit record
4. Go to field 100
5. Click Link authorities automatically
   --> It should say 100 - No matching authority found.
6. Click the plus sign next to 100
7. Fill out the mandatory fields by clinking in the text fields (000, 003, 005, 008, 040), field 100 should already be filled
8. Click 'Save'
   --> Authority number is added in 100 and you get to stay in the record for more edits if needed

Incorrect behaviour:

9. Go back to the imported batch tab
10. Click Edit next to the second title (the one by Paventi, Eza)
11. Redo steps 4 to 8
    --> Record is closedclear :(
    The behaviour should be the same, stay in the bibliographic record until it is saved.

12. Apply the patch
13. Redo step 9, 10, 4
14. Edit field 100, Type 'Paventi Test 2'
15. Redo step 5 to 8
    --> Authority number is added in 100 and you get to stay in the record for more edits if needed

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad124fe536aa11380bdce38b4dfc600864159477)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 03c5a75dfd6560eb30e0a6598d68ec015f6a073b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34213: import_patrons.pl - Fix short version of matchpoint option in POD
Jonathan Druart [Thu, 6 Jul 2023 12:54:11 +0000 (14:54 +0200)]
Bug 34213: import_patrons.pl - Fix short version of matchpoint option in POD

 44     'c|confirm'                      => \$confirm,

 46     'm|matchpoint=s'                 => \$matchpoint,

The POD is wrong.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2442a4537d4d439bdf27e031116f98d880e47e09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5fcaf0aa09bbc76a6b010e9e93a6696308bea9a6)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34332: Removed extra parenthesis that was causing an error
Laura Escamilla [Thu, 20 Jul 2023 18:23:32 +0000 (18:23 +0000)]
Bug 34332: Removed extra parenthesis that was causing an error

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb84c45da46b0b49dec9e9191aeb85a767d119f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 46496e74a000a94befe2842c353a463daded4bde)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34334: Item(s) in MARCdetail untranslatable
Owen Leonard [Fri, 21 Jul 2023 10:17:39 +0000 (10:17 +0000)]
Bug 34334: Item(s) in MARCdetail untranslatable

This patch adds a <span> around the text "Item(s)" in the template for
the MARC detail page in the staff interface. Without the span the
translation tool can't detect the string.

To test, apply the patch and update a translation, e.g. fr-FR:

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

- Open the corresponding .po file, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the string is now in the .po file for translation. You
  should find these lines:

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt:146
c-format
msgid "Item(s)"
msgstr "Exemplaire(s)"

I found that the translation was already populated. Install the updated
po file:

 > perl translate install fr-FR

Test the MARC detail page in your translated language to confirm that
the string is correct.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 92692a2ee96f2eced21849e0ca9fa0b5d7c44801)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9bffe4aec1ec5cd9f224efa0ada0d0b8657a6d71)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34316: Add_credit should rethrow an exception correctly
Marcel de Rooy [Thu, 20 Jul 2023 07:45:05 +0000 (07:45 +0000)]
Bug 34316: Add_credit should rethrow an exception correctly

Found while running Items.t on top of 33608.
Another exception was thrown but not rethrown.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa9750e24de0a6300d683a1316b64e9bed248c4b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2b1b8884ccd49e28bdf31a3c977a876a0f8c5283)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 28493: Make koha-passwd display the username
Mason James [Wed, 21 Sep 2022 11:38:59 +0000 (23:38 +1200)]
Bug 28493: Make koha-passwd display the username

to test...

1/ run command
 $ sudo koha-passwd dev1
 Password for dev1: CraZyPa$$WoRD!!
 Press enter to clear the screen...
 ^C

2/ apply patch

3/ run command again, note 'username' section
 $ sudo koha-passwd dev1
 Username for dev1: koha_dev1  <<<<<<<<<<<<
 Password for dev1: CraZyPa$$WoRD!!
 Press enter to clear the screen...
 ^C

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ce7f8c49378c0e32212493779b07e3ab369dee7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ba51185fbd00591a72af41782ba2d6fd956b731a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34279: Don't enforce overduefinescap unless it is greater than 0
Kyle M Hall [Fri, 14 Jul 2023 11:36:47 +0000 (07:36 -0400)]
Bug 34279: Don't enforce overduefinescap unless it is greater than 0

When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine.

Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is.

Test Plan:
1) Apply the first patch ( unit tests )
2) prove t/db_dependent/Circulation/CalcFine.t
3) Note the test fails
4) Apply the second patch as well
5) prove t/db_dependent/Circulation/CalcFine.t
6) Note the test passes

Test Plan 2:
1) Create an all/all/all rule with an overduefinescap of 0.00, with a
   daily fine. Enable CalculateFinesOnReturn
2) Backdate a checkout so it is overdue
3) Return this item, note the lack of a fine
4) Apply this patch set
5) Backdate a checkout and return it again
6) Note the fine is generated!

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1763b136d1dcd3348ee26bca8663823b5a05f07c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 662da18be2ec7c6c9348a704d9ad8ac955292862)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34279: Unit tests
Kyle M Hall [Fri, 14 Jul 2023 11:32:11 +0000 (07:32 -0400)]
Bug 34279: Unit tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8096ec9fff44a04c8ff32525499652116d1a8ad0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e360c5637c1f910100e10f049823fda01f588d9)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: (QA follow-up) Restore $Price filtering for valid values
Martin Renvoize [Wed, 19 Jul 2023 11:41:28 +0000 (12:41 +0100)]
Bug 32271: (QA follow-up) Restore $Price filtering for valid values

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 093d1959af59423e3a9a69139a4745703b7a399a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cf41331ba113a7b176c292820fb2d51c48ff0605)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: (QA follow-up) Correction to 'can_be_blank' logic
Martin Renvoize [Wed, 19 Jul 2023 11:31:14 +0000 (12:31 +0100)]
Bug 32271: (QA follow-up) Correction to 'can_be_blank' logic

The logic introducing the can_be_blank check into the monetary decimal
format check was flawed and meant we were no longer checking decimal
formatting in the majority of cases. This patch updates that so we pass
the unit tests and correctly check any value passed that's not an empty
string.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c42725bab4f7f4dc360d9b4fe0417b8b3082d879)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7ccbda031cbc076fe2188133c9b1327ed1b599d8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: Unit test
Martin Renvoize [Wed, 19 Jul 2023 11:11:50 +0000 (12:11 +0100)]
Bug 32271: Unit test

Add a unit test for the allow blank option added to the monetary check
in CirculationRules.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 41274ef7516ad09f1f9a5e6723ba7bd53379dd02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8d02637bec9848077bec53abfa449fd158ac12c0)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert...
Kyle M Hall [Fri, 14 Jul 2023 13:08:51 +0000 (09:08 -0400)]
Bug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert all 0 equivilents to blank value

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit daedce4f6ea7d7ae9d4f12cd54e94b0230683a92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 093a97c67b5cc9ab0741f860a119e090b8a3360b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: Fix overdue fines cap (amount) set to 0.00 when editing rule.
Géraud Frappier [Mon, 5 Dec 2022 17:30:40 +0000 (12:30 -0500)]
Bug 32271: Fix overdue fines cap (amount) set to 0.00 when editing rule.

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit adeb4d54530d6ef8c4adc171846eb7c47a81bb23)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b8a9eefc4cdd3062a688a3c693209c2bef599364)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34133: Set default sort on first column (ID) desc
Pedro Amorim [Tue, 27 Jun 2023 15:00:00 +0000 (15:00 +0000)]
Bug 34133: Set default sort on first column (ID) desc

Test plan:

Before applying patch:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by ASC (lowest ID first)
* Close incognito

Apply patch, then:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by DESC (highest ID first)

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan from Bugzilla, and added it above.
Works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 67916fc23a518bb1ddc895f6f3e0b27c434b8a92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f1c1cfdb0c7833ffafcefa06dfb3495a289cf1f9)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33992: Only consider the date when auto-expiring problematic recalls
Aleisha Amohia [Tue, 13 Jun 2023 05:29:22 +0000 (17:29 +1200)]
Bug 33992: Only consider the date when auto-expiring problematic recalls

This patch carries this fix into the misc/cronjobs/recalls/expire_recalls.pl cronjob so that recalls are automatically expired when they have been waiting a problematic number of days, not considering hours, as expected.

To test, follow the test plan from the first patch. This will set you up with a waiting problematic recall.

Run the cronjob manually

perl misc/cronjobs/recalls/expire_recalls.pl

Refresh your 'Recalls awaiting pickup' page. Your problematic recall should be gone/expired.

Expiration dates will apply when expiring any 'unfulfilled' recall i.e. newly requested, overdue to be returned, and awaiting pickup.

Sponsored-by: Auckland University of Technology
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0d2052088ec62654f81154be0b9916b8e8630891)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3a5f4d170117e264ed15c8cf40c799ddfd2f6299)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34028: Show the secret when registering from the auth screen
Jonathan Druart [Tue, 4 Jul 2023 10:03:59 +0000 (12:03 +0200)]
Bug 34028: Show the secret when registering from the auth screen

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3cb77a590bb884e2e6151ec2d24333e828c8ddb9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7651c42b6d1b6943a5cb8e368f863ccf6af3f38f)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34028: Fix manual entry for two factor authentication
David Cook [Fri, 16 Jun 2023 06:04:37 +0000 (06:04 +0000)]
Bug 34028: Fix manual entry for two factor authentication

This patch changes the "Account" and "Key" display so that
you can manually enter two factor authentication details into
an authenticator app.

The details are the same as those provided by scanning the QR code.

Test plan:
0. Apply patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=TwoFactorAuthentication
2. Change setting to "Enable"
3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
4. Click "More" on record toolbar and choose "Manage two-factor authentication"
5. Click "Enable two-factor authentication"
6. Scan the QR code into an authenticator app and note it creates an entry called
"Centerville: Centerville_koha"
7. Manually enter an entry into an authenticator app (like Google Authenticator)
7a. Add the "Account" as shown on the Koha screen
7b. Add the "Key" as shown on the Koha screen
8. Note that the entries added by QR code and manual entry have the same
label and both were accepted by the authenticator app

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c05333914e3f54d66b9de6dde82b614ea83569a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a51d570a6ebff0989df8e599dc4b1a2cd0b14172)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Lower the two digits requirement
Tomas Cohen Arazi [Wed, 19 Jul 2023 14:51:54 +0000 (11:51 -0300)]
Bug 33028: (follow-up) Lower the two digits requirement

This patch makes the code not require two decimal digits, as the main
intention here is to forbid (locale) formatted strings to reach the DB.

The number of digits we support needs to be discussed on its own bug,
and a centralized check implemented.

This patch fixes tests:

prove t/db_dependent/Circulation.t
t/db_dependent/Circulation.t .. 1/67 Exception 'Koha::Exceptions::CirculationRule::NotDecimal' thrown 'The circulation rule expected a decimal value' with name => fine, value => 0.1
t/db_dependent/Circulation.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 53/67 subtests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 45b050871e7ed882b553f211db97204f30634646)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 343221462e71101c13fa39bae5abb87c956e412d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Add POD to new Exception
Martin Renvoize [Wed, 19 Jul 2023 10:26:59 +0000 (11:26 +0100)]
Bug 33028: (follow-up) Add POD to new Exception

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b82f1bd8075e0d14aa9d08293831af4cd8a3059a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 187e58aa4907cefbef034a8d459493f40ef03673)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Unit tests
Martin Renvoize [Wed, 19 Jul 2023 10:21:46 +0000 (11:21 +0100)]
Bug 33028: Unit tests

Add unit tests for is_monetary functionality introduced in the
CirculationRules module.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 88ccaaf3acab9996070a5bcbc057bbe9dad1c771)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0d56eb1dc7e7635d620bbe591c681005ea76638)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Make exception less generic
Tomas Cohen Arazi [Tue, 18 Jul 2023 18:05:50 +0000 (15:05 -0300)]
Bug 33028: Make exception less generic

While testing this bug I found Circulation.t was failing, but the
exception doesn't actually display anything useful in terms of helping
debug what's going on.

This patch makes it add the rule_name and rule_value to the message.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b7c077c9ddade728a7d84a1cf2f5b62cc4d4841)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f44e411edb51dc9f4afb7df18eb4509fed9d5a31)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (QA follow-up) Tidy introduced code
Tomas Cohen Arazi [Tue, 18 Jul 2023 17:28:27 +0000 (14:28 -0300)]
Bug 33028: (QA follow-up) Tidy introduced code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82bdaa8fbcdf836dd2fea93850173f15f17b7de9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: DBRev 22.11.08.001
Tomas Cohen Arazi [Tue, 18 Jul 2023 17:24:46 +0000 (14:24 -0300)]
Bug 33028: DBRev 22.11.08.001

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 86c2d9d1e96f318615ca6c83d6bfd685723ab5c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 834b3ca5d9909f9dec08ef6aa014203b54032f51)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Perltidy database update script
Katrin Fischer [Tue, 11 Jul 2023 13:23:40 +0000 (13:23 +0000)]
Bug 33028: Perltidy database update script

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0a3b98cdb1ae0938403bf919f5494e2708821c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 495a4a7477c715b56a4f96f07c455df029bbcd1c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Throw exception if not passed a decimal number
Martin Renvoize [Mon, 3 Jul 2023 12:45:28 +0000 (13:45 +0100)]
Bug 33028: Throw exception if not passed a decimal number

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d5b1041f43c2a6d8b82f6ee88c1ecf6aaaeb9cae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0bd5fb0bb64fb7eb6a23b719155b9da67d81e99e)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Apply unformat_price to decimal fields
Martin Renvoize [Tue, 27 Jun 2023 15:54:02 +0000 (16:54 +0100)]
Bug 33028: (follow-up) Apply unformat_price to decimal fields

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 461c1931b9137bfcf64c5ec9a5bc3f127727ec14)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 18ce1916fa59662187f7fbcbeee7fe376b49ff4c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Add unformat_price js function
Martin Renvoize [Tue, 27 Jun 2023 15:22:36 +0000 (16:22 +0100)]
Bug 33028: (follow-up) Add unformat_price js function

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 31cbd5ce946832234c8eb6b99729d781e75fd4bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9741e94376ea6c7ecf3920132ea05cc2849db4a8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Rewrite database update
Katrin Fischer [Fri, 16 Jun 2023 17:01:52 +0000 (17:01 +0000)]
Bug 33028: (follow-up) Rewrite database update

This rewrite the database update with some things in mind:

* We now use a positive value list of allowed characters to check
  This makes sure that all of those are recognized:
  1,00
  1.00€
  abc
* Instead of dying after finding one wrong value, we loop through
  all values first, building up an error string
* When we have errors... we die and print the full list of things
  that need fixing.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0199f5fbbb50cbc4656cbeb73c269a7cc6718e55)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 00fc50a1f6af3b94e60b06c7edb0588974d6b1fd)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Add TT filters for Price and pattern checks to input fields
Katrin Fischer [Fri, 16 Jun 2023 16:59:22 +0000 (16:59 +0000)]
Bug 33028: Add TT filters for Price and pattern checks to input fields

With this patch, all monetary values in the table will be displayed
formatted.

Also, the input will be checked against our agreed pattern to make
sure no false values can be entered.

Missing: When editing a rule, we need to unformat the value, so that
instead of the display format we have the input format available
for editing.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c2d40bb4a05687eca67a8e06befd5d43d0a4b9d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 32bddca28690bb05695d3e25fbd5764b7af0a06d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Add is_monetary to recall_overdue_fine and article_request_fee
Katrin Fischer [Fri, 16 Jun 2023 16:57:51 +0000 (16:57 +0000)]
Bug 33028: Add is_monetary to recall_overdue_fine and article_request_fee

This patch marks the 2 missing monetary values for recal over due fines
and article request fees as monetary.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2634097c15d808d4e9a96e33efa9ab245bba88c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit feb6ceaa249b938e1214c4e4bb104f043d1b5bb4)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Fix trailing 0 decimals
Martin Renvoize [Fri, 3 Mar 2023 11:33:46 +0000 (11:33 +0000)]
Bug 33028: (follow-up) Fix trailing 0 decimals

We want to recognise the truthyness of a number vs string so we drop
trailing decimals if they're just 0.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 598970a1223b9af043b1977965322758565f7d06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 84076285128d986f9a75c3135d40156248636420)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Move monetary definition into hash
Martin Renvoize [Fri, 3 Mar 2023 11:28:20 +0000 (11:28 +0000)]
Bug 33028: (follow-up) Move monetary definition into hash

This patch moves the defintion of monetary rule type into the rule kinds
hash.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b48a948cbe7f14526e4ea8836e5175e38ab9d20)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4a8fdaee6695c576966ddfa78262ae4f8da10651)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Fix calculations around cronjob fines.pl
Thibaud Guillot [Tue, 21 Feb 2023 16:05:45 +0000 (17:05 +0100)]
Bug 33028: Fix calculations around cronjob fines.pl

When currency format is set on FR commas are decimals separators
but when cron like fines.pl try to calculate fines it's fails due to
this format.

I changed this behavior by targetted 'fine' and 'overduefinescap' in
circulation_rules.rule_name to unformat them when we save them.

This also fix the display in smart_rules table (before with commas price
was not good displayed - without decimals)

Test Plan :
1) Set your currency format on 'FR' and 'fine' OR/AND 'overduefinescap'
with commas
2) Be sure to have some patron overdues
3) Run ~/misc/cronjobs/fines.pl with args to find overdues
4) See an error like 'isn't numeric in substraction[..] or gt > [...]'
5) Run updatedatabase script (it will replace commas in your rules
changed in step 1) )
6) Repeat step 3 and see that everything was going "fine" (:tada:)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f9e161b412621c048c55741bab56b92c0b01a15)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f9eba2d232dcd709fe4ef74d37963f1e019569d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33117: Make dbrev idempotent
Tomas Cohen Arazi [Mon, 7 Aug 2023 18:13:46 +0000 (15:13 -0300)]
Bug 33117: Make dbrev idempotent

QA didn't spot the issue, nor I. So fixing now.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 951e67a1b3dd1f26eddeaecd2dc63991f9667927)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit caa46019d07d89474feee02c7a2f8961e7414283)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34181: Fix jQuery selector to make delete checkboxes reappear
Katrin Fischer [Sun, 16 Jul 2023 14:11:19 +0000 (14:11 +0000)]
Bug 34181: Fix jQuery selector to make delete checkboxes reappear

Bug 32257 changed the page structure slightly to fix a display
issue with the labels. This resulted in a broken selector in the
function for displaying the checkboxes for deleting/emptying a
certain patron field.

To test:
* Go to Tools > Batch patron modifications
* Enter some cardnumbers or borrowernumbers
* On the batch patron edit form, verify that the checkboxes
  behind each input field are missing
* Apply patch
* Verify the checkboxes reappeared
  * Verify that for mandatory fields the checkbox is locked
* Make some batch edits and verify the checkboxes work as
  intended

Signed-off-by: Lisette Scheer <lisette.scheer@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d81b009ab0634e1ae33a1bb5cf20cad538bb361f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 625d0f812ad1c58750c032e7fdd271eaf2932f8c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34337: (bug 33581 follow-up) Sample patrons not inserted
Jonathan Druart [Fri, 21 Jul 2023 09:27:26 +0000 (11:27 +0200)]
Bug 34337: (bug 33581 follow-up) Sample patrons not inserted

The "select all" link for the optional sample data is not selecting
holidays and patrons.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39496af98f3d6408821636b92c5f6e3a25e5e71c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f400830a56ec12005f922e7b0de012e6c0ef9a07)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoRMAINT: Fix permission of .08 release db_rev
Martin Renvoize [Tue, 15 Aug 2023 09:36:42 +0000 (10:36 +0100)]
RMAINT: Fix permission of .08 release db_rev

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>