]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 24592: Reword LOST_RETURN to LOST_FOUND
Martin Renvoize [Wed, 5 Feb 2020 11:54:20 +0000 (11:54 +0000)]
Bug 24592: Reword LOST_RETURN to LOST_FOUND

This patch updates the wording in the 'lost and found' process to more
closely reflect what the process is achieving by replacing 'RETURNED'
with 'FOUND'

Test plan:
1) Grep codebase for _FixAccountForLostAndReturned and note there are no
   longer any instanced of it.
2) Run t/db_dependent/Circulation.t and note it passes
3) Test returning/renewing an item that has been marked as lost and note
   the updated values in the accountlines now use LOST_FOUND as
   credit_type_code and 'FOUND' as the status for the 'LOST' fee
   (debit_type_code 'LOST')

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24592: Database Update
Martin Renvoize [Wed, 5 Feb 2020 12:19:34 +0000 (12:19 +0000)]
Bug 24592: Database Update

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24643: Add test to cover the timezone
Jonathan Druart [Thu, 13 Feb 2020 13:24:52 +0000 (14:24 +0100)]
Bug 24643: Add test to cover the timezone

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24643: Add unit tests
Andrew Isherwood [Wed, 12 Feb 2020 16:28:58 +0000 (16:28 +0000)]
Bug 24643: Add unit tests

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 24643: Support fractional seconds
Andrew Isherwood [Wed, 12 Feb 2020 16:04:07 +0000 (16:04 +0000)]
Bug 24643: Support fractional seconds

This patch allows dt_from_string to handle RFC3339 strings containing
fractional seconds up to one thousandth of a second.

Test plan:

- Apply patch
- prove t/DateUtils.t

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 24611: Fix wrong budget_id query param in /acquisitions/orders
Tomas Cohen Arazi [Fri, 7 Feb 2020 12:51:10 +0000 (09:51 -0300)]
Bug 24611: Fix wrong budget_id query param in /acquisitions/orders

This patch fixes the wrong query parameter that slipped on rewriting the
patches for the voted RFC.

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> FAIL: Tests fail because fund_id is not a valid query parameter
3. Apply this patch
4. Repeat (2)
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 24611: Regression test
Tomas Cohen Arazi [Fri, 7 Feb 2020 12:53:32 +0000 (09:53 -0300)]
Bug 24611: Regression test

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 24361: Silent Items/GetItemsForInventory.t
Jonathan Druart [Thu, 13 Feb 2020 09:29:56 +0000 (10:29 +0100)]
Bug 24361: Silent Items/GetItemsForInventory.t

It was displaying hundreds of:
Use of uninitialized value in concatenation (.) or string at
/kohadevbox/koha/C4/Items.pm line 862.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19735: (RM follow-up) Update debian/control
Martin Renvoize [Thu, 13 Feb 2020 08:30:00 +0000 (08:30 +0000)]
Bug 19735: (RM follow-up) Update debian/control

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19735: Remove C4::Installer::PerlDependancies
Martin Renvoize [Wed, 12 Feb 2020 16:29:11 +0000 (16:29 +0000)]
Bug 19735: Remove C4::Installer::PerlDependancies

This patch does the actual removal of the PerlDependancies module.

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 19735: (RM follow-up) Final update of cpanfile at push
Martin Renvoize [Wed, 12 Feb 2020 16:28:15 +0000 (16:28 +0000)]
Bug 19735: (RM follow-up) Final update of cpanfile at push

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19735: Update cpanfile
Jonathan Druart [Wed, 12 Feb 2020 11:46:34 +0000 (12:46 +0100)]
Bug 19735: Update cpanfile

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19735: Add support for max_ver
Martin Renvoize [Fri, 7 Feb 2020 16:51:33 +0000 (16:51 +0000)]
Bug 19735: Add support for max_ver

This patchset adds support for extracting 'max_ver' from the cpanfile so
we can use version ranges properly and report errors if we have modules
installed that do not fit within that version range.

Test plan:
1) Manually modify the module version of a required module in the cpanfile
   to have a max version greater than the version you have installed.
2) Run through the install proceedure and note the new warning that a
   module needs upgrade for the module in question.
3) The module should also be reported in the about page

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19735: (QA follow-up) Drop references to 'usage'
Martin Renvoize [Fri, 7 Feb 2020 16:59:44 +0000 (16:59 +0000)]
Bug 19735: (QA follow-up) Drop references to 'usage'

The 'usage' key was dropped as part of this migration to cpanfile but
it was still refered to by the installed. This patch simply removes
references to it. After considering how we might add it back in I
decided that as it stands it wasn't a well maintained list and should be
re-implimented in the future in a more consistent form if we miss it.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19735: Move Perl deps definitions into a cpanfile
Julian Maurice [Thu, 26 Oct 2017 16:28:02 +0000 (16:28 +0000)]
Bug 19735: Move Perl deps definitions into a cpanfile

cpanfile is a format for describing CPAN dependencies for Perl
applications.
It is more concise - thus easier to read and maintain - than
C4::Installer::PerlDependencies, and allows to describe requirements
more accurately (using version ranges or features for instance)
Additionally it can be read by tools such as cpanm or carton for an
easy way to install dependencies on non-Debian-based systems.

For more information on cpanfile, see
http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod

This patch replace C4::Installer::PerlDependencies by an equivalent
cpanfile and update all scripts/modules that were using PerlDependencies
It also removes dead code from C4::Installer::PerlModules (some
subroutines were not used at all, except in unit tests)

Added dependencies:
 - Module::CPANfile
 - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent
   version than the one Module::CPANfile requires)

Test plan:
  1. Go to About page, tab Perl modules and keep this browser tab open
  2. Apply patch
  3. Install Module::CPANfile and CPAN::Meta
    a. On Debian-based systems:
       # will install libcpan-meta-perl as a dependency
       sudo apt install libmodule-cpanfile-perl
    b. Others:
       # will install CPAN::Meta as a dependency
       sudo cpanm Module::CPANfile
  4. In a new browser tab, go to About page, tab Perl modules and compare
     the table with the one in the previous browser tab
     They should be identical, except for newly added dependencies
     (Module::CPANfile and CPAN::Meta)
  5. Do a 'standard' install
    a. perl Makefile.PL (select 'standard')
    b. make
    c. sudo make install
    d. Configure your database, web server, ... and go through the web
       install process
  6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which
     should be /usr/share/koha/lib)
  7. Go to the about page of this fresh install and compare it with your
     dev install
  8. Verify that debian/list-deps still works
     This takes a lot of time and it may not be necessary to wait until
     the end. If you see some Debian package names that correspond to
     modules in cpanfile, it means it still works
     (you need apt-file for this script to work)
  9. Verify that koha_perl_deps.pl still works
 10. prove t/Installer_pm.t t/Installer_PerlModules.t

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 24642: Make Cache::Memcached::Fast::Safe required
Jonathan Druart [Wed, 12 Feb 2020 14:24:35 +0000 (15:24 +0100)]
Bug 24642: Make Cache::Memcached::Fast::Safe required

There is something wrong between the logic in Koha::Cache->new and our
dependencies.

We are having Cache::Memcached required, but
Cache::Memcached::Fast::Safe is optional.
However, in Koha::Cache->new we are initializing the Memcached cache
only if Cache::Memcached::Fast::Safe is installed.

We could fix the logic in Koha::Cache, but it seems better to make
Cache::Memcached::Fast::Safe mandatory (especially after bug 13193).

Note that after bug 13193, you are loosing the Memcached cache, as
Cache::Memcached::Fast::Safe will not get installed by default.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24340: allow koha-sip --disable inst
Liz Rea [Fri, 3 Jan 2020 17:35:20 +0000 (17:35 +0000)]
Bug 24340: allow koha-sip --disable inst

To test:

- Enable sip for your testing instance
 sudo koha-sip --enable inst
- Start sip for your testing instance
 sudo koha-sip --start inst
- Verify it is running
 ps ax |grep sip -> you should see processes
- Disable sip for your testing intance
 sudo koha-sip --disable inst
- Verify that the following has happened:
 * SIP is no longer running for your instance - no SIP processes
 * SIP Cannot be started for the instance because it is not enabled.

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 19014: (QA follow-up) Update test for AddReserve change
Martin Renvoize [Tue, 11 Feb 2020 16:40:04 +0000 (16:40 +0000)]
Bug 19014: (QA follow-up) Update test for AddReserve change

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19014: on_reserve blocks auto_renew
Nick Clemens [Tue, 11 Feb 2020 13:18:10 +0000 (13:18 +0000)]
Bug 19014: on_reserve blocks auto_renew

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19014: Return auto_too_soon before on_reserve
Nick Clemens [Tue, 11 Feb 2020 12:46:42 +0000 (12:46 +0000)]
Bug 19014: Return auto_too_soon before on_reserve

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19014: Unit tests
Nick Clemens [Mon, 30 Dec 2019 19:27:26 +0000 (19:27 +0000)]
Bug 19014: Unit tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 8643: Fix IsMarcStructureInternal tests
Jonathan Druart [Tue, 11 Feb 2020 15:44:07 +0000 (16:44 +0100)]
Bug 8643: Fix IsMarcStructureInternal tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 8643: DBRev 19.12.00.020
Martin Renvoize [Tue, 11 Feb 2020 14:36:55 +0000 (14:36 +0000)]
Bug 8643: DBRev 19.12.00.020

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 8643: Code cleanup
Maryse Simard [Mon, 13 Jan 2020 16:21:09 +0000 (11:21 -0500)]
Bug 8643: Code cleanup

Merges "AreMandatoriesNotOk" and new "AreImportantsNotOk" into one
function "AreFieldsNotOk". It can search for mandatory or important
fields depending on the value of it's boolean "mandatory"
parameter.

To test:
This patch should not change current behavior.
Follow the test plan from previous patch and check that saving is
still prevented for unfilled mandatory fields.

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 8643: Add important constraint to marc subfields
simith [Fri, 18 Dec 2015 14:40:02 +0000 (11:40 -0300)]
Bug 8643: Add important constraint to marc subfields

This fix permits to add an "Important" option to the marc structure pages.

Testing:

1) Apply the patch
2) Run updatedatabase.pl
3) Regenerate CSS
4) Define 100 as an "important" field ( Administration » MARC bibliographic framework » MARC structure ( Default Frameword) » Edit )
5) Define 100$a as an "important" subfield (Administration » MARC bibliographic framework » MARC structure (Default Frameword) » Subfield » Onglet a)
6) Edit a record to clear the field 100 (subfields are all blank)
7) Save the record.
8) Validate the following message:

A few important fields are not filled:

    * tag 100 subfield a Nom de personne in tab
    * Field 100 is important, at least one of its subfields should be filled.

Are you sure you want to save?

Sponsored by the CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
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 14711: Change prototype for AddReserve - pass a hashref
Jonathan Druart [Thu, 16 Aug 2018 17:41:37 +0000 (14:41 -0300)]
Bug 14711: Change prototype for AddReserve - pass a hashref

The number of parameters of AddReserve makes it hard to read and
maintain.
This patch replace it with a hashref, which will make the calls more
readable.

Moreover the bibitems has been removed as it was not used by the
subroutine.

Test plan:
- Make sure the tests pass
- Read the diff and search for typos
- Place a hold on few items

Note for QA: reservation_date and expiration_date do not match the DB column's names,
should we?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21156: (RM follow-up) Add missing filters
Martin Renvoize [Mon, 10 Feb 2020 14:13:04 +0000 (14:13 +0000)]
Bug 21156: (RM follow-up) Add missing filters

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24585: Add 'Managed on' and 'Suggested on' columns to pat_purchase_suggestions.tt
Lucas Gass [Wed, 5 Feb 2020 01:04:52 +0000 (01:04 +0000)]
Bug 24585: Add 'Managed on' and 'Suggested on' columns to pat_purchase_suggestions.tt

This patch adds 2 new columns on the suggestions table on purchase-suggestions.tt. These use the data-order attribute to allow for sorting.
TEST PLAN:
1. Have a patron with some suggestions that have been managed by staff. (accept or reject the request).
2. View that patrons suggestions from purchase-suggestions.pl.
3. No suggested on or managaed on columns.
4. Apply patch and reload the page.
5. The new columns are there, have multiple suggestions and make sure sorting by the date works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21156: Add plural translation capabilities to JS files
Julian Maurice [Mon, 4 Jan 2016 20:08:29 +0000 (21:08 +0100)]
Bug 21156: Add plural translation capabilities to JS files

It adds Javascript equivalent of Koha::I18N's exported subroutines, and
they are used the same way.

String extraction is done only on *.js files and require gettext 0.19
(available in Debian jessie, and also in wheezy-backports)

It adds Javascript library Gettext.js for handling translation and a
Perl script po2json to transform PO file into JSON.

Gettext.js and po2json both come from Locale::Simple.
There are several tools named po2json. It's simpler to integrate this
one into Koha than to check if the good one is installed on the system.
Locale::Simple is not needed.

To avoid polluting the global namespace too much, this patch also
introduce a global JS object named Koha and add some stuff in Koha.i18n

Test plan:
1. Add a translatable string in a JS file. For example, add this:
     alert(__nx("There is one item", "There are {count} items", 3,
     {count: 3}));
   to staff-global.js
2. cd misc/translator && ./translate update fr-FR
3. Open misc/translator/po/fr-FR-messages-js.po, verify that your
   string is present, and translate it
4. cd misc/translator && ./translate install fr-FR
5. (Optional) Verify that
   koha-tmpl/intranet-tmpl/prog/fr-FR/js/locale_data.js exists and
   contains your translation
6. Open your browser on the staff main page, change language and verify
   that the message is translated
7. Repeat 1-6 on OPAC side

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works well, translation is OK and test message is displayed correctly.
Current qa-tool error is a false positive.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24526: Add the confirm flag to the cronjob files
Jonathan Druart [Thu, 6 Feb 2020 10:33:12 +0000 (11:33 +0100)]
Bug 24526: Add the confirm flag to the cronjob files

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24526: Set verbose if confirm not set
Jonathan Druart [Wed, 5 Feb 2020 15:05:19 +0000 (16:05 +0100)]
Bug 24526: Set verbose if confirm not set

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24526: Replace commit with confirm
Jonathan Druart [Wed, 5 Feb 2020 15:03:42 +0000 (16:03 +0100)]
Bug 24526: Replace commit with confirm

Usually commit takes a value

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24526: Use sprintf for readability
Jonathan Druart [Wed, 5 Feb 2020 15:02:25 +0000 (16:02 +0100)]
Bug 24526: Use sprintf for readability

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24526: (follow-up) clean up verbose conditional
Nick Clemens [Wed, 29 Jan 2020 13:48:09 +0000 (13:48 +0000)]
Bug 24526: (follow-up) clean up verbose conditional

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 24526: Add verbose and commit options to automatic_renewals cronjob
Nick Clemens [Tue, 28 Jan 2020 14:27:06 +0000 (14:27 +0000)]
Bug 24526: Add verbose and commit options to automatic_renewals cronjob

To test:
 1 - Apply patch
 2 - Have some items marked for auto-renewal
 3 - Run the job with no parameters
 4 - It should print 'Test mode'
 5 - Provide -v
 6 - It should print 'Test mode' then a line for each item
 7 - Provide -v -c
 8 - It should not say test mode, but should provide a line for each item
 9 - Provide -c
10 - Shoudl run as expected with no output

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 21177: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl
Julian Maurice [Wed, 8 Aug 2018 13:40:09 +0000 (15:40 +0200)]
Bug 21177: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl

It is annoying to have to specify database connection parameters each
time DBIx::Class files need to be updated.

This patch adds a new option --koha-conf that takes an optional <path>
which defaults to the value of KOHA_CONF environment variable, and use
the database connection parameters found in that file.
--db_* options override values from $KOHA_CONF

Test plan:
1. Run the script with the same parameters as before the patch and see
   that it still works.
   Example:
     misc/devel/update_dbix_class_files.pl --db_name koha_dev \
     --db_user koha --db_pass koha

2. Verify that KOHA_CONF is set and execute:
     misc/devel/update_dbix_class_files.pl --koha-conf
   Verify that Koha/Schema files were updated accordingly

3. Execute:
    misc/devel/update_dbix_class_files.pl --koha-conf \
    /path/to/another/koha-conf.xml
   Verify that Koha/Schema files were updated accordingly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 11281: Printing holds awaiting pickup prints both tabs
Owen Leonard [Fri, 22 Nov 2019 19:29:53 +0000 (19:29 +0000)]
Bug 11281: Printing holds awaiting pickup prints both tabs

This patch adds columns configuration to the holds awaiting pickup
tables. Doing so helps solve the printing issue by adding a "Print"
option to both tables. Using this print function will provide a
printable version of only that table.

To test you should have multiple holds in your system which are marked
"waiting" and some which have been waiting longer than the value
specified in the ReservesMaxPickUpDelay system preference.

Apply the patch and go to Circulation -> Holds awaiting pickup.

 - On both the "Holds waiting" and "Holds waiting over..." tabs the
   DataTable should display correctly and all the controls should work,
   including the columns settings and the choices in the export menu.
 - Confirm that the "Print" action creates a printable version of only
   the table you are viewing.

 - Go to Administration -> Columns settings -> Circulation.
 - Change some visibility controls for the tables under the
   "holds_awaiting_pickup" heading (id=holdso and id=holdst). Confirm
   that these changes are reflected in the "Holds waiting" interface.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24462: Adapt mapping to voted RFC (Invoices)
Tomas Cohen Arazi [Mon, 20 Jan 2020 14:29:11 +0000 (11:29 -0300)]
Bug 24462: Adapt mapping to voted RFC (Invoices)

This trivial patch changes the attribute names for API reprensentation
of Koha::Acquisition::Invoice objects.

To test:
1. Open https://wiki.koha-community.org/wiki/Acquisitions_invoices_endpoint_RFC
2. Check the mappings are correct
=> SUCCESS: The patch makes the right changes to the mappings
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22860: Remove 1 remaining patron after authentication.t is ran
Jonathan Druart [Mon, 6 May 2019 20:37:38 +0000 (15:37 -0500)]
Bug 22860: Remove 1 remaining patron after authentication.t is ran

Test plan:
0/ Do not apply the patch
1/ select count(*) from borrowers;
2/ Run the tests
=> Notice that you have 1 more patron
3/ Apply the patch and repeat 1/ and 2/
=> Notice that you have the same number of patrons before and after the
tests

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24516: Add account_type to the columns settings on boraccount
Jonathan Druart [Mon, 3 Feb 2020 16:31:42 +0000 (17:31 +0100)]
Bug 24516: Add account_type to the columns settings on boraccount

The column was missing from the yml file.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13305: Remove tabindex from PrepareItemsRecordDisplay
Marcel de Rooy [Mon, 20 Jan 2020 12:41:51 +0000 (12:41 +0000)]
Bug 13305: Remove tabindex from PrepareItemsRecordDisplay

Test plan:
Check the tab order of the item block on additem.pl (item editor),
Acquisition (neworderempty or addiso2709), serials-edit.pl.
You could also check services/itemrecorddisplay.pl and pass a
biblionumber; this script is used in additem.js for cataloguing and
acquisition.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 16719: (QA follow-up) Remove tabs
Nick Clemens [Fri, 7 Feb 2020 16:52:52 +0000 (16:52 +0000)]
Bug 16719: (QA follow-up) Remove tabs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 16719: (follow-up) Update check on password mapping
Oliver Behnke [Fri, 7 Feb 2020 12:35:21 +0000 (12:35 +0000)]
Bug 16719: (follow-up) Update check on password mapping

Change to allow for unmapped default passwords

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 16719: Pass through undef rather than empty string in LDAP mapping
Oliver Behnke [Fri, 7 Feb 2020 12:31:31 +0000 (12:31 +0000)]
Bug 16719: Pass through undef rather than empty string in LDAP mapping

Nullable DB fields should be passed null in cases where ldap fields are
empty and not replaced with empty strings.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24525: (QA follow-up) Make payment type required with cash registers
Martin Renvoize [Mon, 10 Feb 2020 09:15:51 +0000 (09:15 +0000)]
Bug 24525: (QA follow-up) Make payment type required with cash registers

The use of cash registers adds the requirement to enter a payment type,
this patch adds the required status when cash registers are configured.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24525: (follow-up) Factor out to an include
Martin Renvoize [Tue, 28 Jan 2020 14:05:35 +0000 (14:05 +0000)]
Bug 24525: (follow-up) Factor out to an include

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24525: Remove SIP payment types from point of sale
Martin Renvoize [Tue, 28 Jan 2020 14:05:35 +0000 (14:05 +0000)]
Bug 24525: Remove SIP payment types from point of sale

This patch removes the SIP payments types from displaying in the select
options on the point of sale payment page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23640: Flushing L1 on every SIP connection
Jonathan Druart [Thu, 14 Nov 2019 09:50:24 +0000 (10:50 +0100)]
Bug 23640: Flushing L1 on every SIP connection

This patch flushes the L1 cache on each SIP connection
(ie every invocation of process_request).

This means each SIP connection will fetch values from the
L2 cache (ie memcached) and persist the L1 cache (in Perl
memory cache) only until a new SIP connection comes in.

Without this patch, the L1 cache persists for the length
of the server process, which means the L1 cache will become
stale very quickly, which can lead to unexpected behaviour.

Test plan:
1. Enable IssueLog
2. Start SIP server
    2a. change to Koha git directory
    2b. koha-shell kohadev
    2c. perl C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
3. Issue book via SIP

    perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 1 --item 3999900000001 -m checkout

4. Check action_logs for "CIRCULATION ISSUE <borrowernumber> <biblionumber>" line

    http://localhost:8081/cgi-bin/koha/tools/viewlog.pl

5. Disable IssueLog

6. Check in the book and then check it out again

    perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 1 --item 3999900000001 -m checkin
    perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 1 --item 3999900000001 -m checkout

7. Check action_logs for "CIRCULATION ISSUE <borrowernumber> <biblionumber>" line

    http://localhost:8081/cgi-bin/koha/tools/viewlog.pl

8. Note results

Without the patch, you'll see a 2nd checkout.

With the patch, you won't see the 2nd checkout.

(Note: After applying the patch, you have to restart the SIP server.)

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24482: Fix for formatted price issue with value over 1000
Martin Renvoize [Mon, 27 Jan 2020 14:56:35 +0000 (14:56 +0000)]
Bug 24482: Fix for formatted price issue with value over 1000

This patch for the point of sale feature fixes an issue where items for
purchase with a value of $1,000 or more break the payment calculations.

Test plan:
1) Enable the point of sale feature
   (EnablePointOfSale + UseCashRegisters system preferences)
2) Add a cash register for a library
   (Home > Point of sale > Cash registers > New cash register)
3) Create a purchase item with a cost of $1000
   (Home > Point of sale >  Purchase items > New debit type)
4) Go to to the point of sale page and attempt to sell one of your items
   (Home > Point of sale > click 'Add' next to the item to purchase)
5) Note that Koha inserts a comma into the price in the list of items for
   purchase
6) Note that the 'Amount being paid' changes to 0.00 instead of $1,000,
   which affects the other calculations
7) Apply the patch
8) Repeat step 4
9) Amount being paid and other calculations should now be correct
10) Enter an amount for 'Collected from patron' and click 'Confirm'
    check that the change calculation is correct.
11) Sign-off the patch!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24602: Make get_onshelfholds_policy fallback to 0
Tomas Cohen Arazi [Thu, 6 Feb 2020 14:10:39 +0000 (11:10 -0300)]
Bug 24602: Make get_onshelfholds_policy fallback to 0

The onshelfholds circulation rules values are more of an ENUM type (as
opposed to other rules with integers like max*qty). In the
quantities cases, it makes sense to have undef mean unlimited. In the
enum type it is clearer to just set a default value (0) as the code
already expects (Note: undef and 0 both eval to false so there's no
behaviour problem, but warnings or we get forced to check for
defined when the rule is used. It seems trivial to just make the
rule fallback to a chosen default value).

This patch makes it fallback to 0.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/CirculationRules.t \
           t/db_dependent/Reserves.t
=> FAIL: CirculationRules.t fails and Reserves.t prints a warning
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests pass! No warning!
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24602: Tests for get_onshlefholds_policy
Tomas Cohen Arazi [Thu, 6 Feb 2020 14:09:12 +0000 (11:09 -0300)]
Bug 24602: Tests for get_onshlefholds_policy

Ths patch introduces tests for get_onshelf_policy.
To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/CirculationRules.t
=> FAIL: Tests fail because the current code returns undef instead of 0

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13193: (RM follow-up) Remove Cache::Memcached::Fast from PerlDependencies
Martin Renvoize [Fri, 7 Feb 2020 14:32:13 +0000 (14:32 +0000)]
Bug 13193: (RM follow-up) Remove Cache::Memcached::Fast from PerlDependencies

We replaced this module with Cache::Memcached::Fast::Safe and so do not
need to depend upon it any longer.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13193: (follow-up) Update debian/control file
Mason James [Fri, 7 Feb 2020 02:11:05 +0000 (15:11 +1300)]
Bug 13193: (follow-up) Update debian/control file

The dependancy has now been packaged, this patch adds it to the debian
control file for package installs.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13193: Make Memcached usage fork safe
Joonas Kylmälä [Mon, 16 Sep 2019 10:26:01 +0000 (10:26 +0000)]
Bug 13193: Make Memcached usage fork safe

When a high enough number of forks try to access for example system
preferences with Koha::Cache using memcached as backend the results of
different cache requests get mixed up.

The problem is fixed by using Cache::Memcached::Fast::Safe that is a
fork safe version of Cache::Memcached::Fast.

Sponsored-by: The National Library of Finland
Signed-off-by: David Cook <dcook@prosentient.com.au>
Works as described, and solves an insidious difficult to debug
problem in Koha.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24554: Only embed relations from Koha::Biblio in to_api
Tomas Cohen Arazi [Fri, 31 Jan 2020 12:06:51 +0000 (09:06 -0300)]
Bug 24554: Only embed relations from Koha::Biblio in to_api

This patch simplifies the behaviour of Koha::Biblio->to_api. It was
designed with the idea of handling possible methods that would be added
to Koha::Biblioitem. But it had a weird fallback behaviour was
highlighted by using it with bug 24528.

On fixing it it become obvious that it was unnessessarily complex and
that it was not worth. That's the reason there wasn't any test for it,
as Koha::Biblioitem doesn't implement any extra methods.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 24410: Fix multi holds
Jonathan Druart [Mon, 13 Jan 2020 13:30:35 +0000 (14:30 +0100)]
Bug 24410: Fix multi holds

Bug 19618 replaces the call to placerequest.pl with a REST API /holds
That is wrong as it does not support multi holds.

Test plan:
Confirm that prior to this patch you are not able to place a hold on
several records at once, and that this patch fixes it

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13420: (QA follow-up): Fix typo itemdate -> itemdata
Josef Moravec [Wed, 5 Feb 2020 21:13:22 +0000 (21:13 +0000)]
Bug 13420: (QA follow-up): Fix typo itemdate -> itemdata

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13420: Fallback to the previous behavior if published date is not used
Jonathan Druart [Tue, 6 Aug 2019 13:56:44 +0000 (08:56 -0500)]
Bug 13420: Fallback to the previous behavior if published date is not used

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13420: Sort "Serial enumeration" by published date
Jonathan Druart [Mon, 29 Apr 2019 02:53:55 +0000 (22:53 -0400)]
Bug 13420: Sort "Serial enumeration" by published date

So far the sorting on volume information is incorrect. It sorts by the
string displayed in the cell, which may not have any logics.

A better solution would be to use Kyle's suggestion, see comments 7, 8,
but it will need much more work.

This patch suggests to use the publication date to sort this column.
Note: In the code there is a switch depending on the existence of
items.publisheddate, but I do not think it is valid, this valid should
always exist if the item is received (did I miss something?)

Test plan:
You need to have different existing subscription, using different
numbering.
On the detail page of the bibliographic record you should be able to
sort the serials (tab "Holdings") by "Serial enumeration".
The sort will now use the publication dates.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23784: Show subtitle, number and part in course reserve list of records
Katrin Fischer [Sat, 2 Nov 2019 06:39:28 +0000 (06:39 +0000)]
Bug 23784: Show subtitle, number and part in course reserve list of records

At the moment only the title will display in the course reserves
details, but not the information from other title fields. For
series with multiple volumes that can lead to confusing display.
The patch makes use of the new include to display 245$abnp.

To test:
- Add mulitple records to a course reserce course
  Make sure you have some with different combinations of 245$b$n$p
- Look at the course details in the OPAC
- Verify only $a displays
- Apply patch
- Reload
- Verify now the full information displays

Depending on your installation, you might want ot check that the 245
are correctly mapped and save the record once so the database
fields are correctly filled.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 23673: DBRev 19.12.00.019
Martin Renvoize [Wed, 5 Feb 2020 14:26:47 +0000 (14:26 +0000)]
Bug 23673: DBRev 19.12.00.019

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23673: Set updated_on=time_queued on DB update
Jonathan Druart [Wed, 5 Feb 2020 08:47:47 +0000 (09:47 +0100)]
Bug 23673: Set updated_on=time_queued on DB update

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23673: Avoid sleep in tests
Jonathan Druart [Wed, 5 Feb 2020 08:44:58 +0000 (09:44 +0100)]
Bug 23673: Avoid sleep in tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23673: Add "Updated on" column to patron's notices
Agustin Moyano [Mon, 21 Oct 2019 22:18:55 +0000 (19:18 -0300)]
Bug 23673: Add "Updated on" column to patron's notices

This patch adds "Updated on" column to patron's notices tab. It also adds logic to C4::Letters to retrieve updated_on column.

To test:

1. Apply patches.
2. Restart plack.
3. Choose a patron and add a purchase suggestion.
4. Change suggestion status.
5. Open patron's notifications.
   CHECK => Messages table has now "Updated on" and "Time created" columns, and "Time" column is gone.
   SUCCESS => There is a message with status pending, with a "time created" that equals "updated on"
6. Execute in the shell in Koha directory
   $ ./misc/cronjobs/process_message_queue.pl
7. Open patron's notifications one more time.
   SUCCESS => The message changed status. Time created remained the same, and now "updated on" has the current timestamp.
8. Resend the message and repeat sep 6.
   SUCCESS => Every time you change the status, time created remains the same and updated on updates.
9. Run `prove t/db_dependant/Letters.t`
10. Sign off

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 23673: Change DB Structure
Agustin Moyano [Mon, 21 Oct 2019 20:29:44 +0000 (17:29 -0300)]
Bug 23673: Change DB Structure

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 24595: Silent warnings from Circulation.t
Jonathan Druart [Wed, 5 Feb 2020 13:29:44 +0000 (14:29 +0100)]
Bug 24595: Silent warnings from Circulation.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24449: Add too_many_overdue to patron status for SIP
Nick Clemens [Fri, 17 Jan 2020 14:29:42 +0000 (14:29 +0000)]
Bug 24449: Add too_many_overdue to patron status for SIP

To test:
1 - Have sip running and use the cli to get info for a patron
    example: perl misc/sip_cli_emulator.pl  -a localhost -p 6001 -su koha -sp koha -l CPL -m patron_status_request --patron koha
2 - Checkout an item to the patron, backdated so it is overdue
3 - Set syspref 'OverduesBlockCirc' to anything but "Don't Block"
4 - Get the patron status via SIP, note circ blocked flag is set, but too_many_overdue is not
5 - Apply patch
6 - Restart all the things
7 - Get the patron status via SIP
8 - Note the too_many_overdue flag is now triggered and there is a message
    example: READ: 24Y     Y       00120200117    142716AEEdna Acosta|AA23529001000463|BLY|CQN|BV0.25|AFGreetings from Koha.  -- Patron has overdues -- Patron owes 0.25|AOCPL|

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 24529: Silence another uninitialised value warning
Martin Renvoize [Wed, 29 Jan 2020 13:24:34 +0000 (13:24 +0000)]
Bug 24529: Silence another uninitialised value warning

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24529: Silence warnings for title level holds
Martin Renvoize [Wed, 29 Jan 2020 13:18:20 +0000 (13:18 +0000)]
Bug 24529: Silence warnings for title level holds

This patch simply adds a test for itemnumber being defined in the
reserve before comparing it to silence the warning.

Test plan:
1) Prior to patch, run prove t/db_dependant/Circulation.t and note lots
   of `Use of uninitialized value in numeric eq (==) at
   /kohadevbox/koha/C4/Reserves.pm line 790` warnings.
2) Apply the patch, re-run the test and note the tests still pass but
   the warnings are now gone.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24590: Fix Koha/Object.t on MySQL 8
Jonathan Druart [Wed, 5 Feb 2020 09:36:14 +0000 (10:36 +0100)]
Bug 24590: Fix Koha/Object.t on MySQL 8

% prove t/db_dependent/Koha/Object.t
is failing on MySQL 8 with:

 kohadev-koha@9bbf9ac68519:/kohadevbox/koha$ prove t/db_dependent/Koha/Object.t
 t/db_dependent/Koha/Object.t .. 15/18
     #   Failed test 'Exception field is correct'
     #   at t/db_dependent/Koha/Object.t line 650.
     #          got: 'api_keys.secret'
     #     expected: 'secret'
     # Looks like you failed 1 test of 16.
 t/db_dependent/Koha/Object.t .. 16/18
 #   Failed test 'store() tests'
 #   at t/db_dependent/Koha/Object.t line 723.

MySQL 8 displays the tablename in the error.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24420: Display waiting on hold items in the Cataloging search results Location...
Lucas Gass [Tue, 14 Jan 2020 15:40:38 +0000 (15:40 +0000)]
Bug 24420: Display waiting on hold items in the Cataloging search results Location column

To Test:
1. Place a hold on an item and trigger it.
2  Do a cataloging search that would include this record.
3. Notice that the 'Location' column does not account for this onhold
item.
4. Apply patch and look at catalog results again.
5. You should see information display about the item being on hold.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.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 23844: Check if field defined in framework and specify 'Default' for framework
Nick [Fri, 18 Oct 2019 18:26:38 +0000 (18:26 +0000)]
Bug 23844: Check if field defined in framework and specify 'Default' for framework

To test:
1 - Go to Cataloguing
2 - New from Z3950
3 - Find an import a record
4 - Check the plack logs:
Use of uninitialized value in string ne at /kohadevbox/koha/cataloguing/addbiblio.pl line 565.
Use of uninitialized value in string ne at /kohadevbox/koha/cataloguing/addbiblio.pl line 580.
Use of uninitialized value $frameworkcode in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 711.
Use of uninitialized value $frameworkcode in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 715.
Use of uninitialized value $frameworkcode in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 734.
5 - Apply patch
6 - Repeat
7 - No new errors
8 - Confirm selecting 'Default' from 'New from Z3950' dropdown also generates no errors

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22302: Make ITEMTYPECAT descriptions fallback to lib description if no opac descr...
Nick Clemens [Tue, 4 Feb 2020 14:16:26 +0000 (14:16 +0000)]
Bug 22302: Make ITEMTYPECAT descriptions fallback to lib description if no opac description

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 22302: Unit tests
Nick Clemens [Tue, 4 Feb 2020 14:15:36 +0000 (14:15 +0000)]
Bug 22302: Unit tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 24485: Allow hold when some can be overridden
Nick Clemens [Tue, 28 Jan 2020 13:57:32 +0000 (13:57 +0000)]
Bug 24485: Allow hold when some can be overridden

The check to see if we can place a hold counts the number that we can override vs the number of items on the record.

We cannot override if we already have a hold on an item, however, we don't count these to see if they plus
the number of overrides equal the items on the record.

To test:
1 - Set max reserves to 2, allow 2 holds per recrod
2 - Place 2 holds for a patron on some records
3 - Find another record with 2 items
4 - Place a hold on the first item, you will be notified about the limit but you can override
5 - Attempt to place hold on second item, cannot be done, button disabled
6 - Apply patch
7 - Repeat
8 - You can place the second hold

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23533: Remove spaces after/before the open/close parenthesis
Jonathan Druart [Tue, 4 Feb 2020 15:05:49 +0000 (16:05 +0100)]
Bug 23533: Remove spaces after/before the open/close parenthesis

t/db_dependent/selenium/patrons_search.t is failing because of this change:

    #          got: 'Koha › Patrons › Modify patron <strong>fir's"tname</strong> \123 ❤ test_patron_1 ( iOVAoJj )'
    #     expected: 'Koha › Patrons › Modify patron <strong>fir's"tname</strong> \123 ❤ test_patron_1 (iOVAoJj)'

We are adding space after and before the open/close parenthesis of the category code.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18936: Fix selenium/administration_tasks.t
Jonathan Druart [Tue, 4 Feb 2020 15:00:21 +0000 (16:00 +0100)]
Bug 18936: Fix selenium/administration_tasks.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18936: Display 'Unlimited' for Holds allowed (total)
Jonathan Druart [Tue, 4 Feb 2020 14:59:01 +0000 (15:59 +0100)]
Bug 18936: Display 'Unlimited' for Holds allowed (total)

holds_per_day and reservesallowed are set to unlimited in the rules
inserted by misc4dev

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19008: Replace issues with checkouts in print statement
Jonathan Druart [Tue, 4 Feb 2020 11:09:00 +0000 (12:09 +0100)]
Bug 19008: Replace issues with checkouts in print statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19008: More database cleanups - QA followup
Magnus Enger [Fri, 2 Aug 2019 11:57:13 +0000 (13:57 +0200)]
Bug 19008: More database cleanups - QA followup

This patch tries to change the POD as suggested in the QA process.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19008: More database cleanups - item transfers
Fridolin Somers [Fri, 28 Jul 2017 14:09:14 +0000 (16:09 +0200)]
Bug 19008: More database cleanups - item transfers

misc/cronjobs/cleanup_database.pl provides some database cleanup.
Yet some tables that could need cleanup are not in this script.

This patch adds cleanup for branchtransfers table.

Test plan :
- Count : select count(*),datearrived from branchtransfers group by datearrived;
- Run cleanup : misc/cronjobs/cleanup_database.pl -v --transfers 30
- Recount

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 19008: More database cleanups - old reserves
Fridolin Somers [Fri, 28 Jul 2017 14:01:51 +0000 (16:01 +0200)]
Bug 19008: More database cleanups - old reserves

misc/cronjobs/cleanup_database.pl provides some database cleanup.
Yet some tables that could need cleanup are not in this script.

This patch adds cleanup for old_reserves table.

Test plan :
- Count : select count(*),date(timestamp) from old_reserves group by date(timestamp);
- Run cleanup : misc/cronjobs/cleanup_database.pl -v --old-reserves 30
- Recount

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 19008: More database cleanups - old issues
Fridolin Somers [Fri, 28 Jul 2017 12:57:33 +0000 (14:57 +0200)]
Bug 19008: More database cleanups - old issues

misc/cronjobs/cleanup_database.pl provides some database cleanup.
Yet some tables that could need cleanup are not in this script.

This patch adds cleanup for old_issues table.

Test plan :
- Count : select count(*),date(timestamp) from old_issues group by date(timestamp);
- Run cleanup : misc/cronjobs/cleanup_database.pl -v --old-issues 30
- Recount

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 19008: More database cleanups - deleted patrons
Fridolin Somers [Fri, 28 Jul 2017 12:43:45 +0000 (14:43 +0200)]
Bug 19008: More database cleanups - deleted patrons

misc/cronjobs/cleanup_database.pl provides some database cleanup.
Yet some tables that could need cleanup are not in this script.

This patch adds cleanup for deletedborrowers table.

Test plan :
- Count : select count(*),date(updated_on) from deletedborrowers group by date(updated_on);
- Run cleanup : misc/cronjobs/cleanup_database.pl -v --deleted-patrons 30
- Recount

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 19008: More database cleanups - deleted catalog
Fridolin Somers [Fri, 28 Jul 2017 12:05:03 +0000 (14:05 +0200)]
Bug 19008: More database cleanups - deleted catalog

misc/cronjobs/cleanup_database.pl provides some database cleanup.
Yet some tables that could need cleanup are not in this script.

This patch adds cleanup for deleted catalog tables.
Note that deletedbiblio_metadata is managed by foreign key on biblionumber.

Test plan :
- Count :
select count(*),year(timestamp) from deleteditems group by year(timestamp);
select count(*),year(timestamp) from deletedbiblio group by year(timestamp);
select count(*),year(timestamp) from deletedbiblioitems group by year(timestamp);
- Run cleanup : misc/cronjobs/cleanup_database.pl -v --deleted-catalog 30
- Recount

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 19008: More database cleanups - statistics
Fridolin Somers [Fri, 28 Jul 2017 12:12:22 +0000 (14:12 +0200)]
Bug 19008: More database cleanups - statistics

misc/cronjobs/cleanup_database.pl provides some database cleanup.
Yet some tables that could need cleanup are not in this script.

This patch adds cleanup for statistics table.

Test plan :
- Count statistics : select count(*),date(datetime) from statistics group by date(datetime);
- Run cleanup : misc/cronjobs/cleanup_database.pl -v --statistics 30
- Recount statistics

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 20708: Add Withdrawn status when placing a request in staff
Jonathan Druart [Tue, 4 Feb 2020 10:17:11 +0000 (11:17 +0100)]
Bug 20708: Add Withdrawn status when placing a request in staff

Same as bug 22021 for the withdrawn status.

1. Withdraw an item
2. Place an hold on this item
Notice the new "withdrawn" status in the information column

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24569: (QA follow-up) Fix closing <a> tag
Nick Clemens [Tue, 4 Feb 2020 12:36:18 +0000 (12:36 +0000)]
Bug 24569: (QA follow-up) Fix closing <a> tag

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24569: Fix "add to basket" link (bug 23031 regression)
Jonathan Druart [Tue, 4 Feb 2020 09:44:39 +0000 (10:44 +0100)]
Bug 24569: Fix "add to basket" link (bug 23031 regression)

The modal needs to be defined in both cases.

Test plan:
Repeat test plan from bug 23031 and click on the buttons!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21466: Keep all AVs for a given framework
Jonathan Druart [Wed, 29 Jan 2020 11:44:57 +0000 (12:44 +0100)]
Bug 21466: Keep all AVs for a given framework

There was a major (and silly) issue in the previous version, only one AV
was kept as we erased the hash value at the end of each iteration:
$invalid_locations_per_framework->{$framework->frameworkcode } =
  { items => $items, av_category => $mss->authorised_value, kohafield => $kohafield };

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 9993: On editing basket group delivery place resets to logged in branch
Owen Leonard [Wed, 20 Nov 2019 17:00:52 +0000 (17:00 +0000)]
Bug 9993: On editing basket group delivery place resets to logged in branch

This patch modifies basketgroups.pl so that existing data about a basket
group's billing and delivery place are correctly preselected in the edit
form. These fields shouldn't reset to the logged-in user's home branch
just because they have an empty value.

To test, apply the patch and go to Acquisitions -> Vendor -> Basket
groups.

When adding or editing a basket group the pre-selected value for
"Billing place" and "Delivery place" should be correct:

   - When creating a new basket group: The logged-in user's library
     should be pre-selected.

   - When editing a basket group which has a library defined for either
     the billing or delivery places, the correct library should be
     pre-selected.

   - When editing a basket group which has no library defined for either
     the billing or delivery place there should be no library
     pre-selected (the "--" option should be pre-selected).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 10879: OverDrive should check for OverDriveLibraryID before performing search
Owen Leonard [Tue, 19 Nov 2019 17:02:02 +0000 (17:02 +0000)]
Bug 10879: OverDrive should check for OverDriveLibraryID before performing search

This patch modifies the OPAC search results template to check for three
populated system preferences before performing an OverDrive search:
OverDriveLibraryID, OverDriveClientKey, and OverDriveClientSecret.
Previously OverDriveLibraryID was not checked, but without it the
interface reports an error performing the search.

To test you must have credentials for the OverDrive API as defined
in OverDriveClientKey, OverDriveClientSecret, and OverDriveLibraryID
system preferences.

 - With OverDriveLibraryID defined, the catalog search results page in
   the OPAC should show a link to results in the library's OverDrive
   collection.

 - With no value in the OverDriveLibraryID preference the catalog
   search page should not show any message about an OverDrive
   collection.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24560: Remove No public list text from OPAC
Lucas Gass [Sat, 1 Feb 2020 16:42:10 +0000 (16:42 +0000)]
Bug 24560: Remove No public list text from OPAC

On the OPAC, the dropdown for Lists always includes
the heading Public Lists, even if no public lists exist.
This is sub-optimal for libraries that want VirtualShelves
enabled for private lists but don't want to use public lists.

TEST PLAN:
1. have no public list and look at the List dropdown on the OPAC. It says No Public Lists.
2. Apply patch
3. It should now not say anything about public lists but still be formatted nice.
4. Add some public lists and confirm that everything looks normal.
5. Sign off

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23533: (follow-up) Add markup comments
Owen Leonard [Tue, 10 Dec 2019 17:30:41 +0000 (17:30 +0000)]
Bug 23533: (follow-up) Add markup comments

This patch adds comments to the template to highlight the markup
structure.

This patch should have no effect on the interface or functionality.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23533: Reindent patron entry form (memberentrygen.tt)
Owen Leonard [Tue, 10 Dec 2019 16:34:56 +0000 (16:34 +0000)]
Bug 23533: Reindent patron entry form (memberentrygen.tt)

This patch re-indents the template for patron entry/editing. It
makes only whitespace changes. It should have no effect on the behavior
of the page.

To test, create or edit a patron.

Test every aspect of the process. At each step the page should work
correctly. Including:

 - Adult patron
 - Child patron
 - Organizational patron
 - Quick patron add
 - Duplicate patron
 - With mandatory fields
 - With 'BorrowerUnwantedField's defined
 - With ExtendedPatronAttributes enabled

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24490: Clarify wording and function of Purchase Items link on POS
David Roberts [Mon, 27 Jan 2020 15:41:32 +0000 (15:41 +0000)]
Bug 24490: Clarify wording and function of Purchase Items link on POS

This patch changes the wording of the links on the POS side menu

To test:

1) Apply the patch
2) Check that the links on the left hand side of the screen read "Configure cash registers" and "Configure items for purchase"
3) Click both links to ensure you are taken to the relevant config pages.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24440: Rename current_holds with current_item_level_holds
Jonathan Druart [Mon, 3 Feb 2020 12:36:54 +0000 (13:36 +0100)]
Bug 24440: Rename current_holds with current_item_level_holds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24440: Adding 2 more tests for ->biblio
Jonathan Druart [Fri, 31 Jan 2020 14:08:00 +0000 (15:08 +0100)]
Bug 24440: Adding 2 more tests for ->biblio

Not directly related to the other changes but seems good to have them
here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24440: (follow-up) Make related objects prefetchable
Tomas Cohen Arazi [Fri, 31 Jan 2020 03:54:27 +0000 (00:54 -0300)]
Bug 24440: (follow-up) Make related objects prefetchable

This patch creates aliases for the relations used to retrieve the linked
objects from other tables. It makes the accessor names match the used
relation name, for consistency.

This is important for code trying to be smart and guessing what needs to
be prefetched, like the API code.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Order.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests pass! No behaviour change
4. Verify the POD changes make sense
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 24440: ->biblio tests
Tomas Cohen Arazi [Fri, 31 Jan 2020 03:27:05 +0000 (00:27 -0300)]
Bug 24440: ->biblio tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>