koha.git
8 years agoBug 5685: Validation of email address field
Juhani Seppälä [Fri, 15 Aug 2014 09:11:17 +0000 (12:11 +0300)]
Bug 5685: Validation of email address field

This patch adds server-side & client-side validation for email
form fields in the members/memberentry -view and in the
opac/memberentry-view (bootstrap).

I recently added simple validation for phone number and email address fields
for our in-house koha and saw this old bug: I'm open to any ideas on how
to do this better. Validation for phone numbers would be easy to add on
top of this but I left it out since this bug is only about the email
fields.

To test:
1) Select a member and go to any of the edit forms with email fields
(Primary info, "Library use", "Alternate address", "Alternative
contact").
2) Disable javascript in the browser in order to test server-side
validation and try to input invalid emails in each of the email form
fields.
3) Confirm that an invalid address is catched from any of the email
fields, an alert shown for each invalid address and that the member's
information was not updated with invalid data.
4) Enable javascript in the browser.
5) Confirm that the jquery validation plugin caches invalid addresses
from any of the email fields and that you cannot send the form before
correcting the problem.
6) Perform the same tests for the opac-memberentry-view.

Note: as the jQuery validation plugin doesn't exist in the bootstrap
folder, I just copied it over from the staff-client folder -how to deal
with this?

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I have undone the changes to opac.css so that they can be submitted as a
separate patch. I have some other follow-ups to make as well.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14387: Merge reference selection has no effect when merging authorities.
mxbeaulieu [Mon, 15 Jun 2015 15:05:51 +0000 (11:05 -0400)]
Bug 14387: Merge reference selection has no effect when merging authorities.

This patch swaps the authority records according to the refenrece record selection.

To TEST:
Merge two authority records, select the second as merge reference.
The reference authority is always the first.

Apply the patch.
Repeat previous steps, the authority is now merged using the selected reference record.

modified:   authorities/merge.pl

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 11693: Default emailing preferences not loaded for self registering patron
Marcel de Rooy [Sun, 5 Jul 2015 11:17:02 +0000 (13:17 +0200)]
Bug 11693: Default emailing preferences not loaded for self registering patron

The call to AddMember_Opac does not take care of the messaging prefs
when enhanced messaging is enabled.
This patch adds the call to handle_form_action to do that.

Test plan:
Enable self registering patrons and enhanced messaging.
Check the (default) message prefs for the relevant patron category. At least
enable email for one notice.
Self-register a user with and without verification email enabled.
Check in both cases that the message prefs of the user conform to
those in the patron category. (So at least one enabled.)

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: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 8684: Add regression tests for SearchItemsByField
Jonathan Druart [Mon, 13 Apr 2015 08:12:03 +0000 (10:12 +0200)]
Bug 8684: Add regression tests for SearchItemsByField

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 8684: Fix duplicate check on creating items in the acquisition module
Jonathan Druart [Tue, 7 Apr 2015 12:14:18 +0000 (14:14 +0200)]
Bug 8684: Fix duplicate check on creating items in the acquisition module

The script acqui/check_uniqueness.pl has been introduced by bug 7178.
But bug 11425 added a call to a new subroutine SearchItemsByField in
order to refactore some code. This subroutine calls SearchItems with an
arrayref, which is not what SearchItems is expecting.
This broke the duplicate check done on creating items in the acquisition
module.

To reproduce the issue:
1/ Fill the pref UniqueItemFields with "barcode" and AcqCreateItem with
"placing an order"
2/ Create a new basket
3/ Create a new order
4/ Close the basket
5/ Receive items and set barcode with one already in your DB
6/ Save
7/ Nothing happen on the interface, but an error should have been added
in your Koha log file:
  Can't use an undefined value as an ARRAY reference at
  /home/koha/src/acqui/check_uniqueness.pl line 48.

Test plan:
1/ Repeat steps 1-6
2/ You should see a warning on the interface

Note that this should also happen with AcqCreateItem set to "creating an
order".

Works well, no errors.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields
Jacek Ablewicz [Wed, 24 Jun 2015 17:43:05 +0000 (19:43 +0200)]
Bug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields

If the system preference IncludeSeeFromInSearches is enabled, records
exported for zebra indexing are being additionally processed by
EmbedSeeFromHeadings record filter (right now used only in rebuild_zebra.pl
script). This filter embeds 'see from' fields (extracted from authority
records linked with the given biblio via $9 subfields) into target MARC
record, which is then subsequently indexed in zebra.

Currently all fields containing $9 are getting the same exact treatment
by this filter. But on the export stage when the filter is applied, MARC
record being processed already does have holdings data fields added in
the previous stage (usually 952 / 995, depending on the MARC format).
Problem is that holdings data fields use to have $9 subfields in them
as well (mapped to item.itemnumber by default). As a consequence, some
(great many in the typical setup) records exported for zebra indexing
may have surplus "see from" fields added erroneously in semi-random
fashion, so biblio searches would often return some completely
unexpected additional results.

EmbedSeeFromHeadings record filter should not process holdings fields
when dealing with MARC records intended for zebra indexing.

To reproduce:

1) database with as many sample or real-world biblio, item and authority
records as possible is recommended for testing purposes
2) enable IncludeSeeFromInSearches
3) export a bunch of biblio records for zebra (e.g.:
misc/migration_tools/rebuild_zebra.pl -I -b -x -k -length=1000),
inspect the result xml records in /tmp/<whatever> file; observe that at
the end of many records, here and there some extra "see from" (= 1st
indicator: 'z') fields tend to appear, which shouldn't be there ;)

To test:

4) apply patch
5) redo 3)
6) compare results from 3) and 5) with diff

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I introduced a regression test for this. You should run the tests
without/with the patch and verify that the patch actually fixes the problem.
Good job Jacek! I'm sure writing the regression test would take less time
than such a detailed commit message!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings
Tomas Cohen Arazi [Wed, 22 Jul 2015 14:22:20 +0000 (11:22 -0300)]
Bug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings

This patch introduces a regression test for the situation in which
an itemnumber on a record matches the authid of an authority record
and the current implementation of the EmbedSeeFromHeadings filter
wrongly includes new holding fields with authority data...

To test:
- Apply the patch
- Run:
  $ prove t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t
=> FAIL: The test 'Holdings fields not processed to introduce See-from heading'
   fails.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14545: Typo in help file (stage-marc-import.tt)
Hector Castro [Fri, 17 Jul 2015 19:42:38 +0000 (13:42 -0600)]
Bug 14545: Typo in help file (stage-marc-import.tt)

Typo found in stage-marc-import.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/stage-marc-import.tt:28' and check the typo "precendence" or go to Tools > Stage MARC records for import and open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14569: Typo borroewr|borow
Marcel de Rooy [Mon, 20 Jul 2015 09:38:56 +0000 (11:38 +0200)]
Bug 14569: Typo borroewr|borow

Trivial correction. Only touches comments.

Test plan:
Run git grep -E "borroewr|borow". You should not find anything now.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Typos in comments corrected.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14167: remove the log4perl.conf file from /etc for packages
Robin Sheat [Thu, 23 Jul 2015 23:36:38 +0000 (11:36 +1200)]
Bug 14167: remove the log4perl.conf file from /etc for packages

We don't need that file in the package build because it's generated on a
per-site basis from a template.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14167: package dependencies for Log::Log4perl
Robin Sheat [Thu, 23 Jul 2015 23:14:25 +0000 (11:14 +1200)]
Bug 14167: package dependencies for Log::Log4perl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14167: (QA followup) new entries in koha-conf.xml should be tested in about.pl
Tomas Cohen Arazi [Tue, 21 Jul 2015 14:54:17 +0000 (11:54 -0300)]
Bug 14167: (QA followup) new entries in koha-conf.xml should be tested in about.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) use warn instead of just STDERR
Tomas Cohen Arazi [Tue, 21 Jul 2015 13:50:17 +0000 (10:50 -0300)]
Bug 14167: (QA followup) use warn instead of just STDERR

This patch makes Koha::Logger use 'warn' instead of just printing
to STDERR. It introduces tests for this warnings too.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Tidy Koha/Logger.pm
Kyle M Hall [Thu, 25 Jun 2015 18:23:48 +0000 (14:23 -0400)]
Bug 14167: (QA followup) Tidy Koha/Logger.pm

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: Add a unit test for Koha::Logger
Marcel de Rooy [Fri, 26 Jun 2015 12:22:04 +0000 (14:22 +0200)]
Bug 14167: Add a unit test for Koha::Logger

Test plan:
Run the test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Making Koha::Logger bit more crash resistant
Marcel de Rooy [Fri, 26 Jun 2015 12:12:20 +0000 (14:12 +0200)]
Bug 14167: (QA followup) Making Koha::Logger bit more crash resistant

Moving the BEGIN block to _init for the most part. We only need to
initialize when we actually start using the logger.
Removed the third init part. If we do not have a log4perl_conf in the
koha config, we are not using it yet.
Method get uses hash parameters now. It calls init. If we do not have a
config or the logfile is not writable, we will not use log4perl.
Using AUTOLOAD as a wrapper around Log4perl in order to add some checks
that log4perl does not have.
If a logrotate would change file permissions on a default logfile, we
should catch that now too (see recheck).

Test plan:
Run the previous tests again.
Will still add a unit test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Embed default config into Koha::Logger
Kyle M Hall [Tue, 16 Jun 2015 17:32:53 +0000 (13:32 -0400)]
Bug 14167: (QA followup) Embed default config into Koha::Logger

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Add template and changes needed for packages
Kyle M Hall [Thu, 14 May 2015 11:04:19 +0000 (07:04 -0400)]
Bug 14167: (QA followup) Add template and changes needed for packages

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: upgraded DEBUG level to WARN in config file.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Adjust category handling in Koha::Logger
Marcel de Rooy [Fri, 5 Jun 2015 08:08:22 +0000 (10:08 +0200)]
Bug 14167: (QA followup) Adjust category handling in Koha::Logger

The first patch makes the category parameter mandatory.
This patch makes it optional, falling back to the current package. This is
the expected log4perl model. It would not be necessary to pass the class
name everywhere (check subclasses..)
It also adds a delimiter between the interface and the class name.

This allows you to add config lines like:

log4perl.logger.opac.C4.Auth = DEBUG, OPAC
log4perl.logger.intranet.C4.Circulation = TRACE, INTRANET

The first line would make the logger more sensitive to C4::Auth log
messages while staying at the WARN level for other messages, etc. The
second line makes the trace visible from the renewal example.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: Add Koha::Logger based on Log4perl
Kyle M Hall [Thu, 7 May 2015 15:20:50 +0000 (11:20 -0400)]
Bug 14167: Add Koha::Logger based on Log4perl

Koha needs a better logger, and it seems like the best solution would be
to take advantage of Log4perl which is already a fully featured logger.
We use Log4perl to selectively decide what statements should be logged,
and where they should go!

Test plan:
0) Install Log::Log4perl via packages or cpan
1) Apply this patch and the example renewal patch
2) Copy etc/log4perl.conf to your koha conf directory, edit the paths
   to match your current error logs
3) Edit your koha-conf file and add the
   <log4perl_conf>/path/to/log4perl.conf</log4perl_conf> line
4) Watch your intranet and opac error logs
5) Perform a renewal via the staff interface, note there is nothing new
   in the log file
7) Update the log4perl.conf, change the log level from WARN to TRACE
   for both the staff and opac sides
8) Perform a renewal via the staff interface, note the logged lines
9) Perform a renewal via the opac, note the logged lines

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended this patch: Moved the renewal stuff to a separate example patch.
And upgraded the DEBUG level to WARN in the log4perl config file.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12137: DBRev 3.21.00.015
Tomas Cohen Arazi [Mon, 20 Jul 2015 14:01:38 +0000 (11:01 -0300)]
Bug 12137: DBRev 3.21.00.015

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12137: Use Koha.Preference to access pref value
Jonathan Druart [Mon, 22 Jun 2015 13:45:13 +0000 (15:45 +0200)]
Bug 12137: Use Koha.Preference to access pref value

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
8 years agoBug 12137: followup sort <select> index by value
Indranil Das Gupta [Sat, 20 Jun 2015 12:52:32 +0000 (18:22 +0530)]
Bug 12137: followup sort <select> index by value

adds alphabetical sorting to <select> lists displayed by
preferences.tt. although added for sorting the days of the
week, this may have larger ramifications. haven't been
tested thoroughly, but no apparent breakage seems to be
happening in preferences.

NOTE: Nice tweak. Makes days of week in sensible order.
      Properly adds sorting based on documentation that
      is really hard to find.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
8 years agoBug 12137: Extend CalendarFirstDayOfWeek to be any day
Mark Tompsett [Thu, 24 Apr 2014 23:09:31 +0000 (19:09 -0400)]
Bug 12137: Extend CalendarFirstDayOfWeek to be any day

Mubassir Ahsan asked on the Koha mailing list:
Is there any option to set Saturday as the first day of
the week? Please help me.

CalendarFirstDayOfWeek is currently either Sunday|Monday.

By converting it to 0|1|2|3|4|5|6
(Sunday, Monday, ..., Saturday), we can allow any day of the
week to be the first day of the week in the date picker.

TEST PLAN
---------
1) Backup DB
2) In mysql:
   > DELETE FROM systempreferences;
   > SOURCE .../installer/data/mysql/sysprefs.sql
   > SELECT variable,value FROM systempreferences;
   -- It should say 'CalendarFirstDayOfWeek' and '0'
      May say '1' if you are using Norwegian.
3) Restore your DB
4) .../installer/data/mysql/updatedatabase.pl
   -- If your previous value for 'CalendarFirstDayOfWeek' was
      'Sunday', it should be '0'. For 'Monday', it should be '1'.
5) Test an installation with 'de-DE' as the language.
   -- The default value should be '1'.
6) Test an installation with 'nb-NO' as the language.
   -- The default value should be '1'.
7) In the staff client, confirm that any day of the week is
   available in the I18N/L10N system preferences for the
   CalendarFirstDayOfWeek dropdown.
   -- I'm aware they aren't in order, but I'm after
      functionality, not finesse.
8) In another tab, go to a staff place that has a datepicker.
   For example, Home -> Tools -> Inventory/stocktaking
9) For each possible value in the CalendarFirstDayOfWeek,
   go to the other tab, refresh the page after updating the
   system preference, and click the datepicker icon.
   -- The date picker should then start on the selected
      day of the week.
10) Log into OPAC
    -- This may require setting: opacuserlogin to 'Allow'.
11) Click the personal details tab on the left.
12) There is a date picker for the date of birth.
    -- The date picker should then start on the selected
       day of the week.
13) Run koha QA test tools.

NOTE: not an atomic update, since this is an old patch.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12054: Inactive vendors should be inactive
Jonathan Druart [Tue, 28 Apr 2015 08:10:56 +0000 (10:10 +0200)]
Bug 12054: Inactive vendors should be inactive

This patch make inactive vendors really inactive.
That means an inactive vendor would not be able to add a basket / add an order.

Revised test plan
=================

1/ In the acquisition module create 2 vendors: 1 active and 1 inactive.

2/ On the acqui/booksellers.pl, acqui/uncertainprice.pl,
   admin/aqcontract.pl and acqui/supplier.pl (pages which include the
   acq toolbar), you should be able to, for both the 'active' as well
   as the inactive vendor :
     (a) add new basket
     (b) add order items to the basket

   Remark: This is *wrong*. You should be able to do so only for active
           vendor.

3/ Apply the patch

4/ Go to the links in step #2 above and select the inactive vendor
   you should no longer be able to:
   (a) add new basket
   (b) add order items to the basket

   Remark: This is the *correct* behaviour

5/ No change should be noted for vendor marked "active", and should
   be able to undertake operations 4 (a), 4 (b) and 4 (c).

   Remark: This is the *correct* behaviour.

6/ run koha qa tests tool

Bug 12054: (follow-up) Inactive vendors should be inactive

Don't display "add order""block and buttons if the vendor is inactive.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14404: Rename class no-show to noshow for consistency with nosort
Jonathan Druart [Thu, 9 Jul 2015 09:31:07 +0000 (10:31 +0100)]
Bug 14404: Rename class no-show to noshow for consistency with nosort

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14404: Checkouts default sort order for Self Checkout (SCO) confusing for patrons
Kyle M Hall [Tue, 16 Jun 2015 23:05:10 +0000 (19:05 -0400)]
Bug 14404: Checkouts default sort order for Self Checkout (SCO) confusing for patrons

Libraries are reporting that patrons are very confused during
self-checkout. The problem is they are expecting the list of checkouts
to be in the order they checked out the items ( first checkout on the
bottom, last item checked out on top ). However, the checkouts
table is sorted by title ( ascending ) then due date ( descending ).
This is not intuitive.

Test Plan:
1) Enable Koha's self checkout
2) Use the SCO to check out a random assortment of items,
   make sure you don't check them out in alphabetical order
3) Note the order of the items in the list is not based on the order
   you checked them out in
4) Apply this patch
5) Refresh the page
6) Note the items are now in the order you checked them out
   with the last on top and the first on bottom

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14445: Silences warns in letter.tt
Aleisha [Wed, 1 Jul 2015 01:36:00 +0000 (01:36 +0000)]
Bug 14445: Silences warns in letter.tt

When creating a new notice, warn is triggered "Argument "" isn't numeric in numeric gt (>) at line 400". Same warn is triggered when changing Koha module option to any other module.

To test:
1) Go to Tools, then Notices & Slips
2) Click 'new notice'. Notice warn in intranet-error.log
3) Change Koha module to another module. Notice warn is triggered for every change
4) Apply patch and reload page
5) Change Koha module to another module. Notice there are no longer warns
6) Go back to Notices & Slips and click 'new notice' again. Notice there are no warns

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14445: Silences warn in letter.pl
Aleisha [Wed, 24 Jun 2015 01:15:32 +0000 (01:15 +0000)]
Bug 14445: Silences warn in letter.pl

When changing Koha module to 'Circulation', there is a warn saying that $code is uninitialized. This patch sets $code to an empty string to silence the warn.

To test:
1) Go to Tools, the Notices & Slips
2) Click 'new notice' (This will trigger warns, but ignore these as they will be corrected in the next patch)
3) Change Koha module to 'Circulation'
4) Notice warn about uninitialized $code variable
5) Apply patch and reload page, change Koha module to 'Circulation'
6) Notice page still works and warns are gone

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14121: Silence warnings t/db_dependent/Auth_with_cas.t
Mark Tompsett [Wed, 27 May 2015 20:11:38 +0000 (16:11 -0400)]
Bug 14121: Silence warnings t/db_dependent/Auth_with_cas.t

TEST PLAN
---------
1) $ prove t/db_dependent/Auth_with_cas.t
   -- CGI security warning
2) apply patch
3) $ prove t/db_dependent/Auth_with_cas.t
   -- no noise.
4) koha qa test tools

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Not able to reproduce the error on my setup, but the code
is a clear improvement over the previous version.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11620: Add dissertation-information index for MARC21 (502)
Katrin Fischer [Mon, 25 May 2015 11:58:57 +0000 (13:58 +0200)]
Bug 11620: Add dissertation-information index for MARC21 (502)

Bug 11202 introduced a new index 'dissertation-information' for
UNIMARC. This patch adds the index also for MARC21 installations.

http://www.loc.gov/marc/bibliographic/bd502.html

To test:
- Apply patch
- Copy files in etc/zebradb changed by this patch to your
  corresponding directory (koha-dev..)
- Make sure you have records with 502
- Reindex
- Verify you can search the field contents with
  dissertation-information= and
  diss=

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Can find by dissertation-information,
No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12352: Patron modification request page: Add link to patron record
Katrin Fischer [Tue, 9 Jun 2015 23:43:22 +0000 (01:43 +0200)]
Bug 12352: Patron modification request page: Add link to patron record

The patron modification request page in the staff client does show
the name and home library of a patron, but there is no way to
go to the patron record. This patch adds a link to the patron details.

Extras: changes display of patron name, so a missing firstname won't
result in an extra , showing.

To test:
- Make some update requests from different patron accounts in the OPAC
- Go to the patron modification request page in staff
- Verify a link 'Patron details' now shows on each entry and
  works correctly

Followed test plan. Works as expected. QA tools OK.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Not sure the "Patron details" link is at the best place, but I don't
have something better to suggest.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14524: Don't escape query_cgi with uri
Jonathan Druart [Mon, 13 Jul 2015 14:44:23 +0000 (15:44 +0100)]
Bug 14524: Don't escape query_cgi with uri

According to the doc, we should not escape query_cgi with the uri
filter:
http://www.template-toolkit.org/docs/manual/Filters.html#section_uri

Since query_cgi can contains something like: "idx=kw&q=42", we should
not escape the & char

Test plan:
0/ Don't apply the patch
1/ Go on launch a search at the OPAC
2/ Click on the RSS icon
3/ You should arrive on
opac-search.pl?idx%3Dkw%26q%3D42&count=50&sort_by=acqdate_dsc&format=rss2
The & has been escaped.
4/ Apply the patch
5/ Now you should get result and see an url correctly formatted.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14494: Add some unit tests too for CalcDateDue
Marcel de Rooy [Thu, 9 Jul 2015 13:35:53 +0000 (15:35 +0200)]
Bug 14494: Add some unit tests too for CalcDateDue

The second patch of this report made some changes to CalcDateDue.
We are adding some unit tests here.
See the commments on the third patch too.

Test plan:
Run t/db_dependent/Circulation_dateexpiry.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Set the number of tests for the second subtest (was
commented) and perltidy the second block.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14494: Unit tests for CanBookBeIssued related to dateexpiry
Jonathan Druart [Thu, 9 Jul 2015 08:52:28 +0000 (09:52 +0100)]
Bug 14494: Unit tests for CanBookBeIssued related to dateexpiry

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Moved the test on its own. Nicer than adding TestBuilder in the final part
of the test. No warnings/errors from TestBuilder, no dependency..

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14494: Terribly slow checkout caused by DateTime->new in far future
Marcel de Rooy [Mon, 6 Jul 2015 12:20:07 +0000 (14:20 +0200)]
Bug 14494: Terribly slow checkout caused by DateTime->new in far future

An expiry date like 9999-12-31 in the local timezone will make DateTime
spend a lot of time (maybe 60 seconds) on date calculation. See the
DateTime documention on CPAN.
A calculation in floating (or alternatively in UTC) would only take
a few milliseconds.

This patch makes two changes in this regard:

[1] The compare between expiry date and today in CanBookBeIssued has been
    adjusted in Jonathan's patch. I am moving the compare to the floating
    timezone (as was done in my original patch). This removes a hardcoded
    9999.
[2] If ReturnBeforeExpiry is enabled, CalcDateDue compares the normal due
    date with the expiry date. The comparison is now done in the floating
    timezone. If the expiry date is before the due date, it is
    returned in the user context's timezone.

NOTE: The calls to set_time_zone moving to or from floating do not adjust
the local time.

TEST PLAN:
First without this patch (and the one from Jonathan):
[1] Set expiry date to 9999-12-31 for a patron.
[2] Enable ReturnBeforeExpiry.
[3] Checkout a book to this patron. This will be (very) slow.

Continue now with this patch applied:
[4] Check in the same book.
[5] Check it out again. Should be much faster.

Bonus test:
[6] Set borrower expiry date to today. Change relevant circulation rule
    to loan period of 21 hours. Test checking out with a manual due date
    /time just before today 23:59 and after that. In the second case the
    due date/time should become today 23:59 (note that 23:59 is not
    shown on the checkout form).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14494: Prevent slow checkout if the patron does not have an expiry date
Jonathan Druart [Thu, 9 Jul 2015 08:52:28 +0000 (09:52 +0100)]
Bug 14494: Prevent slow checkout if the patron does not have an expiry date

If a patron has a expiry date set to 9999-12-31 (for organizations for
instance), the checkouts are very slow.

It's caused by 2 different calls to DateTime in CanBookBeIssued:
1/
  DateTime->new( year => 9999, month => 12, day => 31, time_zone => C4::Context->tz );
The time_zone should not be set (as it's done in Koha::DateUtils), set to UTC or floating tz.

2/
  DateTime->compare($today, $expiry_dt)
The comparaison of 2 DT with 1 related to 9999 is very slow, as you can
imagine.

For 1/ we need to call Koha::DateUtils::dt_from_string (actually, we
should never call DateTime directly).
For 2/ we just need to test if the date is != 9999, no need to compare
it in this case.

Test plan:
Before this patch, confirm that the checkouts are slow if the patron has a
dateexpiry set to 9999-12-31.
update borrowers set dateexpiry="9999-12-31" where borrowernumber=42;

After this patch, you should not see any regression when checking out
items to an expired patron and to a valid patron.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14521: SQL injection in local use system preferences
David Cook [Mon, 13 Jul 2015 04:06:46 +0000 (14:06 +1000)]
Bug 14521: SQL injection in local use system preferences

This patch fixes a SQL injection vulnerability in the local use
system preferences.

_TEST PLAN_

Before applying:

1) Go to Global System Preferences
2) Click on the "Local use" tab
3) Add a new preference with the value "') or '1' = '1' -- "
(be sure to include the space at the end after the comment --).
4) When the page refreshes, you should now see about 99 other system
preferences which shouldn't be showing up.

5) Apply the patch

6) Refresh the page
7) Note that you now only see a system preference for "') or '1' = '1' -- "
and the other actual local use system preferences.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14436: Noisy warns in C4/Utils/DataTables/Members.pm
Aleisha [Fri, 10 Jul 2015 14:31:53 +0000 (10:31 -0400)]
Bug 14436: Noisy warns in C4/Utils/DataTables/Members.pm

TEST PLAN
---------
1) Backup the koha intranet error log.
2) Empty the koha intranet error log.
3) In staff client, go to Patrons
   (/cgi-bin/koha/members/members-home.pl)
4) Pick any letter to 'Browse by last name'
   -- koha intranet error log now has warns.
   -- the one of importance is the uninitalized value.
5) Empty the koha intranet error log.
6) apply this patch
7) Repeat steps 3 & 4.
   -- koha intranet error log does not contain the
      uninitialized value error.
8) run koha qa test tools.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 9006: Remove AUTOLOAD in C4::Context
Jonathan Druart [Wed, 1 Apr 2015 11:58:50 +0000 (13:58 +0200)]
Bug 9006: Remove AUTOLOAD in C4::Context

Happily this was only used for intranetdir.
It's time to remove it and replace existing calls.

I used the following commands to catch calls to C4::Context:
git grep 'C4::Context\->' | grep -v 'C4::Context->preference' | grep -v
'C4::Context->config' | grep -v  'C4::Context->userenv' | grep -v
'C4::Context->IsSuperLibrarian' | grep -v 'C4::Context->dbh' | grep -v
'C4::Context->set_preference' | grep -v '_syspref_cache' | grep -v
_userenv | grep -v 'C4::Context->interface' | grep -v
'C4::Context->Zconn' | grep -v 'C4::Context->queryparser' | grep -v
'C4::Context->tz' | grep -v 'C4::Context->boolean_preference' | grep -v
'C4::Context->memcached'

NOTE: I applied 14428, and then did what I suggested in comment #2.
      Only intranetdir references appeared.

      I applied this patch, and repeated.
      Nothing appeared. This means the autoload references are
      properly removed.

      koha qa test tools complained about whitespace, I just fixed
      those. Though, we may wish to perltidy
      auth_fields_substructure.pl on another bug.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14449: Add authentication check on retrieving item info when receiving
Jonathan Druart [Wed, 24 Jun 2015 09:24:14 +0000 (11:24 +0200)]
Bug 14449: Add authentication check on retrieving item info when receiving

The script catalogue/getitem-ajax.pl is called by acqui/orderreceive.pl
when item is receipt.
There is not auth check done, this means anybody can retrieve item info.

Test plan:
With the acquisition => order_receive permission, try to receive an
item.
It should work.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Very easy to test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14303: Fix item search CSV export - obsolete "by" and display of publication...
Katrin Fischer [Tue, 9 Jun 2015 00:44:48 +0000 (02:44 +0200)]
Bug 14303: Fix item search CSV export - obsolete "by" and display of publication year for MARC21

The exported CSV file from the item search didn't display the publication
year in MARC21 installations and the title always contained 'by'
even if there was no author information to display. Also the by is
not needed by MARC21 as the data should include punctuation.

This basically copies the changes done to the JSON format
on bug 13859 to the CSV include.

To test: Switch from 'Screen' to 'CSV'
- Check publication date always displays (MARC21 and UNIMARC)
- Check that for MARC21 the 'by' has been removed from the title information
- Check that for UNIMARC the 'by' only displays when there is also
  an author to display

Tested for MARC21, 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: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14428: Remove C4::Input
Mark Tompsett [Fri, 10 Jul 2015 05:08:29 +0000 (01:08 -0400)]
Bug 14428: Remove C4::Input

Jonathan Druart agreed that C4::Input is vestigial code that should be removed.
Here is how I checked. First I found where C4::Input was used. Then, I checked
what functions are in the package: just checkdigit. Then, I confirmed that
checkdigit is not used at all in any acquisition, administration, or member
related perl scripts. Lastly, I took a look at our supposed test file for the
package. It was painfully sparse.

As such, this patch removes the test file and the package file, and removes
C4::Input references from these six files:
- acqui/addorderiso2709.pl
- acqui/basketgroup.pl
- acqui/neworderempty.pl
- acqui/uncertainprice.pl
- admin/aqplan.pl
- members/memberentry.pl
NOTE: neworderempty had 3 lines of it?! Didn't anyone see that?!

Here is the output of what I did to confirm this correction:

mtompset@debian:~/kohaclone$ git reset --hard origin/master
HEAD is now at 6e9086f Bug 3206: (QA followup) missing comma on sysprefs.sql
mtompset@debian:~/kohaclone$ git grep C4::Input
C4/Input.pm:package C4::Input; #assumes C4/Input
C4/Input.pm:C4::Input - Miscellaneous sanity checks
C4/Input.pm:  use C4::Input;
acqui/addorderiso2709.pl:use C4::Input;
acqui/basketgroup.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/uncertainprice.pl:use C4::Input;
admin/aqplan.pl:use C4::Input;
members/memberentry.pl:use C4::Input;
t/Input.t:        use_ok('C4::Input');
mtompset@debian:~/kohaclone$ grep sub C4/Input.pm
sub checkdigit ($;$) {
                my $temp2 = substr($infl,$i,1);
        if ($rem eq substr($infl,8,1)) {
} # sub checkdigit
mtompset@debian:~/kohaclone$ grep checkdigit `find acqui -type f`
mtompset@debian:~/kohaclone$ grep checkdigit `find admin -type f`
mtompset@debian:~/kohaclone$ grep checkdigit `find members -type f`
mtompset@debian:~/kohaclone$ cat t/Input.t

use strict;
use warnings;

use Test::More tests => 1;

BEGIN {
        use_ok('C4::Input');
}

Apply this patch, and the output of git grep C4::Input will be empty.
Run koha qa test tools (kind of overkill)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14496: Improving opac-detail.pl performances
Julian FIOL [Mon, 6 Jul 2015 10:27:08 +0000 (12:27 +0200)]
Bug 14496: Improving opac-detail.pl performances

Get notes and subjects from MARC record
ONLY when XSLT is not activated.

It's useless doing it when XSLT is activated,
because XSLT takes care of it by its own.

=> With this patch, we are saving precious
milliseconds

I compared the display of some records in XSLT view with and without patch, was the same (as expected).
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
On a slower server, I saw a time save of 0.0274 to 0.0908 seconds (with XSLT).
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14508: 'New patron' dropdown empty list on circulation.pl
Tomas Cohen Arazi [Wed, 8 Jul 2015 21:25:45 +0000 (18:25 -0300)]
Bug 14508: 'New patron' dropdown empty list on circulation.pl

This patch makes includes/patron-toolbar.inc (the one in charge of
rendering the 'New patron' dropdown) make use of the Categories
Template Toolkit plugin to create the list of categories.

(1) To check the setup is sane:
- Go to the Patrons page
=> SUCCESS: The 'New patron' dropdown is populated
- Click on the [+] symbol on the Patron search on the top
=> SUCCESS: The Categories dropdown is populated

(2) To test the patch:
- On the checkout form, perform a patron search that
  (a) returns more than one result
  (b) returns zero results
- Click the dropdown menu to create a new patron
=> FAIL: Dropdown is empty
- Repeat for (a) or (b)
- Apply the patch and reload
=> SUCCESS: The dropdown is correctly populated
- Repeat (1)
=> SUCCESS: Nothing got broken
- Verify the logs
=> SUCCESS: No new warnings
- Sign off :-D
- Get a cookie
- Smile

Regards

Discussion: we might need a new bug to start cleaning stuff like this:

@categories=C4::Category->all;
if(scalar(@categories) < 1){
    $no_add = 1;
    $template->param(no_categories => 1);
}
else {
    $template->param(categories=>\@categories);
}

but it belongs to a new bug me thinks. Well, suggestions are welcome, but this must
be fixed on stable ASAP so hurry :-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: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14424: Add on site checkouts help for 3.20
Nicole C. Engard [Tue, 23 Jun 2015 19:49:55 +0000 (14:49 -0500)]
Bug 14424: Add on site checkouts help for 3.20

There is no help for the pending on site checkouts report. This patch
adds it.

To test:

* visit pending on site checkouts
* click help
* confirm help is there and correct

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14424: Update Acq Help for 3.20
Nicole C. Engard [Tue, 23 Jun 2015 19:44:11 +0000 (14:44 -0500)]
Bug 14424: Update Acq Help for 3.20

This patch adds the missing order from subscription help and updates basket
help.

To test:

* Visit a basket, review the help
* Click order from a subscrption, review the help

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14424: Update Discharge Help for 3.20
Nicole C. Engard [Tue, 23 Jun 2015 19:31:15 +0000 (14:31 -0500)]
Bug 14424: Update Discharge Help for 3.20

This patch adds the missing discharge help file and updates the moremember file with
info on discharges.

To test:

* Visit a patron
* View and confirm help is right
* Visit the discharge page on the patron
* Confirm help file loads and is right

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14424: Update cataloging help for 3.20
Nicole C. Engard [Tue, 23 Jun 2015 18:00:06 +0000 (13:00 -0500)]
Bug 14424: Update cataloging help for 3.20

This patch updates 3 help files for catalolging in 3.20

To test:

* Visit
 * cataloging home
 * cataloging a new record
 * mergin bib records
* Confirm text is right and visible

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14424: Patron Help Files for 3.20
Nicole C. Engard [Tue, 23 Jun 2015 17:45:17 +0000 (12:45 -0500)]
Bug 14424: Patron Help Files for 3.20

This patch updates the help files for 3.20

To test:

* Visit
 * Main patron page
 * Patron search page
 * Patron permissions page
* Confirm the text is right on all three

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14485: HTML comment disables translation in cataloguing/addbooks.tt
Fridolin Somers [Thu, 2 Jul 2015 08:37:22 +0000 (10:37 +0200)]
Bug 14485: HTML comment disables translation in cataloguing/addbooks.tt

In cataloguing/addbooks.tt, the line :
  [% total %] result(s) found in catalog,
is not present in PO files even after an update.
I've found that the cause is the previous HTML comment line.

This patch converts HTML comment into TT comment and adds a div to have a more comprehensive string to translate.

Test plan :
- without patch
- go into <sources>/misc/translator
- run PO update for example in french : translate update fr-FR
=> the text "result(s) found in catalog" is missing from PO file : fr-FR-staff-prog.po
- restore default PO files
- apply patch
- go into <sources>/misc/translator
- run PO update for example in french : translate update fr-FR
=> You find text "result(s) found in catalog" in PO file : fr-FR-staff-prog.po

Sponsored-by: Universidad de El Salvador
Signed-off-by: Hector Eduardo Castro Avalos <hector.hecaxmmx@gmail.com>
Works as advertised. Just one msgid appear with msgid "%s result(s) found in catalog,"

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 3206: (QA followup) missing comma on sysprefs.sql
Tomas Cohen Arazi [Wed, 8 Jul 2015 21:16:47 +0000 (18:16 -0300)]
Bug 3206: (QA followup) missing comma on sysprefs.sql

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 3206: (RM followup) DBIx updates
Tomas Cohen Arazi [Wed, 8 Jul 2015 18:07:24 +0000 (15:07 -0300)]
Bug 3206: (RM followup) DBIx updates

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 3206: DBRev 3.21.00.014
Tomas Cohen Arazi [Wed, 8 Jul 2015 18:05:13 +0000 (15:05 -0300)]
Bug 3206: DBRev 3.21.00.014

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 3206: (QA followup) OAI repository deleted records support.
Matthias Meusburger [Mon, 8 Jun 2015 13:33:24 +0000 (15:33 +0200)]
Bug 3206: (QA followup) OAI repository deleted records support.

 - Fix QA.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
New pref in right order, new option 'no' on syspref, other
fixes following comment #12
All seems to work
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 3206: OAI repository deleted records support.
Matthias Meusburger [Thu, 28 May 2015 14:23:58 +0000 (16:23 +0200)]
Bug 3206: OAI repository deleted records support.

This patch allows Koha OAI repository to support deleted records.

The OAI-PMH:DeletedRecord syspref is introduced and can be set to:

- persistent (in case Koha's deletedbiblio table will never be emptied
  or truncated)
- transient (in case Koha's deletedbiblio table might be emptied or
  truncated at some point)

Test plan:

- After applying the patch, test that:
   - Deleted records appear in ListRecords and ListIdentifiers requests.
   - Filter parameters (from, until, set and resumptionToken) still work
     and are applied to ListRecords and ListIdentifiers requests.
   - Identify request shows if the repository is considered persistent
     or transient, according to the OAI-PMH:DeletedRecord syspref.
   - Deleted records that used to belong to a set are still displayed in
     those sets and marked as deleted.
   - GetRecord requests work on deleted records, which are marked as deleted.

Requests examples:
/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=oai_dc
/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=oai_dc&from=2015-02-20T11:08:33Z
/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=oai_dc&set=new_specSet1
/cgi-bin/koha/oai.pl?verb=GetRecord&identifier=KOHA-OAI-TEST:2&metadataPrefix=oai_dc
/cgi-bin/koha/oai.pl?verb=Identify

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  It works in all situations described in the test plan. Great addition.
  Thanks.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14366: Units doesn't get saved usefully for patroncards
David Cook [Tue, 9 Jun 2015 04:25:23 +0000 (14:25 +1000)]
Bug 14366: Units doesn't get saved usefully for patroncards

This patch causes the "Units" to be saved and displayed correctly
for the "Edit layout" screen in Patroncards.

_TEST PLAN_

Before applying:
0) Create a new layout
1) Edit the layout, change the units, and click Save
2) Edit the layout again, and notice the units are still "PostScript Points"

Apply the patch:
3) Edit the layout again, change the units, and click Save
4) Edit the layout again, note that the units have changed to your
selection

5) Rejoice

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13950: Sort Item search home library list by branch name
Nick Clemens [Wed, 17 Jun 2015 01:48:18 +0000 (21:48 -0400)]
Bug 13950: Sort Item search home library list by branch name

On the item search form the list of home libraries isn't sorted
alphabetically by their descrption.

To test:
- Ensure that you have libraries whose code/name are sorted in a different alphabetical order (e.g. Aardvark/ZZZ & Zebra/AAA)
- Staff: Advanced search - item search
- See that libraries are sorted in code order
- Apply patch
- Verify selection block for home library is correctly sorted after
  applying the patch.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14163: Acq - receive shipment and order from staged: rename 'Show all' to 'Show...
Katrin Fischer [Sun, 31 May 2015 13:52:26 +0000 (15:52 +0200)]
Bug 14163: Acq - receive shipment and order from staged: rename 'Show all' to 'Show inactive'

'Show all' in acquisition makes the inactive funds in the fund list
box visible. This patch changes the text to 'Show inactive' to be more
clear about the functionality.

Patch changes 2 pages. To test:

1) Order from staged file
- make sure you have uploaded a few records via the tools
- create a new order using the 'From a staged file' option
- select a file to order from - 'Add orders'
- Verify the 'Select to import' tab now displayed the text
  'Show inactive funds' and that it works as expected
- Switch to the 'Default accounting details' tab
- Verify the text there is also changed to 'Show inactive' and
  works like expected.

2) Receive shipment
- receive a new shipment for a vendor with unreceived orders
- Verify the label next to the fund list has changed to
  'Show inactive' and works as expected.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Simple string change, no errors.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14163: Acq order form: rename 'Show all' to 'Show inactive'
Katrin Fischer [Mon, 25 May 2015 08:45:54 +0000 (10:45 +0200)]
Bug 14163: Acq order form: rename 'Show all' to 'Show inactive'

On the order form there is a checkbox next to the fund list labelled
'show all'. Checking the checkbox will result in the inactive funds
showing in the pull down list as well.

The patch renames the label to 'Show inactive' to make the purpose
more clear.

To test:
- Create a new order
- Verify the label has changed as described above
- Decide if the change makes sense

Signed-off-by: tadeasm <tadeas.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14453: (followup) Fix shipped XSLT files
Mirko Tietgen [Thu, 25 Jun 2015 13:38:42 +0000 (15:38 +0200)]
Bug 14453: (followup) Fix shipped XSLT files

Make the shipped XSLTs for authorities (MARC21 and UNIMARC) the same as the generated version

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14453: kohaidx is missing for id in authority-koha-indexdefs.xml
Fridolin Somers [Wed, 24 Jun 2015 14:06:05 +0000 (16:06 +0200)]
Bug 14453: kohaidx is missing for id in authority-koha-indexdefs.xml

In authority-koha-indexdefs.xml, all tags use the namespace "kohaidx" except the tag "id".

When re-generating authority-zebra-indexdefs.xsl, the line :
  <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
is modified :
  <xslo:variable name="idfield" select="normalize-space()"/>
This is an error.

This patch adds kohaidx namespace to correct.

Test plan :
- Without patch
- go to etc/zebradb/marc_defs/marc21/authorities/
- run : xslproc xsltproc ../../../xsl/koha-indexdefs-to-zebra.xsl authority-koha-indexdefs.xml > authority-zebra-indexdefs.xsl
- read authority-zebra-indexdefs.xsl
=> the line has changed : <xslo:variable name="idfield" select="normalize-space()"/>
- Apply patch
- go to etc/zebradb/marc_defs/marc21/authorities/
- run : xslproc xsltproc ../../../xsl/koha-indexdefs-to-zebra.xsl authority-koha-indexdefs.xml > authority-zebra-indexdefs.xsl
- read authority-zebra-indexdefs.xsl
=> the line has not changed
(same for unimarc flavor)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
As Mirko mentioned, the xslt's now generate the facet-processing templates in
the authority xslt's too. They are harmless because we don't define facets
for authority records. If we did, it would be harmless too.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14326: XSLT Syntax error in MARC21slimOPACResults.xsl
Winona Salesky [Thu, 4 Jun 2015 02:46:23 +0000 (22:46 -0400)]
Bug 14326: XSLT Syntax error in MARC21slimOPACResults.xsl

Test Plan:
1) Apply this patch
2) Ensure you are using the default XSLT setting for the staff and opac  record details
3) Perform an opac search check "Availability" for expected display values.
5) Note this patch corrects invalid syntax in xslt, there should be no visable changes to the results page.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14189: Use keep_text for the authority header
Jonathan Druart [Tue, 26 May 2015 10:10:50 +0000 (12:10 +0200)]
Bug 14189: Use keep_text for the authority header

includes/authorities-search.inc already used the same behavior but with
another method.
For consistency it's better to have only 1 way to do that.

Test plan:
Go on the authority home page
Fill the input in the header and click on tab 'search all headings' and
'keyword search' and confirm that the text you have filled is kept.

I tested after applying the patch and the text is kept after removing the
part from authorities-search.inc. I also tried applying that jQuery solution
instead of my JS loop but could not get it to work for the other pages with
a reasonable ammount of effort.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Eivin Giske Skaaren <eskaaren@yahoo.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14189: Made text persist when clicking the tabs under the searchbox
Eivin Giske Skaaren [Mon, 11 May 2015 18:57:11 +0000 (18:57 +0000)]
Bug 14189: Made text persist when clicking the tabs under the searchbox

To test:
Apply the patch and see that the text now is there in the search
box when clicking the tabs: check in, check out etc..

(More files changed for persistent text in searchbox)

Sponsored-by: Halland County Library
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
This is something I have wanted quite a few times over the years...

Tested by going to every main area of Koha, entering some random
text into the search box and then clicking on all the available tabs
to check that the entered text is carried over to all the boxes.

There are a couple of places where text is not carried over, but I
guess that might be because one of the boxes is structurally
different to the others. These are:
- "Vendor search" and "Orders search" in Acquisitions
- "Search subscriptions" in Serials

I have not looked at how this is implemented, just that it works as
it should.

Bug 14189 refactor after failed QA.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Amended patch: replace tabs with spaces

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14345: broken isbn logic prevents display of idreambooks image
Mark Tompsett [Fri, 5 Jun 2015 16:24:22 +0000 (12:24 -0400)]
Bug 14345: broken isbn logic prevents display of idreambooks image

TEST PLAN
---------
1) Ensure you have a book that would pull up an idreambooks image
   (e.g. The road to character / David Brooks.)
   -- I imported from the Library of Congress via z39.50
2) Ensure your system preferences for idreambook stuff is set.
3) Ensure you have multiple 020$a's for your book, and
   the first one must just be an ISBN number!
   -- I removed the '(hardcover: acidfree paper)' from the first.
   -- I took the second 020 field and changed 020$z to 020$a
4) Search for that book in OPAC and go to details.
   -- There should be a readometer image, but it will be broken.
   -- Notice the ISBN line has "#############; ..."
      This could also be attained by just putting two semi-colon
      separated ISBN's on the first 020$a.
5) Apply this patch
6) Refresh page
   -- readometer image appears. YAY!
7) run koha qa test tools

NOTE: Only changed test plan, so leaving sign-off on.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14207: Improving circulation performance
Julian FIOL [Tue, 26 May 2015 12:49:20 +0000 (14:49 +0200)]
Bug 14207: Improving circulation performance

by caching yaml file This patch improve circulation performance by caching yaml file With this patch we saved between 300ms and 500ms on circulation page.

Following Comment #3 :
No useless warn
No tidy

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Less lines, same result.
Comments were useful on testing :)
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14135: Adds 'Free' to variabletypes in systempreferences.tt
Indranil Das Gupta [Mon, 4 May 2015 13:25:15 +0000 (18:55 +0530)]
Bug 14135: Adds 'Free' to variabletypes in systempreferences.tt

The 'Local Use' system preference addition/modification template provides the following options against "Variable Type" - Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSource.

There is no option presented for "Free" which seems to be the most
used variable type out-of-the-box (i.e. INTRAdidyoumean,
OPACdidyoumean, UsageStatsID and UsageStatsLastUpdateTime)

This trivial patch proposes to modify the systempreferences.tt
and add the option 'Free' to the list offered to users.

Test Plan
=========

1/ Go to Home > Administration > System preferences > Local use
2/ Click on 'New preference'.
3/ In the fieldset 'Koha Internal', the variable types offered
   are Choice, YesNo, Integer, Textarea, Float, Themes,
   Languages, Upload or ClassSources.
4/ Clicking on 'Choice' should set the 'preftype' field as
   'Choice'.
5/ Apply this patch.
6/ Refresh the page.
7/ The variable types list should read - "Free, Choice, YesNo,
   Integer, Textarea, Float, Themes, Languages, Upload or
   ClassSources".
8/ Clicking on 'Free' should set the 'preftype' field as 'Free'.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
NOTE: Discovered that there is no validation on the type field.
      However, that is beyond the scope of this bug.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14382: [QA Follow-up] Bad regex alarm
Marcel de Rooy [Fri, 3 Jul 2015 09:02:22 +0000 (11:02 +0200)]
Bug 14382: [QA Follow-up] Bad regex alarm

The regex /|date>>/ will match much more than you like :)
The unescaped pipe is bad, but you also need to remove the >> because
the split a few lines above it removes them already.

This allows you to recover from an error like this one, running another
report with a string parameter:
The given date (india%) does not match the date format (us) at
Koha/DateUtils.pm line 144.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended for possible spaces around the word date.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14382: Non-ISO Date parameters generate empty reports.
Mark Tompsett [Wed, 24 Jun 2015 16:13:46 +0000 (12:13 -0400)]
Bug 14382: Non-ISO Date parameters generate empty reports.

The issue is that SQL expects ISO dates, but the user may wish to view dates according to the dateformat system preference.

By detecting a date preference, the non-ISO dates can be converted to ISO dates before being stuffed back into the SQL query to be executed.

TEST PLAN
---------
1) Add a report with date parameters.
   -- I used 'Holds placed in date range' from
      http://wiki.koha-community.org/wiki/SQL_Reports_Library
2) Set your dateformat to YYYY-MM-DD
3) Run the report
   -- Note the SQL reads
      "... BETWEEN '{date formatted in YYYY-MM-DD}'..."
   -- If there is supposed to be data, there is some.
4) Set your dateformat to MM/DD/YYYY
5) Run the report
   -- Note the SQL reads
      "... BETWEEN '{date formatted in MM/DD/YYYY}'..."
   -- If there is supposed to be data, there is none.
6) Apply patch
7) Repeat steps 2-5
   -- The SQL will always read YYYY-MM-DD (ISO) format.
   -- The report will have data, if there is some.
8) koha qa test tools.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Adding a QA follow-up.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14427: Use Koha::version instead of C4::Context->KOHAVERSION
Mark Tompsett [Fri, 19 Jun 2015 18:00:13 +0000 (14:00 -0400)]
Bug 14427: Use Koha::version instead of C4::Context->KOHAVERSION

While testing bug 9006, I discovered this gem in
installer/install.pl

TEST PLAN
---------
 1) back up DB
 2) drop db and create db
 3) git reset --hard origin/3.20.x
 4) run web installer and all sample data
 5) git reset --hard origin/master
 6) empty your koha intranet error log
 7) run web installer to upgrade
    -- there will be warnings regarding regex around
       installer/install.pl line 328 or so.
       grep "\$kohaversion" ~/koha-dev/var/logs/koha-error_log
 8) repeat steps 2-6
 9) apply this patch
10) run web installer to upgrade
    -- no regex warnings.
       grep "\$kohaversion" ~/koha-dev/var/logs/koha-error_log
11) koha qa test tools

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 9942: DBRev 3.21.00.013
Tomas Cohen Arazi [Tue, 7 Jul 2015 18:15:01 +0000 (15:15 -0300)]
Bug 9942: DBRev 3.21.00.013

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 9942: [QA Followup] - Add test and alert to returns.pl
Kyle M Hall [Thu, 25 Jun 2015 21:22:25 +0000 (17:22 -0400)]
Bug 9942: [QA Followup] - Add test and alert to returns.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 9942: Make Koha fails if privacy is not respected
Jonathan Druart [Thu, 9 Apr 2015 11:07:05 +0000 (13:07 +0200)]
Bug 9942: Make Koha fails if privacy is not respected

If a patron has requested anonymity on returning items and the system is
not correctly configured (AnonymousPatron no set or set to an inexistent
patron), the application should take it into account and not fail
quietly.

This patch is quite radical: the script will die loudly if the privacy
is not respected.

To be care of the bad "Software error", some checks are done in the
updatedatabase to be sure the admin will be warned is something is wrong
in the configuration.

Test plan:
1/ Test the updatedatabase entry:
a. Turn on OPACPrivacy and set AnonymousPatron to an existing patron
=> You will get a warning
b. Turn on OPACPrivacy and set AnonymousPatron to 0 or ''
=> You will get a warning
c. Turn on OPACPrivacy and set the privacy to 2 (Never) for at least 1 patron
Turn off OPACPrivacy
=> You will get a warning
d. In all other cases you will get no error

2/ Test the interface
a. Turn on OPACPrivacy and set the privacy to 2 (Never) for a patron
b. Now you can turn off OPACPrivacy or keep it on, behavior should be
the same
c. check an item out the patron
d. Check the item in using the check out table
=> fail
e. Check the item in using the Check in tab
=> fail (not gracefully).

Note that the software error could appear on other pages too.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Updatedatabase works as described
On staff, if don't have correct settings for anonymity it's
impossible to check-in (with OPACPrivacy on)
No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14431: FIX encoding issues in search (staff client)
Jonathan Druart [Mon, 22 Jun 2015 10:45:50 +0000 (12:45 +0200)]
Bug 14431: FIX encoding issues in search (staff client)

Note that this does not appears at the OPAC.

We will need 2 different testers here, the results seem to depend on the
Encode version.

0/ Determine your Encode version (`pmvers Encode`).
If you have 2.60:
1) /cgi-bin/koha/catalogue/search.pl?q=ééé&op=Submit
You should get
" No results match your search for 'kw,wrdl: ���' in my library Catalog."
2) /cgi-bin/koha/catalogue/search.pl?q=ກ
You should get
Cannot decode string with wide characters at
/usr/lib/i386-linux-gnu/perl/5.20/Encode.pm line 215.

If you have <2.60 (? not sure here):
1) /cgi-bin/koha/catalogue/search.pl?q=ééé&op=Submit
You should not get encoding problems.
2) /cgi-bin/koha/catalogue/search.pl?q=ກ
You should not get encoding problems.

Apply this patch, try again 1 and 2.
If the Encode version is >=2.60, the encoding issues should be fixed.
If not, please detail if there are any regression.

NOTE: Tested on Ubuntu 14.04, Debian 8, and Debian 7. See comment #3.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14467: Security updates break some Koha plugins
Kyle M Hall [Thu, 25 Jun 2015 20:41:23 +0000 (16:41 -0400)]
Bug 14467: Security updates break some Koha plugins

The new security updates break previously functioning plugins, most
notably the cover flow plugin and the Ebsco EDS plugin.

Test Plan:
1) Install and configure the cover flow plugin ( http://bywatersolutions.com/koha-plugins/ )
2) Note that attempting to access coverflow.pl from the OPAC results in an error
3) Apply this patch
4) Note that coverflow.pl now output html again

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14389: Editing a syspref in a textarea does not enable the Save button
Liz Rea [Tue, 16 Jun 2015 04:12:57 +0000 (16:12 +1200)]
Bug 14389: Editing a syspref in a textarea does not enable the Save button

Test plan:
  1. Navigate to the "opaccredits" syspref (or any other textarea, i.e.,
     "Click to Edit", syspref) in the system preferences editor.
  2. Change its contents, by either pasting or typing. The field may not
     be marked as modified, even after you click outside the box.
  3. Apply the patch.
  4. Reload the page and try again; either pasting or typing should mark
     the field as changed and allow you to save.

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>
Confirmed working for normal input, paste and middle-click paste in
Chrome and Firefox in Linux.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14490: Duplicate armenian translator
Samanta Tello [Fri, 3 Jul 2015 14:12:05 +0000 (11:12 -0300)]
Bug 14490: Duplicate armenian translator

This patch fix trivial duplicate
in about page.

To test:
1) Go to about page > translations
2) Check duplicate entry for Armenian
first in 4th line, second before indonesian
3) Apply patch
4) Reload page and check again

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Trivial string patch. The restults are the expected.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Double checked :-P

8 years agoBug 11882: (QA followup) fix capitalization errors
Tomas Cohen Arazi [Fri, 26 Jun 2015 18:10:55 +0000 (15:10 -0300)]
Bug 11882: (QA followup) fix capitalization errors

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11882: Add a new button to the checkout confirmation dialog when checking out...
simith [Thu, 26 Feb 2015 18:21:21 +0000 (13:21 -0500)]
Bug 11882: Add a new button to the checkout confirmation dialog when checking out a reserved item

This patch adds a "Don't Check Out and Print Slip" button to the dialog that appears
        when trying to checkout a reserved item.

Test case :
* Put a hold on an item for User A.
* Try to check out it item with User B.
* The "Please confirm checkout" box should appear. The "Don't Check Out and Print Slip" button should appear in this box.
* Click on the "Don't Check Out and Print Slip" button.
* A print popup will appear

Signed-off-by: Nick <Nick@quechelibrary.org>
Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14002: Display readonly values as plain text
Jonathan Druart [Tue, 16 Jun 2015 17:25:58 +0000 (19:25 +0200)]
Bug 14002: Display readonly values as plain text

There is no need to display the cardnumber and expiration date values in
a disabled input.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14002: Show patron expiry date in OPAC
Katrin Fischer [Tue, 9 Jun 2015 22:52:39 +0000 (00:52 +0200)]
Bug 14002: Show patron expiry date in OPAC

This patch makes it possible to show the expiration date
of a patron account in the OPAC on the details tab in the
patron account.

Extras:
- Makes it possible to hide cardnumber with
  PatronSelfRegistrationBorrowerUnwantedField

To test:
- Toggle OPACPatronDetails and test date expiry always shows
- Check PatronSelfRegistrationBorrowerUnwantedField for dateexpiry
  and cardnumber
- Verify a patron address modification request still works
  as expected

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14440: get_template_and_user can not have an empty template_name (quote*_ajax.pl)
Jonathan Druart [Wed, 24 Jun 2015 09:03:22 +0000 (11:03 +0200)]
Bug 14440: get_template_and_user can not have an empty template_name (quote*_ajax.pl)

This patch uses check_api_auth instead of get_template_and_user.

Test plan:
Confirm that you are still able to access to the quote editor with the
edit_quotes permission.
Confirm that you are not if you don't have the permission.

wget your_url/cgi-bin/koha/tools/quotes/quotes_ajax.pl
should return "403 : Forbidden."

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14440: get_template_and_user can not have an empty template_name (opac-ratings.pl)
Fridolin Somers [Tue, 23 Jun 2015 15:45:30 +0000 (17:45 +0200)]
Bug 14440: get_template_and_user can not have an empty template_name (opac-ratings.pl)

Since Bug 14408, the method get_template_and_user can not have an empty template_name.
Pages calling with an empty value should use C4::Auth::checkauth()

This patch corrects opac/opac-ratings.pl

Test plan :
- Apply patch
- Set sysopref OpacStarRatings to 'results and details'
- Disable Javascipt on your browser (otherwise it will use ajax)
- Login at OPAC
- Go to a record
- Click on a button left of 'Rate me' to choose a rating, ie 4
- Click on 'Rate me'
=> The page is reloaded and you see 'your rating: 4'
- Loggout from OPAC
- Try to access URL : http://<serveur>/cgi-bin/koha/opac-ratings.pl
=> You see the loggin page

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14440: get_template_and_user can not have an empty template_name (updatesupplier.pl)
Fridolin Somers [Tue, 23 Jun 2015 14:45:21 +0000 (16:45 +0200)]
Bug 14440: get_template_and_user can not have an empty template_name (updatesupplier.pl)

Since Bug 14408, the method get_template_and_user can not have an empty template_name.
Pages calling with an empty value should use C4::Auth::checkauth()

This patch corrects acqui/updatesupplier.pl

Test plan :
- Apply patch
- Connect to intranet with a user having "vendors_manage" permission
- Go to acquisition module
- Create a new vendor
- Click on "Edit vendor"
- Change some information and save
=> Your change is saved
- Connect to intranet with a user not having "vendors_manage" permission
- Try to access <intranet>/cgi-bin/koha/acqui/updatesupplier.pl
=> Access is denied
- Disconnect from intranet
- Try to access <intranet>/cgi-bin/koha/acqui/updatesupplier.pl
=> Access is denied

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13014: (QA followup) have new warnings tested
Tomas Cohen Arazi [Wed, 24 Jun 2015 17:54:36 +0000 (14:54 -0300)]
Bug 13014: (QA followup) have new warnings tested

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13014: DBRev 3.21.00.012
Tomas Cohen Arazi [Wed, 24 Jun 2015 17:40:01 +0000 (14:40 -0300)]
Bug 13014: DBRev 3.21.00.012

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13014: [QA Follow-up] Few typos in cronjob
Marcel de Rooy [Fri, 17 Apr 2015 09:48:02 +0000 (11:48 +0200)]
Bug 13014: [QA Follow-up] Few typos in cronjob

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 years agoBug 13014: (follow-up 2) Notify budget owner on new suggestion - sample notices
Jonathan Druart [Thu, 6 Nov 2014 09:21:48 +0000 (10:21 +0100)]
Bug 13014: (follow-up 2) Notify budget owner on new suggestion - sample notices

This patch updates the 2 optional sample_notices.sql files for ru-RU and
uk-UA.
Not sure if it is relevant but I don't understand why they are not
up-to-date.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Checked by running them manually.
English installs 27, Russian 27 and Ukrainian 26.
Last language can be updated somewhere else.

8 years agoBug 13014: (follow-up) Notify budget owner on new suggestion - sample notices
Jonathan Druart [Thu, 6 Nov 2014 09:21:01 +0000 (10:21 +0100)]
Bug 13014: (follow-up) Notify budget owner on new suggestion - sample notices

This patch adds the new notice for all other languages.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 years agoBug 13014: Notify budget owner on new suggestion - cronjob
Jonathan Druart [Tue, 30 Sep 2014 14:59:50 +0000 (16:59 +0200)]
Bug 13014: Notify budget owner on new suggestion - cronjob

Test plan:
0/ Create a new notice suggestions > TO_PROCESS
You can use the one defined in the other patch.
1/ Create a suggestion and link it to a fund
2/ Add a owner to this fund and make sure this patron has an email
address (the email address used should be the one defined in the
AutoEmailPrimaryAddress syspref).
3/ Execute the cronjob script with the -v and without the -c argument
4/ The output should tell you that an email will be sent
5/ Execute the cronjob script with the -v and with the -c argument
6/ Verify the notice is generated in the message_queue table and it is
correctly formatted.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 years agoBug 13014: Notify budget owner on new suggestion - sample notices
Jonathan Druart [Tue, 30 Sep 2014 14:58:48 +0000 (16:58 +0200)]
Bug 13014: Notify budget owner on new suggestion - sample notices

This patch add the new notice suggestion > TO_PROCESS

Others will be added when the patch will be signed off.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Followup expected :-) It would be nice also to have an updatabase.pl entry to
insert the new TO_PROCESS notification.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13014: Notify budget owner on new suggestion - UT
Jonathan Druart [Tue, 30 Sep 2014 14:56:46 +0000 (16:56 +0200)]
Bug 13014: Notify budget owner on new suggestion - UT

When a suggestion is created and linked to a fund, a mail will be
generated, using a cronjob, to notify the budget owner.

A suggestion is considered as "can be treated" if its status is "ASKED".

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 12074: Filter duplicates when adding a batch from a staged file
Lyon3 Team [Tue, 24 Feb 2015 14:50:49 +0000 (15:50 +0100)]
Bug 12074: Filter duplicates when adding a batch from a staged file

When adding a batch of records to a basket, duplicates are skipped and
an alert is displayed with a link to them so as they could be treated
individually.

Test plan :

You need the 2 test attached files TestFile1.mrc and TestFile2.elc
(TestFile1 includes only the title "Amilec ou La graine d'hommes" that
is also included in TestFile2)

1) go to “Stage MARC records for import” page, upload TestFile1 and
stage it (select iso 5426 encoding).
2) Manage staged record and import the batch.
3) Make sure that the new record is indexed (depending to your indexing
system and test platform).
4) Go back to go to “Stage MARC records for import” page upload
TestFile2 and stage it (select iso 5426 encoding).
5) Go to acquisitions module and create a new basket.
6) From your basket, in the “Add order to basket block”  choose  'From a
staged file'.
7) Then click File2 (‘addorder button').
8) Go down the "Import all" block and save.
9) You are redirected to the basket page : a warning is displayed to
tell you that some duplicates have been found and skipped.
There's a link on the warning throughout you can go back to the list of
remaining records and treat them individually if necesary.
10) Click the link : you fall upon the title of TestFile1 (of course as
it's a duplicate).
11) Check that the imported records have been indexed.
11) Go down the "Import all" block and save.
12) A warning is displayed saying that no records have been imported
because they all match an existing record. The “Import all” block is not
any more visible.

Signed-off-by: JA <aloi54@live.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14450: itemsearch no longer working
Liz [Wed, 24 Jun 2015 09:52:05 +0000 (09:52 +0000)]
Bug 14450: itemsearch no longer working

To test:
Click Advanced search in staff client
Click the link for "Go to Item Search" at the top of the page
Do a search, you should get results. Try some combinations and make sure it works like it should.

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14439: Add test - template path should finish by .tt
Jonathan Druart [Tue, 23 Jun 2015 14:10:22 +0000 (16:10 +0200)]
Bug 14439: Add test - template path should finish by .tt

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14439: Typo in Bug 14408 regexp
Fridolin Somers [Tue, 23 Jun 2015 13:50:39 +0000 (15:50 +0200)]
Bug 14439: Typo in Bug 14408 regexp

In Bug 14408 first patch, the regexp used needs an escape on dot and does not need an ending "?"

Test plan :
  - prove t/db_dependent/Auth.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14252: DBRev 3.21.00.011
Tomas Cohen Arazi [Wed, 24 Jun 2015 13:34:51 +0000 (10:34 -0300)]
Bug 14252: DBRev 3.21.00.011

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14252: Add sort by rfc4646_subtag in footer
Jonathan Druart [Thu, 4 Jun 2015 14:02:19 +0000 (16:02 +0200)]
Bug 14252: Add sort by rfc4646_subtag in footer

This patch sort by rfc4646_subtag the languages in the footer.
Same as in the header.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14252: (followup) addresses the QA Manager comments
Indranil Das Gupta [Mon, 1 Jun 2015 13:52:29 +0000 (19:22 +0530)]
Bug 14252: (followup) addresses the QA Manager comments

Addresses Katrin's comments in comment# 56

TEST PLAN
---------
 1) Back up your DB
 2) Ensure you have multiple languages, including
    some that have sub-languages (e.g. de-DE, de-CH)
    -- cd misc/translator
    -- perl translate install {language code}
 3) Ensure that you have all the languages enabled
    -- Staff client -> Home -> Global system preferences
       --> I18N/L10N
       Check all the languages in opaclanguages.
       Ensure that opaclanguagesdisplay is 'Allow'
 4) Open OPAC
    -- should only have languages in footer.
       Annoyingly below the fold.
 5) Drop your koha database, and create a blank one.
 6) Apply all patches
 7) Reinstall all the known languages, so the templates
    are appropriately updated.
 8) Go to staff client and do an install of koha, with
    all the dummy data.
 9) Ensure you have all the languages enabled (see (3))
10) Refresh your OPAC page
    -- language selector position should be in both
       the footer and at the top as expected.
    -- this confirms the sysprefs.sql change.
11) Restore your DB
12) run the updatedatabase.pl script
13) Ensure you have all the languages enabled (see (3))
14) Refresh the OPAC page
    -- should still only have languages in the footer.
    -- this confirms that upgrade won't change anything.
    -- this confirms the atomic update.
15) git diff origin/master
    -- the opac-bottom.inc difference should only
       have changes around a SET, IF, and END.
       This confirms the noprint was fixed.
16) In the staff client, change the OPAC system preference,
    OpacLangSelectorMode, to all three values.
    For each value, refresh the OPAC page, and confirm the
    position of the language selector.
    -- should work as expected.
17) run koha qa test tools

NOTE: Tested as a single batch together.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>