Address hash/list thinko; Ensure initialization

Two cascading defects were identified after being reported by users. The
first, which was only a potential issue, was an apparent lack of mod_perl
initialization for the item-age record feed.  While not the direct cause
of the error message, a lack of initialization here would manifest in the
same way.  So, we check that initialization.

Feed-generating callbacks were not being constructed properly due to a
simple thinko in the construction of the default record format list provided
by the SuperCat backend.  We need a list of two hashes, not a hash of two
keys.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Reinstate required TEXT SEARCH CONFIGURATION data

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Stamping upgrade script for reinstate tsconfigs.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
2.3.5 -> 2.3.6 SQL upgrade

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
2.2.7-2.2.8 database upgrade script

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Address SQL injection vulnerability in SQL ORM layer

If the user-supplied value and the db column are both numbers
(jsonObject->type == JSON_NUMBER, get_primitive(field) == "number") then
don't quote. Otherwise, quote.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Prevent compiler warning about unused numtype var

There was a dangling variable left around that was making noise in the
compiler. Credit to Jeff Godin for the heads-up.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Fixed bug in staff client offline mode.

https://bugs.launchpad.net/evergreen/+bug/1089657

In list.js at start you create obj.columns for lineno, but later
you don`t process this value so it`s return default render
function.  This code repairs this.

Signed-off-by: Dmitry Nechai <nechai.dmitry@gmail.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Minor change to chrome/content/util/list.js.

Change the initializer of this.count_for_display from 0 to 1 in
order to match the counting of other lists in the client and to
provide something that staff are likely to prefer.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Approximate number of search results

The number of results listed on the search results page is often an
estimate when working with a large set. Let's add the word "about" to
reflect the fact that it is indeed an estimate.

At the same time, I moved the <strong> tags out of the code, adding a CSS
class in its place, moved the HTML tags out of the translatable
string (as recommended by Pasi Kallinen), and fixed a typo in the
stylesheet.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Acq: re-use more code for two ways of creating invoices (EDI and manual)

This solves two problems.

 1) With EDI invoices, we had been failing to disencumber fund debits
    related to the invoiced lineitems, although that worked for manual
    invoices.
 2) With manual invoices, we would not automatically uncancel copies
    when the user decided to invoice them despite their canceled status.
    This was already working in EDI invoices though.  This is especially
    important since our schema lumps "backordered" in with "canceled,"
    and in theory backordered things do show up eventually.

There were earlier version of this commit out there with bugs that
prevented the EDI workflow from working correctly (the manual invoice
flow worked and still should).

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Allow combined search to be optional per class

Relevance is thrown off for, in paticular, the keyword class when combined
search is used.  This is because the effect of an opaque blob of data, such
as the keyword|keyword index definition, is to applify the inclusion of spurious
(to the user) data in matching attempts.

This commit adds the ability to specify, per class, whether combined FTS should
be used, and turns this on for only the subject class by default.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Stamping upgrade script for optional combined search by class

Signed-off-by: Ben Shum <bshum@biblio.org>
Fix schema.org mapping for MusicAlbum, add Map

We had set LDR[06] = j to MusicRecording, but that is really meant for
individual songs. Use MusicAlbum instead, and per
http://schema.org/MusicAlbum, use a new MusicGroup itemtype with a
'byArtist' property for the primary artist rather than the generic
'accountablePerson'.

Also map LDR[06] = e to Map, because that seems like a safe bet.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
TPAC: Fix schema.org name / dates for authors

Per http://schema.org/Person, the birth date and death date are not
supposed to be part of the name of a Person. We can separate these out
correctly based on subfield d for 100 fields.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
TPAC schema.org: Add Organization types for contributors

Given a 110 / 710 field, when generating the record details for authors
and contributors we can declare an http://schema.org/Organization
itemtype rather than just jamming the name under the "contributor"
property. This is more in accordance with schema.org directions.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Bring back #deleted modifier post-revive-qp-fts

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
QP: Limit to deleted records for #deleted modifier at this level

Down in the DB's query_parser_fts procedure, we also know whether we're
in a deleted_search, and in those cases we skip all visibility and
similar testing accordingly.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
QP: Repair edit_date, create_date, and bib_source filters

And also make records undeletable, where reingestion at undelete time
formerly balked in this manner:

> ERROR: duplicate key value violates unique constraint
> "record_attr_pkey" DETAIL: Key (id)=(1) already exists. CONTEXT: SQL
> statement "INSERT INTO metabib.record_attr (id, attrs) VALUES (NEW.id,
> new_attrs)" PL/pgSQL function "indexing_ingest_or_delete" line 129 at
> SQL statement

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Stamping upgrade for #deleted search modifier (and friends) fix

Signed-off-by: Mike Rylander <mrylander@gmail.com>