Bug 9114: Make frameworks import/export routines correctly use UTF-8

Currently both the import_export_framework.pl script outputs data with
Perl's default encoding, ISO-8859. This patch properly sets
the binmode to UTF-8 when exporting SQL and CSV files using the PerlIO
layer (":encoding(UTF-8)") for STDOUT.

To test:

Export step test
- Use some ASCII character(s) with DIACRITICS in some field description
  in a chosen framework.
- Export the framework at Administration > MARC frameworks
- Run this to check the file is ISO-8859 encoded:
 $ file export_XXX.csv
 export_XXX.csv: ISO-8859 text, with very long lines
 (Note: try SQL and other output formats too. But not ODS)
- Apply the patch
- Export the framework again (change the name), and test encoding:
 $ file export_XXX_2.csv
 export_XXX_2.csv: UTF-8 Unicode text

Import step test
I assume you have two files, export_XXX.csv (ISO-8859 encoded) and
export_XXX_2.csv (XXX will depend on your framework's code)
- Reset your testing branch to master
- Import export_XXX.csv
- The string with non-ASCII chars is truncated at the first non-ASCII
  char's position (Note: this is the current behaviour).
- Import export_XXX_2.csv
- The non-ASCII chars are broken, the logs show errors on non-UNICODE
  chars.  (Note: even thou UTF-8 is the expected encoding it is
  treated as ISO-8859).
- Apply the patch
- Import the good (UTF-8 as expected) file and check everything worked
  as expected.

No double encoding should occur with either combination of formats.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
I put some Norwegian and accented letters in a fremawork to test.
Before the patch, the exported CSV came out as ISO-8859, after the
patch it came out as UTF-8. ODS and XML (viewed in LibreOffice)
both looked good, before and after the patch.

Importing the ISO-8859 CSV cut off the strings at the first non-ASCII
char. Importing the UTF-8 CSV worked as epected.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected, passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11403: (follow-up) Fix typo in renew help

This patch adds a missing letter to the Renew help file

To test:

Go to Circulation > Renew
Click Help
Confirm that the text now reads 'scan' instead of 'can'

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11762 - intranet & prog: Re-order 245 $a $b $h in results.

In the results view for OPAC and Intranet search results, titles are
currently displayed in 245 $a $b $h order. In detailed view the titles
are displayed in the better 245 $a $h $b order.

This patch corrects the behaviour for NORMARC and MARC21: all now
display 245 $a $h $b.

To test:
- Find records containing 245 $a $b and $h fields.
- Compare the way they look in detail and results view in OPAC
  (non-bootstrap) and intranet (you should see a discrepancies).
- Apply the patch.
- Re-check detail and results view: all should now look the same in
  both OPAC (non-bootstrap) and intranet.

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, works as described.
Checked with Magnus Enger about the changes for the NORMARC
stylesheets and the changes are ok.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11762 - bootstrap: Re-order 245 $a $b $h in results.

In the results view for OPAC and Intranet search results, titles are
currently displayed in 245 $a $b $h order. In detailed view the titles
are displayed in the better 245 $a $h $b order.

This patch corrects the behaviour for NORMARC and MARC21 in
BOOTSTRAP: all now display 245 $a $h $b.

To test:
- Find records containing 245 $a $b and $h fields.
- Compare the way they look in detail and results view on the OPAC
  (bootstrap).
- Apply the patch.
- Re-check detail and results view: all should now look the same
  on the OPAC (bootstrap).

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10647 - Make OPAC MARC plain view work for all flavours of MARC

On "MARC view" in the OPAC, clicking on "Plain view" does not work
for UNIMARC and NORMARC.

To test:
- Make sure you have a UNIMARC or NORMARC setup
- Go to the "MARC view" of a record in the OPAC
- Click on "view plain" and observe the "Sorry, plain view is
  temporarily unavailable." error message
- Apply the patch
- Click on "view plain" and observe that a plain view of the MARC
  record is now displayed
- Sign off

I have only tested this on NORMARC, it might be good if someone
can test on UNIMARC.

Updated 2014-03-13: Incoroprates changes suggested by Marcel.
Test plan is the same as before.

Updated 2014-03-13: Tested in my UNIMARC system.
toggled opactheme to all three values, with OPACXSLTDetailsDisplay
and OPACXSLTResultsDisplay both set to default.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with MARC21 and UNIMARC, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9366: add widget to bib editor to control display of the MARC tags

If the syspref hide_marc is set to "don't display", tags were not shown
by default.

This patch adds a checkbox to hide/show tags directly on the
cataloguing page. The value is stored in a cookie.

Test plan:
Enable/disable the sysprefs hide_marc and advancedMARCeditor in order to
check if the display is according with what the user want.
Reload the page and verify the value is kept.
The first value of the cookie is retrieved from the hide_marc pref.

Bonus:
This patch removes the link "Show MARCtag documentation links" if the
syspref advancedMARCeditor is enabled.

Signed-off-by: Joel Aloi <aloi54@live.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works as described, the editor will remember the choices
made by the cataloguer.

Passes all tests and QA script.

Notes:
- The error messages for mandatory fields upon saving only
give the tag number and not the description, so this might require
to turn back on the tag display.

- The advancedMARCeditor doesn't display the documentation links before
and after the patch was applied. I think it could still be useful for
an advanced cataloger to be able to look up information on a field quickly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11637: don't try to guess publication dates for irregular subscriptions

Test plan:
Create a subscription with an irregular numbering pattern.

Verify the prediction pattern. With this patch, it should show "unknown"
instead of the date of the first issue publication date.

This patch does not fix the issue on generating the next serial.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This is a partial fix for a small regression in the serials module.
Now the prediction pattern doesn't predict dates when you test it,
and shows 'Unknown' instead.

We still need to fix the 'planned date' set for the expected serial.
There should be no date, it should also be 'unknown'.

Passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>