koha.git
6 years agoAdd release notes for Koha 16.05.15 v16.05.15
Mason James [Sun, 30 Jul 2017 16:10:22 +0000]
Add release notes for Koha 16.05.15

6 years agoRevert "Bug 18613: Add unit tests for getletter"
Mason James [Sun, 30 Jul 2017 16:04:35 +0000]
Revert "Bug 18613: Add unit tests for getletter"

This reverts commit 212d3bd9b9e07ddd76d7fbb72ae7b70c762fc058.

6 years agoRevert "Bug 18613: Remove letter rule correctly as superlibrarian"
Mason James [Sun, 30 Jul 2017 16:04:25 +0000]
Revert "Bug 18613: Remove letter rule correctly as superlibrarian"

This reverts commit ab019faecad351dc7f2df55db9487fdbbbb6c59f.

6 years agoTranslation updates for Koha 16.05.15
Mason James [Sun, 30 Jul 2017 13:16:35 +0000]
Translation updates for Koha 16.05.15

6 years agoIncrement version for 16.05.15 release
Mason James [Sun, 30 Jul 2017 13:04:17 +0000]
Increment version for 16.05.15 release

6 years agoBug 18572: Remove AddRenewal parameter
Jonathan Druart [Mon, 24 Jul 2017 17:04:06 +0000]
Bug 18572: Remove AddRenewal parameter

6 years agoBug 18572 - QA Followup
Nick Clemens [Wed, 19 Jul 2017 18:26:07 +0000]
Bug 18572 - QA Followup

6 years agoBug 18572 - Improper branchcode set during OPAC renewal
Nick Clemens [Fri, 23 Jun 2017 12:27:19 +0000]
Bug 18572 - Improper branchcode set during OPAC renewal

To test:
1 - Set 'OpacRenewalBranch' to various settings
2 - Renew an item for a ptron under each setting
3 - Confirm action_log entries reflect the correct branch for each
secnario
4 - prove t/db_dependent/Circulation/issue.t

Signed-off-by: David Kuhn <techservspec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18955 - autocomplete is on in OPAC password recovery
Fridolin Somers [Wed, 19 Jul 2017 07:48:04 +0000]
Bug 18955 - autocomplete is on in OPAC password recovery

In OPAC password recovery form autocomplete is not disabled.
So when login or email is entered, it is saved in browser input history for autocomplete.
This is a major issue for OPAC on computers with public access.

This patch adds autocomplete off on forms.

Test :
- Enable system preferences OpacPasswordChange and OpacResetPassword
- Go to OPAC
- Be sure to not be logged in
- Click on "Forgot your password?"
- Enter a loggin and email and Submit
=> Without patch there is an autocompletion with values you entered
=> With patch there is no autocompletion

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18613: Add unit tests for getletter
Baptiste Wojtkowski [Tue, 11 Jul 2017 09:12:37 +0000]
Bug 18613: Add unit tests for getletter

Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18613: Remove letter rule correctly as superlibrarian
Baptiste Wojtkowski [Fri, 19 May 2017 09:23:17 +0000]
Bug 18613: Remove letter rule correctly as superlibrarian

TEST PLAN

(reproducing bug)
1 - Set 'IndependantBranches' to enable
2 - Log in as Superlibrarian.
3 - Create 3 rules
    - 1 for all librairies (1)
    - 1 for the library of the superlibrarian (2)
    - 1 for another library (3)
4 - Try to delete them and see them and see that (3) isn't the good one

(checking patch)
5 - Apply patch
6 - Try again 3-
7 - Connect as not superlibrarian
8 - Try again 3-

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18901: [QA Follow-up] Do not translate zzpref either
Marcel de Rooy [Wed, 12 Jul 2017 11:33:51 +0000]
Bug 18901: [QA Follow-up] Do not translate zzpref either

Adding one backslash makes a difference :)
We need to escape the dot in the regex to exclude a file like zzpref
from translation too. Perfect_regexes++

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)
Julian Maurice [Thu, 6 Jul 2017 12:39:20 +0000]
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)

Text editors can create temporary files in this folder and this can
confuse the translator.
For instance, vim can create a file named '.opac.pref.swp' which will
make the translator dies with the following error message:

Can't use string ("b0VIM 8.0") as a HASH ref while "strict refs" in use
at LangInstaller.pm line 248.

Test plan:
1. echo 'Oops' > .../en/modules/admin/preferences/whatever.pref.whatever
2. cd misc/translator && ./translate update fr-FR
3. Verify that you have the error message mentioned above
4. Apply patch
5. cd misc/translator && ./translate update fr-FR
6. No more errors!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18854: Protect few other occurrences of offset
Jonathan Druart [Mon, 10 Jul 2017 14:56:46 +0000]
Bug 18854: Protect few other occurrences of offset

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18854: Make sure offset will not be < 0 - protect from DoS
Jonathan Druart [Wed, 5 Jul 2017 13:44:55 +0000]
Bug 18854: Make sure offset will not be < 0 - protect from DoS

There was a bug that meant a very large offset in the search params
will cause the search script to run forever (or long enough to crash
the machine)

To test

1/ Get ready with sudo top so you can kill the thread before it causes
your machine to OOM
2/ Hit a page like yourdomain.com/cgi-bin/koha/opac-search.pl?q=1&offset=-9999999999999999999
3/ Notice the process runs for a long time
4/ Kill the process
5/ Apply the patch
6/ Hit the page again, notice the it loads (offset is set to zero)
7/ Do the same to search in the staff client

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18854 - Protect from DOS
Chris Cormack [Sun, 25 Jun 2017 05:34:12 +0000]
Bug 18854 - Protect from DOS

There was a bug that meant a very large offset in the search params
will cause the search script to run forever (or long enough to crash
the machine)

To test

1/ Get ready with sudo top so you can kill the thread before it causes
your machine to OOM
2/ Hit a page like yourdomain.com/cgi-bin/koha/opac-search.pl?q=1&offset=-9999999999999999999
3/ Notice the process runs for a long time
4/ Kill the process
5/ Apply the patch
6/ Hit the page again, notice the it loads (offset is set to zero)
7/ Do the same to search in the staff client

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: changed -2 to 0 in opac-search.pl.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 17639 - Remove white filling inside of Koha logo
Owen Leonard [Tue, 6 Jun 2017 15:50:19 +0000]
Bug 17639 - Remove white filling inside of Koha logo

This patch modifies the Koha logo SVG file to remove the fill from two
letters. This patch also optimizes the file and converts the text object
to paths for better cross-platform portability.

To test you could:

- Open the file in an editor and confirm that the change is correct
  - or -
- Open the file in a browser and use the code inspector to add a
  background-color attribute to the top-level <svg> tag. The logo should
  appear transparent, with no white fills.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 068db9aaabb0694b4d12404bda16525efad0fde7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cffb4a26b3264137130d7a1a3c287d1f17c05b77)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18934: Preventing warns in Admin -> SMS providers
Aleisha Amohia [Thu, 13 Jul 2017 05:16:53 +0000]
Bug 18934: Preventing warns in Admin -> SMS providers

This patch initialises the $op variable to prevent the warns

To test:
1) Go to admin -> sms providers
2) Notice warns in error log
3) Apply patch and refresh page
4) Notice warns are gone

Sponsored-by: Catalyst IT

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 88ab0ef5791d2b428399690c505ac42aba4616df)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit adbd961d82fa6aebcc3f93f2dec6af1c8127aab9)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18858: Prevent warn when deleting a borrower debarment
Aleisha Amohia [Tue, 27 Jun 2017 01:40:48 +0000]
Bug 18858: Prevent warn when deleting a borrower debarment

To test:
1) Look at intranet log
2) Go to delete a debarment on a borrower
3) Notice warn
4) Apply patch
5) Add a new debarment
6) Delete this debarment
7) Notice warn is gone

Sponsored-by: Catalyst IT

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7ed66a6c8ae1c3c824e496c2d312e23db1dd8e41)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7d2bd0482033ac106434aca59bab6b201a592fef)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18554: Adjust a few typos including responsability
Marcel de Rooy [Mon, 8 May 2017 10:08:43 +0000]
Bug 18554: Adjust a few typos including responsability

typo responsability
typo defautl in authorities.pref
typo reveived in t/db_dependent/Acquisition.t
typo ;; in advance_notices.pl
typo Stopping in restart_indexer (koha-indexer)
typo instutitional in moremember.pl
typo Corretly (Biblio.t)
typo periodicy in help serials

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18400 - Noisy warns in opac-search.pl during itemtype sorting (16.11)
apirak [Thu, 29 Jun 2017 10:42:23 +0000]
Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting (16.11)

6 years agoBug 18830: Fix phrasing of screen message
Colin Campbell [Tue, 20 Jun 2017 15:35:35 +0000]
Bug 18830: Fix phrasing of screen message

Verb should be plural in this message

Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8a0ecda6c4ff368b9ff7a18593d7bdf4fc07e541)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5bbb863147959471a1a11e019eb18007c5c78583)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 14572 - insert_single_holiday() forces a value on an AUTO_INCREMENT column, durin...
Rodrigo Santellan [Wed, 21 Jun 2017 18:40:43 +0000]
Bug 14572 - insert_single_holiday() forces a value on an AUTO_INCREMENT column, during an INSERT

Removing all the id from the columns on the inserts and removing the
parameter '' of the values for the id.

Test plan:
1) Go to tools -> calendar
2) Add a Holiday only on this day.
3) Add a Holiday repeated every same day of the week.
4) Add a Holiday repeated yearly on the same date.
5) Add a Holidays on a range.
6) Add a Holidays repeated yearly on a range.
7) You should have the five calendars displayed.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b94b16f67963b03fd17170d2c2f2efa581c12c0f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9efe6332901e081cb7f7fc0a510449b697da4ce4)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18755: Allow empty passwords in Patron Info to return OK
Colin Campbell [Thu, 8 Jun 2017 11:59:55 +0000]
Bug 18755: Allow empty passwords in Patron Info to return OK

With this patch a parameter 'allow_empty_passwords="1" can be added to a
login in the SIP configuration file to allow the behaviour as was normal
before the patch for bug 16610 was applied. Some sip clients rely on
this behaviour sending an empty password field when they wish to
validate to user but do not have the password.
If a password is supplied it will be validated

A test has been added to Message.t to confirm this behaviour

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ebb887e5c93c96c6fc51d95b76de6a221ba4463e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 459c144f2a54f4b1ddeb9e7595030107e821d2b2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18771: CGI.pm: Subroutine multi_param redefined
Mark Tompsett [Fri, 9 Jun 2017 17:01:14 +0000]
Bug 18771: CGI.pm: Subroutine multi_param redefined

The commands in the test plan are examples, and may need varying
depending on your installation. This was created as a result
of attempting to clean the installation process up. However,
I believe the redefine might exist normally too. I just didn't
check. This is tested on a Debian 8 box sudo apt-get update'd
fully.

TEST PLAN
---------
empty error log
$ echo > ~/koha-dev/var/log/koha-error_log

drop and recreate and empty db
> drop database koha_library;
> create database koha_library;
> quit

run the web installer, but DO NOT LOG IN!
*opening chrome to Staff Client URL*

check the error log
$ less ~/koha-dev/var/log/koha-error_log
...
[Fri Jun 09 13:08:52.793627 2017] [cgi:error] [pid 5802] [client 192.168.71.101:58169] AH01215: [Fri Jun  9 13:08:52 2017] CGI.pm: Subroutine multi_param redefined at /usr/share/perl5/CGI.pm line 419.
...

apply patch

empty error log
$ echo > ~/koha-dev/var/log/koha-error_log

refresh the installation login page

recheck the error log
$ less ~/koha-dev/var/log/koha-error_log

notice no reference to "Subroutine multi_param redefined"

run koha qa test tools

Notice that it is just a require CGI; and comment added.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18634: Handle colliding translation for preference sections
Marcel de Rooy [Wed, 14 Jun 2017 13:37:55 +0000]
Bug 18634: Handle colliding translation for preference sections

Problem on this report was caused by translating the tabs Privacy
and Payments by the same string. This caused overwriting a hash entry.

This patch tests if the key already exists and if so, it merges the
entries instead of overwriting the old contents.

Test plan:
[1] Make sure that e.g. Privacy and Payments translate to e.g Vie privee.
[2] Run translate install fr-CA (or the language you altered)
[3] Without this patch you should loose preferences from either Privacy or
    Payments. With this patch, they should be merged.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with fr-CA.

Signed-off-by: Blou <philippe.blouin@inlibro.com>
Reset the .po files, reproduced the problem.  Applied the patch and suddenly 'paypal' appeared.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0d98089ec701bc96893e68408ce2dedad36f7235)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7bcad818744b11180b2b2c31a5dda8d51552b862)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18756 - add Unit Test
Fridolin Somers [Wed, 14 Jun 2017 10:33:25 +0000]
Bug 18756 - add Unit Test

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18756: Users can view aq.baskets even if they are not allowed
Christophe Croullebois [Thu, 8 Jun 2017 13:17:56 +0000]
Bug 18756: Users can view aq.baskets even if they are not allowed

Due to bad use of grep syntax if there is one or more Basket Users the result of grep is not equal to 0 and the borrower is allowed.

Test plan :
1- select system preference 'AcqViewBaskets' on 'user'
2- create 2 borrowers (A, B) with only permissions on acquisition :
group_manage
order_manage
order_receive
staff
3- login with A and create a basket
4- add a basquet manager other than B
5- relog with account B
6- you can see the basket

Apply the patch.
The basket is no longer visible.
1- relog with A
2- add basquet manager B
3- relog with B
5- you must see the basket

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18214: Add check for shared or public list
Marcel de Rooy [Thu, 22 Jun 2017 06:55:16 +0000]
Bug 18214: Add check for shared or public list

Following the idea behind bug 10865, we are only showing the permissions
when the list is shared or public.
Adding a simple test in opac-shelves here.

Note 1: Since the owner can always add or delete entries, the permissions
will not be relevant anymore for a strictly private list.

Note 2: Staff view always shows the permissions. This could have been
changed here too, but that change is far less urgent (bug 10865 did not
touch staff view and bug 18228 will rearrange permissions anyway).

Test plan:
[1] Verify on OPAC that you see the permissions for a private list with
    shares or a public list. And you do not see them for a private list
    without shares.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18214: Cannot edit list permissions of a private list
Marcel de Rooy [Mon, 6 Mar 2017 08:44:48 +0000]
Bug 18214: Cannot edit list permissions of a private list

If you have disabled the pref OpacAllowPublicListCreation, your users are
not able to edit the list permissions for private/shared lists.
For a private list they may only be theoretically relevant, but for a shared
list they are relevant.
Since we do not always know the history of a list (has it been public or
shared, does it contains entries from other users) and therefore permissions
are even relevant for a currently private list, we should just allow editing
these permissions.

Test plan:
[1] Do not yet apply this patch.
[2] Disable OpacAllowPublicListCreation.
[3] Create a private list in OPAC. Edit the list. Verify that you do not
    see the permission combo boxes.
[4] Apply this patch. Edit the list again. Do they appear now?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoUpdate mailmap - Jonathan Druart
Jonathan Druart [Wed, 21 Jun 2017 15:41:22 +0000]
Update mailmap - Jonathan Druart

I do not longer work at biblibre

(cherry picked from commit 2702b4688e31e62fb6851b7979dc56011d38ce89)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bb14ce9d657f2a30621a0a6465809cef1f820f3c)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18800: Patron card images: Add some more explanation to upload page and fix small...
Marc Véron [Wed, 14 Jun 2017 09:10:56 +0000]
Bug 18800: Patron card images: Add some more explanation to upload page and fix small translatabiity issue

The file
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/image-manage.tt
has a small translatability issue (sentence splitting by html tags).

This patch fixes it and adds a little bit more explanation about
uploading, using and replacing such images.

To test:
- Verify that text changes make sense
- Apply patch
- Go to Home > Tools > Patron card creator > Images and verify
  that the page displays properly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 053fbaf9267cce79ba80d23389b26f46a91111f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e5ad6741bac0996d635c61ea2b3aee403c46954e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18697: Final polishing
Marcel de Rooy [Wed, 31 May 2017 14:19:35 +0000]
Bug 18697: Final polishing

GetFictiveIssueNumber:
Returns undef instead of 0 for irregular frequencies. Also added to POD.
Removed unused variable $wkno.
Adding a return makes the if(unit) unneeded.
Replaced (a+b)/b by 1+a/b.

_delta_units:
Added a comment about its parameters.

GetFictiveIssueNumber.t:
Adjusted the tests for irregular frequencies accordingly.

Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
[2] Run t/db_dependent/Serials/GetNextDate.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18697: Adjusting unit tests for dayly serial frequencies
Marcel de Rooy [Wed, 31 May 2017 13:20:40 +0000]
Bug 18697: Adjusting unit tests for dayly serial frequencies

No changes were needed for GetNextDate.t.
In GetFictiveIssueNumber.t we add a subtest for daily frequencies.

Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18697: Fix date calculation for dayly frequencies in Serials
Marcel de Rooy [Tue, 30 May 2017 14:44:46 +0000]
Bug 18697: Fix date calculation for dayly frequencies in Serials

The changes in _get_next_date_day are actually only cosmetic. The sub
now reads exactly the same as its counterparts for other units, but
the results are exactly the same as before.

In GetFictiveIssueNumber we now call _delta_units for each type of unit.
The two Delta_Days calls are moved to _delta_units. Note that this also
is a cosmetic change; results should be exactly the same.

Test plan:
[1] Edit a subscription. Test predication pattern for some daily freq.
[2] Run t/db_dependent/GetNextDate.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18697: Adjusting unit tests for weekly serial frequencies
Marcel de Rooy [Tue, 30 May 2017 13:56:22 +0000]
Bug 18697: Adjusting unit tests for weekly serial frequencies

Corrections and added unit tests following the changes of the first patch.

GetFictiveIssueNumber.t: New subtest for weekly frequencies.

GetNextDate.t: Correcting a few dates one day. If we use 2/week, we will
calculate an interval of 3 days and correct with 4 days at the end of
the cycle. The connection with firstacqui is not relevant anymore.

Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
[2] Run t/db_dependent/Serials/GetNextDate.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18697: Fix date calculations for weekly frequencies in Serials
Marcel de Rooy [Tue, 30 May 2017 13:01:52 +0000]
Bug 18697: Fix date calculations for weekly frequencies in Serials

Same solution applied as in bug 18356/18607. Consistency++

The code in _get_next_date_week is again very similar to the code in
_get_next_date_month or _get_next_date_year. I will not merge them here,
but we could consider that in the future.

Code in GetFictiveIssueNo has been adjusted similarly to month and year.

Test plan:
[1] Do not apply this patch. Create a subscription for 3/week.
    When the first issue date is on a Saturday or Sunday, the
    intervals in the prediction pattern are 0,0,7,0,0,7,etc.
    Starting on Wed-Fri 1,1,5,etc. Starting on Mon-Tue 2,2,3,etc.
[2] Apply this patch. Check again.
    The interval should be always 2,2,3 now and no longer depend on the
    day_of_week of first issue date.
[3] Check another weekly frequency with multiple units per issue.
    Say 1 issue/3 weeks.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18607: Adjusting unit tests for monthly serial frequencies
Marcel de Rooy [Mon, 29 May 2017 10:08:40 +0000]
Bug 18607: Adjusting unit tests for monthly serial frequencies

The changes in the first patch require some corrections as well as
additional test cases.

GetNextDate.t: Since the calculation for multiple issues per unit has
slightly changed, a few dates (day 15 or day 16) have been changed in the
unit test; when we use 2/month, the algorithm now always adds 15 days.
Added a few test descriptions in this regard too.

GetFictiveIssueNumber.t: Add the monthly subtest with two test cases. In
the first case we tests multiple units per issue, and in the second case
we test multiple issues per unit (month).

Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
[2] Run t/db_dependent/Serials/GetNextDate.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18607: Fix date calculations for monthly frequencies in Serials
Marcel de Rooy [Tue, 16 May 2017 12:46:55 +0000]
Bug 18607: Fix date calculations for monthly frequencies in Serials

Similarly to the solution of bug 18356, this patch fixes the date
calculation for monthly frequencies.

The calculation in GetFictiveIssueNumber now makes use of the new
_delta_units sub introduced on bug 18356.

The calculation in _get_next_date_month is also very similar to the one
in _get_next_date_year. I do not merge them here, but this could still
be considered later on. At least consistency is achieved now between
both routines. The connection with firstacquidate has been cut thru
just like for year units.

Test plan:
[1] Without this patch, look at the prediction pattern for a
    subscription with first issue on Feb 21 and 5 per month. The first
    issues will be 21, 22, 23, 24, 25. Then jumping to 21, 23, 25, etc.
[2] Apply the patch. Look at the same prediction pattern. You will now
    see 6 day intervals and a new cycle starting on the 21st.
    So Feb 21, 27, Mar 5, 11, 17 and Mar 21, 27, etc.
[3] Edit an subscription. Try a few other monthly frequencies.
[4] The next patch adjusts related unit tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18356: Fix date calculations for yearly frequencies in Serials
Marcel de Rooy [Tue, 9 May 2017 15:01:46 +0000]
Bug 18356: Fix date calculations for yearly frequencies in Serials

The problem as described on BZ 18356 is a combination of an error in
GetFictiveIssueNumber and GetNextDate for unit==year.

[1] In GetNextDate the Add_Delta_YM calculation should be applied only to
frequencies based on years per unit.
In the case of multiple units per year we calculate the number of days to
add. And if we have reached the end of a cycle, we correct the
rounding applied in the cycle.
NOTE 1: We obsolete the idea here of rebasing dates on firstacqui. In case
of manual adjustments, we probably do not want it. And otherwise we do not
need it anymore due to the correction at the end of a cycle.
NOTE 2: The calls to Add_Delta_YM are intentionally not corrected for leap
years. Say you start at 2016-02-29. If you use 1/yr or 1/2yr, you will
switch to the Feb 28th in the following years. In 2020 there will be no
switch to Feb 29 again; if someone should need it, please use a manual
adjustment. This is probably highly exceptional.

[2] In GetFictiveIssueNumber the year should be decreased by one if you
have more units per year and you did not yet reach firstacqui day and
month. This affects calculations in GetNextDate with irregularities.
NOTE 1: I added a wrapper around Date::Calc::N_Delta_YMD in order to improve
its results; this will especially be needed when we use it later for
month units.
NOTE 2: In case of manual adjustments this calculation does not really make
sense. Another report should deal with improving irregularities.

Test plan:
[1] Verify that both GetNextDate.t as well as GetFictiveIssueNumber.t pass.
[2] Look at the prediction pattern for a few frequencies.
    For example: 1 iss/y, 1 iss/2y, 5 iss/y.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18356: Extend GetNextDate.t, add GetFictiveIssueNumber.t (unit=year)
Marcel de Rooy [Thu, 11 May 2017 08:47:22 +0000]
Bug 18356: Extend GetNextDate.t, add GetFictiveIssueNumber.t (unit=year)

This patch deals with tests for yearly frequencies.

Adjust/extend GetNextDate.t:
[1] Adjust mixup of units/issues in a description.
[2] Add testing +2 years on 29-2 of leap year for freq 1 issue/2 years.
[3] Add tests for freq 9 issues/year.

Add GetFictiveIssueNumber.t:
[1] Two subtests are provided for irregular frequencies (very trivial) and
    for year frequencies (with four specific test cases).

Test plan:
[1] Run t/db_dependent/Serials/GetNextDate.t
[2] Run t/db_dependent/Serials/GetFictiveIssueNumber.t

Note: Without the second patch both tests should fail. This shows the need
of the adjustments in the second patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 17181: Simplify code
Jonathan Druart [Wed, 11 Jan 2017 21:37:33 +0000]
Bug 17181: Simplify code

- do not prepare statement when used only once
- remove use of Data::Dumper
- remove $duplicate, not needed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 17181: Check for duplicate image names when uploading image to patron card creator
Aleisha Amohia [Wed, 11 Jan 2017 00:40:31 +0000]
Bug 17181: Check for duplicate image names when uploading image to patron card creator

This patch adds a check for duplicates before uploading the image.

To test:
1) Go to Tools -> Patron card creator -> Manage images
2) If you haven't already, upload an image
3) Try to upload another image with the same image name
4) Notice the first image is replaced with the second image, with no
warning.
5) Apply patch and refresh page
6) Try to upload an image with the same image name again
7) Notice you are now warned about a duplicate image name.
8) Check that uploading an image with a unique name still works.

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18807: t/db_dependent/www/batch.t fails
Mark Tompsett [Thu, 15 Jun 2017 22:07:53 +0000]
Bug 18807: t/db_dependent/www/batch.t fails

get() does not take two parameters. fixed.
prove and run koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit da10c3169b8cae71bf4a98b6585654a09704c323)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 15146ec2920caa464683e04798763cb2e3dac0e4)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18807: Fix tests www/batch.t
Jonathan Druart [Wed, 14 Jun 2017 19:56:13 +0000]
Bug 18807: Fix tests www/batch.t

Several things are wrong here:
1. It assumes that import_record_id is the biblionumber
=> Wrong, it is only true when the DB is empty and that the 2 AI equal 1
2. The encoding in the template is 'UTF-8', not 'utf8', it leaded to
  "stage-marc-import.pl: marc21record.mrc: Unexpected charset UTF-8, expecting utf8"
3. We did not test that the biblio was correctly imported

Test plan:
Make sure the tests now pass.
For the www tests you need to set the following env vars:
KOHA_USER, KOHA_PASS, KOHA_INTRANET_URL and KOHA_OPAC_URL

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 768c5758a2bb34876528e64edbb9d651942668c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 92fee49448f9bc68ad6884d5600bbba94caae547)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18806: Fix batch revert
Jonathan Druart [Wed, 14 Jun 2017 18:53:18 +0000]
Bug 18806: Fix batch revert

Since bug 18242: When a biblio is deleted, a new transaction is created.
tools/manage-marc-import.pl use the AutoCommit flag, which does not
allow nested transaction.
AutoCommit must not be used.

Test plan:
Import a batch, then revert it.
The biblios must have been correctly deleted, they were not before this
patch

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3db0401366b8e099ab2046d68cf20a9f754e1eae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eafd2e7299e3db30d0d84d084fa5e49de60fa748)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18699: Get rid of %%] in translation for edi_accounts.tt
Marc Véron [Tue, 30 May 2017 14:08:32 +0000]
Bug 18699: Get rid of %%] in translation for edi_accounts.tt

Translation for edi_accounts.tt exposes:
[%% transport_types = [ 'FTP', 'SFTP', 'FILE' ] %%]

Translators should not be confronted with such code internals.

To test:
- Review code change (it removes line breaks)
- Bonus test: Create a new translatin for "language" aa-AA and
  verify that the line no longer appears in aa-AA-staff-prog.po

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 3b64ebe2346de50d2fa3745d0febb935b5cc8b75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 63239abdf119cbe21fe316bddc9ba6acc164f2c9)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18804: Add additional information to execute successfuly selenium tests
Jonathan Druart [Fri, 16 Jun 2017 20:00:23 +0000]
Bug 18804: Add additional information to execute successfuly selenium tests

Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18804: (bug 13501 follow-up) Fix add item form (select2)
Jonathan Druart [Wed, 14 Jun 2017 16:08:43 +0000]
Bug 18804: (bug 13501 follow-up) Fix add item form (select2)

Hard to say here, select2 adds so many elements that we need to ignore.
Here we just assume that input text with an id starting with
tag_952_subfield must be filled

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18804: (bugs 16400,11088 follow-up) Update the "save category" elt selector
Jonathan Druart [Wed, 14 Jun 2017 16:08:20 +0000]
Bug 18804: (bugs 16400,11088 follow-up) Update the "save category" elt selector

With bug 11088 and bug 16400 the submit node switched from:
  <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
to:
  <button type="submit" name="save" onclick="return check_form_borrowers">
then finally to:
  <button class="btn btn-small" id="saverecord" type="submit" name="save" onclick="return check_form_borrowers();">

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18804: (bug 16286 follow-up) Update the "save category" elt selector
Jonathan Druart [Wed, 14 Jun 2017 16:07:41 +0000]
Bug 18804: (bug 16286 follow-up) Update the "save category" elt selector

Bug 16286 replaced the submit node:
  <input type="button" value="Save" onclick="Check(this.form);" />
with
  <input type="submit" value="Save" />

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18804: Skip selenium tests if Selenium::Remote::Driver is not installed
Jonathan Druart [Tue, 13 Jun 2017 20:43:39 +0000]
Bug 18804: Skip selenium tests if Selenium::Remote::Driver is not installed

We do not want these tests to fail if the module is not installed.
This module is not in the dependencies of Koha and it is good as it.
A developper who wants to use it will know what to do.
It is part of RM duties to make sure these tests pass

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 11235: Names for reports and dictionary are cut off when quotes are used
Marc Véron [Sun, 4 Jun 2017 17:55:08 +0000]
Bug 11235: Names for reports and dictionary are cut off when quotes are used

To reproduce for saved reports:

- Go to Home > Reports > Guided reports wizard
- Create a report with double quotes in it's name, e.g. 'My "double quoted" report'
- Go to "Saved reports", locate in the list the new report (name is correct here,
  is correct in database as well)
- From the selection button at the right choose "Edit"
- Result: Content of edit field for the report name is truncated (displays only: 'My')

To reproduce for Reports dictionary:

- Go to Home > Reports > Guided reports wizard
- Create a new definition, give it the name 'The "double quoted" definition' and enter
  a text with double quotes for "Description"
- Save
- Verify that in the list of definitions both name and descriptions are truncated
  (in database as well)

To test:
- Apply patch
- Verify that issues described above can no longer be reproduced

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f4c965781d82e9537015b695cc15677cd06d72cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d6eb92b44f85a82db4dc063bd369b449f17cd7a5)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 13452: Fix for plack
Julian Maurice [Wed, 12 Oct 2016 10:38:16 +0000]
Bug 13452: Fix for plack

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 13452: Fix obvious issues in issues_avg_stats.pl
Julian Maurice [Fri, 2 Oct 2015 09:31:10 +0000]
Bug 13452: Fix obvious issues in issues_avg_stats.pl

- Remove joins with issuingrules which are not needed
- Fix the SQL query so that $weight is now the value of COUNT(*) instead
  of a timestamp
- QA fix: '$column eq $itype' instead of '$column =~ $itype' (same for
  $line)

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 13452: 'Average loan time' report to obey item-level_itypes preference
Katrin Fischer [Mon, 8 Jun 2015 23:04:07 +0000]
Bug 13452: 'Average loan time' report to obey item-level_itypes preference

Fixes the 'Average loan time' report so that the system
preference setting item-level_itypes is taken into account.

Before the patch, the report was always using the biblio
level itemtype. With the patch, it will depend on the pref
setting.

To test:
- Run various reports, compare results with both
  possible pref settings
- Try limiting your search in various ways, especially
  on a specific itemtype
- Make sure you switch checkboxes in testing,
  using itemtype as the row or as the column

Notes:
- Filtering on a specific itemtype on master was not working
  if the itemtype was chosen as column. The patch should fix that.
- Fixes headings and breadcrumbs so that the name of the report
  is the same as on the reports start page

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 17710 - C4::Matcher::get_matches and C4::ImportBatch::GetBestRecordMatch should...
David Cook [Wed, 11 Jan 2017 04:36:05 +0000]
Bug 17710 - C4::Matcher::get_matches and C4::ImportBatch::GetBestRecordMatch should use same logic

C4::ImportBatch::GetBestRecordMatch uses SQL to sort by score descending
then candidate_match_id descending. With C4::Matcher::get_matches, I
implement the same sort but use Perl code to do it, since we're sorting
search results.

It's a simple change, but it's in a big block of code, so I don't have
unit tests.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18761: Fix tests for AutomaticItemModificationByAge.t - clear cache
Jonathan Druart [Thu, 8 Jun 2017 17:17:53 +0000]
Bug 18761: Fix tests for AutomaticItemModificationByAge.t - clear cache

The mapping structure is cached and may be wrong if already populated.
We need to clear the cache when a framework is modified

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works as described in test plan and passes QA tools.

(cherry picked from commit c3a115916146e7c1e98c58c0b0a429e9841af461)
(cherry picked from commit a44c0f82712a1e9492b0604711fdaebdcfd345b2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18601: OAI/Sets.t mangles data due to truncate in ModOAISetsBiblios
Marcel de Rooy [Mon, 15 May 2017 07:58:04 +0000]
Bug 18601: OAI/Sets.t mangles data due to truncate in ModOAISetsBiblios

This patch replaces the TRUNCATE statement in ModOAISetsBiblios by a
DELETE statement. A truncate will cause an implicit commit and will
therefore commit the transaction started in the test script.

Also simplifying the module load in the test script.

Test plan:
Do not apply this patch and observe that biblio records are added to your
database by running t/db_dependent/OAI/Sets.t.
Apply this patch, run the test again and verify that it does no longer
add records to your biblio table.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e0444e8600efbe06016ff857f23ea85893a93041)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 28928c69376fd25edaee8a7843dc4fd4309f0615)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18752 - Automatic item modifications by age should allow 'blank' values
Owen Leonard [Thu, 8 Jun 2017 15:19:22 +0000]
Bug 18752 - Automatic item modifications by age should allow 'blank' values

This patch modifies the automatic item modification by age template to
correct errors in form validation:

- Age in days should not be required
- A value should not be required in substitutions.

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

- Go to Tools -> Automatic item modification by age.
- Confirm that when editing or creating a rule the only required field
  is the substitutions field name.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1bc45a470e55bcbb5e4031c001749a1ec9b35160)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8c782759ef2ff01a5e125c05f998a3a678346455)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18584: Fix trailing spaces in C4/Accounts.pm
Lee Jamison [Sat, 10 Jun 2017 09:26:51 +0000]
Bug 18584: Fix trailing spaces in C4/Accounts.pm

Removed trailing spaces at line 182 of C4::Accounts.

Test plan:
1. Edit C4/Accounts.pm and verify trailing spaces
2. Apply patch
3. Verify that trailing spaces in C4/Accounts have been removed

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a80ed84d070f81065b1fb2fa14f5ced3c25d6431)
(cherry picked from commit abc32e9099376b6f6c9ffed8033e8e041c4cec68)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18656 - Require confirmation of deletion of files from patron record
Owen Leonard [Wed, 24 May 2017 13:46:50 +0000]
Bug 18656 - Require confirmation of deletion of files from patron record

This patch adds a JavaScript confirm to the deletion of files. It also
styles the file deletion link as a Bootstrap button.

To test, apply the patch and open the "Files" page for a patron who has
files attached.

- Verify that clicking any "delete" link prompts for a confirmation.
- Verify that confirming the dialog triggers the deletion of the correct
  file.
- Verify that canceling the confirmation dialog aborts the deletion.
- Confirm that the "Delete" button looks correct.

Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>

Revision for QA: Replaced '.click(function' with '.on("click",function'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a38ffe2d48c35029ef80ea0a4294e36b408cd1a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2bc4791dedc9d266b7aa3a121e62af2dc78354e2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18706 - Remove useless Javascript
Fridolin Somers [Wed, 31 May 2017 14:10:41 +0000]
Bug 18706 - Remove useless Javascript

Whe checking a subfield to be deleted, the code
  $(this).val($(this).siblings("[name='subfield']").val());
is useless, the checkbox already contains the subfield code :
  <input type="checkbox" ... name="disable_input" value="[% ite.subfield %]" />

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6bb4a0405abe0d03be3915644c6a05e2e3ee1e9f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7bf1bf36f4b075979e4e47beb5de0891a1f1e533)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18706 - subfields to delete not disabled anymore in batch item modification
Fridolin Somers [Wed, 31 May 2017 14:02:44 +0000]
Bug 18706 - subfields to delete not disabled anymore in batch item modification

In Tools > Batch item modification, one can click a checkbox to delete a subfield.
This click use to disable the input to change the field value.

This comes from the patch : Bug 13501: Move "Required" and checkbox after input/select
Because input is found using JQuery next().

This patch replaces with $(this).parent().find("[name='field_value']").

Test plan :
- Go to Tools > Batch item modification
- Enter a barcode and submit
- Click on a checkbox on a non-mandatory subfield
=> Without patch the input or select is not disabled
=> With patch the input or select is disabled
- Submit
=> Check that subfield is deleted

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c9273be169ca4da47059aa152f8c6ea11137a52)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dc1f51959ad1b7a5e7ca7e6259e0e42cc6260643)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18767: Remove useless diags from GetDailyQuote.t
Tomas Cohen Arazi [Fri, 9 Jun 2017 14:16:08 +0000]
Bug 18767: Remove useless diags from GetDailyQuote.t

This tests print useless debugging info.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/Koha/GetDailyQuote.t
=> FAIL: Some output telling what is doing on each step is printed.
- Apply the patch
- Run
 k$ prove t/db_dependent/Koha/GetDailyQuote.t
=> SUCCESS: No output, YAY!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 78a9f39f9a97179af3e3a38cf8cb17b3f043d88a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4def0870d85975c4e926fb62dbc2a9db2807ae20)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18727: System preferences loose part of values because of double quotes
Marc Véron [Mon, 5 Jun 2017 04:52:58 +0000]
Bug 18727: System preferences loose part of values because of double quotes

System preferences do not display values of text fields properly if they
contain doulbe quotes.

To recreate:
- Go to Home > Administration > System preferences , then tab Acquisitions
- Enter values to both system preferences like proposed in the example (o=5|a="bar foo" and  o=5|a="foo bar")
- Save
- Click on tab Acquisitions to reload
- Wrong result: Both preferences show a value of: o=5|a=
  (parts with double quotes are truncated)

- Edit any of the email addresses (Bug 9814):
  KohaAdminEmailAddress, NoticeBcc, ReplytoDefault, PayPalUser
- Set value to: "The Library" <thelibrary@example.com>
- Search for this email address syspref to re-display it
- Wrong result:
  Use [     ] " autocomplete="off" /> as the email address for the
  administrator of Koha.

To test:
- Apply patch
- Try to recreate issues above
- Additionally, edit other system preferences that could contain double
  quotes, e.g. LibraryName or UsageStatsLibraryName
- Set value to: Bibliothek "Zur Leseratte"

(Note: patch contains a tiny fix for a typo in acquisitions.pref)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6e7c125a56be8971ec9c9bb52373bff5004a936a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c5fcadf128e84c2a5deae5209b04fa82559845fb)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18689: calendar error with double quotes in title or description of holiday
Marc Véron [Sun, 4 Jun 2017 16:04:00 +0000]
Bug 18689: calendar error with double quotes in title or description of holiday

This patch fixes the calendar display with holidays having double qoutes in
title or description.

To test:
- Apply patch
- Go to Home > Tools > Calendar
- Create new holidays of each type (Day only, repeated wekly/yearly,
  range, yearly repeated range and enter double qoutes in their titles and
  descriptions
- Verify that calendar displays and works as expected
- Verify that you can edit the holidays

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f1d90f205e3dc8177c0d524b208d9d4a367cf56e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0f20a2c97acb04e137db35499f0c46d27d57bf0c)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18722: Fund name is not shown in received orders fund subtotals
Josef Moravec [Mon, 5 Jun 2017 11:20:18 +0000]
Bug 18722: Fund name is not shown in received orders fund subtotals

Test plan:
1) Go to acquisition and receive some orders
2) Show the receive summary for invoice
--> without patch, the fund name in subtotal is not shown
--> with patch the name is shown as expected

Signed-off-by: Michael Cabus <michael@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6a2ef935ac63c67a4b31d8c3eb9bcb8d974d844e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0cb001e83a7810233e488f99b67fae7c4776918)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoRevert "Bug 11122 - publisher code and publication year not fetched in acq orders"
Mason James [Sun, 30 Jul 2017 12:29:37 +0000]
Revert "Bug 11122 - publisher code and publication year not fetched in acq orders"

This reverts commit b2aea8eb88691ecdbb6ec08a28c633cef96deabe.

6 years agoRevert "Bug 11122: Address MARC21 vs. UNIMARC issue"
Mason James [Sun, 30 Jul 2017 12:29:29 +0000]
Revert "Bug 11122: Address MARC21 vs. UNIMARC issue"

This reverts commit 2f6823b4350f26a9756e8ccc0f12665fdd44348b.

6 years agoRevert "Bug 11122: Follow up - Fix some display issues and typos"
Mason James [Sun, 30 Jul 2017 12:29:18 +0000]
Revert "Bug 11122: Follow up - Fix some display issues and typos"

This reverts commit 3b2cb8a3c3ae3b83ae596394663c839b0b44ff8a.

6 years agoBug 18746: Text_CSV_Various parse failures
Mark Tompsett [Wed, 7 Jun 2017 22:07:13 +0000]
Bug 18746: Text_CSV_Various parse failures

While it might be an idea to just delete it,
this patch attempts to catch everything and make it
clear that Text::CSV::Unicode (binary) is the parser
that should be used.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Running 'prove xt/author/Text_CSV_Various.t' passes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 89d36585bb3483ac46c87224391b6867ae8468bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d3ccdd1df3eda8c933cbc841532a0000707cc9e2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18675: Translatability: Get rid of [%% in translation for csv-profiles.tt
Marc Véron [Fri, 26 May 2017 09:06:56 +0000]
Bug 18675: Translatability: Get rid of [%% in translation for csv-profiles.tt

Translation tool for file csv-profiles.tt picks following line:
%s [%% IF csv_profile.encoding == encoding OR NOT csv_profile AND encoding == 'utf8' %%]
It is is due to a line break inside a template directive. This patch removes it.

To test:
- Verify that code change makes sense
- Apply patch
- Verify that csv exports behave as before

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dd9da3e8f64ac4eb8fde5a1a58e0d692542ce2e6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e464f291b8793909400d9f44d0b297d5bee238d7)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18690 - Typos in Koha database description (Table "borrowers")
Marc Véron [Mon, 29 May 2017 18:13:03 +0000]
Bug 18690 - Typos in Koha database description (Table "borrowers")

This string patch fixes typos in kohastructure.sql as described in initial
comment.

To test:
- Carefully verify that string changes make sense

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 279126d710233f7925432ab1f8fa6ae9f947889e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7ff2fd6e9a3bcd40e22a4f69c5c303fe0f7d1706)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18644: Translatability: Get rid of pure template directives in translation for...
Marc Véron [Tue, 30 May 2017 09:23:20 +0000]
Bug 18644: Translatability: Get rid of pure template directives in translation for memberentrygen.tt

Translation for memberentrygen.tt exposes a lot of template directives
like the following:
[% UNLESS opduplicate %][% othernames | html %][% END %]
Translators should not be confronted with such code internals.

To test:
- Review code changes
- Verify that creating / editing patrons works as before
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines like mentioned above
  do no longer appear in aa-AA-staff-prog.po

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5a30dea05b158fd6a77b0495ee047310865072eb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 649cdbb91bffb37b0ea4958e80b55975ddce65bb)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18682 - Translatability: Get rid of [%% in translation for 2 files av-build-dropb...
Marc Véron [Tue, 30 May 2017 12:27:56 +0000]
Bug 18682 - Translatability: Get rid of [%% in translation for 2 files av-build-dropbox.inc

Two files av-build-dropbox.inc has linebreaks inside template directives,
 exposing internals (comments and tt code) to translations as mentioned
in initial comment.
Translators should not be confronted with such interal code.

This patch fixes it.

To test
- Verify, that code changes make sense and have no more line breaks insied
  tt directives.
- Run QA tools in newest version (checking for line breaks inside tt
  directives)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines mentioned above do
  no longer appear in aa-AA-staff-prog.po and in aa-AA-opac-bootstrap.po

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 953504a0769a38a60f379a2e9c72bf7b71814fd0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9db81e5ead064b21394c75ee9746cd825ec9954f)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18641 - Translatability: Get rid of template directives in translations for ...
Marc Véron [Sat, 20 May 2017 07:18:10 +0000]
Bug 18641 - Translatability: Get rid of template directives in translations for *reserves.tt files

Template directives should not be exposed in translation, but lines like the following pop up in the translation tool:
Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %] All

This patch fixes it.

To test:
- Apply patch
- Verify that code changes make sense
- Verify that submit buttons of pendingreserves.tt and waitingreserves.tt
  still work and display the same string as before

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 18641: (RM-followup) for waitingreserves.tt

Code changed for waitingreserves.tt as asked for in comment #7

Bug 18641: Followup for pendingreserves.tt (less %s)

Change as of comment #13 to reduce %s

After creating a new translation for a "language" aa-AA, we have
the following in the file aa-AA-staff-prog.po

msgid ""
"(Inclusive, default is %s days ago to %s days ahead. Set other date ranges "
"as needed.)"
msgstr ""

msgid ""
"(Inclusive, default is %s days ago to today. Set other date ranges as "
"needed.)"
msgstr ""

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 78b30baf3fa975ab9eabc58733a2252b08d22f25)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 485f2cdc7e44b16c90c9c6ba5a9861751e31c215)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18759: (follow-up) Try to fix random failure from Circulation.t
Jonathan Druart [Fri, 9 Jun 2017 13:08:37 +0000]
Bug 18759: (follow-up) Try to fix random failure from Circulation.t

If IndependentBranches, CanBookBeRenewed will set ITEMNOTSAMEBRANCH
or BORRNOTSAMEBRANCH flags, if the branches do not match.

Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18759: Try to fix random failure from Circulation.t
Jonathan Druart [Thu, 8 Jun 2017 14:54:18 +0000]
Bug 18759: Try to fix random failure from Circulation.t

Circulation.t is failing randomly on our CI
https://jenkins.koha-community.org/job/Koha_Master_D8/192/console

    #   Failed test at t/db_dependent/Circulation.t line 1147.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1152.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1156.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1170.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1184.
    #          got: '1'
    #     expected: '0'
    # Looks like you failed 5 tests of 23.

Sometimes one of the alert or impossible flags is set.
This patch guesses that it's because of the 'restricted' value of the item that is evaluated to 1.
If it is not fixed by this patch, we will have more info next time (at least know
if alert or impossible is set).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The fix is trivial. Using random data will lead to this situations. The good thing is that
it lets us spot places in which tests need more fine-grained data.
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18695: Translatability: Get rid of [%% INCLUDE in translation for circulation.tt
Marc Véron [Tue, 30 May 2017 08:47:48 +0000]
Bug 18695: Translatability: Get rid of [%% INCLUDE in translation for circulation.tt

The file circ/circulation.tt exposes the following line to translation:
%s %s [%% INCLUDE 'blocked-fines.inc' fines = chargesamount %%] %s %s
Translators should not be confronted with code internals.

This patch fixes it by removing a line break.

To test:
- Verify that code change makes sense
- Run QA tools in newest version (check for line breaks in tt directives)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that line mentioned above do
  no longer appear in aa-AA-staff-prog.po )

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18648: Restore hyphen
Jonathan Druart [Fri, 9 Jun 2017 16:24:07 +0000]
Bug 18648: Restore hyphen

Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18648: Fix syntax 'unexpected end of input'
Jonathan Druart [Tue, 6 Jun 2017 14:06:29 +0000]
Bug 18648: Fix syntax 'unexpected end of input'

Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18648: Translatability: Get rid of tt directives in translation for macles.tt
Marc Véron [Tue, 30 May 2017 19:10:32 +0000]
Bug 18648: Translatability: Get rid of tt directives in translation for macles.tt

koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/macles.tt contains
template directives inside a div tag:
<span title="[% FOREACH lib IN cell.libs %][% lib.lib |html %] - [% END %]">
This is exposed in translation tool.

To test:
- Carefully examine code changes
- Apply patch, verify that the directive is no longer exposed (picked for
  po files), e.g. by creating a new "language" aa-AA and examing aa-AA-staff-prog.po
- If you know where / how this macles is used, verify that it behaves as before

(Note: New patch, needs new sign off)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 13747: Fix problems with frequency descriptions containing quotes
Marc Véron [Sun, 4 Jun 2017 20:09:14 +0000]
Bug 13747: Fix problems with frequency descriptions containing quotes

If a serial frequency description contains quotes or is surrounded by
quotes, the description is empty ("TEST" > empty) or shown without the
quotes part (TEST "sth" > TEST) on editing the frequency.

To verify:
- Create a new frequency with description: "Test"
- Modify frequency
- Verify the description field is empty

To test:
- Apply patch
- Try to recreate, verify that the description field is
  correctly filled when editing
- Test also with a name like: 'A "souble quoted" name'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 16307c40343cdb0ed4ff69c9c001fc4d9e1a459f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17df2459ddc294eb2499fce6d9f6f32d20e6db67)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18653: Possible privacy breach with OPAC password recovery
Marc Véron [Tue, 23 May 2017 05:08:41 +0000]
Bug 18653: Possible privacy breach with OPAC password recovery

OPAC password recovery allows to find out which email address belongs to an account. An attacker could systematically guess login names. If they hit an existing one, OPAC displays a message like:
An email has been sent to "xxx@yyy.zz".

Having a combination of login name and email, attackers could use the information e.g. for phishing or other personalized actions.

To reproduce:
- Enable OPAC password recovery (syspref OpacResetPassword)
- 'Guess' a login name e.g. by using a common pattern like ptester for Peter Tester
- If such account exists, you get to know the related email address

This patch removes the email address from the success message. Additionaly, it changes
wording to address Bug 18570 ('will be sent' instead of 'has been sent')

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Simplified the wording. "Will be sent shortly" is used elsewhere too.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit eddf975cf0244c731f987c64af5126090f73f9f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2d1dad1a4afa1bfaa14715b7953ed8265dbdb398)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 13913 - Renewal error message in OPAC is confusing
Owen Leonard [Sat, 29 Apr 2017 17:14:10 +0000]
Bug 13913 - Renewal error message in OPAC is confusing

This patch adds some formatting to the error message a patron receives
when there are renewal failures in the OPAC.

This is pretty much the least which could be done to address this
problem. However, I don't think the issue can be fixed without
re-thinking how renewals are processed. Sending error messages back to
opac-user.pl via URL parameter isn't flexible enough.

To test, apply the patch and attempt to renew multiple items in the OPAC
which cannot be renewed for some reason, for instance because they have
been renewed too many times. The error messages should appear in a list
rather than strung together in one long block of text.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 281e1253777d2bd635610075fe610bedb2d47360)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 14e8f5bb713bd4f45a85f028e0c9b5738f3eefd5)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Changed borrower back to patron as it was before this patch.

6 years agoBug 11122: Follow up - Fix some display issues and typos
Katrin Fischer [Mon, 1 May 2017 23:08:02 +0000]
Bug 11122: Follow up - Fix some display issues and typos

This patch fixes the display of copyrightdate for MARC21 installations.
As MARC21 already requires you to add punctuation in cataloguing, there
is usually no need for punctutation in the templates.

Also fixes a template variable name typo and the basket summary page.

To test (all 3 patches):
- Add several order lines to an order, one should be uncertain
- Verify that the publisher and publication year are displayed
- Check the uncertain price page
- Verify that the publisher code and publication year are displayed
- Fix uncertain price and close your order
- Basket summary: Verify... (you know what)
- Cancel one of your orders
- Verify... for cancelled orders
- Receive shipment
- Verify... for unreceived orders
- Receive order
- Verify ... for received orders
- Finish receiving
- Verify ... on the invoice summary page

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 11122: Address MARC21 vs. UNIMARC issue
Mark Tompsett [Mon, 20 Apr 2015 00:28:21 +0000]
Bug 11122: Address MARC21 vs. UNIMARC issue

In comment #6 and comment #17, Katrin pointed out the discrepancy
between UNIMARC (using publisheryear) vs. Other MARC installations
(using copyrightdate). This was dealt with in invoice.tt already.
This patch does similar logic for the other 3 template files.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 11122 - publisher code and publication year not fetched in acq orders
Fridolyn SOMERS [Wed, 23 Oct 2013 10:05:23 +0000]
Bug 11122 - publisher code and publication year not fetched in acq orders

In acquisition, several templates try to display publisher code and publication year : invoice.tt, parcel.tt, transferorder.tt.
Thoses pages use C4::Acquisition methods GetPendingOrders or GetInvoiceDetails.
The bug is that in the SQL query of those methods, biblioitems.publishercode and biblioitems.publicationyear.
In uncertainprice.pl those datas are fetch using GetBiblioData.
It whould be better to fetch them in GetPendingOrders and GetInvoiceDetails.

This patch changes SQL queries to fetch wanted datas : aqorders.*,biblio.title,biblio.author,biblioitems.isbn,biblioitems.publishercode,biblioitems.publicationyear. GetInvoiceDetails also needs : biblio.seriestitle,biblioitems.volume.
This patch also unifies the way biblio datas are displayed :
  <a href="link to catalog using biblionumber">[title]</a> <em>by</em> [author] &ndash; [isbn]
  <em>Publisher:</em> [publishercode], [publicationyear]

Test plan :
- Choose a biblio record containing a data in :
    biblio.title,
    biblio.author,
    biblioitems.isbn,
    biblioitems.publishercode,
    biblioitems.publicationyear,
    biblio.seriestitle,
    biblioitems.volume.
- Create an order using this biblio.
- Look at this order in pages : parcel.pl, transferorder.pl, uncertainprice.pl
=> You see publisher code and publication year
- Look at this order in page : invoice.pl
=> You see publisher code, publication year, series title and volume

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18700 Fix grammar (data cannot be pluralized)
Colin Campbell [Tue, 30 May 2017 14:17:58 +0000]
Bug 18700 Fix grammar (data cannot be pluralized)

data is a mass noun or plural of datum - datas is ungrammatical
and jarring for a native speaker.
Split the awkward sounding sentence into two for more clarity,
thanks to Marc Véron for the suggestion.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 60b31a7a2219dea16f124684bd21e6d12a35c05a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ad741d2512e23746ceb009b2c0a7f57403ab3bb5)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18704 - File types limit in tools/export.pl is causing issues with csv files...
Nick Clemens [Tue, 30 May 2017 20:55:19 +0000]
Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel

To test:
1 - Save a csv of biblionumber from MS/Excel
2 - Attempt to export records using this file
3 - It fails (mimetype is appliction/vnd.ms-excel)
4 - Apply patch
5 - Try again
6 - It succeeds!

Signed-off-by: Jason Palmer <jpalmer@switchinc.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ef6211b319b58b4c35e8cb8555e1caa4da9b2a8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 283ccd4da55ce950cf7ace02688daf0db7c0e494)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 17974 (QA Followup)
Nick Clemens [Thu, 16 Feb 2017 11:04:11 +0000]
Bug 17974 (QA Followup)

    Use the $biblio_rs variable

    In case of Koha::Object you can call new_from_dbic directly, however,
    it fails for Koha::Objects so using an intermediary variable should
    be done for consistency

Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 17974: Add the Koha::Item->biblio method
Jonathan Druart [Sat, 21 Jan 2017 15:45:34 +0000]
Bug 17974: Add the Koha::Item->biblio method

Test plan:
  prove t/db_dependent/Koha/Items.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18478 - QA Followup
Nick Clemens [Tue, 23 May 2017 20:11:06 +0000]
Bug 18478 - QA Followup

Make sure to build necessary letters
Fix awkward construction

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18478 - Unit tests
Nick Clemens [Wed, 17 May 2017 16:58:09 +0000]
Bug 18478 - Unit tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18478 - Some notices sent via SMS gateway fail
Nick Clemens [Wed, 17 May 2017 16:54:44 +0000]
Bug 18478 - Some notices sent via SMS gateway fail

It seems that for HOLD and DUE (and maybe more) notices we rely on
C4::Letters::SendQueuedMessages
to populate the correct address.

This patch adjust that subroutine to correctly populate the field and/or
fail messages if no SMS provider available

To test:
 1 - Define a messaging prefs for a patron to recieve hold notices via
 SMS
 2 - Ensure you have defined an SMS message for 'HOLD' letter
 3 - Set an SMS alert number for patron
 4 - Set the SMS::Send driver to 'Email'
 5 - Fill a hold for the patron
 6 - Check the db and note the address is null
 7 - run process_message_queue.pl
 8 - Check db - address is null and message pending
 9 - Apply patch
10 - run process_message_queue
11 - Message to_address should be populated and message sent

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4fa3df9462eaa4a6a2399af4d7036d2f3ee990ce)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

6 years agoBug 18482 False duplicates detected on adding a batch-[16.11.x]
Olivier Crouzet [Sat, 22 Apr 2017 16:20:48 +0000]
Bug 18482 False duplicates detected on adding a batch-[16.11.x]

For applying on 16.11.x
When adding a batch from a stage file with defaut matching on
title/author, if a duplicate is detected, all following records
treated in the batch are discarded from import even if they are not duplicates

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 18512: Add tests 16.11.X version
Jonathan Druart [Tue, 2 May 2017 20:27:48 +0000]
Bug 18512: Add tests 16.11.X version

Remove use of build_object

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

6 years agoBug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not...
Nick Clemens [Fri, 28 Apr 2017 18:11:00 +0000]
Bug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not empty string) if value not found

To test:
1 - Create or edit a borrower with info in Sort1 and Sort2 field, not
mapped to authorized values
2 - Note this info does not display on moremember.tt
3 - Apply patch
4 - Note value is passed through

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>

6 years agoBug 12913 - wrong inventory results when notforloan filter is not used
Fridolin Somers [Fri, 12 Sep 2014 13:21:18 +0000]
Bug 12913 - wrong inventory results when notforloan filter is not used

In inventory tool, there is a test on scanned items notforloan value : if the value is not one of authorized values, the inventory results displays the problem "Change item status".
The bug is that if notforloan filter is not used, the notforloan values array is not filled and so all scanned items are marked with this problem.

Test plan :
- Check you have in default framework an item subfield mapped with items.notforloan and with an authorized value catergory, for example 'NOTFORLOAN'
- Check the authorized value category has at least value '0'
- Create a new value in this category, for example '9'
- Create a biblio with default framework
- Create an item with barcode='000AAA1', callnumber='ZZZAAA1' and notforloan=0
- Create an item with barcode='000AAA2', callnumber='ZZZAAA2' and notforloan=9
- Delete new value created above, for example '9'
- Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2'
- Go to inventory tool : /cgi-bin/koha/tools/inventory.pl
- Choose file in 'Barcode file'
- Enter item callnumber between 'ZZZ' and 'ZZZZ'
- Check 'Compare barcodes list to results'
- Submit
=> without patch, you get 2 results with problem 'Change item status' even for item with notforloan=0
=> with patch, you get 1 result with 'Change item status' on item with notforloan=9

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>