Fix TPAC shelf browser's previous link

Line fix suggested by Thomas Berezansky.

The cnoffset was strictly checking for values that start with a digit.
But negative numbers start with a "-" instead. Once this check was
changed, the previous link will continue to move further into negative
offsets.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
TPAC - fix alignment of "You are now browsing..." in shelf browser

The "You are now browsing..." message does not align to the center of the
page. Changing the <div> to a <p> seems to properly align the text.

Along the way, we should remove the extra <span> and <strong> (the strong
is redundant with the css being inherited by color_4 class) and make the
new single line message more i18n-friendly for future translations.

Credit to Michael Peters for noticing the problem and thanks to Dan Scott,
Lebbeous Fogle-Weekley, and Thomas Berezansky for help via IRC for the
i18n-bits.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Make opac/results.tt2 remember facet when sorting, etc.

Add a hidden field in the search form and set its value to the value
of the CGI 'facet' param if the facet parameter is set.  This appears
to work for multiple facets.  Clearing a facet is as simple as clicking
on the gray-backgounded facet name.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
TPAC - add library scoping to shelf browser

The shelf browser currently uses the 'loc' variable to define scoping and
limit browsing to specific org units. However, since much of the scoping
actually uses 'locg', the scoping was broken for the shelf browser.

Additionally, under Advanced Search's Numeric Search, the option for
'Call Number (Shelf Browse)' only applies the 'cn' variable to searches
and never adds the search scope, despite the search library now being
an available filter choice.

Based on suggestion by Dan Scott in IRC, this patch uses the function for
_get_search_lib() to retrieve the search library and add it to both parts
of the shelf browser.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
TPAC: Reset Form and New Search should clear queries

Currently, clicking "Another Search" in the search results page, or
"Reset Form" on the advanced search page, keeps the same query terms and
type around. Clear these parameters as expected; essentially, we keep
only the search location (loc or locg) in scope.

Note that we explicitly keep parameters around when someone is going
from a basic search to an advanced search, because the assumption is
that they want to refine their search further.

Also affected are the org_selector, because we want to pull the logic
for loc or locg out into a common area (the get_library block in
misc_util.tt2), and the style (input.opac-button elements now get styled
the same as a.opac-button elements, which makes it easier to intermingle
them on the same form).

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>
Change "Reset form" to "Clear Form"

As suggested by Thomas Berezansky in the comments on LP 994058, change
the button from "Reset form" to "Clear form" to be absolutely clear
that the button now removes all previous search variables.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Fiscal year selector in ACQ order record upload

* Support a 'fiscal_year' parameter to ACQ order record upload API.
* Adds a new "Fiscal Year" selector to the upload form to facilitate
  uploading orders to different fiscal years.

This partially resolves LP 1031927 by allowing manual selection of the
correct fiscal year.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Enable pcrud access to fiscal year / fiscal calendar

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Default to current fiscal year in ACQ order upload

* Adds a new API call to determine the current fiscal year for a given
  org unit:  open-ils.acq.org_unit.current_fiscal_year

* Use open-ils.acq.org_unit.current_fiscal_year to populate the correct
  fiscal year in the ACQ order upload selector.

This addresses part 2 of LP 1031927

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
TPAC - fix pickup locations for edit holds

When a patron goes to edit a hold in TPAC, they have the option to
choose a different pickup location. Unfortunately, it looks like that
dropdown does not prevent them from selecting locations that aren't
normally allowed for pickups, such as system groups or consortium
itself.

This patch adds a check for 'can_have_vols_only' to the edit holds
screen.

Credit to Melissa Lefebvre for finally nailing down the source of
the issue.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Physical Location Fixes/Enhancements

Teach the physical location retrieval function about using an ENV var.

This allows a subdomain to force a specific physical location, say by adding
to their apache config:

SetEnv physical_loc 4

Rewriterules could also be used for more dynamic configuration.

Also, as a fix:

Have preferred library use the stored physical location instead of assuming
that CGI has the setting all the time.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Change grammar for lost and missing failure messages

Update to the lost and missing failure wording to make it
gramatically correct.  Removed the word "has" from both
messages.

Signed-off-by: Melissa Lefebvre <mlefebvre@biblio.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
TPAC - Fix footer on hold history page

The hold history page was missing an ending div tag to complete the
block which leads to the footer being generated incorrectly on that
page.

Adding the ending tag repairs the display of the footer to match all
the other pages.

Credit to Melissa Lefebvre for noticing this discrepancy.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
TPAC: Give login boxes a border

For some reason, the boxes for the login form were stripped of
their default border style. Let the natural input box formatting for the
border shine through and give users an easier target when logging in.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
TPAC: Silence two uninit variable warnings

These warnings were being thrown on every TPAC page request, slowly
filling the logs:

Use of uninitialized value $set_locale in string eq at
/usr/local/share/perl/5.10.1/OpenILS/WWW/EGWeb.pm line 159.

Use of uninitialized value in pattern match (m//) at
/usr/local/share/perl/5.10.1/OpenILS/WWW/EGCatLoader.pm line 250.

Banish them.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Silence warnings in search results for holdable copies

Have not yet determined the exact reason the holdable copies size is not
defined in some instances in the search results only, but this commit
prevents warnings from being spewed by apache about undefined variables.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
SuperCat fixes - Child Init

Sometimes it seems that child_init has not run properly for supercat.

This attempts to fix that by checking for the global appsession objects. If
they are not there we run child_init. The function that does this is being
called from all handler entry functions.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Check for filled hold on transit checkin

"Fill related hold" can grab a hold out from under a transit, so check for
filled holds in addition to canceled ones.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Trying to update patron CSS color fails here, so don't try

After modifying user standing penalties ("messages" in the staff client
patron interface), you could get this error message in an alert() dialog:
    TypeError: patron.display is undefined.

We were apparently trying to use patron.util.set_patron_css() wrongly,
so the commented out changed verison of the call got farther, but stopped at
    ...penalties[i].standing_penalty().name is not a function.

Which probably has something to do with unfleshed data.  Somebody can
get to the bottom of this if they want, but for now it's easier just not
to try to do this and make the alert() dialog go away.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Stage 1: Perl

Attempt to ensure that we always write to oils://remote when needed.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>