Use the batch-by-org AOUS lookup function to fetch settings with one
cstore call across a wide set of org units. This reduces the number of
cstore calls required, significantly in some cases, for single-use hold
targeter instances (like placement time targeting, checkin retargeting).
Specifically, in cases where a hold has targetable copies at multiple
circ libs, only one cstore call is needed for each of the
circ.holds.org_unit_target_weight and
circ.holds.target_when_closed settings, as opposed to one cstore call
for each per circ lib.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Use the CStoreEditor linked to the ::Single (child) targeter object when
possible to fetch org unit setting values.
In cases where settings for many org units have to be retrieved at once,
the settings lookups can take long enough that the in-transaction editor
on the child targeter can timeout. Using the child's editor directly
for the lookups will prevent this timeout and make the lookups a little
bit faster, since a new connect will not be required for each lookup.
This timeout scenario can occur with settings like
circ.holds.max_org_unit_target_loops and
circ.holds.target_when_closed, when there is wide variety of targetable
copies, because each have to be fetched once per target-able copy circ lib.
A secondary optimization would be a batch org setting lookup that
batches on org unit instead of setting name.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Allow the caller to pass a list of hold ID's (consistent with the
current hold targeter). This resolves the issue where the checkin
process attempts to retarget a set of holds via a single targeter call.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Pickup and requesting org unit IDs were passed in the wrong order to
the copy permit test. This resulted in some items, particularly age
protected copies, appearing on the holds pull list even though they were
not (yet) permitted for hold capture at a remoted library.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Identify holds to process by which metarecord the hold is (ultimately)
linked to within the main holds query instead of via a secondary filter.
This avoids the overhead of starting a new batch of hold targeters,
where each process has to fetch all possible holds, then filter down to
those targetable within the current parallel slot. In thise case, each
process only retrieves the holds it plans to process.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
1. Batch of tests for concerto hold 1 / title hold
2. Batch of tests for concerto hold 265 / metarecord hold with
holdable_formats restriction.
3. --skip-viable test
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Bill Erickson [Tue, 7 Jun 2016 21:32:14 +0000 (17:32 -0400)]
LP#1596595 Hold targeter refactoring and optimization.
* New open-ils.hold-targeter service
* Ports hold targeter code to a Perl utility function, communicating w/
the DB via cstore instead of storage.
* Adds a new global flag 'circ.holds.retarget_interval' for configuring
the hold retarget interval in the database.
* Adds a new DB function to regenerating hold copy maps to make map
deletion and creation more efficient.
* Adds an option for targeting holds in newest to oldest order.
* Caches all org unit settings per targeter run.
* Adds support for "skip_viable" option. This tells the hold targeter
to avoid modifying any holds that target viable copies. AKA "fix
broken" mode.
For example, you might run in skip_viable mode with a retarget
interval of 24hr once a day to repair non-viable holds, then also run
the targeter in regular mode once a day with a retarget interval of 48
hours to give staff 2 days to process viable holds.
* Hold target loops logic changes:
** Org units with fewer target attempts are prioritized during loop
processing. So, instead of segregating org units into 2 categetories,
those attempted in the current loop and those not attempted, sort those
not attempted by the number number of times they have been attempted.
Within each grouping, prioritize by target weight/proximity as before.
** All org units that have been attempted less than the max configured
amount are on the table for targeting, not just those that have been
targeted less than the current loop max. If no orgs with
less-than-current-max attempts are found, try orgs that match the
current max (but are still less than the configured max).
** When activated, target looping treats the pickup lib like any
other org unit. If a targeted copy at the pickup lib remains
un-captured, at re-target time, a copy at a different branch is
chosen (if one is available) even if other copies at the pickup
lib are targetable.
* Parallel targeting support baked into service.
Teach the targeter to process a subset of holds based on the number of
parallel targeters at play and the parallel targeting slot each targeter
instance occupies.
As with the existing hold targeter, group holds by their metarecord to
avoid multiple targeter processes targeting the same sets of potential
copies.
* Logging / code refactoring and clean up.
* New hold_targeter_v2.pl script for batch hold targeting. Existing
targeter remains for backwards-compat.
hold_targeter_v2.pl options:
--verbose
Print process counts
--parallel <parallel-process-count>
Number of parallel hold processors to run. This overrides any
value found in opensrf.xml
--target-all
Target all active holds, regardless of when they were last targeted.
--skip-viable
Avoid modifying holds that currently target viable copies.
In other words, only (re)target holds in a non-viable state.
--retarget-interval
Override the 'circ.holds.retarget_interval' global_flag value.
--parallel-init-sleep
Time to wait between starting each parallel instance. Useful for
avoiding dog-piling the DB.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Unprivileged users can retrieve organizational unit setting values
for setting types lacking a "view" permission. When the feature adding
Stripe credit card processing was added, the upgrade script neglected to
add the VIEW_CREDIT_CARD_PROCESSING permission to the organizational unit
setting type (which was included in 0396.data.org-setting-payflowpro.sql).
Fresh installs are not affected, but anyone who upgraded through 0863.data.stripe-payments.sql
(included in the 2.5.3-2.6.0-upgrade-db.sql version upgrade script) and is
using Stripe credit card processing should run this script.
Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Bill Erickson [Thu, 16 Feb 2017 17:17:55 +0000 (12:17 -0500)]
LP#1646166 Hatch printing multi root-node templates
Print templates with no root element or root elements that contained
necessary attributes (id, style, etc.) failed to print correctly in
some casese with Hatch HTML printing because the root node was dropped
after compilation. This commit changes how we extract the compiled HTML
from the page, using the more reliable method of pulling it directly
from the print element div instead of inspecting the compiled nodes.
Commit also wraps all content in <html/><body/> for good measure.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Hatch now inserts its attribute into the root documentElement instead of
the body. This is part of the move to using content_scripts instead of
declarativeContent for the extension.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Bill Erickson [Wed, 25 Jan 2017 21:40:15 +0000 (16:40 -0500)]
LP#1646166 Hatch loader matches on explicit DOM content
Make it more evident in the browser staff markup that Hatch is getting
requested by the page. Additionally, the <body> tag will never disappear,
though in theory <eg-navbar> could.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Hide printer settings in the print config UI when Hatch is not available
and provide better inline alerts. Avoid attempts by the printer config
UI from talking to Hatch when Hatch is known not to be available.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Bill Erickson [Wed, 18 Jan 2017 19:36:11 +0000 (14:36 -0500)]
LP#1646166 À la carte Hatch, on-call settings, strict access.
1. Hatch now supports a al carte features instead of requiring all-or-none
functionality. Supported features currently include printing, settings,
and offline. (Note: offline handling pending merge of offline UI code).
2. Adds support for on-call setting keys. On-Call keys are those that
can be set/get/remove'd from localStorage when Hatch is not avaialable,
even though Hatch is configured as the primary storage location for the
key in question.
The initital target use case for on-call keys are those that allow the
user to login and perform basic admin tasks (like disabling Hatch) even
when Hatch is down. AKA Browser Staff Run Level 3.
3. egHatch no longer attempts requests at Hatch, falling through to
local requests when Hatch fails. With the exception of on-call keys
(above), either Hatch is used or local requests are used, depending on
the configuration. The goal is to prevent any unintended and
confusing blending of local and remote data. In other words, if Hatch
is broken, it needs to be fixed or disabled for regular work flow to
continue.
4. Hatch now has a dedicated UI under workstation administration.
5. Workstation admin splash page rearranged to take advantage of more
horizontal space and avoid pushing so many options down the page.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Bill Erickson [Mon, 28 Nov 2016 17:12:47 +0000 (12:12 -0500)]
LP#1646166 Hatch extension connect via DOM, remote cache
Determine Hatch availability by checking for the presence of a
well-known Hatch attribute in the DOM, inserted into the page
by the extension at load time.
Cache get/set values when talking to the Hatch extension (on a per-page
basis) to reduce unnecessary Hatch I/O.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
1. Query printers for available options via Hatch.
2. Allow the user to apply print options on a per-context / per-printer
basis.
3. As before, store printer conifugration options via Hatch.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Replaces Hatch Websockets communication layer with browser extension-
based communication.
Hatch API remains the same with 2 notable exceptions:
1. appendItem() API call has been removed. It did not work as designed
and (thus far) has served no purpose. It was originally intended for
offline data storage, but that will probably require something a
little smarter.
2. The printer configuration API is no more. This will be replaced with
an in-app configuration page. Note, this does not prevent use of the
printer dialog, it only means settings are not collected from the
printer dialog.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
This patch fixes a problem where the bib fingerprint algorithm
could end up putting completely different works in the same
metarecord. For example,
100 $a Steel, Danielle
245 $a Blue
and
*no 1XX
245 $a Blue steel
previously (with stock config.biblio_fingerprint settings) got
a fingerprint of "bluesteel". With this patch, their fingerprints
are now:
"Title:blue Author:steel"
and
"Title:bluesteel Author:"
The upgrade script supplied with this patch remaps the metarecords
after updating the fingerprints. While existing metarecord holds
may get moved, note that there is no known way of ensuring that a
metarecord hold placed on a collided metarecord will end up attach
to whatever work the patron intended to request.
To test:
[1] Add records for "Blue" and "Blue steel".
[2] Note that they end up on the same metarecord.
[3] Apply the patch and perform the update.
[4] The two bibs should now be on separate metarecords.
Kathy Lussier [Wed, 22 Jun 2016 17:59:34 +0000 (13:59 -0400)]
LP#1553287: Add part information to biblio.fingerprint
Evergreen metarecord searching will sometimes group together different works
that are part of the same series because biblio.fingerprint doesn't incorporate
subfield n or p from the title. For example, bib records for the Mockinjay
movies list the Hunger Games in the 245a with Mockinjay in subfield p.
Without the part information in the fingerprint, Evergreen will group these
movies together with versions of the first Hunger Games book.
This branch adds parts subfields to biblio.fingerprint to allow us to
distinguish among different parts in a series.
Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Mike Rylander <mrylander@gmail.com>
Before the TPAC, a site could configure the OPAC to use metarecord searching
by default, via a configuration file. Here we bring that back.
A new setting is present in templates/opac/parts/config.tt2 to enable this
feature. By setting this to a true value (normally 1) the TPAC will silently
include the #metabib search modifier in the search form on any interfaces that
do not have a UI component that allows the user to control the setting.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
This feature will display sibling records when viewing a bib record in the OPAC.
Altered Record.pm to gather up additional metarecord information to pass to
misc_util.tt2 for parsing. Displayed on summary.tt2 styled in responsive in
style.css.tt2. Also fixed the URL in mmr search results for single bib results in
table.tt2. Transcendent bibs needed to be included in the unapi.mmr_mma function.
This code requires the code from LP1629108.
http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;
h=refs/heads/user/blake/LP1629108-metarecord-constituent-result-reroute
To test
-------
[1] Apply patch.
[2] In public catalog, add one or more bibs to the temporary
list ('My List').
[3] Click the 'View List' button, then verify that the titles
are displayed.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Jason Stephenson [Tue, 22 Nov 2016 19:35:58 +0000 (14:35 -0500)]
LP 1473054: No-op Checkin Should Not Always Float a Floating Copy.
Prior to this patch, a no-op checkin would not check if a copy should
float using the evergreen.can_float() function. It would simply float
the copy to the org_unit where the checkin happened if the copy had a
float value set.
This commit changes the behavior to use evergreen.can_float() to
determine if the copy should float to the org_unit where the checkin
happened. This change makes the behavior consistent with a regular
checkin.
blake [Fri, 10 Feb 2017 03:14:24 +0000 (21:14 -0600)]
LP1629108 Finalizing Search.pm removing if block
For ease of diffing, I left the old if block in place because removing it would
cause all of the lines to show changes when in fact it was just spacing. This commit
simply removes the if block and the spacing is the only change.
blake [Mon, 13 Feb 2017 21:19:45 +0000 (15:19 -0600)]
LP1629108 metarecord_constituent_result_reroute
This patch will route the metasearch logic through the "standard" search logic
in order to leverage the heavy use of filters and other features.
A column is introduced to unapi.mmr_mr to include the constituent bibs in the
return. A tweak was required in the template toolkit code to take advantage of the
new payload. This enables TT to decide which icons should be displayed when search
results are filtered.
Display the contents of the patron alert message in the web staff patron
summary side-bar. Alert displays below blocking penalties, above the
name, etc. with the same style as a blocking penalty.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Chris Sharp [Mon, 5 Dec 2016 22:46:02 +0000 (17:46 -0500)]
LP#1643932 - Fix search slowness when patron searching by username
Bug 1501781 introduced a feature to improve patron name searching,
but which was causing very slow queries when searching by username.
Adding an index to username solves the slowness problem.
Suggested by Mike Rylander.
Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
This patch fixes a regression introduced in 2.11 that had
the effect of making the stock Full Overlay merge profile
act like a match-only merge that also updates the bib source.
To test
-------
[1] After applying the patches, verify that the Full Overlay
merge profile now fullly updates the target bib record.
Jason Stephenson [Fri, 25 Mar 2016 01:35:27 +0000 (21:35 -0400)]
LP 1507807: Release Notes for In-House-Use Copy Alerts
Add a release notes document explaining how the settings work.
If you want to test the functionality, you should set the settings to
true. Next, find a copy with an alert message and another copy with
the check in alert set to true on its location. Recording an
in-house-use for either of these copies should cause an alert to
display the respective message. If a copy has both, then two alerts
will appear one after the other.
Resetting the settings to false or deleting the settings should stop
the alerts from displaying.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Jason Stephenson [Wed, 23 Mar 2016 01:25:17 +0000 (21:25 -0400)]
LP 1507807: Show Alert dialogs in XUL staff client.
If the circ.in_house_use.copy_alert org setting is true and the copy
has an alert_message, then we display an alert dialog with the copy
alert message when doing an in-house-use in the XUL staff client.
If the circ.in_house_use.checkin_alert org setting is true and the
copy location checkin_alert field is also true, then we display an
alert dialog with the "item needs to be routed to..." alert message
when doing an in-house-use in the XUL staff client.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Jason Stephenson [Sun, 20 Mar 2016 00:36:55 +0000 (20:36 -0400)]
LP 1507807: Show Alert dialogs in browser staff client.
If the circ.in_house_use.copy_alert org setting is true and the copy
has an alert_message, then we display an alert dialog with the copy
alert message when doing an in-house-use in the browser staff client.
If the circ.in_house_use.checkin_alert org setting is true and the
copy location checkin_alert field is also true, then we display an
alert dialog with the "item needs to be routed to..." alert message
when doing an in-house-use in the browser staff client.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
This idiom is no longer needed, as session information required to
generate a transaction ID is reliably passed to subrequests. Without
this patch, current Evergreen master and OpenSRF master will cause
the following methods to return not only their results, but also
"1" from each use of this idiom:
To test
-------
[1] Be running current Evergreen master and OpenSRF master
(or the 2.5 alpha)
[2] Run (say) open-ils.storage.actor.user.checked_out in srfsh:
[3] Note the extraneous 'Received Data: 1' sent prior to the substantive
response.
[4] Apply the patch and rerun step 2; note that this time
only the desired response is sent.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Bill Erickson <berickxx@gmail.com>
The Other menu in a patron's account was dropping down behind the specify due
date input box. A tweak to the zindex for the Patron Account tabs was needed
for the menu to display in front of the input box.
Test plan:
Retrieve a patron in the web client. To the right of the Patron Account tabs,
click the Other dropdown menu. The menu will appear behind due date input.
Depending on the browser / screen resolution, it may also hide one of the
options in the dropdown menu. After the patch is loaded, the menu should display in front of the input as expected.
There is an unused (and apparently never used) org unit setting
related to self checkout:
circ.selfcheck.require_patron_password
This commit removes the redundant unused setting, related
permissions, and related strings.
Thanks to Lynn Floyd with the Anderson County Library for pointing
this out.
Signed-off-by: Jeff Godin <jgodin@tadl.org> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Ben Shum <ben@evergreener.net>
Conflicts:
build/i18n/po/db.seed/db.seed.pot
Bill Erickson [Tue, 3 Jan 2017 16:59:26 +0000 (11:59 -0500)]
LP#1653742 Copy tree authoritative API share cstores
Avoid opening one cstore connection per requested org unit in the
open-ils.cat.asset.copy_tree.retrieve.authoritative API by creating a
single shared cstore connection at the top of the API shared by all
API actions.
Jason Stephenson [Sat, 10 Dec 2016 01:45:33 +0000 (20:45 -0500)]
LP 1648918: Remove Workstation at Root of User's Permission Tree
If you register a workstation at the root of the user's permission
tree in the webstaff client, you are not able to later remove it. The
Remove button is dimmed. You can remove a workstation registered at
any other org_unit where the user has the REGISTER_WORKSTATION
permission.
To reproduce this bug, login as the admin user and register a
workstation at the CONS org_unit. Then, go to Workstation
Administration and see that the Remove button is dimmed.
To test the patch, do the same, but see that the Remove button is not
dimmed. When you click it, the workstation is also removed.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Michele Morgan <mmorgan@noblenet.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Current acq behavior is that received items get a
copy status of "In Process". This status is typically
holdable and opac_visible, and some libraries have a need
for an intermediate status between "On Order" and "In Process".
Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Kathy Lussier [Fri, 6 Jan 2017 16:13:26 +0000 (11:13 -0500)]
LP#1654534: Prevent loop that occurs when staff us 'place another hold' link
A hidden field that tracked the page the user was on before placing a hold was
inadvertently removed in another bug fix. As a result, if staff used the link
to place another hold on the same title, they were stuck in a loop where they
couldn't return to the source page after hitting the 'continue' button. This
commit restores that hidden field.
Also provides a fix so that hold labels used in the place another hold link
can be translated.
Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Ben Shum <ben@evergreener.net>
Dan Pearl [Wed, 8 Feb 2017 22:57:20 +0000 (17:57 -0500)]
LP#1613341 - Patron name search should be punctuation-insensitive
O'Brien will be matched by Obrien, O'Brien, O Brien etc.
Grubbly-Plank will be matched by Grubbly Plank, Grubbly-Plank, Grubblyplank, etc.
This feature is controlled by the same org setting that controls ignoring
of diacritical marks.
Signed-off-by: Dan Pearl <dpearl@cwmars.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Galen Charlton [Mon, 6 Feb 2017 17:07:01 +0000 (12:07 -0500)]
LP#1541801: order search fields in Z39.50 alphabetically
This patch causes search fields in the Z39.50 search interface
in the web staff client to be place in alphabetical order by
field label.
To test:
[1] Open the Z39.50 search page in the web staff client and select
one or more search services.
[2] Verify that the list of fields is ordered alphabetically.
1) Use a unicode X instead of the string "Remove"
2) Provide a border around filters
3) Label filters with "Filtered by"
4) Only show "[X filters applied ]" when in mobile mode, and make it
work like the "Refine these results" button.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Mike Rylander [Tue, 15 Nov 2016 19:26:48 +0000 (14:26 -0500)]
LP1281280: Improve query tree compression
In addition to collapsing adjacent nodes sharing the same boolean operator,
we'll now also do the following two things: collapse filters, facets and
modifiers when there exists only a single subnode; and absorb single node
subplans.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
If one has a long list of boolean operations, such as can
be generated by third-party products looking for a book that
might have one of several different ISBNs, those are currently
searched separatelly, in a deep nested set of joined full-text
queries. This behavior was introduced to address problems of
non-deterministic grouping of boolean operations, along with
them generally not working in complex situations. We call
the mechanism "boolean push-down", because it explicitly
bifurcates the tree at each boolean operator.
This is suboptimal in the case of adjacent, like boolean ops.
This commit re-compresses the parse tree for adjacent nodes
that use the same boolean operator and are composed of atoms
only (that is, no modifiers, filters, or phrases). It ignores
any explicit groupings by the user, the "magical" floating
subplan, any subplans that include filters or modifiers, and
any nodes that have a mix of boolean operators between their
atoms.
This is probably more conservative that is strictly necessary,
and phrases would likely be safe, but baby steps.
Signed-off-by: Mike Rylander <mrylander@gmail.com>