Bug 9801: display facet labels in search results only when there are facet values

Currently, the headings for facets (such as location) are showing even
if there are no actual values/links for that facet type.

This patch simply checks if the facet array contains any facets before
printing the heading and HTML for each facet value/link.

Test Plan:

Before applying:

0) If you want to check the location facet (which is easiest),
enable singlebranch  mode in the globals system preferences.

1) Do a search for records/items that you have no shelving location
specified (or simply remove the shelving location for a small range
of records that you can find in a search query).

2) Note that "Location" appears amongst the facets even though there
are no values/links present. (If you look at the HTML source, you'll
see some empty HTML tags have been printed out.)

Apply patch.

3) Flush your cache and refresh your page.
4) You should no longer see a "Location" facet (or those empty HTML
tags) on the facet sidebar.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template changes only.
Checked according to test plan, made sure location facet
still shows up when values exist, otherwise it's hidden.

It might make sense to add ids to the facets so libraries
can decide to hide some of them easily. Or alternatively
add a system preference to make that possible.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7598: make strings in acquisitions JavaScript translatable

English strings in acq.js cannot be processed by the translation script.
This patch moves the strings to the templates to be set as JS variables
for use by the script.

To test:

- On the uncertain prices page, enter an invalid price and click save.
  You should see a JavaScript alert pointing this out.

- When adding a fund to an existing budget, enter an amount which
  exceeds the amount in the parent budget. You should see a JavaScript
  alert pointing this out. There is a similar function which has been
  corrected, checkBudgetParent(), but I don't know how to trigger it for
  testing.

The closebasketgroup function has been updated but as far as I can tell
it's not actually in use.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7598: [Follow-up] make strings in acquisitions JavaScript translatable

This follow-up addresses QA comments and moves punctuation and line
breaks out of the string to be translated.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10592: fix MARC21 006/008 cataloging plugins

Move the XML and XSD data files so that access to them
(particularly the XML files) is not blocked by the Apache
configuration change introduced by the patch for bug 9812.

To test, after applying the patch.

[1] Open a MARC21 bibliographic record in the cataloging editor.
[2] Click on the plugin link for the 008 field.  Verify that
    that the form for all of the fixed field positions is displayed,
    and verify that you can change the type of material.
[3] Repeat step 2 for the 006 field.
[4] Verify that there are no entries in the Apache error log that contain

client denied by server configuration: {...}/cataloguing/value_builder/marc21_field_008.xml

or

client denied by server configuration: {...}/cataloguing/value_builder/marc21_field_006.xml

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Also verified translation of those plugins still works correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10592: fix display of favicon

Move the favicon files for OPAC and staff so that they are not
blocked by the Apache configuration change introduced by the
patch for bug 9812.

Note that this patch makes the favicon customizable by theme,
not both theme and language.

To test, after applying the patch.

[1] Open pages in the OPAC and staff client.  Verify that the favicon
    is displayed in the usual place in your web browser.  Specific pages
    to test include

    - circulation receipts and slips
    - help
    - lists view
    - web-based self-checkout

[2] Verify that the Apache logs do not contain entries like this:

client denied by server configuration: {...}/prog/en/includes/favicon.ico

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified that the favicon displays correctly. Also
tried changing favicons for staff and OPAC using the
system preferences for those. This still works, where
the system preferences are correctly supported in the
templates.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8911: make sure history.txt gets installed where history.txt can see it

This patch makes Makefile.PL put the history.txt file in the right places
depending on the chosen setup layout, adds a reference to that place in
koha-conf.xml (and debian template version), and finally tweaks about.pl to
use it.

To test, apply the patch and verify that perl Makefile.PL runs fine, and
installing in
 - dev
 - single
 - standard
layouts works as expected. Then go to the about.pl page and see if Koha's
history shows there.

Then, build your packages and test on your newly created instances.

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>
Bug 7143 - Updating history and about page

First commit from Silvia Simonetti, went into the 3.12.x branch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
bug 7143: add latest batch of committers

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10604: increase width of two columns in the courses table

The department and term columns in the courses table started
as varchar(20), but since they refer to authorized values, need
to be varchar(80) to match authorised_values.authorised_value.  This
patch increases the width of those columns.

To test:

[1] Create two DEPARTMENT authorised values, one whose code
    is shorter than 20 characters and one whose code is longer
    than 20 characters.
[2] Create two courses; give one course the short department and
    the other the long department.
[3] Go to the courses list.  Observe that the department column is
    displays the department name only for the short course.
[4] Apply the patch.
[5] Edit the course with the long department and assign that long
    department to it again.
[6] Go back to the courses list.  Observe that both of the courses
    now display their assigned department.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified changes are consistent for new installations
and updated installations.
Passes all tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10604: DBRev 3.13.00.014

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10197: Add classes to patron info list

This patch adds classes to the patron info found on the
top left of the circulation and patron related pages to
allow for easy styling of the information displayed.

To test:

* Apply patch
* View a patron detail page and view the source on the list to the
  left to see the styles
* View a checkout screen and view the source on the list to the
  left with patron info to see the styles
* You could also try to style things by customizing your CSS

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template only changes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10552: make several sysprefs available to the OPAC login page

Several system preference variables are unavailable to the OPAC login
template because they are not explicitly enabled for that page. Instead
of adding them to Auth.pm using the old method this patch uses the new
system preference check syntax using the Koha TT plugin.

The following preferences are now checked using this syntax in
masthead.inc:

OpacAddMastheadLibraryPulldown
UseCourseReserves
reviewson
OpacShowRecentComments

In order for the call in masthead.inc to the new plugin to work on all
OPAC pages "[% USE Koha %]" must be added to any template which
includes it (most of them).

Also in this patch: A change to Auth.pm to enable correct display of the
LibraryName in the title of the OPAC login page.

To test, turn on the above system preferences and confirm that the
relevant links appear under the OPAC's main search bar on all pages
including the login page.

Confirm that the text specified in the LibraryName system preference is
shown as the title of the login page.

Confirm that course reserves and comments are displayed correctly on the
biblio detail page.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
I checked both prog and ccsr - all seems well and the links are appearing and disappearing in accordance with the appropriate sysprefs.

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10576: make strings in additem.js accessible to translation

There are a couple of untranslatable strings in additem.js. This patch
moves the strings out of the script and into the include file which has
been created for this purpose.

To test, apply the patch and test the process for adding an item to an
existing or new basket (with AcqCreateItem set to "when placing an
order."

The add item form should be correctly labeled "Add item." After adding
an item, click to edit it again. The form should now be labeled "Update
item."

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely and passes all tests.
Made sure strings can be translated testing with German templates.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10578: fix results sorting in staff interface

To test  (in librarian's interface):

1. Have some biblio records to get a list when searching.
2. Make an advanced search with 'as phrase' modifier (title -- ti,phr:
or author -- au,phr: , etc.)
3. Having the result list try to change the sort order.
4. You should get no results with a message like: "No results match your
search for 'au%2Cphr: " etc.
5. Apply the patch
6. Repeat steps 2. & 3.
7. You should get the list sorted according to your choice.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10586: fix CSS styling when printing cart from Firefox

When printing the Cart from Firefox the styling is off even though it
looks correct in preview. I think this may be because the preview is
including stylesheets designated for screen.

This patch removes special handling of JS and CSS assets for the Cart's
print view, letting the page handle print styling like other pages in
the OPAC.

To test, put items in your Cart in the OPAC. Open your Cart and click
the "print" link. Your printout should be correctly styled and match the
preview.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Tested both fail condition and condition with patch - display is much improved. Thanks, Owen!

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Works as advertised

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10516 - Improve titles, breadcrumbs, and confirmation messages for Z39.50 server adds and updates

The template for adding/editing Z39.50 servers shows the same title,
breadcrumbs, etc. for add and edit operations. This patch creates
separate text for each case.

To test, try both adding and editing a Z39.50 server. The page title,
breadcrumb, and heading should correctly reflect the operation you
perform.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely and all strings are translatable.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10516 - Follow up - Fixing capitalization

Fix capitalization on submit buttons when deleting
a Z39.50 server.

- Delete this Server
- Do Not Delete

I think the "Do not delete" should maybe even be a cancel
link to be more consistent with how Koha displays this
kind of dialog in other places.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
fixes capitalisation, tool stil works

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10557: remove unused branch parameter from GetBooksellersWithLateOrders

C4::Booksellers::GetBooksellersWithLateOrders has an unused parameter.
The $branch variable is never used in the routine.

Test plan:
Check that no behavior changes on the late orders page.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I couldn't find any use of the branch parameter apart from
the one corrected by this patch. Also tested late orders,
couldn't find any problems.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9755: Refactor record merge functionality

This patch refactors the merge record interface and code a little bit
in preparation for making it possible to merge authority records.

To test:
1) Apply patch.
2) Try merging two records:
    a) Create a list.
    b) Add two records you would like to (or be willing to) merge
       to said list.
    c) View said list.
    d) Check the checkboxes next to the two records you added.
    e) Click "Merge selected records."
    f) Choose a merge reference.
    g) Choose fields from each record that you want to keep.
    h) Click "Merge."
3) Confirm that your merged record has the fields and subfields you
   wanted.
4) Run the unit tests for the two files that were changed:
    prove t/Koha_Record.t t/db_dependent/Koha_Authority.t
5) Sign off.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9755 QA follow-up: move MARC-specific functionality to utility class

This follow-up moves all the MARC-specific functionality of Koha::Record
(now renamed to Koha::MetadataRecord) to a Koha::Util::MARC utility class.

To test, run relevant unit tests:
> prove t/Koha_MetadataRecord.t t/Koha_Util_MARC.t t/db_dependent/Koha_Authority.t
and optionally try to merge a record.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>