Commit Graph

25559 Commits

Author SHA1 Message Date
Marcel de Rooy 17bd3a5deb Bug 16636: [QA Follow-up] Make BakerTaylor plack safe
Initialize file level lexicals each call. Do not call _initialize
outside the module.
Adjust test by mocking preferences.

Test plan:
Run t/db_dependent/External_BakerTaylor.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested module with trivial script under Plack/memcached by toggling
the associated preferences.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5361440f65)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit c8ef873ee9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:05:38 +02:00
Mark Tompsett cd8fc9afcd Bug 16636: t/00-load.t warning from C4/External/BakerTaylor.pm
Since the tests are expecting an initialize function, the
initialize call was just moved outside of the INIT block.

TEST PLAN
---------
1) prove t/00-load.t
   -- warnings about INIT for BakerTaylor
2) prove `git grep -l BakerTaylor | grep [.]t$`
   -- should all run okay
3) apply patch
4) repeat steps 1 and 2
   -- warning should be gone, and everything else run okay
5) run koha qa test tools

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

Signed-off-by: Florent Mara <florent.mara@gmail.com>

NOTE: Tweaked test plan based on comment #4,
      Added sign off based on comment #6.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b4479624de)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 9c7c4f02dd)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:04:27 +02:00
Marcel de Rooy fbc8114f54 Bug 16635: [QA Follow-up] Eliminate some global package vars
[1] $branch is only related to line 123 as fallback.
[2] $width moved to a constant; sub width is not used.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested the corresponding plugin in item editor.
Test t/db_dependent/Barcodes.t and Barcodes_ValueBuilder.t still pass.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4fc8b3d6cf)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 94d77bd9c2)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:03:37 +02:00
Mark Tompsett 8a5e451e7f Bug 16635: t/00-load.t warning from C4/Barcodes/hbyymmincr.pm
According to http://perldoc.perl.org/vars.html, "our" should
be a reasonable substitute for the "use vars". By declaring as
"our", and removing the INIT, prove t/00-load will no longer
generate a warning about INIT for the C4/Barcodes/hbyymmincr.pm
module.

TEST PLAN
---------
1) prove t/00-load.t
   -- warnings about INIT for hbyymmincr
2) prove `git grep -l hbyymmincr | grep [.]t$`
   -- should all run okay
3) apply patch
4) repeat steps 1 and 2
   -- warning should be gone, and everything else run okay
5) run koha qa test tools

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit fd152d9e95)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 7fbfa01f78)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:01:49 +02:00
Marc Véron 4f8e1dc5d8 Bug 16634: Translatability: Fix issue in memberentrygen.tt
This patch fixes a small translatability issue in
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
The sentence following sentence was splitted by HTML tags:
"Attribute value xxxxx is already in use by another patron record."

To test:
- Review code
- Apply patch
- In Admin, create a unique patron attribute type and try to give
  two patrons the same value for this attribute type.

Signed-off-by: Rocio Dressler <rocio@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 45dce0ac79)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit cedc2b736e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:01:03 +02:00
Marc Véron 6b34cc972c Bug 16633: Translatability: Issues in tags/review.tt (sentence splitting)
This patch fixes translatability issues in
koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt
(isolated words by sentence splitting).

To test:
- Review code and verify that changes make sense.

Signed-off-by: Rocio Dressler <rocio@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 203d34a3ca)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 98a8dca482)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:00:31 +02:00
Marc Véron 42ddeb3dd0 Bug 16620: Translatability: Fix problem with isolated word "please" in auth.tt
This patch fixes a translatability problem (syntax in different languages) with a tag-isolated word "please"
in koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt

To test:
- Verify in code that there is no sentence spliting by a-tags (lines 80/84).

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b0ba45058a)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 7f3243daec)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:59:36 +02:00
phette23 4f3f4daf98 Bug 16613: fix MARC 09X help links
The 09X MARC fields, such as 099 local call number or 090
locally-assigned Library of Congress call number, all point to
non-existent pages on the LC website, e.g.
http://www.loc.gov/marc/bibliographic/bd090.html

Test plan:
- enter the advanced cataloging editor
- begin to input any MARC tag of form 09X
- click the help link at the bottom of the browser window
=> Without this patch, taken to a URL of form `'http://www.loc.gov/marc/bibliographic/bd' +
  tag + '.html'` which is broken because the only documentation for
  these tags is at https://www.loc.gov/marc/bibliographic/bd09x.html
=> With this patch applied, the link is correct

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ec66ff457b)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit fe295fce2d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:59:02 +02:00
Marc Véron b2141103ee Bug 16540 - Clean up opac-auth.tt for translatability
This patch fixes translatability issues in opac-auth.tt (ugly
translations caused by sentence splitting).

It was necessary to change indentation to make the the file more
readable and to make sure that changes have no side effects.

The changes do not touch the overall functionallity.

To test:
- Review code to verify that no functionality change is introduced
  and to verify that the text changes make sense.
- Apply patch, verify that OPAC login page behaves as before.

UPDATE: Amended for comment #10 / mv
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6b432d2b21)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 88c130eb43)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:53:39 +02:00
Tomas Cohen Arazi 3672be7315 Bug 16667: Unused variable and function call in circulation.pl
This patch removes an unused occurence of the $branches variable. Probably a
leftover from a recent rewrite.

To test:
- Run:
  $ git grep '$branches' circ/circulation.pl
=> FAIL: Only on occurence of the variable
- Apply the patch
- Run:
  $ git grep '$branches' circ/circulation.pl
=> SUCCESS: The variable has been removed
- Sign off :-D

Regards

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2bff91eb4e)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 9d8b407d7e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:46:21 +02:00
Fridolin Somers b8c64ec224 Bug 16608 - Missing entity nbsp in some XML files
The special character "non breaking space" &nbsp; is not contained in XML
syntax by default.  So we add it in the file header :
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>

Even if the source code files do no contain this character, it can be that
translated files contain it.  French for example "Titre&nbsp;:".

This entity is missing in all files in koha-tmpl/intranet-tmpl/prog/en/data/
and in some files of koha-tmpl/intranet-tmpl/prog/en/xslt.

Test plan :
  - generate French templates:
    cd misc/translator
    ./translate install fr-FR
    cd ../..
  - run test:
    prove -v t/00-valid-xml.t
    you get failing error message
  - apply this patch
  - translate again
  - run test again: it passes

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as described following test plan
Tes pass, no errors.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f38a9927a3)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 0cc550dcc3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:22:07 +02:00
Fridolin Somers 5844ed5b59 Bug 16608 - Add xsd extension to t/00-valid-xml.t
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ce97930016)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit e6d820ade3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:22:06 +02:00
Marc Véron 17ed90f215 Bug 16589 - Quote of the day: Fix upload with csv files associated to LibreOffice Calc
To reproduce:
- Install LibreOffice and make sure that csv files are associated to Calc
  (Note: tested with Firefox 46.0.1 on Windows 8)
- Go to Home > Tools > Quote editor > Quote uploader
- Try to upload a valid CSV (e.g. Example from Bug 15684)
Result: File can not be uploaded
        (Incorrect filetype: application/vnd.sun.xml.calc)
To test:
- Apply patch
- Try to upload again
Expected result: Quotes are imported.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Can't reproduce on a Mac but get it fails on a Windows Box: fixed with this
  patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Can't recreate on debian but the fix looks safe.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8631ebaf9f)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 34f8ab6f40)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:20:49 +02:00
Owen Leonard a97e139921 Bug 15676 - Actions in pending offline circulation actions are not translatable
This patch modifies the offline circulation transaction processing page
so that English strings describing actions are processed in the template
rather than being output directly from the script.

To test, apply the patch and create an offline circulation file
containing at least one checkout, one check-in, and one payment.

- Upload the file and choose 'Add to offline circulation queue.'
- View pending offline circulation actions
- In the list of pending actions, the actions column should show "Check
  out" instead of "issue," "Check in" instead of "return," and "Payment"
  instead of "payment."

Strings appear as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e9d6ac9478)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit acc459fa1b)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:17:41 +02:00
Dimitris Antonakis f6d2b24938 Bug 14897 - Header name mismatch in ./modules/catalogue/detail.tt
We changed the detail.tt file for staff interface from Publication details to
"Serial enumeration / chronology" to match the cataloguing editor.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 43d77fdcf0)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 4b3b7bbd8d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:16:32 +02:00
Blou 9c7fbadac0 Bug 14605 - Corrects the individual fine's description
When paying a fine, the description is built out of the borrower's type and title, instead of the actual fine's description.

STEPS:
1) in the staff, go to a user with a fine to pay.
   a) if none, go to a user and Fines>>"Create manual invoice" with a
      distinctive description.
2) In Fines>>Pay fines, click the "Pay" button on the line of the fine.
3) This will take you a "Pay an individual fine" screen, where the description
   will look like "Staff Mrs", for the category and title of the borrower.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 63041c19c9)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 744b035932)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:15:12 +02:00
Jonathan Druart 51417fde52 Bug 16492: Add a FIXME to explain the possible problem with no_set_userenv
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4f3067184d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit ac00e73077)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:12:37 +02:00
Jonathan Druart f952cf0b7f Bug 16492: Test that no_set_userenv will not set userenv if not exist yet
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit bb6e70fe7d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit f69eeca6c4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:12:36 +02:00
Kyle M Hall 853d297415 Bug 16492 - Checkouts ( and possibly checkins and other actions ) will use the patron home branch as the logged in library
Bug 14507 introduced the use of checkpw in C4::SIP::ILS::Patron so that
non-Koha internal authentication processes would be able to function via
SIP ( LDAP et al ).

The problem is that checkpw changes the userenv to that of the patron!
This is not usually an issue in Koha because most of the time that
patron running through checkpw is the one to be logged in.

Aside from SIP2 the only other area where this may be an issue is in SCO
when using SelfCheckoutByLogin.

Test Plan:
1) On master, check out an item to a patron via SIP2
2) Note the checkout lists the item as having been checked out
   from the patron's home library not matter which library is was
   supposed to be checked out from.
3) Apply this patch
4) Re-checkout the item
5) The item should now be checked out as if it was checked out from
   the library as defined in the SIP configuration file.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 90307bcbfa)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 57086a241e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:12:34 +02:00
Jonathan Druart 32bf30da9d Bug 16695: Require Exception::Class 1.38 instead of 1.39
Looking at
http://cpansearch.perl.org/src/DROLSKY/Exception-Class-1.40/Changes
there is no need to require 1.39

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a4c44b9f64)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 700fbd0a35)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 11:08:36 +02:00
Jonathan Druart 6f26745c21 Bug 16668: Fix t/Ris.t tests
Caused by bug 16442.
Now we need to mock the marcflavour pref

Test plan:
  prove t/Ris.t
should return green

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 023384811f)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit a1f1ea0317)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:58:50 +02:00
Jonathan Druart 0bd65b6e11 Bug 16199: Remove C4::Ris::charconv
This subroutine always returns what has been sent in parameter.
It is unecessary and can be removed.

Test plan:
  prove t/Ris.t
should not be noisy

Export a catalogue record in Ris should generate the same file with and
without this patch

NOTE: With/Without were identical in my testing.
      t/Ris.t is nicely silenced.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 88dc70f7e6)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:53:35 +02:00
Jonathan Druart eb8c112456 Bug 16578: Same fix for the staff interface
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as first patch
No errors

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3948102f2a)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 43002c3b0e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:44:36 +02:00
Tomas Cohen Arazi 27e63b7867 Bug 16578: Fix wide character errors in opac-export.pl
This simple patch fixes wide character warning raised by opac-export.pl when
'MARC (Unicode/UTF-8)' and 'MARC (Unicode/UTF-8, Standard)' formats are chosen
for downloading records.

To test:
- Have records indexed
- Open your OPAC logs:
  $ tail -f /var/log/koha/kohadev/opac-error.log
- Open the detail page in the opac for a record
- Choose Save record > MARC (Unicode/UTF-8)
=> FAIL: opac-export.pl: Wide character in print at /home/vagrant/kohaclone/opac/opac-export.pl line 116., referer: http://localh...
- Choose Save record > MARC (Unicode/UTF-8, Standard)
=> FAILE opac-export.pl: Wide character in print...
- Apply the patch
- Choose Save record > MARC (Unicode/UTF-8)
=> SUCCESS: No warnings raised.
- Choose Save record > MARC (Unicode/UTF-8, Standard)
=> SUCCESS: No warnings raised.
- Sign off :-D

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7d4844e171)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 164ffdb43c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:44:32 +02:00
Jonathan Druart 0be92bcc01 Bug 16465: Fix typo issues vs checkouts
Test plan:
Confirm the wording is correct

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit af59b66941)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit c5fc0fcd0e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:43:13 +02:00
Jonathan Druart d79a51ae9f Bug 16465: discharge - Add a title tag at the OPAC
Test plan:
Confirm that the opac-discharge.pl has now a title

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 27254de06d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 5ce7baf937)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:43:12 +02:00
Marcel de Rooy ea04333e53 Bug 16428: [QA Follow-up] Useless call to GetMarcStructure in _build_default_values_for_mod_marc
The routine calls GetMarcStructure and does not use its return value
after all.

Test plan:
Run t/db_dependent/Items.t

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6a706b86a2)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit b31ee2eaf9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:41:25 +02:00
Jonathan Druart 9c03081053 Bug 16428: Use the biblio framework to know if a field is mapped
The subroutine _build_default_values_for_mod_marc takes the
frameworkcode in parameter, but ModItemFromMarc did not pass it.
It uses it to know if a field is mapped or not to a Koha field
(C4::Koha::IsKohaFieldLinked).
Consequently the default framework ("") was always used.

This bug has been found working on bug 13074 and has been put on a
separate bug report to ease the backport.

Test plan:
Without this change, the tests added by bug 16428 won't pass

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 52b1b8eae1)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 4ebfb709f6)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:41:21 +02:00
Jonathan Druart 679d0414a0 Bug 16441: Fix Letters.t
These tests were wrong, but the package variable used to cache the
letters hid the problem.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 687a7e22b6)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit a44040d07d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:38:43 +02:00
Jonathan Druart 799ac3cb86 Bug 16441: Do not use a package variable to cache C4::Letters::getletter
C4::Letters::getletter use a package variable (%letter) to cache letter
returned by the subroutine.
I have not found any direct issues caused by that but it is safer to
remove it.
It won't be a big deal to hit the DBMS to get a valid letter when
needed.

No test plan here, just confirm that the changes make sense.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Confirm that performance loss is just a millisecond or so per
subsequent call of getletter.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c4f388f649)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit c63dccba27)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:38:42 +02:00
Marcel de Rooy bf40e2b333 Bug 16443: [QA Follow-up] Add two tests for get_fields
Adds t/db_dependent/Members/Statistics.t.

Test plan:
Run the test.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 30cf9ee277)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 03d51281b0)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:31:38 +02:00
Jonathan Druart bd17c1f874 Bug 16443: Make C4::Members::Statistics plack safe
If the prefs is updated, the fields won't be.
To make sure we already fetch updated values, we should remove the
package variable and define it in the subroutine.

There is not test plan, just make sure the changes are consistent.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 29e402d398)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 93ffd58fe3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:31:37 +02:00
Jonathan Druart 2074138283 Bug 16455: Remove the "Too late to run INIT block" from C4::Tags
The pref TagsExternalDictionary is used to tell Lingua::Ispell to use an
other dictionary, different from the default one (/usr/bin/ispell).

To do so we need to set $Lingua::Ispell::path to the expected path.
It's currently done in the INIT block.

If you try to use C4::Tags, you will get the famous "Too late to run
INIT block at C4/Tags.pm line 74." warning. Plack use the INIT block to
load functions at run time, when we are using C4::Tags when hitting a pl
script, the compilation phase is finished and it's "too late to run INIT
block" from C4::Tags.

I do not really know if it has an impact on the behavior of
Lingua::Ispell (i.e. is the path redefined?), but I know that this INIT
block is not executed when we want.

Test plan:
under Plack,
- hit /cgi-bin/koha/opac-search.pl and confirm that the warning does no
longer appears
- Use another dictionnary (??), fill TagsExternalDictionary with its
  path and confirm that it is used by the tags approval system

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 7d916c380a)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 6ff159e214)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:30:47 +02:00
Jonathan Druart 13bb412c73 Bug 16508: Updating a syspref requires parameters_remaining_permissions
And not all of parameters flags.

Test plan:
1/ Create a staff user.
2/ Go to details, select more->set permissions.
3/ Set catalogue, Manage Koha system settings (Administration panel),
manage circulation rules, and Remaining system parameters permissions.
4/ Log in as the new staff user, go to administration > system
preferences. Change a syspref and save it... it will save correctly.
5/ Log back in as superlibrarian
6/ On the 'set permissions' screen, un-check 'manage circulation rules'
and save.
7/ Log back in to the new staff user, and try to change the same
systemprefrence and save.

Followed test plan, works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit f2fe433cf9)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 259fe9947b)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:28:16 +02:00
Jonathan Druart 37a0ba4f10 Bug 16518: Fix Plack variable scoping problem in opac-addbybiblionumber.pl
The script opac/opac-addbybiblionumber.pl is not plack safe because the
variable @biblios is declared with our and is not assigned to an empty
array (so not reset).

The issue:
When trying to add items to a list (virtualshelf), the biblionumbers are
added to the @biblios variable and the list is not reset between each
run.

Test plan:
Check from records from the result list and add them
to a list.
Cancel or save and re-add them (or others) to a list (same or
different).
=> Without this patch, the list of records will never stop growing, the
previous items added are still listed when adding new ones.
=> With this patch, the behavior is the one expected.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit ab1beed06f)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 2729f038c3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:27:30 +02:00
Aliki Pavlidou 825d496194 Bug 15641 - Typo in explanation for MembershipExpiryDaysNotice
There's an extra period after the word "in" in the MembershipExpiryDaysNotice
sys "Send an account expiration notice when a patron's card will expire in.
[value box

Bug fixed!

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 6b7f4a3a9e)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit e242625721)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:26:14 +02:00
Rocio Dressler 20cbdd2311 Bug 16537 - Overdue and Status triggers grammar
Test plan:

1) Go to the staff client
2) Click on Tools - Overdue notice/status triggers
3) Confirm that the first sentence reads "a" checkout rather than "an" checkout

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit a589879f49)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 020d755ed0)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:25:09 +02:00
Jonathan Druart 73df494cca Bug 16444: Make C4::Tags plack safe
C4::Tags use a package variable to cache the pref
TagsExternalDictionary, it's not needed and not safe.

There is not test plan, just make sure the changes are consistent.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit fff754a7fc)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 97a3f03970)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:23:52 +02:00
Jonathan Druart 2bb2e2520c Bug 16458: Update library when a guarantor is set
If you edit a patron from the Edit link of the patron information block
(step 1 of the memberentry script), the branchcode is not displayed. If
you set a guarantor to a child from this form, a JavaScript error will
be raised:
  JavaScript error form.branchcode is undefined

It happens because there is the branchcode is not displayed and there is
no element with a branchcode name.

To avoid this issue, a branchcode hidden input is added to the form and
it will be updated when a guarantor is selected (same behavior as when
you edit a patron using the complete form).

Test plan:
Edit a patron using the Edit link of the patron info block (not the Edit
button in the toolbar)
Set a guarantor
=> Notice that the branchcode of the patron has been updated with the
branchcode of the guarantor

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit fc35a5099f)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit b7a0322258)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:21:16 +02:00
Jonathan Druart b5934c48ad Bug 16442: Make C4::Ris plack safe
C4::Ris incorrectly uses 4 package variables:
- $utf: not used, can be removed
- $intype: set to marcflavour once, but later it assumes that it is
  usmarc if not defined
- $marcprint: always 0, so set it to 0
- $protoyear: only used in 1 subroutine, let's define it at this
  level

Test plan:
Just make sure the RIS export works as before this patch

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 87b181c6d4)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit a987ff3ba9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:05:36 +02:00
Claire Gravely 5976b4f16f Bug 16642 - Fix capitalisation for upload patron image
To fix capitalisation on the staff interface when patronimages is turned on.

Test plan:
1. In staff interface. Turn on patronimages sys preference.
2. Go to a patron without an image and check that the "Upload
 patron image" box heading now has correct capitalisation.
3. Go to a patron with an image already uploaded and check the
 "Manage patron image" box heading has correct capitalisation.

Signed-off-by: Sofia <szapoun@lib.auth.gr>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 78b2fde348)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 9a2c6bfde2)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:04:17 +02:00
Jonathan Druart 8f8ba80f2e Bug 16565: Drop additional_fields and additional_field_values before creating them
These 2 tables should be dropped before trying to create them

Test plan:
From the SQL CLI, source the kohastructure.sql file
source it again
=> Without this patch you get 2 warnings
ERROR 1050 (42S01) at line 3580 in file:
'installer/data/mysql/kohastructure.sql': Table
'additional_fields' already exi
sts
ERROR 1050 (42S01) at line 3596 in file:
'installer/data/mysql/kohastructure.sql': Table
'additional_field_values' alrea
dy exists

=> With this patch, you won't get them

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit a01cd77e19)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit b49adab4a1)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 10:03:45 +02:00
Mark Tompsett 2131a6dec2 Bug 16582 t/Price.t test should pass if Test::DBIx::Class is not available
TEST PLAN
---------
1) prove t/Prices.t
   -- failure
2) apply patch
3) prove t/Prices.t
   -- nicely skipped when Test::DBIx::Class is not available.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 5ba5f9e0c5)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 6523236123)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 09:59:20 +02:00
Kyle M Hall 3cd0ac25fa Bug 16610 - Regression in SIP2 user password handling
Previous to bug 14507, SIP2 only did internal authentication. A change
to the way we check empty passwords has caused any empty password to
send back a CQ of Y. Previous to that patch set, a CQ of Y would only be
sent back of the patron password column was NULL. Now, an empty AD field
*always* returns a CQ of Y.

Test Plan:
1) Send a patron information request with an empty AD field
   Note: You must send the AD field or you won't get back a CQ field
2) Note you get back a CQ of Y
3) Apply this patch
4) Repeat step 1
5) Note you now get back a CQ of N

Signed-off-by: Trent Roby <troby@bclib.info>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 71f0370ddd)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 66c9ef12c1)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 09:55:13 +02:00
Marcel de Rooy 8d9a4841e4 Bug 16504: [QA Follow-up] Make koha-qa happy with two newlines
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 567a1a9021)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 5712275a46)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 09:52:17 +02:00
Jonathan Druart ea598df624 Bug 16504: (follow-up for bug 15163) Do not remove attributes of other patrons
Simple patch for a silly error, this single line is going to fix a
critical bug.
If a patron attribute is limited to a library, all the values for that attributes
for every patrons will be deleted.

Test plan:
Create a patron attribute limited to a library
Set the the attribute for a patron
Set the the attribute for another patron
=> Without this patch applied, the attribute's value for the first
patron is deleted
=> With this patch applied, the 2 values exist in the DB after the
second edition

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit da94410ab5)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 247bd55876)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 09:52:12 +02:00
Jonathan Druart fc2776a5c9 Bug 16504: Add regression tests
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 72bd06e3a8)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 5949faae07)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 09:52:08 +02:00
Aleisha 26cd82e15c Bug 16511: Making contracts actions buttons
To test:
1) Go to Acqui -> find a vendor
2) On Vendor details page (supplier.pl) confirm that Contracts table now
   has one column called Actions
3) Confirm that Edit and Delete show as buttons
4) Confirm that buttons don't wrap on a narrower browser
5) Click Contracts tab
6) Confirm Actions column, Edit and Delete buttons, and button's don't
   wrap

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

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 23c8dc0e63)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 92c08a6a4e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 09:44:55 +02:00
Aleisha be21661a31 Bug 16525: Have cancel button when adding new aq budget
At the moment you only see the cancel button on the form if editing an
existing budget. This patch adds a cancel button to the form which adds
a budget. Also changes the wording of the save button from 'Save
changes' to just 'Save' so it makes more sense when adding a new budget

To test:
1) Go to Admin -> Budgets -> New budget
2) Notice 'Save changes' button and no cancel
3) Apply patch and refresh page
4) Notice 'Save' button and 'cancel' link
5) Click 'cancel' - should be taken to Budgets administration page
6) Edit an existing budget
7) Click 'cancel' - should be taken to the funds page for that budget

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

Signed-off-by: Sabine Liebmann <Liebmann@dipf.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Still an issue: If edit a budget fron aqbudgets.pl, then cancel, you get
aqbudgets.pl?budget_period_id=XX. But existed before this patch.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit c4f17a6eb3)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 0c4661110c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 09:41:22 +02:00
Owen Leonard e876a7112b Bug 16001 - Use standard message dialog when there are no cities to list
If there are no existing cities in Administration -> Cities and Towns,
the message saying so should be in the standard message dialog.

Another minor change: Edit the message to say "There are no cities
defined," which I think reads better in English.

To test you must have no cities and towns defined.

Apply this patch and go to Administration -> Cities and Towns. You
should see a message displayed in a standard "message" style dialog.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Better view, no errors

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 89b41ede65)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 300cfc1ac8)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 09:38:36 +02:00