Bug 12859 - Patron import tool doesn't import extened attributes values any longer

To reproduce:

1/ define/set up extended pattron attribute in administration module,
2/ using "Tools -> Import patrons", try to import some sample patron
record[s], having some arbitrary (non-empty) value assigned in
'pattron_attributes' CSV column for attribute defined in step 1/,
3/ observe that extended attribute defined in step 1/ was not imported
(not added to the database), without any warnings.

This patch restores a small code chunk which went AWOL somewhere around
commit b4158f2d2485c9e57bd7f14362b210732bef9d35.

To test:

1/ apply patch & retest,
3/ ensure that this issue is no longer reproductible, and there are no
apparent regressions of any kind,
4/ make sure that the ability to specify default value for extended
attributes added in bug Bug 12716 is still working as intended
(= follow up the test plan for bug 12716).

Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com>
Patch fixes import of extended patron attributes.
Step 1-3 in test plan confirmed.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.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>
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>
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>
Bug 12879: Remove unnecesary diags from Holds.t

There are two unnecessary diag statements:
- Creating biblio instance for testing.
- Creating item instance for testing.

TEST PLAN
---------
1) prove t/db_dependent/Holds.t

t/db_dependent/Holds.t .. 1/38 # Creating biblio instance for testing.
Use of uninitialized value in subroutine entry at /home/tcohen/git/koha-community-src/C4/Charset.pm line 181.
 # Creating item instance for testing.
Use of uninitialized value in subroutine entry at /home/tcohen/git/koha-community-src/C4/Charset.pm line 181.
Use of uninitialized value in subroutine entry at /home/tcohen/git/koha-community-src/C4/Charset.pm line 181.
t/db_dependent/Holds.t .. ok
All tests successful.
Files=1, Tests=38,  1 wallclock secs ( 0.03 usr  0.01 sys +  1.13 cusr  0.11 csys =  1.28 CPU)
Result: PASS

-- They are in the first and fourth lines of this sample output

2) apply patch
3) prove t/db_dependent/Holds.t

t/db_dependent/Holds.t .. 1/38 Use of uninitialized value in subroutine entry at /home/mtompset/kohaclone/C4/Charset.pm line 186.
Use of uninitialized value in subroutine entry at /home/mtompset/kohaclone/C4/Charset.pm line 186.
Use of uninitialized value in subroutine entry at /home/mtompset/kohaclone/C4/Charset.pm line 186.
t/db_dependent/Holds.t .. ok
All tests successful.
Files=1, Tests=38,  1 wallclock secs ( 0.01 usr  0.00 sys +  0.78 cusr  0.09 csys =  0.88 CPU)
Result: PASS

-- They are no longer in the first and fourth lines of this sample output

4) run koha QA test tool

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>