]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 24584: Rewrite optional/marc21_relatorterms to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 00:17:00 +0000 (21:17 -0300)]
Bug 24584: Rewrite optional/marc21_relatorterms to YAML

YAML version of optional marc21_relatorterms

To test:
1) Same test plan of first patch, only check table
   authorised_values

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24584: Rewrite optional/marc21_holdings_coded_values to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 00:07:44 +0000 (21:07 -0300)]
Bug 24584: Rewrite optional/marc21_holdings_coded_values to YAML

YAML version of optional marc21_holdings_coded_values

To test:
1) Same test plan of first patch, only check table
   authorised_values

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24584: Rewrite optional/csv_profiles to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 23:56:30 +0000 (20:56 -0300)]
Bug 24584: Rewrite optional/csv_profiles to YAML

YAML version of optional csv_profiles.

To test:
1) Do a clean install with optional data,
   dump table export_format, reserve.

2) Apply this patch and it's dependencies

3) Do a clean install, dump again and compare
   No major differences expected

4) Try translation
  a) Go to misc/translator
  b) create files for a new language
     ./translate create xx-YY
  c) Check new file po/xx-YY-instaler.po
     Verify strings from this file.
  d) Install new language
     ./translate install xx-YY
  e) Try clean install with new files

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24583: (follow-up) restore null values to labels
Bernardo Gonzalez Kriegel [Thu, 5 Mar 2020 13:21:55 +0000 (10:21 -0300)]
Bug 24583: (follow-up) restore null values to labels

This patch adds null values to selected label2/3 in
sample numberpatterns

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24583: Rewrite mandatory/sample_numberpatterns to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 23:34:54 +0000 (20:34 -0300)]
Bug 24583: Rewrite mandatory/sample_numberpatterns to YAML

YAML version of mandatory sample_numberpatterns

To test:
1) Same test plan of first patch, only check table
   subscription_numberpatterns

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24583: Rewrite mandatory/sample_notices to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 23:07:43 +0000 (20:07 -0300)]
Bug 24583: Rewrite mandatory/sample_notices to YAML

YAML version of mandatory sample_notices

To test:
1) Same test plan of first patch, only check table
   letter

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24583: Rewrite mandatory/sample_frequencies to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 23:05:31 +0000 (20:05 -0300)]
Bug 24583: Rewrite mandatory/sample_frequencies to YAML

YAML version of mandatory sample_frequencies

To test:
1) Same test plan of first patch, only check table
   subscription_frequencies

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24583: Rewrite mandatory/class_sources to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 22:58:09 +0000 (19:58 -0300)]
Bug 24583: Rewrite mandatory/class_sources to YAML

YAML version of mandatory class_sources

To test:
1) Same test plan of first patch, only check tables
   class_sort_rules, class_split_rules and class_sources

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24583: Rewrite mandatory/auth_values to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 22:45:07 +0000 (19:45 -0300)]
Bug 24583: Rewrite mandatory/auth_values to YAML

YAML version of mandatory auth_values.

To test:
1) Do a clean install, dump auth_values, reserve.

2) Apply this patch and it's dependencies

3) Do a clean install, dump again and compare
   No differences expected

4) Try translation
  a) Go to misc/translator
  b) create files for a new language
     ./translate create xx-YY
  c) Check new file po/xx-YY-instaler.po
     Verify strings from this file.
  d) Install new language
     ./translate install xx-YY
  e) Try clean install with new files

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24262: (follow-up) admit null values on labels
Bernardo Gonzalez Kriegel [Thu, 5 Mar 2020 13:23:53 +0000 (10:23 -0300)]
Bug 24262: (follow-up) admit null values on labels

This patch adds handling of null values on translatable
labels.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24262: Translate installer data in YAML format
Bernardo Gonzalez Kriegel [Fri, 20 Dec 2019 13:53:11 +0000 (10:53 -0300)]
Bug 24262: Translate installer data in YAML format

This patch adds the ability to:
1) Create new translation files from yaml installer files
2) Create installer directory for a given language

It will not create a installer directory if it already exists.

New (possible) translation files:
  xx-YY-installer.po
  xx-YY-installer-MARC21.po
  xx-YY-installer-UNIMARC.po

Needs Bug 13897 (for yaml files)

NOTE: updated version adding ability to process multiline
fields, discard small ( < 2) strings, and discard strings
with pure html, TT or punctuation.

To test:
1) Apply patches from Bug 13897
2) Apply this patch
3) Go to misc/translation
4) Create translation files for a NEW language
   $ ./translate create xx-YY

   check new file 'xx-YY-installer.po'

5) Copy ../../installer/data/mysql/en/optional/auth_val.yml
   into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/
   and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/

   remove po/xx-YY*, then repeat creation

   check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po'
   and 'xx-YY-installer-UNIMARC.po'

   remove all new files

6) Create for xx-YY again and try update
   $ ./translate create xx-YY
   edit ../../installer/data/mysql/en/optional/auth_val.yml
   and change one char in one of the translatable values,
   also edit 'xx-YY-installer.po', translate the same
   string (in msgstr).

   Do an update
   $ ./translate update xx-YY

   check in 'xx-YY-installer.po' a fuzzy value for the
   translated value and the preservation of the translation
   Fix the translation, or add a new one.

7) Create an install dir for xx-YY
   ./translate install xx-YY

    Check new dir '../../installer/data/mysql/xx-YY/'
    Check files on it
    $ tree ../../installer/data/mysql/xx-YY/
    and compare with ../../installer/data/mysql/en/

    All installation files must be present

8) Try a new Koha install using this language in the
   usual way.
   Check in authorised_values table for the translated string.

9) Try create an install dir for an existing language
   (eg. es-ES, de-DE or fr-FR ), eg.
   ./translate install de-DE

   Install dir is detected and not changed, a note is printed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13897: Surround columns with backticks
Jonathan Druart [Wed, 12 Feb 2020 10:27:39 +0000 (11:27 +0100)]
Bug 13897: Surround columns with backticks

We have some column's names that need to be surrounded by ` as they are
protected keywords ('rows' for instance)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13897: Process description, multiline values and SQL statements in YAML files
Bernardo Gonzalez Kriegel [Thu, 30 Jan 2020 14:30:30 +0000 (11:30 -0300)]
Bug 13897: Process description, multiline values and SQL statements in YAML files

This patch adds 3 features:
1) Display description of YAML files at install time
   for frameworks, and fixes it's encoding.
2) Enable use of multiline values, field required
3) Process SQL statements declared in YAML files

With this features we can process files with the
following generic YAML strucure:

  ---
  description:
    - "File description"

  tables:
    - table_name:
        translatable: [ title, content ]
        multiline: [ content ]
        rows:
          - title: "Example title"
            content:
              - "Content:"
              - ""
              - "This is the content."
            id: 1
            value: ~

  sql_statements:
    - "UPDATE table_name SET value ='empty' WHERE value IS NULL"
  ...

* file description is now inside the YAML, can have multiple
  lines.
  This attribute is expected in all YAML files.
* translatable attribute in table declare fields that can be
  translated
* multiline attribute in table declare fields that can have
  multiple lines of content, they are joined using '\r\n'
  before insert into database.
  This is useful to express fields like 'news' content, and
  to simplify it's translation.
  '\r\n' is used for correct display in Windows clients.
* sql_statements allows to add multiple SQL sentences, not
  insertions normally, that are executed in order.

This features are not needed for the example file of this patch,
but will be used in new bugs.

To test:
1) Use the same test plan of first patch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13897: Catch the error and warn it
Jonathan Druart [Wed, 18 Dec 2019 08:27:59 +0000 (09:27 +0100)]
Bug 13897: Catch the error and warn it

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13897: Use YAML files for installer data
Bernardo Gonzalez Kriegel [Thu, 28 Nov 2019 22:06:35 +0000 (19:06 -0300)]
Bug 13897: Use YAML files for installer data

This patch modifies C4/Installer.pm to add support
for loading YAML files into database.

As an example of the functionality, optional
auth_val.sql file is replaced by auth_val.yml

The rationale behind this feature is to enable the
translation of the data that is loaded into the
database. That will be addressed in another bug.

But taking into account that goal, translatable
values are declared in the YAML files, to ease
identification by translate script.

Also file description is moved into the yaml
file.

To test:
0) Do a clean install with all optional data,
   then dump authorised_values table, reserve.
1) Apply the patch
2) Do a clean install in English (marc21/unimarc)
3) On optional data check for description of auth_val
   "Some basic default authorised values for ..."
4) Select all optional data
5) Finish installation
6) Dump again authorised_values table and compare with that
   of point '0'.
   No differences should be found.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24817: Replace sleep calls with date setting in test data
Martin Renvoize [Fri, 6 Mar 2020 14:47:00 +0000 (14:47 +0000)]
Bug 24817: Replace sleep calls with date setting in test data

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24817: Add sleep between db create actions
Martin Renvoize [Fri, 6 Mar 2020 08:25:39 +0000 (08:25 +0000)]
Bug 24817: Add sleep between db create actions

We need to allow some time to pass between calls that add cash register
lines to accountlines or cash_register_actions. We use database level
triggers to maintain the timestamp fields, so cannot use Time::Fake, and
the methods we are testing assume that, as human interactions, there
will be at least a second between the last 'sale' on a cash register and
the 'cashup' of that same cash register.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24066: Add missing POD for has_permission
Martin Renvoize [Tue, 19 Nov 2019 14:03:37 +0000 (14:03 +0000)]
Bug 24066: Add missing POD for has_permission

To test:
1) do perldoc Koha/Patron.pm
   search has_permission

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fixed (removed) space before 'my $permission' to make it similar to
other entries.
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24219: Preserve sort order when returning to result list
Jonathan Druart [Tue, 17 Dec 2019 09:45:11 +0000 (10:45 +0100)]
Bug 24219: Preserve sort order when returning to result list

There is a mismatch between sort_cgi, sort and sort_by variables.

 * sort_cgi
I did not find relevant occurrences of sort_cgi in the git log of both
search.pl and results.tt. So it seems that it never worked correctly.
 * sort
It is the JS variable use in browser.js
 * sort_by is the search.pl parameter to set the sort_by option

Test plan:
1. Perform a search in the staff client
2. Change the sort order to something different (try Author A-Z)
3. Click on a result to view the record
4. Click on "Results" button on left side to return to result list
=> Without this patch the result list is sorted by relevancy
=> With this patch applied the Author A-Z is kept

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23384: Fix use statement order for ArticleRequest::Status
Jonathan Druart [Tue, 18 Feb 2020 15:13:11 +0000 (16:13 +0100)]
Bug 23384: Fix use statement order for ArticleRequest::Status

Koha::ArticleRequest is used by Koha::ArticleRequests so
Koha::ArticleRequest::Status should not be needed in
Koha::ArticleRequest.
Also Koha::ArticleRequest::Status must be loaded before
Koha::ArticleRequest

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24760: (follow-up) Add a neighboring test messsage
Marcel de Rooy [Fri, 6 Mar 2020 11:13:15 +0000 (11:13 +0000)]
Bug 24760: (follow-up) Add a neighboring test messsage

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24760: Use C4::BackgroundJob->fetch in tests
Julian Maurice [Fri, 28 Feb 2020 13:22:34 +0000 (14:22 +0100)]
Bug 24760: Use C4::BackgroundJob->fetch in tests

Starting with YAML 1.30 and YAML::Syck 1.32, these modules don't bless
loaded objects by default. This is not a problem as
C4::BackgroundJob->fetch bless them anyway.

So, instead of testing what's in the session, test the result of
C4::BackgroundJob->fetch, which is what's used everywhere else

Test plan:
1. Install latest version of YAML::Syck (or YAML if YAML::Syck is not
installed)
2. prove t/db_dependent/BackgroundJob.t => should FAIL
3. Apply patch
4. prove t/db_dependent/BackgroundJob.t => should PASS
5. Verify that background jobs are still working (for instance,
tools/batchMod.pl)

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24788: Remove autoloaded column accessors in Koha::Object->store
David Gustafsson [Tue, 3 Mar 2020 13:32:31 +0000 (14:32 +0100)]
Bug 24788: Remove autoloaded column accessors in Koha::Object->store

Columns are accessed as methods, relying on AUTOLOAD, in
Koha::Object->store. This could be a source of strange bugs
if a column name clashes with an existing method name.

To test:

1) Apply patches for Bug 14957
2) Follow the testing instructions, when saving a new marc rule and
error is thrown.
3) Apply patch
4) Try saving a new rule once again, this should now work

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: (RM follow-up) Fix rebase error
Martin Renvoize [Fri, 6 Mar 2020 13:13:37 +0000 (13:13 +0000)]
Bug 23051: (RM follow-up) Fix rebase error

Looks like at some point during reworking/rebasing the signature for
Koha::Account::Line->apply changed and was then reverted but one case of
the reversion got lost.

The error was highlighted in the patrons_accounts credit api tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: DBRev 19.12.00.037
Martin Renvoize [Fri, 6 Mar 2020 10:08:55 +0000 (10:08 +0000)]
Bug 23051: DBRev 19.12.00.037

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: (follow-up) Remove call to GetFines
Andrew Isherwood [Thu, 5 Mar 2020 10:26:38 +0000 (10:26 +0000)]
Bug 23051: (follow-up) Remove call to GetFines

As mentioned by Nick in comment #69 and subsequently discussed on Slack,
the call to GetFines in renew_item was unnececcesary. It has now been
removed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: (follow-up) Fix renew summary display
Andrew Isherwood [Wed, 4 Mar 2020 15:11:23 +0000 (15:11 +0000)]
Bug 23051: (follow-up) Fix renew summary display

As mentioned in comment #69:

>staff client does unless I click 'pay' next to the individual fine

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: (QA follow-up) Missing curly and tabs and fix test
Nick Clemens [Wed, 4 Mar 2020 13:25:48 +0000 (13:25 +0000)]
Bug 23051: (QA follow-up) Missing curly and tabs and fix test

Some rebase issues, accounttype no longer exists, circ rules make
CanBookBeRenewed fail, so we mock that too

interface must be passed as a hashref

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: (follow-up) Add renewal feedback and move code to subroutines and test
Andrew Isherwood [Wed, 9 Oct 2019 14:13:54 +0000 (15:13 +0100)]
Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test

Rebasing was a nightmare, so I'm squashing the sign off follow-ups to
ease the pain with any future rebases

Includes:

Bug 23051: (follow-up) Refactor renewal code
As per Nick's first point in comment #20, the code that tests for
renewability and renews items has been refactored into it's own
function.

Bug 23051: (follow-up) Provide feedback
For renewals that fail when a fine is being paid off, this patch causes
any errors to be passed back to the template for display.
Addresses the second point in Nick's comment #20

Bug 23051: (follow-up) Fix unit tests
As raised by Nick in comment #35

Bug 23051: (follow-up) Fix/improve feedback
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- it would be nice to get feedback on what was successfully renewed as well
- In general I think I would prefer to see 'ok' and 'not_ok' returned as
a single 'renewal_results' array
- There is no listing of errors if I use the 'pay' button on an
individual fine

Bug 23051: (follow-up) Refactor methods
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- I don't really like that the functions are internal functions and then
exported
- I think the pref description should highlight that if 'RenewalPeriodBase'
is set to due date, there may be doubled charges

Bug 23051: (follow-up) Add SIP summary
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- Ideally SIP would get feedback in a screen message

Bug 23051: (follow-up) Renewing in OPAC
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- I am also not sure about the code path if a patron paid fines on the
opac (via paypal etc.) but renewals are not allowed on the opac.

We've introduced the syspref RenewAccruingItemInOpac (default is off)
which, when enabled, will cause items attached to fines that are paid
off in the OPAC (via payment plugins), to be automatically renewed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: Renew items when fines paid off
Andrew Isherwood [Tue, 11 Jun 2019 13:17:17 +0000 (14:17 +0100)]
Bug 23051: Renew items when fines paid off

When the RenewAccruingItemWhenPaid syspref is enabled and all the fines
on an item that is accruing fines are paid, we automatically renew that
item to prevent it from starting to accrue fines again.

This patch adds an additional argument to C4::Circulation::AddRenewal
which allows us to skip the calculation of fines upon renewal, which we
don't want to do if the fines on that item have just been paid. Existing
calls to AddRenewal have not been amended because there seems to be a
convention of only passing undef when adding arguments that require
their positioning to be maintained. Since the new argument is the last
one, this is not the case with any existing call.

Sponsored-by: Loughborough University
Signed-off-by: Lucy Harrison <L.M.Harrison@lboro.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: Add unit tests
Andrew Isherwood [Wed, 12 Jun 2019 14:18:54 +0000 (15:18 +0100)]
Bug 23051: Add unit tests

This patch adds unit tests for all modules affected by this bug

Sponsored-by: Loughborough University
Signed-off-by: Lucy Harrison <L.M.Harrison@lboro.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23051: Add RenewAccruingItemWhenPaid syspref
Andrew Isherwood [Wed, 5 Jun 2019 13:38:07 +0000 (14:38 +0100)]
Bug 23051: Add RenewAccruingItemWhenPaid syspref

This patch adds the new syspref "RenewAccruingItemWhenPaid"

Sponsored-by: Loughborough University
Signed-off-by: Lucy Harrison <L.M.Harrison@lboro.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24573: Add missing dependencies to cpanfile
Julian Maurice [Tue, 4 Feb 2020 07:01:06 +0000 (08:01 +0100)]
Bug 24573: Add missing dependencies to cpanfile

When using Elasticsearch, Catmandu::Store::ElasticSearch is required for
search, and Catmandu::MARC is required for indexation

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24813: Prevent api/v1/holds.t to fail randomly
Jonathan Druart [Thu, 5 Mar 2020 15:27:15 +0000 (16:27 +0100)]
Bug 24813: Prevent api/v1/holds.t to fail randomly

Hold cannot be suspended if found=W:
Koha::Hold->suspend_hold
 90     if ( $self->is_found ) {    # We can't suspend found holds

So when TestBuilder generate a hold with found=W the test fail.

A question however:
Why did not we have the correct exception displayed somewhere? That
would be much more helpful to find the problem!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24713: JavaScript error on staff client catalog search results page
Owen Leonard [Tue, 25 Feb 2020 18:08:59 +0000 (18:08 +0000)]
Bug 24713: JavaScript error on staff client catalog search results page

This patch modifies the output of template toolkit variables so that
values in the in-page JavaScript are quoted. This avoids JavaScript
errors when the template variable is empty.

To test, apply the patch and perform a catalog search in the staff
client. Use the browser's developer tool to check for JavaScript errors
in the console. There should be none.

Test with AmazonCoverImages both on and off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24802: Updating holds can cause suspensions to apply to wrong hold
Kyle M Hall [Wed, 4 Mar 2020 17:08:29 +0000 (12:08 -0500)]
Bug 24802: Updating holds can cause suspensions to apply to wrong hold

On request.pl, the table of holds shows a suspend_until date picker for each hold, *unless* that hold is waiting or in transit. The script reserve/modrequest.pl assumes that there will be a suspend_until input for each hold, but that is incorrect. Assume there are 20 holds on a record, and 10 of them are waiting or in transit. If you were to then set the suspend until date on the 10 open holds, and use the "Update hold(s)" button, those 10 suspensions would apply to the 10 found holds and not the holds they should apply to!

Test Plan:
1) Place two holds on a record
2) Check in an item and trap it for the first hold
3) Now that one hold is waiting and the other is not, attempt to set
   a suspension date using the "Update hold(s)" button
4) Note your hold does not get suspended!
5) Apply this patch
6) Restart all the things!
7) Repeat steps 1-3
8) Your hold should now be suspended!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22969: fix biblionumber on 001 in UNIMARC XSLT
Fridolin Somers [Thu, 23 May 2019 05:55:15 +0000 (07:55 +0200)]
Bug 22969: fix biblionumber on 001 in UNIMARC XSLT

In UNIMARC default configuration the 001 is linked to biblio.biblionumber.
In some XSLT files, 090$a is used.
This is by default biblioitems.biblionumber so it usually works but it may not be the same and var biblionumber is used to create hyperlinks to record detail page.

Test plan :
1) Use UNIMARC database
2) Set default in all XSLT system preferences
3) At OPAC, perform a search and click on a result
4) Check displayed page shows the correct biblio record
5) Same at intranet

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested on clean UNIMARC install.
Before insert new records: "alter table biblioitems AUTO_INCREMENT = 5"
Added two records, with result:
+--------------+------------------+
| biblionumber | biblioitemnumber |
+--------------+------------------+
|            1 |                5 |
|            2 |                6 |
+--------------+------------------+
Without patch, OPAC results shows for first record
  http://opac/cgi-bin/koha/opac-detail.pl?biblionumber=5, Wrong!
with patch result is correct

Works, no errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24798: smart-rules.tt has erroneous comments
Owen Leonard [Wed, 4 Mar 2020 18:29:24 +0000 (18:29 +0000)]
Bug 24798: smart-rules.tt has erroneous comments

This patch corrects a couple of invalid Template Toolkit comments in the
Circulation and Fines rules template.

To test, apply the patch and log into the staff client as an
administrator.

On the Circulation and Fines Rules page "View source" and look for
instances of the text "[#% Default branch %#]" There should be none.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] There is a theoretical difference between [% # and [%#. The latter
marks the whole directive as a comment and not just until EOL.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24803: Remove JS error when clicking "Log in to your account"
Owen Leonard [Wed, 4 Mar 2020 19:47:26 +0000 (19:47 +0000)]
Bug 24803: Remove JS error when clicking "Log in to your account"

This patch removes the "data-toggle" attribute from the login link in
order to avoid a JavaScript error. Since we have a custom click handler
to trigger the modal we don't need Bootstrap's "automatic" modal
handling.

Test plan:
1. Apply patch
2. Open F12 dev tools
3. Click "Log in to your account" on OPAC
4. Observe no Javascript errors in console

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24719: Remove use of CGI object in C4::Context::set_remote_address()
David Cook [Thu, 27 Feb 2020 00:28:48 +0000 (00:28 +0000)]
Bug 24719: Remove use of CGI object in C4::Context::set_remote_address()

This patch replaces the CGI "http" object method with its equivalent
class method, which doesn't require object instantiation and thus skips
global initialization and premature handling of the incoming HTTP request.

Test plan:
0. Disable Plack if it is enabled
1. Set koha_trusted_proxies in koha-conf.xml to 1.1.1.1
2. Clear Memcached
3. Try to upload MARCXML file to /cgi-bin/koha/tools/stage-marc-import.pl
4. Note that form below "Upload progress" never appears and errors show
in browser console
5. Apply the patch
6. Try to upload MARCXML file to /cgi-bin/koha/tools/stage-marc-import.pl
7. Note that form appears below "Upload progress"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24492: (RM follow-up) Redirect to correct page after cashup
Martin Renvoize [Thu, 5 Mar 2020 14:16:33 +0000 (14:16 +0000)]
Bug 24492: (RM follow-up) Redirect to correct page after cashup

Cashup of a single register was resulting in a redirect to the register
details page. It should return to the branch details page instead.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24492: Update GPL license
Kyle M Hall [Wed, 4 Mar 2020 19:02:53 +0000 (19:02 +0000)]
Bug 24492: Update GPL license

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24492: Add branch details page
Martin Renvoize [Thu, 9 Jan 2020 13:53:09 +0000 (13:53 +0000)]
Bug 24492: Add branch details page

This patch adds a new 'branch details' page to the POS system which
displays a summary of the cash register transactions for a branch
since each register was last cashed up. It also allows for cashing
up individual registers or cashing up all registers at a given branch
in one transaction.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22615: Fix perlcritic
Josef Moravec [Wed, 22 Jan 2020 14:24:15 +0000 (14:24 +0000)]
Bug 22615: Fix perlcritic

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22615: Add endpoint for getting one ill backend
Josef Moravec [Wed, 22 Jan 2020 14:21:33 +0000 (14:21 +0000)]
Bug 22615: Add endpoint for getting one ill backend

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22615: Add /ill_backends endpoint
Josef Moravec [Mon, 1 Apr 2019 15:08:26 +0000 (15:08 +0000)]
Bug 22615: Add /ill_backends endpoint

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24369: DBRev 19.12.00.036
Martin Renvoize [Thu, 5 Mar 2020 13:01:22 +0000 (13:01 +0000)]
Bug 24369: DBRev 19.12.00.036

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24369: Add CORS support to the API
Tomas Cohen Arazi [Thu, 9 Jan 2020 14:13:47 +0000 (11:13 -0300)]
Bug 24369: Add CORS support to the API

This patch adds CORS support for API requests. It uses the
AccessControlAllowOrigin syspref. To test:

1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth.t
=> SUCCESS: Tests pass!
3. Set the AccessControlAllowOrigin to any string (for example, *)
4. Use any API testing tool (Postman?) to place a request on the API
=> SUCCESS: The response headers include Access-Control-Allow-Origin,
    containing what you set on the syspref
5. Sign off :-D

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24369: Add CORS support to output_with_http_headers()
Tomas Cohen Arazi [Thu, 9 Jan 2020 13:44:09 +0000 (10:44 -0300)]
Bug 24369: Add CORS support to output_with_http_headers()

This patch adds CORS support to output_with_headers(). It will use the
AccessControlAllowOrigin syspref to pick the value and set the Access-Control-Allow-Origin header.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/Output.t
SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24369: Add AccessControlAllowOrigin syspref
Tomas Cohen Arazi [Thu, 9 Jan 2020 13:42:43 +0000 (10:42 -0300)]
Bug 24369: Add AccessControlAllowOrigin syspref

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24552: Be compatible with Search::Elasticsearch 6.00
Julian Maurice [Fri, 31 Jan 2020 10:13:47 +0000 (11:13 +0100)]
Bug 24552: Be compatible with Search::Elasticsearch 6.00

There is no need to specify the `client` param here because
'5_0::Direct' is the default value for Search::Elasticsearch 5.x and it
breaks when Search::Elasticsearch 6.x is installed

Test plan:
1. Apply the patch
2. Make sure you have Search::Elasticsearch 5.x
3. Reload starman
4. Verify that search works
5. Install Search::Elasticsearch 6.x
6. Reload starman
7. Verify that search works

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: (RM follow-up) Correction for cash register selection
Martin Renvoize [Thu, 5 Mar 2020 08:51:51 +0000 (08:51 +0000)]
Bug 23354: (RM follow-up) Correction for cash register selection

The form element for selectin cash register override at point of sale was
misnamed and as such one could not actually override the cash register.

This patch corrects the form element name and updates the logic very
slighlty to ensure we still fall back to the defualt no the subsequent
page load.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23354: (RM follow-up) Correction for cash register selection
Martin Renvoize [Thu, 5 Mar 2020 08:51:51 +0000 (08:51 +0000)]
Bug 23354: (RM follow-up) Correction for cash register selection

The form element for selectin cash register override at point of sale was
misnamed and as such one could not actually override the cash register.

This patch corrects the form element name and updates the logic very
slighlty to ensure we still fall back to the defualt no the subsequent
page load.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24790: Add POS to the 'More' dropdown on the staff client
Tomas Cohen Arazi [Tue, 3 Mar 2020 14:39:38 +0000 (11:39 -0300)]
Bug 24790: Add POS to the 'More' dropdown on the staff client

This trivial patch adds 'Point of sale' to the dropdown.

To test:
1. Notice there is no 'Point of sale' entry in the staff dropdown
=> FAIL: No dropdown
2. Apply this patch and reload
=> SUCCESS: Point of sale displays and works
3. Play with enabling/disabling the feature and removing permissions
=> SUCCESS: The entry in the dropdown respects the configured
permissions and settings.
4. Sign off :-D

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24082: DBRev 19.12.00.035
Martin Renvoize [Wed, 4 Mar 2020 16:05:28 +0000 (16:05 +0000)]
Bug 24082: DBRev 19.12.00.035

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24082: (QA follow-up): Template fixes
Tomas Cohen Arazi [Tue, 3 Mar 2020 19:10:17 +0000 (16:10 -0300)]
Bug 24082: (QA follow-up): Template fixes

This patch introduces missing TT filters and also replaces tabs for
spaces to fix indentation problems.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24082: Add access to historical transactions
Martin Renvoize [Thu, 23 Jan 2020 16:05:06 +0000 (16:05 +0000)]
Bug 24082: Add access to historical transactions

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24082: Add refund action to relevant lines
Martin Renvoize [Thu, 23 Jan 2020 16:03:06 +0000 (16:03 +0000)]
Bug 24082: Add refund action to relevant lines

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24082: Add `anonymous_refund` permission to `cash_management`
Martin Renvoize [Thu, 23 Jan 2020 15:52:25 +0000 (15:52 +0000)]
Bug 24082: Add `anonymous_refund` permission to `cash_management`

This patch adds the new `anonymous_refund` permission to the
`cash_management` flag and binds it to the visability of the register
details page.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22529: Use new C4::Auth::haspermission from svc/members/search
Jonathan Druart [Mon, 6 May 2019 16:02:03 +0000 (11:02 -0500)]
Bug 22529: Use new C4::Auth::haspermission from svc/members/search

The svc/members/search script can be used to retrieve patrons with a
specific permission. This feature is only used once, to link patrons to
funds.
The code in the script is duplicated from what we have in
C4::Auth::haspermission, and it makes sense to clean it.

Test plan:
Create a fund and add users to this fund.
When you search for users you must only have a list of patrons with the
acquisition.order_manage permission.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as described. No errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24801: Display all the categories - Selenium fix
Jonathan Druart [Wed, 4 Mar 2020 14:53:12 +0000 (15:53 +0100)]
Bug 24801: Display all the categories - Selenium fix

To make sure we are going to be able to click on the "Delete" button of
our newly created category PATRON_CAT, we are displaying them all.

Test plan:
Create several patron categories that will fill the first page:

use t::lib::TestBuilder;
my $builder = t::lib::TestBuilder->new;
for my $i ( 1..20 ) {
    $builder->build_object({ class => 'Koha::Patron::Categories', value => { description => "cat_$i" } });
}

Execute the selenium tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24775: Add ID to POS submit payment button
Martin Renvoize [Mon, 2 Mar 2020 11:59:27 +0000 (11:59 +0000)]
Bug 24775: Add ID to POS submit payment button

This patch simply adds an ID to the submit button to make it easier to
overide styling and functionality.

Test Plan:
0/ Inspect the element on page and note there is no id
1/ Apply patch
2/ Refresh page
3/ Inspect the element on page and note there is now an id

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24479: Use $Price filters for '0' amounts
Martin Renvoize [Mon, 2 Mar 2020 11:32:42 +0000 (11:32 +0000)]
Bug 24479: Use $Price filters for '0' amounts

This patch adds the use of the $Price TT filter to properly format '0'
amounts in the POS system.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24081: DBRev 19.12.00.034
Martin Renvoize [Wed, 4 Mar 2020 14:49:27 +0000 (14:49 +0000)]
Bug 24081: DBRev 19.12.00.034

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24081: (QA follow-up) Fix small typo
Tomas Cohen Arazi [Wed, 4 Mar 2020 12:49:46 +0000 (09:49 -0300)]
Bug 24081: (QA follow-up) Fix small typo

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24081: Add discount action to boraccount
Martin Renvoize [Tue, 3 Mar 2020 19:22:49 +0000 (19:22 +0000)]
Bug 24081: Add discount action to boraccount

This patch adds the ability to apply discounts to existing patron
charges from the boraccount page.

Test plan
1/ Carry out some accounting actions that end up with debts on the
patron record. (Add a manual invoice for example)
2/ Note a new 'Apply discount' action button on the unpaid debt
3/ Paid debts do not display the action button
4/ Click the button
5/ Enter an amount into the resulting modal and click confirm
6/ Confirm that the outstanding debt has been reduced by the amount you
specified.
7/ Confirm that a new 'Discount' line appears on the patrons account
8/ Confirm that in the 'details' view of the debt that the discount line
was used against the debt to create the reduction.
9/ Signoff

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24081: Add DISCOUNT to the allowed 'reduce' types
Martin Renvoize [Thu, 9 Jan 2020 14:14:34 +0000 (14:14 +0000)]
Bug 24081: Add DISCOUNT to the allowed 'reduce' types

This patch adds the DISCOUNT type to the handled types list in the
reduce method introduced in bug 23442

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24081: Add credit_types, offset_types and permissions
Martin Renvoize [Thu, 9 Jan 2020 14:13:25 +0000 (14:13 +0000)]
Bug 24081: Add credit_types, offset_types and permissions

This patch adds the credit_type, offset_type and permissions required
for the addition of a discounting workflow in the accounts system.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24540: Prevent add button being triggered on enter
Martin Renvoize [Mon, 2 Mar 2020 16:50:17 +0000 (16:50 +0000)]
Bug 24540: Prevent add button being triggered on enter

This patch prevents the add button being triggered by hitting return
from inside the collected from patron form input.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24741: (bug 21674 follow-up) Fix destructive update DB 19.12.00.017
Jonathan Druart [Tue, 3 Mar 2020 08:55:03 +0000 (09:55 +0100)]
Bug 24741: (bug 21674 follow-up) Fix destructive update DB 19.12.00.017

Previous version of the SQL query did not deal correctly with subgroup.

Test plan:
checkout the following commit to be just before 017
  commit 715da06db557edc4b1baa51cc278fdac362c01c4
  Bug 22868: DBRev 19.12.00.016
reset_all # recreate the DB
Create a complex tree of library groups, with several groups, subgroups,
etc.
When you add a new library, refresh the page to add it several time.
When ready, git checkout master, restart all the things, execute the
updatedatabase script, then go to the library groups page.
You should see that the duplicated entries have been removed, but
subgroups have not been deleted

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested with duplicated entries on groups and subgroups,
going back to the right commit and doing clean install.
Patch works, subgroups are preserved. No errors.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: (RM follow-up) Tidy Template
Martin Renvoize [Wed, 4 Mar 2020 09:04:15 +0000 (09:04 +0000)]
Bug 23355: (RM follow-up) Tidy Template

At Jonatans request, I have tidied the table markup

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Make "Print receipt" translatable
Jonathan Druart [Wed, 4 Mar 2020 08:49:06 +0000 (09:49 +0100)]
Bug 23355: Make "Print receipt" translatable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: (RM follow-up) Remove reintroduced relationship
Martin Renvoize [Tue, 3 Mar 2020 16:19:53 +0000 (16:19 +0000)]
Bug 23355: (RM follow-up) Remove reintroduced relationship

As part of an accidental push of a DO NOT PUSH schema update commit
we re-introduced a formerly removed relationship accessor

This patch removes that mistake.

Tests added to the pre-push hook to prevent future mishaps.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: (RM follow-up) Add DROP statement for cash_register_actions
Martin Renvoize [Tue, 3 Mar 2020 16:09:28 +0000 (16:09 +0000)]
Bug 23355: (RM follow-up) Add DROP statement for cash_register_actions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: DBRev 19.12.00.033
Martin Renvoize [Tue, 3 Mar 2020 15:01:48 +0000 (15:01 +0000)]
Bug 23355: DBRev 19.12.00.033

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: (QA follow-up) Add a modal confirm to the cashup action
Martin Renvoize [Tue, 3 Mar 2020 14:09:40 +0000 (14:09 +0000)]
Bug 23355: (QA follow-up) Add a modal confirm to the cashup action

This patch adds a simple modal to confirm the cashup action adding a
safely measure to it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Rename staff_id for manager_id
Tomas Cohen Arazi [Tue, 3 Mar 2020 13:50:44 +0000 (10:50 -0300)]
Bug 23355: Rename staff_id for manager_id

This patch makes the parameter naming more consistent and also fixes the
tests (there was a missmatch on the parameter naming, and tests count
was incorrect).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: (QA follow-up) Missing koha_object(s)_class definitions
Tomas Cohen Arazi [Tue, 3 Mar 2020 13:48:22 +0000 (10:48 -0300)]
Bug 23355: (QA follow-up) Missing koha_object(s)_class definitions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: (QA follow-up) Add missing TT filters
Tomas Cohen Arazi [Tue, 3 Mar 2020 13:03:33 +0000 (10:03 -0300)]
Bug 23355: (QA follow-up) Add missing TT filters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: License fixes
Tomas Cohen Arazi [Tue, 3 Mar 2020 13:03:01 +0000 (10:03 -0300)]
Bug 23355: License fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Add cashup permissions
Martin Renvoize [Fri, 13 Sep 2019 13:48:49 +0000 (14:48 +0100)]
Bug 23355: Add cashup permissions

Add new 'cashup' sub-permissions to the 'cash_management' permission to
allow fine grained control over whome may 'cashup' a cash register.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Add register details page
Martin Renvoize [Thu, 23 Jan 2020 13:40:33 +0000 (13:40 +0000)]
Bug 23355: Add register details page

This patch adds a new page which can be accessed via the menu to the
left of the point of sale page.  This new page displays a list of
transactions since the last 'cashup' action, a summary of transaction
amounts and a button to allow the recording of a new 'cashup action.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Split tests for Line vs Lines
Martin Renvoize [Thu, 23 Jan 2020 13:39:44 +0000 (13:39 +0000)]
Bug 23355: Split tests for Line vs Lines

This patch simply splits the existing tests for accountlines into two
test files, one for the singular object and one for the set.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Link cash_register_actions to cash_registers by foreign key
Martin Renvoize [Fri, 13 Sep 2019 13:11:37 +0000 (14:11 +0100)]
Bug 23355: Link cash_register_actions to cash_registers by foreign key

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Add accountline deletion test
Martin Renvoize [Thu, 22 Aug 2019 08:10:51 +0000 (09:10 +0100)]
Bug 23355: Add accountline deletion test

This patch adds a test to ensure database relations do not cascade
deletions when a cash register is deleted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Add CASHUP actions
Martin Renvoize [Thu, 23 Jan 2020 13:37:46 +0000 (13:37 +0000)]
Bug 23355: Add CASHUP actions

This patch adds methods relating to cashup procedures to the cash
register object to ease adding and querying for cashup actions related
to the register.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: [DO NOT PUSH] DBIC Classes
Martin Renvoize [Thu, 23 Jan 2020 13:37:33 +0000 (13:37 +0000)]
Bug 23355: [DO NOT PUSH] DBIC Classes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23355: Add cash_register_actions table
Martin Renvoize [Tue, 23 Jul 2019 13:05:18 +0000 (14:05 +0100)]
Bug 23355: Add cash_register_actions table

This patch adds the new cash_register_actions database table to allow
for storing of cash register actions which are not already stored as
accountlines.

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23534: Fix selenium tests
Jonathan Druart [Tue, 3 Mar 2020 14:58:40 +0000 (15:58 +0100)]
Bug 23534: Fix selenium tests

The title of the page now contains lot of info (is it what we really
want?)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24756: Catch two failed to load-variations in Security.t
Marcel de Rooy [Mon, 2 Mar 2020 11:08:18 +0000 (11:08 +0000)]
Bug 24756: Catch two failed to load-variations in Security.t

Test 7 in Security.t failed when 'failed to load HTTP resource' was
returned by libxml2 instead of 'failed to load external entity'.

We now remove the debugging with Dumper again and adjust the regex to
include both variations.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24757: (RM follow-up) Restore test count
Martin Renvoize [Tue, 3 Mar 2020 10:30:32 +0000 (10:30 +0000)]
Bug 24757: (RM follow-up) Restore test count

Somehow we lost a '0' on the test count for
t/db_dependent/Koha/Patrons.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23975: (QA follow-up) Add another plugin source
Martin Renvoize [Tue, 3 Mar 2020 09:22:18 +0000 (09:22 +0000)]
Bug 23975: (QA follow-up) Add another plugin source

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23975: (QA follow-up) Add missing TT filters
Tomas Cohen Arazi [Tue, 3 Mar 2020 03:08:09 +0000 (00:08 -0300)]
Bug 23975: (QA follow-up) Add missing TT filters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23975: (QA follow-up) Search button style and functionality
Tomas Cohen Arazi [Tue, 3 Mar 2020 03:04:36 +0000 (00:04 -0300)]
Bug 23975: (QA follow-up) Search button style and functionality

This patch makes the search form button match the other buttons style,
and also adds the submit() action on click.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23975: (QA follow-up) Fix styling of install buttons
Martin Renvoize [Mon, 2 Mar 2020 18:58:13 +0000 (18:58 +0000)]
Bug 23975: (QA follow-up) Fix styling of install buttons

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23975: (follow-up) Don't rely on save_to being present
Martin Renvoize [Thu, 13 Feb 2020 08:48:17 +0000 (08:48 +0000)]
Bug 23975: (follow-up) Don't rely on save_to being present

The `save_to` shortcut method was introduced to Mojolicious in version
8.02 but we still support 7.21 as our minimum dependancy and as such we
cannot yet use it.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23975: Add 'Install' support for github results
Martin Renvoize [Wed, 12 Feb 2020 14:43:01 +0000 (14:43 +0000)]
Bug 23975: Add 'Install' support for github results

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23975: Add ability to search and install plugins from GitHub
Kyle M Hall [Tue, 5 Nov 2019 17:31:04 +0000 (12:31 -0500)]
Bug 23975: Add ability to search and install plugins from GitHub

It would be nice to be able to search and install plugins directly from GitHub ( and GitLab if possible ). This would make it easier to verify the authenticity of plugins and make discovering new plugins easier as well as making installation of plugins simpler.

Test Plan:
1) Apply this patch
2) Add the new block for plugin_repos to your koha-conf.xml
3) Restart all the things!
4) Browse to the plugins home page
5) Try searching for 'patrons' in the new search box
6) Verify you get results!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24615: Make object.search helper also order by embedded columns
Agustin Moyano [Sat, 8 Feb 2020 02:54:14 +0000 (23:54 -0300)]
Bug 24615: Make object.search helper also order by embedded columns

With this patch REST API request can order results by embedded columns.

Full path to the column must be given for it to work.
For example: If you are on biblio endpoint and you want to order by holding patron's card number you could

> GET /biblio/1?_order_by=item.holds.cardnumber HTTP/1.1
> x-koha-embed: item.holds

To test:
1. apply this patch
2. prove t/db_dependent/Koha/REST/Plugin/Objects.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24502: (follow-up) Add all 3 query parameters in api definition
Agustin Moyano [Thu, 30 Jan 2020 19:20:42 +0000 (19:20 +0000)]
Bug 24502: (follow-up) Add all 3 query parameters in api definition

This patch adds api definition for body, query or header parameters.

To use them include:

* "$ref": "../parameters.json#/q_body" for body parameter.
* "$ref": "../parameters.json#/q_param" for query parameter.
* "$ref": "../parameters.json#/q_header" for header parameter.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>