Bug 12371 - Links in every patron self-registration email points to a single borrower

If multiple registrations are submitted, the first patron to register
will be used for the first patron to click the registration confirmation
link!

Test Plan:
1) Submit 2 new patron registrations
2) Use the confirm link from the 2nd registration
3) Note you end up registering as the first submitted registration
4) Apply the patch
5) Repeat steps 1 and 2
6) Note you are now confirmed correctly

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

Test plan appears to work fine, I have a feeling the sql could be
written better but can't come up with it on a Sunday morning

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and fixes a critical bug.
Passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12429 [staff client] patron seeing fines codes

Bug 2546 introduced translatable handling of Koha account type codes but
missed several codes. This patch adds handling of these codes to the
staff client.

This patch also corrects a couple of instances of incorrect
capitalization.

To test, apply the patch and view fines page (Patron details ->
Fines) and the pay fines page (Patron details -> Fines -> Pay fines).
You should not see any account type codes like CR, LR, or FU.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12429 [OPAC] patron seeing fines codes

Bug 2546 introduced translatable handling of Koha account type codes but
missed several codes. This patch adds handling of these codes to the
bootstrap OPAC.

This patch also corrects a couple of instances of incorrect
capitalization.

To test, apply the patch and log in to the OPAC as a user who has
existing fines and charges. View the "Your fines" page. You should not
see any account type codes like CR, LR, or FU.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12465: Improve display of MARC21 710 in intranet and OPAC

Currently, 710$a and $b and $b will not display correctly.
This patch tries to improve the display adding the missing
space between both subfields.

Please test.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested, work as described on staff & opac for 710 detailed view.
Add space and punctuation.
No errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12432 - Saved reports tabs not working

In release 3.14.05.000 the tabs on the Saved Reports page worked
correctly but after upgrading to 3.16.00.000 the tabs stop working.
Visually the tabs change but the table of reports is not filtered. There
are no errors reported in the browser console.

Test Plan:
1) Attempt to filter saved reports by group tabs
2) Note no matter the tab you select, all reports appear
3) Apply this patch
4) Repeat step 1
5) Note the reports are now filtered correctly

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, works as described with the
second patch applied as well.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12432 [QA Followup] - Make "All" tab work when switching back to it

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12438 - Bad encoding in acquisition basket

We noticed a bad encoding (diacritics replaced by <?>) in acquisition basket when updating a server to Debian Wheezy.
We found it comes from a query containing biblio.title twice.
Maybe the mysql newer version creates this side-effect.

Test plan :
- Create an order on a record containing a diacritic in title
- Look at the basket : cgi-bin/koha/acqui/basket.pl?basketno=x
=> Without the patch the record title is bad encoded (with <?>)
=> With this patch the record title is well encoded
- Check also basket CSV export

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Good catch!
Works as expected, passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Duplicated biblio.title is a (minor) bug, and should be removed.

The side-effect of it solving an encoding problem might be seen
as problematic: it hides a real problem.
The efforts on 11944 actually solve this encoding problem (11944
merged into master actually fixes this), so I'm pushing it, for
a short term solution for stable, with the hope that we will soon
have 11944 pushed.
BTW, non-diacritic but non-ASCII characters are not broken either.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12717: Library no longer receiving Overdue email for patrons without email address

Bug 10832 changes the fallback behavior if a patron does not have email
address: a print notice is generated into the message_queue table.
But this can cause issue for some libraries. The script should sent an
email and (generated csv, html, text file) with the list of all unsent
notices.

Test plan:
1/ Add overdue to a patron without email address (or smsalertnumber)
2/ Check email in the overdue rules configuration (or sms)
3/ Launch the overdue_notices.pl cronjob
4/ Verify the message_queue contain a print notice AND an email notice
for the library

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This works as described and restores the old behaviour for now, with
the difference that you have a print notice generated and visible
in the patron account notices tab that will say 'pending'.

We will have to figure out how we can change the workflows nicely
to have only one script deal with print notice in the future.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12619 - Shipment date gets lost on finishing and/or editing the invoice

To reproduce:
- Create a new shipment, make sure to add a shipment date
- Receive or not receive orders
- Finish receiving with the button at the bottom of the page
- Verify that shipment date is now empty

To test:
- reproduce the aforementioned issue
- apply patch
- confirm that the issue is no longer rerpoductible (= shipment date is
not getting lost any longer), and that there are no apparent regresssions
of any kind involving invoice shipment date entering and/or editing
- sign off

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script, fixes the issues, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11703: (followup) svc/holds invoked with trailing .pl

On my followup I forgot to fix js/holds.js. This patch rectifies that.

Regards
To+

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10519: Suggestions: 'Organize by' and correct display of tab descriptions broken

The tabbed display in suggestions offers different options to organize
the tabs. The descriptions on the tabs and some of the search options were
not working correctly, displaying as "Unknown".

To test:
- Add several suggestions to your installation, make sure you have:
  - suggestions from different users
  - suggestions managed by different users
  - suggestions with different statuses
  - suggestions with different selected item types

Test all the 'organize by' options (except "Organize by: Library"
- see note below), make sure that the tabs and search options
have correct descriptions and do no longer display as "Unknown".

- Add 1 or 2 custom status to SUGGEST_STATUS authorized value.
  - Verify display is still correct and your new status are displayed.

Note: "Organize by: Library" option is currently severely broken
(and not easily fixable, especially for 'IndependentBranches'
enabled). But this turns out to be a separate issue, with a different
underlaying causes, and it's outside the scope of this patch.
This should be dealt with later, in it's own bug report.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10519: (followup) Fix context for evalyating $borrowernumber

Follow-up to fix additional suggestion statuses, which are not working
properly due to

   416:  borrowernumber           => $input->param('borrowernumber'),

being evaluated in list context inside $template->param() call arguments.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10519: (followup) unit tests leave problematic cruft

On testing I've found that t/db_dependent/Suggestions.t leaves
cruft on the DB. Small followup for that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12729 - Overdue items won't show as overdue in red in circulation

It seems that Firefox date parser doesn't like our dates which are
formatted in ISO format like "2014-08-06 00:00:00". This results in
missing red color in overdue dates.

So intead of munching different date formats and JavaScript (and having
to support different browers) this patch moves check for overdue dates
back to mysql and just transfers boolean value to JavaScript so it can
show correct class for date_due.

Test scenario:
1. find borrower with overdue checkouts
2. verify that all dates are black (and are in ISO format)
3. apply this patch
4. reload page and verify that overdue dates turned red

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with different due dates (hourly and not) and different date formats.
Passes tests and QA script.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12899: Row grouping in checkouts table is alphabetical and depends on translation

The sort order of the "today's checkouts" and "previous checkouts" row
groupings depends on the label, so in English "today's checkouts" comes
first. However, in other languages the reverse alphabetical order is
incorrect resulting in "previous checkouts" coming first.

This patch adds a dummy column with numeric data on which the sorting
can be done. This should make it translation-agnostic.

To test, apply the patch and install or update a translation which will
demostrate the problem (sv-SE for instance).

- Clear your browser cache and switch to the English templates.
- Check out some items to a patron who has checkouts from a previous
  day.
- Confirm that the sorting of the "today's checkouts" and "previous
  checkouts" row groups is correct.
- Switch to the new/updated translation and reload the circulation page
  for that patron. Confirm that the sort remains correct.
- Confirm that the checkouts table looks correct and that other features
  (sorting, checkboxes) still work correctly.

Revision: Corrected the table footer include to correct the colspan
error causing column misalignment.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12963: Columns misplaced in moremember.tt

After applying Bug 12899, in moremember page, checkouts table has
misplaced columns.

Test plan:
1. Check out title for a user. Columns in Detail page at checkout tab
are misplaced; there's no Due date column.
2. Aplly patch, everything shuld look fine now.

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

My bad! Thanks for catching this.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12811 - Patron 'Details' and 'Check out' pages not working for staff users without renewal override permissions

In case when the staff user doesn't have (circulate) ->
(override_renewals) permission granted, this code part

   var AllowRenewalLimitOverride = [%
CAN_user_circulate_override_renewals && AllowRenewalLimitOverride %];

in circ/circulation.tt and members/moremember.tt leads to javascript
error, because TT statement evaluates to empty string.

To reproduce:

- set AllowRenewalLimitOverride syspref to "Don't allow" (this step is
  possibly redundant / not quite relevant),
- for testing purposes, log in as some (sample) staff user whitch does
  not have permission granted for "(override_renewals) Override blocked
  renewals",
- have a look at some patron accounts (preferably, ones with 1+
  check-out), observe that page layout is incorrect in "Check Out" and
  "Details" tab.

To test:

- apply patch,
- retest and ensure that this issue is no longer reproductible,
- make sure that there are no regressions of any kinds regarding renewal
  override permission for staff users (i.e, that it still works like
  intended).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes QA script and tests.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12419: Not for loan items are not listed

On the cataloguing search (cataloguing/addbook.pl), if an item has a
notforloan value > 0, the item is not listed in the Location column.

It is quite confusing, the current behavior let patrons believe that
there is not item for the biblio (or less than the real count).

Test plan:
1/ Create 2 biblio records A and B
2/ Create some items for A
3/ Create 1+ item(s) for B with a notforloan status > 0
4/ Reindex both records
5/ Launch a search on the cataloguing module and verify that the
notforloan items are not listed in the 'Location' column.
6/ Apply this patch and verify the not for loan items are listed ("Not
for loan (XXX)").

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script, not for loan items now show up.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12419: (QA followup) regression tests

Changes to searchResults deserve unit tests.

Edit: minor tweaks:
 - Remove warning in line 702
 - Modernize
 - License added
 - "This file is a stub" removed

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12151: Remove uses of smartmatch operator in Search.pm and opac-search.pl

This patch removes the use of smartmatch operators in the search code.

Regards
To+

Edit: this revision uses 'grep' instead of Lists::MoreUtils::any

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Tested search, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>