Bug 12115: follow-up fix for tools/inventory's output_pref issues

This should correct issues with the output_prefs in the
compareinv2bar logic section of tools/inventory.pl
It is a follow up to bug 11253.

TEST PLAN
---------
NOTE: There should be no distinguishable difference before and
      after the patch. This corrects a works by accident bug.

Back up DB.
Create a small barcode file from books in a given branch.

Set I18N/L10N system preference of dateformat to mm/dd/yyyy.
Go to inventory/stocktaking tool.
Browse for the barcode file.
Click submit just below the 'Use a barcode file' section.
All looks fine in mm/dd/yyyy format.

Set I18N/L10N system preference of dateformat to yyyy-mm-dd.
Go to inventory/stocktaking tool.
Browse for the barcode file.
Click submit just below the 'Use a barcode file' section.
All looks fine in yyyy-mm-dd format.

Set I18N/L10N system preference of dateformat to dd/mm/yyyy.
Go to inventory/stocktaking tool.
Browse for the barcode file.
Click submit just below the 'Use a barcode file' section.
All looks fine in dd/mm/yyyy format.

Apply patch
Restore DB (so results should be comparable to the first result)
Repeat the three testing blocks above.
There should be no visible difference.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12134: Add unit tests to reflect the change in IsDebarred

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12134: (follow-up) add more unit tests to reflect the change in IsDebarred

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12134: (follow-up) fix one of the IsDebarred() tests

- pass valid ISO date to the debar-date-in-future test
- correctly verify that patron is restricted

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12134: ensure that patrons are not restricted even when the last restriction has expired

Test Plan:
1) Add a manual restriction to a patron and wait until the
   expiration date of the restriction has passed.  This can be
   simulated by modifying borrowers.debarred for a borrower and
   setting the date in the past.
2) Try to check out an item to that patron
3) Note you cannot
4) Apply this patch
5) Repeat step 2
6) Note you can now check out items the patron

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11856: Add publication year and edition to English acq PDF templates

To test:
- Switch OrderPdfFormat to pdfformat::layout3pages
- Create one or more  baskets with a few orders, make sure you
  are adding some records that contain a publication year and/or
  edition statement
- Close the basket
- Create a basket group
- Print the PDF and check that edition and publication year
  show up and bibliographic information is printed correctly
- Switch OrderPdfFormat to pdfformat::layout2pages
- Repeat PDF print

This patch also changes the formatting a bit and differentiates between
UNIMARC and MARC21. For MARC21 no additional punctuation is needed as
those are cataloged with the information. Only spaces are added for MARC21,
while UNIMARC is kept they way it was before.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11856: Add publication year and edition to German acq PDF template

Follow up to the patch for the English templates - repeat tests
with OrderPDFFormat set to pdfformat::layout2pagesde.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11856: Add publication year and edition to French acq PDF template

Follow up to the patch for the English templates - repeat tests
with OrderPDFFormat set to pdfformat::layout3pagesfr.

Additional change:
Translates 'published by' to 'publie par'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11724: Make Funds/Status on suggestions page sortable/searchable

The fund and status columns on the suggestions page are not sortable or
searchable. This patch makes them so.

This patch also amends the DataTables configuration to use class-based
targeting for sorting types as was decided on the koha-devel list. The
table markup has been modified accordingly.

To test you must have existing suggestions. Apply the patch and go to
Acquisitions -> Suggestions. View the table of existing suggestions and
confirm that the funds and status columns are sortable and searchable.

Confirm that the title column correctly ignores articles when sorting.

Signed-off-by: David Cook <dcook@prosentient.com.au>

Works as described.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, template change only.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12127: fix incorrect DataTable types in Holds to Pull list

This patch explicitly sets the sType in the Holds to Pull list table
for the libraries, itypes, and locations columns. It appears that the
type is automatically being set to "html" when it should be set to
"string".

It needs to have a sType of "string", since DataTables will strip out
the <br> tags when using "html", and we need them for the regexp
we use to create a more precise filter search.

_TEST PLAN_

Before applying:

1) Place a "next available" hold on a record with an item available
from one library/branch (e.g. "Branch A")
2) Place a "next available" hold on a record with an item available
from two different libraries/branches
3) Place a "next available" hold on a record with an item available
from three different libraries/branches - one of which is the same
as the library/branch from Step 1.
4) Go to the Holds to Pull List
5) Filter the branches by "Branch A".
6) You should only see the hold from Step 1 - not Step 3.
7) Try filtering on a branch for a hold that has multiple
libraries/branches. (They shouldn't appear when filtering, except
when using the "None" filter).

Apply the patch.

After applying:
1) Repeat Steps 4-7 from above. When filtering on "Branch A", you
should be able to see all holds that are available at "Branch A",
even if they are available at other branches (i.e. the holds has
multiple libraries listed).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7125: make MARC framework tag form not suggest that one can change the form

When you edit an existing tag in a MARC framework the form makes it
appear as if you can change the tag number when in fact you cannot. This
patch changes the template so that the tag number does not appear as an
editable form field during the edit process.

To test, apply the patch and open an existing MARC framework in
Adminstration -> MARC bibliographic framework.

- Choose an existing tag from the list and click 'Edit.'
- The line labeled "Tag" should display the tag as text.
- Making a change to any of the tag's details should work correctly.
- Return to the list of the MARC framework's tags.
- Click 'New tag.'
- The line labeled "Tag" should display a blank form field.
- Create a new tag and confirm that it saves correctly.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as describes, on edit and new.
No koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Work as described, template change only.
Checked editing and adding tags.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11351 - Add support for SIP2 media types

Koha's SIP2 server implementation does not currently support the SIP2
protocol field "media type" ( CK ).

This patch implements the SIP2 media type by allowing an arbitrary
mapping of itemtypes to SIP2 media types.

Test Plan:
1) Apply this patch
2) Run updatedatabase
3) Edit an itemtype, select a SIP media type, and save the changes
4) Make a SIP2 Item Information Request
5) Verify that the CK field of the Item Information Response contains
   the correct media type code.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 11351 - Add support for SIP2 media types - French file

This patch adds the SIP_MEDIA_TYPE AV for the fr-FR file.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Bug 11351: (follow-up) fix typos in seed SIP2 media types

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11351: DBrev 3.15.00.037

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11351: (follow-up) update DBIC schema classes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11351: (follow-up) ensure itemtypes.sip_media_type is set to NULL when cleared

This patch ensures that the sip_media_type is set to NULL
rather than the empty string when it is cleared via item
types administration.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11719 - Use new DataTables include in serials templates

Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to all
serials-related pages which use DataTables.

Apply the patch and test the following pages to confirm that table
sorting works correctly:

- Serials search results (serials/serials-search.pl): Perform a search
  which will return more than one subscription. The expiration date
  column is now sorted using the "title-string" filter for sorting based
  on the unformatted date. The "anti-the" filter has been added to the
  title column to exclude articles when sorting.

- Serials collection (serials/serials-collection.pl): View the serial
  colection page for an existing subscription. The table of issues
  should be sorted correctly.

- Serial claims (serials/claims.pl): The "since" and
  "claim date" columns have been modified to use the title-string filter
  for sorting based on the unformatted date.
  C4::Serials.pm::GetLateOrMissingIssues has been modified to pass an
  unformatted date along with the formatted date. The "anti-the" filter
  has been added to the title column to exclude articles when sorting.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested all 3 tables, no regressions found.
Passes QA script and tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11719: (follow-up) fix column sorting configuration

This patch corrects column sorting configuration to avoid an error when
sorting on the call number column. Also changed: removed obsolete UK
sort mention.

To test, search for serial subscriptions. Test sorting on all columns in
the results table with and without the RoutingSerials preference
enabled. Sorting should work correctly without error.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11719: (follow-up) fixed two more sorting issues

This second follow-up addresses QA issues:

- Corrected sorting on claims page while converting sorting
  configuration to up-to-date method.
- Removed sorting from routing list column on serial collection page.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>