koha.git
4 years agoBug 24277: Fix date received editing when receiving an order
Jonathan Druart [Mon, 23 Dec 2019 15:19:47 +0000 (16:19 +0100)]
Bug 24277: Fix date received editing when receiving an order

Bug 8417 added the ability to edit the date received, but a merge
conflict was wrongly resolved during a rebase of
  commit 20d9ed618fbe3cdcb9c04444a1f8a584b0364069
  Bug 13321: Rename variables

Test plan:
Create an order
Receive it
Set a date (different from today)
=> The date you picked should have been set in DB for the order

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 24277: Regression tests
Tomas Cohen Arazi [Wed, 8 Jan 2020 13:55:40 +0000 (10:55 -0300)]
Bug 24277: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24263: DBRev 19.12.00.006
Martin Renvoize [Wed, 8 Jan 2020 14:21:23 +0000 (14:21 +0000)]
Bug 24263: DBRev 19.12.00.006

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24263: (QA follow-up) Atomic update fixes
Tomas Cohen Arazi [Wed, 8 Jan 2020 13:11:07 +0000 (10:11 -0300)]
Bug 24263: (QA follow-up) Atomic update fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24263: Replace borrowers.relationship with NULL when was empty string
Jonathan Druart [Wed, 18 Dec 2019 13:04:58 +0000 (14:04 +0100)]
Bug 24263: Replace borrowers.relationship with NULL when was empty string

When you create a new patron, its relationship field is populated with
an empty string when we are expecting NULL.

Otherwise the about page will display a warning about a missing/wrong
relationship in data (that is not in the syspref)

Test plan:
0/ Do not apply the patches from this bug report
1/ Create a new patron (child)
2/ Notice that relationship column in DB is set to an empty string
3/ Go to the about page, notice the invalid warning about relationship
values not in the syspref
4/ Apply DB changes and tests
5/ Execute the update DB entry
=> The value in DB is now NULL when was ""
6/ Execute the tests
=> It fails
7/ Apply the last patch
8/ Add and edit a patron (child)
=> relationship is set to NULL in DB
9/ Execute the tests
=> They pass!

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>
4 years agoBug 24263: DB changes
Jonathan Druart [Wed, 18 Dec 2019 13:08:34 +0000 (14:08 +0100)]
Bug 24263: DB changes

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>
4 years agoBug 24263: Add tests
Jonathan Druart [Wed, 18 Dec 2019 13:04:35 +0000 (14:04 +0100)]
Bug 24263: Add tests

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>
4 years agoBug 24327: Redirect to the login form if AnonSuggestion misconfigured
Jonathan Druart [Thu, 2 Jan 2020 10:38:18 +0000 (11:38 +0100)]
Bug 24327: Redirect to the login form if AnonSuggestion misconfigured

Test plan:
Turn on AnonSuggestion but set AnonymousPatron to an invalid value
Go to /cgi-bin/koha/opac-suggestions.pl?op=add
=> You see the login form

Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24327: Add warning to the about page is AnonSugggestions but AnonymousPatron
Jonathan Druart [Thu, 2 Jan 2020 10:26:49 +0000 (11:26 +0100)]
Bug 24327: Add warning to the about page is AnonSugggestions but AnonymousPatron

This patch adds a warning to the about page if AnonSuggestions is set
but AnonymousPatron.

Test plan:
Turn on AnonSuggestions and set AnonymousPatron to 0
=> You see a warning on the about page
Turn on AnonSuggestions and set AnonymousPatron to an invalid value
=> You see a warning on the about page
Turn off AnonSuggestions
=> No warning
Turn on AnonSuggestions and set AnonymousPatron to a valid value
=> No warning

Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24054: Typo in ClaimReturnedWarningThreshold system preference
Bernardo Gonzalez Kriegel [Sun, 29 Dec 2019 10:40:37 +0000 (07:40 -0300)]
Bug 24054: Typo in ClaimReturnedWarningThreshold system preference

Fixed type: cliams -> claims

To test:
1) Apply the patch
2) Go to System preferences > Circulation preferences > ClaimReturnedWarningThreshold
3) Check the text is fixed.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24104: Item search - Prevent "Edit" dropdown button to overflow
Jonathan Druart [Mon, 25 Nov 2019 15:48:15 +0000 (16:48 +0100)]
Bug 24104: Item search - Prevent "Edit" dropdown button to overflow

Making it displays on the left fixes the problem.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24329: DBRev 19.12.00.005
Martin Renvoize [Wed, 8 Jan 2020 11:09:54 +0000 (11:09 +0000)]
Bug 24329: DBRev 19.12.00.005

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24329: Add a test
Jonathan Druart [Sun, 5 Jan 2020 22:08:28 +0000 (23:08 +0100)]
Bug 24329: Add a test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24329: Prevent update of timestamp on action_logs updates
Martin Renvoize [Thu, 2 Jan 2020 13:03:07 +0000 (13:03 +0000)]
Bug 24329: Prevent update of timestamp on action_logs updates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24329: Correction to updatedatabase
Martin Renvoize [Thu, 2 Jan 2020 12:56:19 +0000 (12:56 +0000)]
Bug 24329: Correction to updatedatabase

Ensure timestamp is not overwriteen during upgrade when applying updates
for bug 3820

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: (RM follow-up) Restore 0 handling in CalcFine
Martin Renvoize [Wed, 8 Jan 2020 10:02:02 +0000 (10:02 +0000)]
Bug 24361: (RM follow-up) Restore 0 handling in CalcFine

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24350: Fix Branches.pickup_locations
Jonathan Druart [Mon, 6 Jan 2020 21:10:16 +0000 (22:10 +0100)]
Bug 24350: Fix Branches.pickup_locations

This will fix the following error:
Template process failed: undef error - Not a HASH reference at
/home/vagrant/kohaclone/Koha/Template/Plugin/Branches.pm line 96.
 at /home/vagrant/kohaclone/C4/Templates.pm line 122

Koha::Libraries->pickup_locations does not always return an array, but
arrayref if $biblio is not a Koha::Biblio object.

I do not think it's the correct fix, the pattern in
Koha::Libraries->pickup_locations is wrong: we should not expect 2
different types for a given parameter, biblio should always be a
Koha::Biblio (idem for item btw).
That could be fixed easily if the template had the Koha::Biblio object
sent.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21684: Fix Hold.t
Jonathan Druart [Tue, 7 Jan 2020 15:06:38 +0000 (16:06 +0100)]
Bug 21684: Fix Hold.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21684: Koha::Object->delete must return a Koha::Object
Jonathan Druart [Tue, 7 Jan 2020 12:30:32 +0000 (13:30 +0100)]
Bug 21684: Koha::Object->delete must return a Koha::Object

Not a DBIx::Class object.

Tests have been added, add Bookseller.t fixed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21684: Fix UploadedFile[s]->delete
Jonathan Druart [Tue, 7 Jan 2020 11:10:05 +0000 (12:10 +0100)]
Bug 21684: Fix UploadedFile[s]->delete

Tests were failing with:
 #   Failed test 'Test delete via UploadedFile as well as UploadedFiles'
 #   at t/db_dependent/Upload.t line 193.
 DBIx::Class::Row::delete(): Not in database at /kohadevbox/koha/Koha/Object.pm line 219

I am not sure this patch is perfect, a set of uploaded files should be
deleted in a transaction, which would be rollback if something is wrong.
But it will be tricky to restore the files after they have been deleted.
It seems that we should deal with that with a more complicated process
and should be part of a separate bug.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24150: Prevent random failure comparing updated_on
Jonathan Druart [Tue, 7 Jan 2020 15:02:36 +0000 (16:02 +0100)]
Bug 24150: Prevent random failure comparing updated_on

Jenkins is currently failing (slow server, datetime comparison, etc.)

koha_1       |     #   Failed test at t/db_dependent/Koha/Old.t line 48.
koha_1       |     #     Structures begin differing at:
koha_1       |     #          $got->{updated_on} = '2020-01-07 14:15:22'
koha_1       |     #     $expected->{updated_on} = '2020-01-07 14:15:21'
koha_1       |     # Looks like you failed 1 test of 1.
koha_1       |
koha_1       | #   Failed test 'Koha::Old::Patrons'
koha_1       | #   at t/db_dependent/Koha/Old.t line 49.
koha_1       | # Looks like you failed 1 test of 2.
koha_1       | [14:15:22] t/db_dependent/Koha/Old.t ...............................................

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24328: Fix bibliographic frameworks install (linkid)
Jonathan Druart [Thu, 2 Jan 2020 12:12:58 +0000 (13:12 +0100)]
Bug 24328: Fix bibliographic frameworks install (linkid)

With strict mode enabled (tested with MariaDB 10.4.11)

ERROR 1366 (22007) at line 8029: Incorrect integer value: '' for column
`koha_kohadev`.`auth_subfield_structure`.`linkid` at row 769

Test plan:
Insert the .sql files from this patch and confirm that you can now
insert them correctly

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24314: Update de-DE MARC21 frameworks for updates 28+29 (May and November 2019)
Katrin Fischer [Sun, 29 Dec 2019 03:36:35 +0000 (03:36 +0000)]
Bug 24314: Update de-DE MARC21 frameworks for updates 28+29 (May and November 2019)

This updates the MARC framework files in the de-DE (German) installer
to the latest MARC standard. The files also include some translation
changes and fixes.

Files have been generated using the po files on translate.koha-community.org.

To test:
- Run the de-DE installer on a fresh database
- Verify that all files are installed without errors
- Verify that the frameworks are correctly in place

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
MARC21 files load without problems, no qa errors.
Loaded into 'en' install (delete fw then load) all frameworks look good.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24312: Update MARC21 frameworks to Updates 28+29 (May and November 2019)
Bernardo Gonzalez Kriegel [Fri, 27 Dec 2019 13:09:22 +0000 (10:09 -0300)]
Bug 24312: Update MARC21 frameworks to Updates 28+29 (May and November 2019)

MARC21 format changes

Bibliographic
-------------
Update 28 (May 2019)

New subfield f in 540
New subfield g in 506,540
New subfield q in 506,540
New subfield 2 in 540
New subfield 2 in 100,110,111,130,240,
                  700,710,711,730,758
                  800,810,811,830
New subfield 7 in 856
New code b in 007/01 Sound Recording

Update 29 (November 2019)

New field 688
New subfield i in 041
New subfield t in 041
New subfield g in 751
Renamed subfield g in 041

Authority
---------
Update 28 (May 2019)

New subfield 0 and 1 in 024
Renamed subfield 2 in 024
New subfield 7 in 856

Update 29 (November 2019)
No changes

To test:
1) Remove all your frameworks
2) Check mandatory bibliographic and authority files load without problem
3) Check new fields/subfields

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24365: (bug 24217 follow-up) Fix encoding issue for translator script
Jonathan Druart [Tue, 7 Jan 2020 14:47:14 +0000 (15:47 +0100)]
Bug 24365: (bug 24217 follow-up) Fix encoding issue for translator script

I am not sure what happened here, but adding strict for TmplTokenizer.pm
breaks a test for translation.

It has been caught by a failing test:
 % prove xt/author/translatable-templates.t
will display lines "invalid multibyte sequence"

I did a diff between the generated files and found:
< msgid "àrbok"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24361: (bug 24217 follow-up) Fix several warnings in C4 modules
Jonathan Druart [Tue, 7 Jan 2020 11:26:01 +0000 (12:26 +0100)]
Bug 24361: (bug 24217 follow-up) Fix several warnings in C4 modules

With bug 24217 pushed, lot of warnings appears during the tests are run.
Most of them are "Use of uninitialized value in "

Test plan:
Take a look at the output of run 1049
https://jenkins.koha-community.org/job/Koha_Master_D9/1049/consoleFull

Most of the warnings from this run will be removed by this patch

At least 2 are not fixed:
Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/C4/Reserves.pm line 791.
t/db_dependent/Items_DelItemCheck.t => see 23463

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24361: Fix warning in C4::Record line 435
Jonathan Druart [Tue, 7 Jan 2020 11:26:01 +0000 (12:26 +0100)]
Bug 24361: Fix warning in C4::Record line 435

Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/C4/Record.pm line 435

Caught by a failing test:
    #   Failed test 'Export csv with wrong marcxml should raise a warning'
    #   at t/db_dependent/Exporter/Record.t line 113.
    # found warning:  problem with :721 : :1: parser error : Start tag expected, '<' not found
    # found warning: Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/C4/Record.pm line 435.
    # expected to find warning: (?^u:.*Start tag expected.*)

Test plan:
Make sure the tests pass now

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24150: Add missing koha_object[s]_class methods and skip for deletedborrowers
Jonathan Druart [Mon, 6 Jan 2020 22:49:37 +0000 (23:49 +0100)]
Bug 24150: Add missing koha_object[s]_class methods and skip for deletedborrowers

deletedborrowers does not have a PK, and adding it is out of the scope
of this patchset. Indeed we will have to handle possible duplication of
borrowernumber values, which does not seem trivial.
Having bug 20271 in mind, we will have to deal with this problematic
anyway later.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24080: DBRev 19.12.00.004
Martin Renvoize [Fri, 3 Jan 2020 16:46:23 +0000 (16:46 +0000)]
Bug 24080: DBRev 19.12.00.004

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24080: (QA follow-up) Remove processing for removed field
Martin Renvoize [Mon, 23 Dec 2019 14:58:48 +0000 (14:58 +0000)]
Bug 24080: (QA follow-up) Remove processing for removed field

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24080: Adjust text in modal
Kelly McElligott [Mon, 23 Dec 2019 13:03:00 +0000 (10:03 -0300)]
Bug 24080: Adjust text in modal

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24080: Add payout option to patron account page
Martin Renvoize [Thu, 21 Nov 2019 13:59:43 +0000 (13:59 +0000)]
Bug 24080: Add payout option to patron account page

This enhancement adds a refined workflow to allow librarians to pay out
money to patrons and record these payouts on the patrons account.

The use case is that a patron has somehow accrued credit, through a
refund perhaps, and the library wants to be able to physically hand over
some money to balance the patrons account.

Test plan:
1) Undertake a series of transactions that result in some outstanding
   credit on a patrons account.
2) Note that a new 'Issue payout' button appears next to a credit with
   an outstanding balance (but only if your user has the payout
   permission or is a superlibrarian)
3) Click the 'Issue payout' button and a modal should appear
   pre-populated with the amountoutstanding.
4) You should be able to edit the amount you wish to payout, make
   payment or cancel.
5) Signoff

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 24080: Add updatecharge payout permission
Martin Renvoize [Thu, 21 Nov 2019 14:28:03 +0000 (14:28 +0000)]
Bug 24080: Add updatecharge payout permission

Add a new subpermission called 'payout' to the 'updatecharges'
permission group which will allow/prevent payout actions to be performed
by staff.

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 24080: Add 'payout' method to Koha::Account::Line
Martin Renvoize [Thu, 21 Nov 2019 13:22:39 +0000 (13:22 +0000)]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff

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 24080: Payout account debit type
Martin Renvoize [Thu, 21 Nov 2019 14:50:12 +0000 (14:50 +0000)]
Bug 24080: Payout account debit type

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 10469: Display more when editing subfields in frameworks
Owen Leonard [Fri, 13 Dec 2019 23:42:28 +0000 (23:42 +0000)]
Bug 10469: Display more when editing subfields in frameworks

This patch removes the accordion feature from the MARC subfields
structure editor. The form is not long, and I think in this case the
accordion makes the process more difficult to navigate.

To test, apply the patch and go to Administration -> MARC frameworks ->
Framework structure -> Subfield structure -> Edit. Choose a tag with
multiple subfields to best test the changes.

The whole form should apppear, and tabs functionality should work
correctly. Test that making changes under multiple tabs works correctly.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 7882: (follow-up) Only show sortable icon for sortable tags
Owen Leonard [Tue, 17 Dec 2019 15:19:56 +0000 (15:19 +0000)]
Bug 7882: (follow-up) Only show sortable icon for sortable tags

Only tags which can be repeated can be sorted, so the "bars" icon should
not display by these tags.

Signed-off-by: Maryse Simard <maryse.simard@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 7882: (follow-up) Update sorting interaction
Owen Leonard [Mon, 16 Dec 2019 19:06:57 +0000 (19:06 +0000)]
Bug 7882: (follow-up) Update sorting interaction

This follow-up modifies the CSS for the sortable fields so that a
different icon is used. Elsewhere in Koha (stock rotation stage sorting)
we use the "bars" icon to indicate a sortable element. I think it would
be good to continue to use this. The cursor is now styled as a "Move"
cursor.

The configuration of the sortable function in the script has been
updated in two ways: 1. The movement of the element is constrained along
the y-axis, and 2. The movement of the element is contstrained to the
container within which it can be moved (for the tag, the tab, and for
the subfield, the tag).

To test, apply the patch and edit a MARC record in the basic cataloging
editor.

Confirm that the new icon is used, and that the "Move" cursor shows when
you hover over the icon.

Confirm that a tag can be dragged up and down within the constraints of
the visible section. A subfield should be only movable within its parent
tag.

Signed-off-by: Maryse Simard <maryse.simard@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 7882: Add ability to move and reorder fields in MARC editor
Maryse Simard [Wed, 23 Oct 2019 19:34:39 +0000 (15:34 -0400)]
Bug 7882: Add ability to move and reorder fields in MARC editor

Use jQueryUI sortable to make fields and subfields moveable in the
MARC editor for both records and authorities.

This patch convert items from div's to ul's and consequently alter css
and js to match. It also replace the up arrow with a more adapted icon
(from font awesome).

Primary authorship by Elliott Davis.

To Test:

1. Add or edit a record in cataloguing module.
2. You should be able to move the fields and subfields around.
    - You can click on any part of the element to drag it, the move
    icon to the left of the item is a good place to do it.
    => You can only change the order of fields of the same tag.
3. Make sure all of the javascript driven fonctionnality still work :
    - Duplicate fields/subfields
    - Remove fields/subfields
    - Using the tag editor for control fields or to link authorities
    - etc
4. Reorder some fields/subfields and save the record.
5. Edit the record again.
6. The order in the editor should match the changes which were saved.
    - Empty subfields should appear after the ones with content.
7. Repeat steps 1-6 with the authority editor.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24173: Advanced Editor: Show subtitle & published date on the search page
Cori Lynn Arnold [Wed, 18 Dec 2019 18:18:59 +0000 (18:18 +0000)]
Bug 24173: Advanced Editor: Show subtitle & published date on the search page

To test:

Prior to patch:
1/Verify that EnableAdvancedCatalogingEditor syspref is set to "enable"
2/Go to Cataloging
3/Click on "Advanced Editor" button
4/In left hand box put "specious" under Keywords and hit "enter"
5/verify that "Library of Congress" (or some other server) Z39.50 is checked
6/Verify that there are no headings for "Subtitle" and "Published"

Apply Patch
1/Go to Administration->Koha to MARC mapping
2/Add or verify that there are entries for "biblio.subtitle" and
"biblio.copyrightdate"
3/Go to Cataloging
4/Click on "Advanced Editor" button
5/In left hand box put "specious" under Keywords and hit "enter"
6/verify that "Library of Congress" (or some other server) Z39.50 is checked
7/Verify that there are headings for "Subtitle" and "Published" and the
data matches with the fields from Koha to MARC mapping when you click on
"View MARC" link for that record.

Signed-off-by: Owen Leonard <oleonard@myacpl.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 24059: Remove unused Greybox assets from detail.tt
Owen Leonard [Mon, 18 Nov 2019 18:21:52 +0000 (18:21 +0000)]
Bug 24059: Remove unused Greybox assets from detail.tt

This patch removes reference to the Greybox include file because it is
unused.

To test, apply the patch and view the bibliographic details page. Test
various JavaScript-driven interactions to make sure no functionality has
been broken: Menus, tabs, table filters, MARC Preview, etc.

Searching for "gb-" or "GB_" should return no results in any files
related to the details page.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24212: Increase size of OPAC 'send list' dialog box for IE
Aleisha Amohia [Wed, 11 Dec 2019 05:07:31 +0000 (05:07 +0000)]
Bug 24212: Increase size of OPAC 'send list' dialog box for IE

To test:
1) Create a list and view it in the OPAC (ensure you are using Internet
    Explorer as a browser)
2) Click Send list
3) Notice the dialog box cuts off the content in the window
4) Close the popup, apply the patch
5) Click Send list again
6) Confirm the dialog box shows the entire window
7) Confirm the box is resizable and has scrollbars

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24063: Add Sami language characters to Zebra
Pasi Kallinen [Tue, 19 Nov 2019 09:26:01 +0000 (11:26 +0200)]
Bug 24063: Add Sami language characters to Zebra

Some Sami languages need few more characters to be mapped, or
are otherwise very hard to search for.

Test plan:

1) Catalogue a new record with title "Ǩoǯeŋa"
2) Make sure zebra indexed that record, then try to search for
   it with the text "kozena"
3) Apply patch
4) Redo 2, now the record should be found.

Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24181: Compiled CSS
Martin Renvoize [Fri, 3 Jan 2020 15:53:18 +0000 (15:53 +0000)]
Bug 24181: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24181: Move the icon back into the input
Jonathan Druart [Thu, 5 Dec 2019 15:33:00 +0000 (16:33 +0100)]
Bug 24181: Move the icon back into the input

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 24181: Make our datepicker inputs sexy
Jonathan Druart [Thu, 5 Dec 2019 15:27:35 +0000 (16:27 +0100)]
Bug 24181: Make our datepicker inputs sexy

They are skinny and different from others.
Not that a problem, I am too.
But I do not think it is what they need.

Test plan:
Edit a patron and take a look at the input for "Date of birth"
=> Before this patch they are not looking great
=> After this patch they are beautiful

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 24089: Upgrade jQuery Validate plugin in the staff client
Owen Leonard [Fri, 22 Nov 2019 13:23:21 +0000 (13:23 +0000)]
Bug 24089: Upgrade jQuery Validate plugin in the staff client

This patch upgrades the jQuery Validate plugin in the staff client from
v1.10.0 to v1.19.1.

To test, apply the patch and clear your browser cache if necessary.

Test various pages to confirm that form validation works as expected:

 - Patron password change form:
   - Password must conform to minPasswordLength
   - Password must not contain leading/trailing spaces
   - Passwords must match

 - Administration -> Add or edit budget:
   - Description, start date, and end date are required
   - Start date must be before end date

 - Administration -> Add or edit Z39.50/SRU server:
   - Server name, hostname, port, and database are required
   - Port, rank, and timeout must be a number

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23957: Compiled CSS
Martin Renvoize [Fri, 3 Jan 2020 15:44:09 +0000 (15:44 +0000)]
Bug 23957: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23957: (follow-up) Disable both place hold buttons
Owen Leonard [Tue, 10 Dec 2019 13:36:19 +0000 (13:36 +0000)]
Bug 23957: (follow-up) Disable both place hold buttons

This follow-up adds the correct markup to the second of two "Place hold"
buttons so that it is disabled when the first is disabled.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23957: Remove button style with famfamfam icon background and replace with Font...
Owen Leonard [Sun, 3 Nov 2019 23:45:44 +0000 (23:45 +0000)]
Bug 23957: Remove button style with famfamfam icon background and replace with Font Awesome

The patch modifies the markup and CSS related to the holds template in
the staff client when holds policy override is necessary. The CSS
background image is replaced with a Font Awesome icon. <input>s are
replaced with <button>s to allow for the icon markup.

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

 - Enable the AllowHoldPolicyOverride system preference.
 - Start the process of placing a hold for a patron on a title which
   would not normally be available for hold. For instance: The patron
   already has too many holds.
 - On the hold confirmation screen the "Place hold" buttons should
   appear with a little yellow "warning" icon.
 - Clicking either of the two "Place hold" buttons should trigger a
   confirmation dialog. Test both the "Confirm" and "Cancel" options.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23956: Compiled CSS
Martin Renvoize [Fri, 3 Jan 2020 15:42:12 +0000 (15:42 +0000)]
Bug 23956: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23956: Replace famfamfam calendar icon in staff client with CSS data-url
Owen Leonard [Sun, 3 Nov 2019 22:31:39 +0000 (22:31 +0000)]
Bug 23956: Replace famfamfam calendar icon in staff client with CSS data-url

This patch modifies the staff client CSS so that the backround image for
datepicker input fields is defined as a data-url rather than a reference
to an image file.

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

 - In the staff client, view any form which includes a datepicker-styled
   input. For instance, patron entry: date of birth, expiry; Aquisitions
   -> Late orders -> Filter results.
 - Confirm that the calendar icon looks correct.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: DBRev 19.12.00.003
Martin Renvoize [Fri, 3 Jan 2020 13:05:39 +0000 (13:05 +0000)]
Bug 22284: DBRev 19.12.00.003

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: (QA follow-up) Make pickup locations be Koha::Library objects
Tomas Cohen Arazi [Sat, 21 Dec 2019 03:14:10 +0000 (00:14 -0300)]
Bug 22284: (QA follow-up) Make pickup locations be Koha::Library objects

This patch makes the following methods return array references of
Koha::Library objects instead or unblessed objects;

- Koha::Item->pickup_locations
- Koha::Biblio->pickup_locations
- Koha::Libraries->pickup_locations

Bonus:

- The template plugin is adjusted to unbless things to keep behavior
- Tests are moved to the right .t file.
- Tests for the new behavior are added.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: (follow-up) Anotate boolean values in Koha::Schema::Result::LibraryGroup
Agustin Moyano [Wed, 18 Dec 2019 17:50:31 +0000 (14:50 -0300)]
Bug 22284: (follow-up) Anotate boolean values in Koha::Schema::Result::LibraryGroup

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: Schema update
Josef Moravec [Wed, 3 Jul 2019 22:29:42 +0000 (22:29 +0000)]
Bug 22284: Schema update

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: (follow-up) Squash multiple follow-ups
Agustin Moyano [Wed, 29 May 2019 05:06:46 +0000 (02:06 -0300)]
Bug 22284: (follow-up) Squash multiple follow-ups

  * Bug 22284: (follow-up) Use GetReserveControlBranch in Koha::Item->pickup_locations
  * Bug 22284: (follow-up) Fix tests
  * Bug 22284: (follow-up) Fix typo in request.tt
  * Bug 22284: (follow-up) Filter pickup on specific item click
  * Bug 22284: (follow-up) Fix typos transfered -> transferred

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: Add "patron's hold group" as new hold_fulfillment_policy option
Agustin Moyano [Tue, 28 May 2019 02:49:05 +0000 (23:49 -0300)]
Bug 22284: Add "patron's hold group" as new hold_fulfillment_policy option

This patch adds "patron's hold group" as a new option to Hold pickup library match

To test:
1. Set ReservesControlBranch preference to item.
2. Create a hold group
3. Go to circulation and fines rules
SUCCESS => in 'Hold pickup library match' there is a new option called "patron's hold group"
4. In a library not in hold group set 'Hold policy' to "any" and 'Hold pickup library match' to "patron's hold group"
5. Search for a user in the hold group
6. 'Search to hold' for items of the library of step 4
7. Select an item and 'Place hold for [user]'
SUCCESS => in 'Pickup at' you should see patron's hold group as options
8. In OPAC sign in as the same user of step 5
9. Search for the item in step 7
SUCCESS => in 'Pick up locations' you should see patron's hold group as options
10. Sign off

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: (follow-up) Squash multiple follow-ups
Agustin Moyano [Tue, 23 Apr 2019 19:18:59 +0000 (16:18 -0300)]
Bug 22284: (follow-up) Squash multiple follow-ups

  * Bug 22284: (follow-up) Remove commented warn and address test failures
  * Bug 22284: (follow-up) fix test count after merge
  * Bug 22284: (follow-up) fixes after 15496
  * Bug 22284: (follow-up) fixes after 18936
  * Bug 22284: (follow-up) Remove HomeOrHolding from reserves

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: Filter item's pickup locations in holds_table.inc
Agustin Moyano [Tue, 30 Apr 2019 11:05:17 +0000 (08:05 -0300)]
Bug 22284: Filter item's pickup locations in holds_table.inc

This patch filters pickup locations per item in holds_table.inc

To test:
1) Go to Circulation and fines rules and change max holds allowed to > 0, and change 'Hold pickup library match' to homebranch
2) Search for a patron
3) Click on "Search to hold"
4) Search for any bilio
5) Place hold on a specific item
CHECK => Item's pickup location is a select with all libraries
6) Apply this patch
7) Repeat steps 2 to 5
SUCCESS => Item's pickup location is filtered by allowed pickup locations
8) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: New message, new column and filter pickup locations in reserve/request.tt
Agustin Moyano [Thu, 4 Apr 2019 04:10:16 +0000 (01:10 -0300)]
Bug 22284: New message, new column and filter pickup locations in reserve/request.tt

This patch adds a new message to 'Hold' column in 'Place a hold on a specific item' table.

The message is "Cannot place hold from patrons's library". It appears when patron's homebranch is not in item's hold group, and hold_fulfillment_policy is set to 'holdgroup'.

This patch also adds a new column "Allowed pickup locations" that lists allowed pickup locations per item.

Finally, the select that displays pickup locations is filtered by allowed pickup locations, when multi_hold is not enabled

To test:
1) Apply this patch
2) In library groups add a root group and check it as hold group.
3) Add two libraries to the group
4) In circulation and fines rules, in 'Default checkout, hold and return policy', in Hold policy change the value to 'From local hold group'
5) Search a patron from a different library than step 3, select one and click 'search to hold'
6) Search by location for items in any library of step 3
7) On any item, clic on 'Place hold for ...'
SUCCESS => when the page is loaded, in the 'Place a hold on a specific item', you should see the message "Cannot place hold from patrons's library" in 'Hold' column
=> You should see a new column called "Allowed pickup locations" and the message is "Any library"
8) In circulation and fines rules, in 'Default checkout, hold and return policy', in 'Hold policy' change the value again to 'From any library' and change 'Hold pickup library match' to "Item's hold group"
8) Repeat steps 5 to 7
SUCCESS => when the page is loaded, you should see the "Pickup at" select filtered by libraries in hold group
=> You should see in "Allowed pickup locations" a coma separated list of the libraries in item's hold group
=> If biblio has an item whose control branch is not in a hold group, you should see the control branch name in "Allowed pickup locations"
9) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: (follow-up) Default to circulation control branch when no hold libraries...
Agustin Moyano [Tue, 30 Apr 2019 02:07:28 +0000 (23:07 -0300)]
Bug 22284: (follow-up) Default to circulation control branch when no hold libraries are found

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: Opac pickup_locations
Agustin Moyano [Fri, 12 Apr 2019 10:32:48 +0000 (10:32 +0000)]
Bug 22284: Opac pickup_locations

This patch modifies Koha::Libraries->pickup_location and moves most of the logic to
Koha::Item and Koha::Biblio in preparation for api endpoints in the future.

There where 2 methods added

1) Koha::Item->pickup_locations that given a patron, returns all pickup locations of
this item, considering hold fulfillment rules, and hold allowed rules.

2) Koha::Biblio->pickup_locations that given a patron, returns a distinct list of
libraries returned by each of this biblio items pickup location.

Koha::Libraries->pickup_location analyzes input param and calls Koha::Item->pickup_locations
or Koha::Biblio->pickup_locations as needed.

Also in opac-reserve.tt the way options where obtained to fill the pickup location select
was modified to pass the patron as a parameter.

To test:
1) opac: try to place hold on a item and check that all libraries are shown in the
pickup location select.
2) intranet: in Library groups, add 2 root groups marked as local hold group and
add different libraries to each.
3) opac: login as a user of a library belonging to one hold group, and search try to
place a hold on an item belongin to the other hold group.
4) intranet: in Circulation and fines rules, play with 'Hold policy' and 'Hold pickup
library match' rules.
5) opac: On each modification of the rules reload the page.
SUCCESS => Every time you reload the page, the number of pickup locations showed in
select varies.
6) prove t/db_dependent/Koha/Biblios.t t/db_dependent/Koha/Items.t
SUCCESS => Result: PASS
7) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: New methods in Koha::Library::Groups and Koha::Library
Agustin Moyano [Mon, 25 Mar 2019 02:00:36 +0000 (23:00 -0300)]
Bug 22284: New methods in Koha::Library::Groups and Koha::Library

This patch adds new methods in Koha::Library::Groups and Koha::Library.
1) For Koha::Library::Groups adds get_root_ancestor that returns all root
groups for a given search parameters, for example
Koha::Library::Groups->get_root_ancestor( { id => $group_id } )
2) For Koha::Library adds
2.1) get_hold_libraries: returns all libraries (including self) that
belongs to the same holdgroups. If $self belongs to several holdgroups
it will return a distinct list of all libraries belonging to them.
2.2) validate_hold_sibling: Returns 1 if the given parameters matches any of the
libraries that belong to any of the holdgroups this library belongs. For example
$library->validate_hold_sibling( { branchcode => $branchcode } )

To test:
1) apply this patch
2) prove t/db_dependent/Koha/Libraries.t t/db_dependent/LibraryGroups.t
SUCCESS => green letters :-D
3) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: Control hold groups in C4::Reserves
Agustin Moyano [Mon, 25 Mar 2019 03:45:58 +0000 (00:45 -0300)]
Bug 22284: Control hold groups in C4::Reserves

This patch modifies C4::Reserves to control when hold group options where selected
in smart rules.
In CanItemBeReserved adds 2 new error status messages
1) branchNotInHoldGroup: when a patron's homebranch is not in item's hold group
2) pickupNotInHoldGroup: when a selected pickup location is not in item's hold group
Also CheckReserves is modified when item's priority is defined, to control by hold
group when required.
Finally, IsAvailableForItemLevelRequest was also modified to control by hold group when
required.

To test:
1) Apply this patch
2) prove t/db_dependent/Holds.t
SUCCESS => Result: PASS
3) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: New hold group options in smart-rules
Agustin Moyano [Mon, 25 Mar 2019 03:43:05 +0000 (00:43 -0300)]
Bug 22284: New hold group options in smart-rules

This patch adds new options for 'Default checkout, hold and return policy'
and 'Default holds policy by item type', both in 'Hold policy' and 'Hold
pickup library match' columns

To test:
1) Go to 'Circulation and fines rules' in admin
2) Check that there are no options for hold group in 'Hold policy' and 'Hold
pickup library match' columns
3) Apply this patch
SUCCESS => in 'Hold policy' you should see 'From local hold group' option, and in
'Hold pickup library match' you should see "Item's hold group"
4) Select any of those options and save
SUCCESS => options should be selected when page reloads
5) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: Add new checkbox in Library Groups
Agustin Moyano [Mon, 25 Mar 2019 01:56:06 +0000 (22:56 -0300)]
Bug 22284: Add new checkbox in Library Groups

This patch adds a new checkbox option 'Is local hold group' when you create a new root group.

To test:
1) In intranet go to Library Groups in admin module
2) Add new root group
3) Check that there is no 'Is local hold group' checkbox
4) Apply this patch
5) Add new root group
SUCCESS => a new 'Is local hold group' checkbox appears
6) Select 'Is local hold group' and save
7) Click edit button for root group
SUCCESS => 'Is local hold group' is checked
8) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22284: New ft_local_hold_group column, and 'holgroup' enum option
Agustin Moyano [Mon, 25 Mar 2019 01:50:42 +0000 (22:50 -0300)]
Bug 22284: New ft_local_hold_group column, and 'holgroup' enum option

In order to add groups for holds, this patch provides a new column in
library_groups to identify them. Also provides new enum option for
hold_fulfillment_policy column of default_branch_circ_rules,
default_circ_rules, default_branch_item_rules and branch_item_rules.

To test:
1) check that there is no ft_local_hold_group column in library_groups
and that there are no 'holdgroup' enum option in hold_fulfillment_policy
in default_branch_circ_rules, default_circ_rules, default_branch_item_rules
and branch_item_rules
2) apply this patch
3) perl installer/data/mysql/updatedatabase.pl && dbic
SUCCESS => !(step 1) ;-D
4) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21684: Adjust some tests
Jonathan Druart [Fri, 13 Dec 2019 15:01:46 +0000 (16:01 +0100)]
Bug 21684: Adjust some tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21684: Fix delete methods and add more tests
Jonathan Druart [Thu, 12 Dec 2019 13:28:03 +0000 (14:28 +0100)]
Bug 21684: Fix delete methods and add more tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21684: Add tests to show some of the discrepancies
Jonathan Druart [Fri, 26 Oct 2018 16:54:47 +0000 (13:54 -0300)]
Bug 21684: Add tests to show some of the discrepancies

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24150: Add Koha::Old::*[s]
Jonathan Druart [Tue, 24 Sep 2019 21:00:00 +0000 (18:00 -0300)]
Bug 24150: Add Koha::Old::*[s]

This bug report will add new classes for:
  * Koha::Old::Patron[s]
  * Koha::Old::Biblio[s]
  * Koha::Old::Item[s]
  * Koha::Old::Biblioitem[s]

Sponsored-by: Association KohaLa - https://koha-fr.org/
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23261: (RM follow-up) Add missing uri filter
Martin Renvoize [Fri, 3 Jan 2020 10:49:15 +0000 (10:49 +0000)]
Bug 23261: (RM follow-up) Add missing uri filter

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24217: use Modern::Perl for modules when strict is missing
Jonathan Druart [Wed, 11 Dec 2019 12:02:07 +0000 (13:02 +0100)]
Bug 24217: use Modern::Perl for modules when strict is missing

We absolutely need that for modules.
We are enabling strict by using Modern::Perl.
Note that other modules from C4 use strict and warnings, instead of
Modern::Perl

Test plan: git grep 2505 **/*.pm should not return any results

And let's see later what needs to be fixed.

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 24016: (QA follow-up) Format code to adhere to perltidy format
Joonas Kylmälä [Tue, 17 Dec 2019 13:59:55 +0000 (13:59 +0000)]
Bug 24016: (QA follow-up) Format code to adhere to perltidy format

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv...
Lari Taskula [Tue, 12 Nov 2019 12:18:27 +0000 (12:18 +0000)]
Bug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv alone

Koha::Patron::Message->store has this

    my $userenv = C4::Context->userenv;
    $self->manager_id( $userenv ? $userenv->{number} : undef);

This breaks in REST API when userenv is not set.

Let API user pass manager_id without relying on C4::Context->userenv.

To test:
1. prove t/db_dependent/Koha/Patron/Messages.t
2. Observe success

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24016: Add a failing test for overwrite-able manager_id in Koha::Patron::Message
Lari Taskula [Tue, 12 Nov 2019 12:24:30 +0000 (12:24 +0000)]
Bug 24016: Add a failing test for overwrite-able manager_id in Koha::Patron::Message

To test:
1. prove t/db_dependent/Koha/Patron/Messages.t
2. Observe failure

t/db_dependent/Koha/Patron/Messages.t .. 2/12
   Failed test 'Manager id should be overwrite-able even if defined in userenv'
   at t/db_dependent/Koha/Patron/Messages.t line 90.
          got: '1100'
     expected: '1101'
 Looks like you failed 1 test of 12.
t/db_dependent/Koha/Patron/Messages.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/12 subtests

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23261: (follow-up) Use logged_in_user and move test
Nick [Tue, 17 Dec 2019 02:07:47 +0000 (02:07 +0000)]
Bug 23261: (follow-up) Use logged_in_user and move test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23261: Add notice for login/registering to RBdigital results
Nick Clemens [Wed, 3 Jul 2019 19:11:54 +0000 (19:11 +0000)]
Bug 23261: Add notice for login/registering to RBdigital results

To test:
 1 - You will need a valid library RBDigital account
 2 - Fill in the RecordedBooks system preferences
 3 - Open the catalog, perform a search with RBDigtal resuls, 'love' often works
 4 - Click to the results
 5 - Note if not logged you don't see availability
 6 - Log in with a patron with no email, note you do not see any notice that you must register your email with RBDigital
 7 - Apply patch
 8 - Reload results, you now see a notice to register with rbdigital, do so unless you already have an account
 9 - Add your associated email to the koha account
10 - Reload results, note you see availability
11 - Log out, reload results
12 - Note you see a promp to login to see availability

Signed-off-by: Jessica Zairo <jzairo@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 23913: Use a single menu to sort lists in the OPAC
Owen Leonard [Mon, 28 Oct 2019 16:02:35 +0000 (16:02 +0000)]
Bug 23913: Use a single menu to sort lists in the OPAC

This patch modifies the sorting form on the OPAC list contents view so
that the two menus (sort field and direction) are combined into one.
This makes it consistent with the sort menu on the search results page.

To test, apply the patch and view a list with multiple titles on it.

Test the "Sort by" menu, trying all the various options. Confirm that
the pre-selected item in the sorting menu is correct after each re-sort.

Edit the list to change the default sorting and verify that the "Sort
by" menu reflects your selection.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23889: Compiled CSS
Martin Renvoize [Thu, 2 Jan 2020 14:38:03 +0000 (14:38 +0000)]
Bug 23889: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23889: Use same css class on the basic editor view
Jonathan Druart [Mon, 16 Dec 2019 14:11:27 +0000 (15:11 +0100)]
Bug 23889: Use same css class on the basic editor view

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23889: Improve style of menu header in advanced cataloging editor
Owen Leonard [Thu, 24 Oct 2019 14:15:41 +0000 (14:15 +0000)]
Bug 23889: Improve style of menu header in advanced cataloging editor

This patch updates the style of dropdown menu headers to make it apply
more globally and changes the advanced cataloging editor template so
that the correct class is applied to the menu header.

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

Test the interfaces where these kinds of menu headers can be found:

 - Catalog search results: The "Sort" menu (Popularity, Author, etc.
   headings).

 - Saved report results: Run a report which returns a column of
   biblionumbers or itemnumbers. Check the "Batch operations" menu
   (Bibliographic records or item records headings).

 - Advanced cataloging editor: The settings menu (Change framework
   header).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24267: (QA follow-up) Remove two calls, add transaction
Marcel de Rooy [Fri, 20 Dec 2019 07:14:32 +0000 (07:14 +0000)]
Bug 24267: (QA follow-up) Remove two calls, add transaction

Call to GetAuthorizedHeading is already done just before calling ImportBreedingAuth.
Call to GuessAuthTypeCode is not used.
Adding transaction to test (check your database, kidclamp ;)

Test plan:
Add new authority via Z3950 in the interface.
Run t/db_dependent/Breeding.t

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 24267: Unit tests
Nick Clemens [Thu, 19 Dec 2019 17:37:23 +0000 (17:37 +0000)]
Bug 24267: Unit tests

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 24267: Improve ImportBreedingAuth
Nick Clemens [Wed, 18 Dec 2019 18:27:33 +0000 (18:27 +0000)]
Bug 24267: Improve ImportBreedingAuth

git grep ImportBreedingAuth - there is only one call to this routine
from SearchZ3950Auth

We pass it a MARC record, '2' for overwrite_auth

We then check for this record in the DB and get the breeding id,
however, when overwrite_auth is 2 we always add the auth to the batch
and return the new breeding id.

We don't actually use any of the other parameters returned here either

To recreate:
1 - Browse to Authorities
2 - Select New form Z3950
3 - Perform a search that returns results
4 - SELECT COUNT(*) FROM import_auths
5 - Repeat the search
6 - SELECT COUNT(*) FROM import_auths
7 - There are 20 more records
8 - SELECT * FROM import_auths - note the repeated rows

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 24316: (follow up) Fix es-ES web installer
Bernardo Gonzalez Kriegel [Mon, 30 Dec 2019 23:55:41 +0000 (20:55 -0300)]
Bug 24316: (follow up) Fix es-ES web installer

Same correction, as other languages, removing
obsolete authorised value MANUAL_INV.

Same test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24316: Remove obsolete sample data for MANUAL_INV authorised value
Katrin Fischer [Sun, 29 Dec 2019 22:21:06 +0000 (23:21 +0100)]
Bug 24316: Remove obsolete sample data for MANUAL_INV authorised value

Bug 23049 replaced the MANUAL_INV authorised value by a dedicated table,
but missed to remove the authorised value sample data from the non-English
installers.

This patch corrects this oversight.

Note:
The German (de-DE) file was changed a bit more, adding 2 missing translations
for the new RETURN_CLAIM_RESOLUTION and to match the sequence of the en
file.

To test:
- Verify the SQL file changes are valid by loading those files OR
- Run the installers for each language on an empty database
- Verify there is no error loading the optional authorised value data

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested with 24317 and a small followup for this bug for es-ES

Tested doing clean install for de-DE es-ES fr-CA it-IT nb-NO pl-PL
up to loading of all mandatory & optional data.
All languages load without problems.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14973: Compiled CSS
Martin Renvoize [Thu, 2 Jan 2020 13:15:05 +0000 (13:15 +0000)]
Bug 14973: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14963: Fix ergonomic issue on small screen
Jonathan Druart [Thu, 7 Nov 2019 18:15:08 +0000 (19:15 +0100)]
Bug 14963: Fix ergonomic issue on small screen

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14963: Set status=ORDERED for suggestions created from existing record
Jonathan Druart [Thu, 7 Nov 2019 17:18:31 +0000 (18:18 +0100)]
Bug 14963: Set status=ORDERED for suggestions created from existing record

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14963: Add the ability to suggest purchase on existing title
Jonathan Druart [Tue, 5 Nov 2019 18:42:43 +0000 (19:42 +0100)]
Bug 14963: Add the ability to suggest purchase on existing title

This patch adds the ability to create a new purchase suggestion from an
existing title. This will prevent the creation of bibliographic records
that already exist in the catalogue. Also it will ease the process
during acquisition.

Test plan:
- Login at the OPAC and go to the detail of a bibliographic record.
- Note that there is a new link "New purchase suggestion for this title"
on the right of the screen
- Please suggest an other icon if that one is not appropriated
- Click on it and submit your new suggestion
=> You should not get the confirmation screen (introduced by bug 14973)
warning you that the title already exists.
- Login staff side and order from this suggestion.
- Receive items and confirm that a new bibliographic record is not
created.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14973: Fix edit a suggestion and dup found
Jonathan Druart [Mon, 18 Nov 2019 15:53:41 +0000 (16:53 +0100)]
Bug 14973: Fix edit a suggestion and dup found

The find duplicate call must only be done when the suggestion is new. It
does not make sense to search for a duplicate when the suggestion
already exists.

This patch also fixes a side-effect:
- Create a suggestion using an existing biblio title
- Ignore the warning and save
- Edit again and save
=> BOOM on date

Template process failed: undef error - The given date (18/11/2019) does
not match the date format (iso) at /kohadevbox/koha/Koha/DateUtils.pm
line 168

The dates are not processed and so badly formatted when sent to the
template.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14973: Add missing filters in templates
Jonathan Druart [Wed, 6 Nov 2019 16:25:57 +0000 (17:25 +0100)]
Bug 14973: Add missing filters in templates

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14973: Remove double declaration of suggestions_loop
Jonathan Druart [Wed, 6 Nov 2019 16:23:33 +0000 (17:23 +0100)]
Bug 14973: Remove double declaration of suggestions_loop

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14973: Remove double textarea for notes
Jonathan Druart [Wed, 16 Oct 2019 13:54:39 +0000 (15:54 +0200)]
Bug 14973: Remove double textarea for notes

Certainly a bad merge conflict resolution (I am certainly the one to
blame).
However I do not understand where this "note" variable come from.

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14973: Do not skip validation step when submiting a suggestion - OPAC
Jonathan Druart [Wed, 16 Oct 2019 13:46:56 +0000 (15:46 +0200)]
Bug 14973: Do not skip validation step when submiting a suggestion - OPAC

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14973: Check existing biblio when submitting a purchase suggestion (staff side)
Alex Arnaud [Wed, 8 Mar 2017 11:23:12 +0000 (11:23 +0000)]
Bug 14973: Check existing biblio when submitting a purchase suggestion (staff side)

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14973: Check existing biblio when submitting a purchase suggestion (opac side)
Alex Arnaud [Wed, 7 Oct 2015 15:34:33 +0000 (17:34 +0200)]
Bug 14973: Check existing biblio when submitting a purchase suggestion (opac side)

Test plan:
- Go to opac suggestions page (opac-suggestions.pl) and click on "New purchase suggestion",
- type the title (and author?) of a document that stand in you database
- you should get a warning message about an exiting biblio.
- clicking on confirm your suggestion add it, cancel does nothing

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23783: Show languages from MARC21 field 041 in OPAC
Katrin Fischer [Sat, 2 Nov 2019 00:19:33 +0000 (00:19 +0000)]
Bug 23783: Show languages from MARC21 field 041 in OPAC

This copies the changes made in bug 20364 for the staff
interface to the OPAC.

Some slight changes have been made in comparison:
- OPAC uses the class "separator" for the characters
  that are used between repeatable tags. "sep" as
  used in the original patch set has some CSS rules
  attached to it that break display, so it makes
  double sense to change it.
- We revently removed ending . from the display in
  OPAC - so it's done here too.

To test:
1) Apply patch
2) Do a search in the OPAC and check the results look correct
3) Check some biblio detail pages and verify that they look correct
4) Add some 041 subfields (a, b, d, h, j) in any combinations
5) Repeat 2 and 3

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>