Bug 10058 - Fix unapi for NORMARC

This patch uses a lot of MARC21 XSLT to transform NORMARC records
to desired formats. Since NORMARC is mostly a subset of MARC21, I
think this should give passable results. And better results than
no unapi-support at all for NORMARC!

To reproduce:
- Make sure you have marcflavour = NORMARC
- Visit /cgi-bin/koha/unapi in a browser
- Observe the empty <formats></formats> element

To test:
- Apply the patch
- Visit /cgi-bin/koha/unapi in a browser
- Observe the the list of formats in the <formats></formats> element
- Import the provided sample NORMARC record and make a note of its
  biblionumber
- View the record at /cgi-bin/koha/unapi?id=koha:biblionumber:x&format=y
  where x = the biblionumber of the sample record and y = one of the
  formats marcxml, marcxml-full, mods, mods-full, mods3, mods3-full,
  oai_dc, rdfdc, rss2, rss2-full and srw_dc
- Check that the transformed records make some kind of superficial
  sense

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10058' into 3.14-master
Bug 10074 - Encoding problems at login time

Bug 6554 patched output_html_with_http_headers to encode utf8 data, and Templates.pm to expect utf8 data to be encoded.
(At least) the staff login screen outputs directly to STDOUT (Auth.pm does, WHICH IS WRONG!) and wasn't fixed to do the encoding first.

This patch makes it use output_html_with_http_headers and solves the problem.

Changed 'use' for 'require' as jcamins and marcelr suggested.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 10074 - Encoding problems for installer

Bug 6554 patched output_html_with_http_headers to encode utf8 data, and Templates.pm to expect utf8 data to be encoded.
The Installer page login screen outputs directly to STDOUT (InstallAuthAuth.pm does, WHICH IS WRONG!) and wasn't fixed to do the encoding first.

This patch makes it use output_html_with_http_headers and solves the problem.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 10074: QA Followup for InstallAuth.pm

Moving use Output.pm to optional require.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10074' into 3.14-master
Bug 10019: Fix for userid containing UTF8 chars

Decodes userid on two places in checkauth of C4/Auth.pm

Test plan:
Include some non-Latin characters in your userid (loginname). Arab, Chinese?
Login into opac and check user page.
Go to staff (no new login), check your login name at various places.
Logout, login via staff.
Do the same.
Go to opac again (no new login), check user page.
Optionally: Remove all your sessions from table. Do a login. Check sessions.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Works as described. No errors.
This patch fixes this problem, but I wonder if
there is a general solution that handle all as utf8.
Tested in opac and staff.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10019' into 3.14-master
Bug 10072 - "my suggestions" always says "There are no pending purchase suggestions."

Test Plan:
1) Switch off the IndependantBranches syspref
2) Log into the OPAC
3) Place a suggestions
4) Instead of seeing your suggestion, you will see "There are no pending
   purchase suggestions."
5) Apply this patch
6) Reload the page
7) You should now see your suggestions

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10072' into 3.14-master
Bug 9951: Followup for Tools

Adds decoding for Patron Cards/Patron Search and Tags (moderation).

Test plan:
Goto Tools. Add accent with diacritics in both areas. Check if you do not see
converted characters.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 9951: Followup for tools/viewlog.pl

Adds utf8 cgi parameter decoding.

Test plan: Enter diacritics in librarian field. Submit. Check.

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

This is ok in this case, as we are not doing any post/get of binary
data, but I note from the man page

This makes CGI.pm treat all parameters as UTF-8 strings. Use this with
care, as it will interfere
with the processing of binary uploads. It is better to
manually select which fields are expected
to return utf-8 strings and convert them using code like
this:

  use Encode;
  my $arg = decode utf8=>param('foo');
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9951' into 3.14-master