Dan Wells [Fri, 5 Dec 2014 19:33:17 +0000 (14:33 -0500)]
LP#1198465 Lost fine handling refactor - first pass
This commit makes a first pass at moving the lost fine logic out of the
lost processing portion of Circulate.pm and into the new handle_fines()
method. This is accomplished through setting a new flag and lost
options hash on the main Circulator object.
A secondary change made here is that stop_fines is also now being set
during the handle_fines() stage.
Dan Wells [Fri, 5 Dec 2014 18:57:12 +0000 (13:57 -0500)]
LP#1198465 Stop using storage wrapper for generate_fines()
With pieces now in place, let's stop using the storage wrapper for
generate_fines() and call the code directly.
Also, to avoid potential confusion, rename the calling function in
Circulate.pm from generate_fines() to handle_fines(). This function
may also be taking on more than just fine generation in the near future.
Finally, since the new generate_fines() expects one or more pre-filtered
circ objects, add the requisite stop_fines check to handle_fines().
The generate_fines() method was split back in 2010. There is some
concern about the speed of checkin (e.g. via SIP for a sorter, where we
don't care about fines), and this may have been the reason for the
split. It might also have been the fact that waiting for the storage
xact to finish was causing the circ xact to timeout.
In any case, since we are bringing them into the same xact now, reason
number 2 is invalid, and reason number 1 won't be helped by the split
anymore (since there is no longer any parallel action). Let's bring it
back together.
Ultimately, as suggested by Mike, we will probably want to refactor a
bit and return a streaming response for sorting location, then a final
response once we have the fine generation figured out.
Generate overdue fines for lost checkins (if configured) within the main
body of the checkin transaction to avoid complications with negative
balance reconciliation.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Conflicts:
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
Remington Steed [Wed, 18 Jun 2014 13:34:13 +0000 (09:34 -0400)]
LP 1198465: Account for overdues voided the old way
The code for the particular case of "void"-overdues-for-lost is incomplete.
This is the one case in the new code where it now always adjusts rather
than voids, but the new restore code still needs to recognize cases where
the voiding happened under the old code.
Dan Wells [Tue, 1 Apr 2014 19:13:00 +0000 (15:13 -0400)]
LP 1198465: Delay creation of bill map for special bill handling
We were making the map, then deciding whether we wanted to void or
adjust. Since we only want the map if we adjust (and it creates havoc
when voiding), let's just get the bill IDs, then let the adjustment
code create the map it needs.
Dan Wells [Wed, 26 Feb 2014 22:49:49 +0000 (17:49 -0500)]
LP 1198465: Move overdue restore above lost void/adjustment
If a person loses something and has their overdues adjusted to zero,
then pays for part of it, then returns the item, the part they
actually paid should apply to the overdues. In order for this to
happen, the overdues must exist *before* the lost fines are adjusted.
- Replace ou_ancestor_setting() with ou_ancestor_setting_value() calls
This also fixed a bug where we were expecting just the setting, not
a HASH
- Reword interval checking
This fix is two part. First, we simplify the check to not require
the whole payment map. Second, we use this newfound simplicity to
push this check up into the gatekeeper functions, further clarifying
the code paths.
- make $note into $for_note for void_or_zero_bills_of_type()
Because the function can both void and adjust, we can't supply a
complete note, so let's just supply text of what the void/adjustment
is for.
Dan Wells [Wed, 26 Feb 2014 16:12:21 +0000 (11:12 -0500)]
LP 1198465: Refactor logic into gatekeeper functions
The bulk of this commits take the logic from adjust_bills_to_zero() and
moves it up a layer into the "gatekeeper" void_or_zero* functions.
This move also allows us to simplify the logic, since some facts are
already known based on our function path.
Also:
- give void_or_zero_overdues() a new signature to better support
multiple options
- add new 'force_void' and 'force_zero' options to this function
- rename real_void_bills() to simply void_bills() (since there is no
other void_bills(), the "real" was redundant)
Dan Wells [Tue, 25 Feb 2014 22:37:43 +0000 (17:37 -0500)]
LP 1198465: Restore voiding code, rename adjustment function
This commit restores the code we removed a few commits earlier, and
also renames "real_void_bills()" "adjust_bills_to_zero()" in order to
better delineate the split functionality.
This new payment type complements the current void logic that flags
bills as voided.
This new payment type is needed because the current way that Evergreen
voids bills requires that all voids happen in the same increment as the
bills themselves. This prevents voiding of a partial bill or a bill
that has had a partial payment applied.
This commit also adds the org. unit setting types for the conditional
negative balances enhancements:
Finally, create a helper function for checking intervals along the way,
and a handy little subroutine to void all bills of a given type on a
circulation transaction.
Dan Wells [Wed, 3 Dec 2014 19:49:54 +0000 (14:49 -0500)]
LP#1198465 First pass at generate_fines cstore conversion
Broadly speaking, this commit does two things:
1) Rewrite bits of the generate_fines copy in CircCommon.pm to use
cstore in place of the DBI code bits.
2) Gut the old generate_fines in Publisher/action.pm, then make it a
wrapper for the CircCommon verison.
Dan Wells [Wed, 3 Dec 2014 19:21:16 +0000 (14:21 -0500)]
LP#1198465 Allow null fields to stay null in to_fieldmapper()
In CDBI.pm, we can convert DB objects to Fieldmapper objects using
to_fieldmapper(). Part of the conversion was forcing stringification,
which does what we need for nested objects, but also converts 'nulls'
(undefineds) to 'empty' values. This causes problems when trying to
write these Fieldmapper objects back to the DB using cstore (or the
like).
This commit simply lets undefined values stay that way, which in turn
prevents NULLs from trying to become empty strings in the DB.
Remington Steed [Fri, 5 Dec 2014 15:29:48 +0000 (10:29 -0500)]
Docs: Web Client preview intro
This commit adds an introduction for the Web Client preview. It explains
what to expect as development continues, and where to give feedback. It
also includes the rationale from the 2.7 release notes.
Revised instructions based on my testing. Swapped around the Monster
and Default skin discriptions since the listed Alternate Skin is the default skin.
Kathy Lussier [Tue, 5 Feb 2013 15:24:17 +0000 (10:24 -0500)]
Add KPAC configuration info to the community docs
Adds the KPAC TechRef docs to root.txt so that this information can be
available via the community docs. Also adds a section to the docs on
configuring the alternate skin and removes a reference to configuration
from the end-user KPAC docs.
Fredric T Parks [Wed, 6 Nov 2013 23:36:32 +0000 (15:36 -0800)]
LP#1246839: marc_stream_importer.pl no longer crashes with vs 0.23 of File::Temp
updated marc_stream_importer.pl to use the 0.23 API
Signed-off-by: Fredric T Parks <fparks@catalystitservices.com> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Generate overdue fines for lost checkins (if configured) within the main
body of the checkin transaction to avoid complications with negative
balance reconciliation.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Dan Wells <dbw2@calvin.edu>
Mike Rylander [Thu, 25 Sep 2014 16:58:45 +0000 (12:58 -0400)]
LP#1198465 Allow fine generator to respect a stop_fines filter
In order to support situations where billings should be generated on
specific circs, even when stop_fines is set, we allow a filter to
be passed. The default of not passing a filter is the same as requiring
that stop_fines be NULL, which is the pre-commit behavior.
We also remove a never-used parameter.
Signed-off-by: Mike Rylander <miker@esilibrary.com> Signed-off-by: Dan Wells <dbw2@calvin.edu>
The commit to prompt users if they are going to lose data in MARC edit
added some new variables (tabs, and tab) in various files. If the MARC
edit window does not appear in a tab, then these variables remain
unitialzed and cause problems for MARC edits that appear in their own
window. By checking for the existence of the variables before MARC
edito loads in its own windown, the problems are resolved.
Signed-off-by: Liam Whalen <liam.whalen@bc.libraries.coop> Signed-off-by: Jennifer Pringle <jpringle@sitka.bclibraries.ca> Signed-off-by: Ben Shum <bshum@biblio.org>
LP1282277 & LP1282286 MARC edit save warning & TCN search warning
LP1282286 TCN search shortcut incorrectly prompts for lost data
When cataloguing in the Marc Edit view, users can hit Shift-F3 to bring
up the TCN search dialog box. After entering a TCN and confirming their
entry, they will be taken to the record specified by the TCN entered.
However, if the user has edited some data on the current marc record,
then another dialog box should appear before the TCN search box that
gives them a warning that they will lose data if they go to a new
record.
Currently, whenver a user presses the Shift-F3 shortcut, they are given
a warning about losing data regardless of the current state of the marc
record being edited.
When a record is edited, a key press event is captured and the function
oils_lock_page is called to record the page as edited. In the case of
this bug, the Shift key is not being ignored. So, when the user
presses Shift-F3, the marc record is locked as if it were edited, then
the TCN search function is called. After the user enters a TCN and
presses OK, the warning about lost data is displayed because the
pressing of Shift marked the record as edited.
This fix adds a check for the ev.shiftKey event in the
set_lock_on_keypress function call in marcedit.js.
Currently, if the user has edited a marc record and
pressed Shift-F3 to retrieve another record via TCN, then the prompt for
the TCN appears and after the user ok's that prompt they are prompted to
make sure they are ok with losing data.
This modification causes the prompt for lost data to appear before the
prompt for the TCN value. It requires modifying
chrome/content/main/menu.js, which will require a staff client update.
This fix also ensures that if users confirm that it is ok to lose
data but then cancel their TCN searches that they will be prompted that
they might lose data again if they do more TCN retrieving.
LP1282277 Prompt for lost data in Marc Edit
When using the MARC editor, if you modify a record and then use another
UI element to leave the MARC editor, you will be prompted that you might
lose data if you leave the MARC editor. Currently, this prompt does not
happen if the user uses an Action for This Record drop down menu item.
As well, if the user then returns to the MARC editor, the changes are
still present, but leaving the MARC editor no longer prompts with a
lost data warning.
This fix, adds checks to the Actions for This Record menu items, and it
adds some tab variables to keep track of the state of the MARC editor.
That way, if the user leaves then comes back and changes are still
present, the user will still get a lose data warning if they try to
leave again.
As well, when ever a key is pressed in MARC Edit that would result in
modifying a record, a counter is increased on a semamphor stored on
the XUL tab containing the Marc Edit UI. Currently, when the record is
saved, this counter is decremented by 1. However, the code checks to
see that the counter is 0 in order to determine if the tab is still
locked and data might be lost.
So, to fix this, we check in the unlock_tab code to see if we are in the
MARC Editor, and if we are, then we set the counter to 0. The
unlock_tab code is used when saving via the Marc Editor. It may be
used elsewhere in other parts of the Staff Client, so I have left the
original decrement by 1 logic in for all cases other than being in the
Marc Editor.
The fix was modified, because the previous fix was storing the flags that
indicated a change to a MARC record at the window level.
This new fix stores them at the tab level. I am keeping this commit
message to indicate that there were more Conflicts when mergin Sitka's
code into the community code. In case, I missed something and a record
of what was done needs to be consulted.
LP1282277 & LP1282286 MARC edit TCN search lose data prompts
This commit modifies my previous commits. The code now uses the
previous versions code to mark a tab as locked and to record that data
is saved or not saved. However, when a user returns to the MARC edit
screen, if there are changes still present, then the code now locks the
tab again and records that there is unsaved data. This should allow all
previous functionality to remain while providing the proper warnings
when within the MARC editor.
LP1282277 & LP1282286 MARC Edit and TCN lose data prompt
This commit sets the tab.marc_edit_changed value to false when the tab
is set. This means if an MARC record is edited in a tab then the tab is
set to another view, if the user then goes back to MARC edit, the tab
will not be locked because the flag will now be set to false. This
results in no warning being shown when a user tries to leave a MARC edit
page when they have not edited the MARC.
Signed-off-by: Liam Whalen <liam.whalen@bc.libraries.coop> Signed-off-by: Kyle Tomita <tomitakyle@gmail.com> Signed-off-by: Jennifer Pringle <jpringle@sitka.bclibraries.ca> Signed-off-by: Ben Shum <bshum@biblio.org>
LP#778989: Attempt to find "Correct" copy location
This adds a trigger to asset.copy that on insert or change of the location
and/or call number tries to find an identically named copy location that
is scoped to the owning library of the copy.
If it does not find one it uses the location provided.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Ben Shum <bshum@biblio.org>
If you don't supply a due date when creating a circulation with the
open-ils.circ.checkout family of calls, the due date is currently
calculated from now(). This code modification changes that so that
if a checkout_date is supplied that is used to calculate the due date
instead of now().
This enables some interesting uses of the open-ils.circ module for
batch circulation in the cases of offline use from a spreadsheet and
not the offline client or in the case of migrating circulations from
another ILS into Evergreen.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org> Signed-off-by: Dan Wells <dbw2@calvin.edu>
Adds documentation that describes how to use the local content bypass
feature of the AddedContent modules. This allows for local added content like
cover art, reviews, TOC, exerpts or annotations to be shown in bib records.
I also changed the headers in the External Added Content section to use title case.
Mike Rylander [Thu, 6 Nov 2014 21:03:36 +0000 (16:03 -0500)]
LP#1390225: Fail to care about errors from auth.session.delete
We're just tossing this call over the wall and moving on. We don't
care if the session wasn't there to delete or even if we didn't pass
a session to the server.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Mike Rylander [Thu, 6 Nov 2014 20:36:16 +0000 (15:36 -0500)]
LP#1390225: redirect to ctx.home_page instead of through ctx.logout_page
This way, we skip the auth.session.delete call that will error out because
we no longer have the authtoken cookie.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Bill Erickson [Tue, 21 Oct 2014 02:55:20 +0000 (22:55 -0400)]
LP#1366964 Update libdbi connection test error parsing
Modern version of libdbi return a slightly different error message for
queries which fail mid-transaction, causing an C-based DB backends to
exit abruptly unnecessarily. Update the error message test to include
the new format.
Includes Perl live test for confirming functionality.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Dan Scott [Tue, 21 Oct 2014 15:02:12 +0000 (11:02 -0400)]
lp1383763 - Display OpenURL embargo statement
The ResolverResolver service fetches the embargo statement (such as
"Last year not available") from OpenURL resolvers and stores it in a
target_embargo field. In JSPAC we used to display this along with the
coverage statement, because it is very important that people know that a
resource may be available from 1999 but the last year isn't available
online.
Restore the display of this information to the TPAC.
Signed-off-by: Dan Scott <dscott@laurentian.ca> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Galen Charlton [Thu, 23 Oct 2014 19:17:58 +0000 (12:17 -0700)]
LP#1384868: limit fund drop-downs on the invoice page to only active funds
This patch fixes the fund selectors for adding extra copies
and charges to invoices to only active funds (in addition
to the existing restriction to funds visible to the user).
Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Bill Erickson <berickxx@gmail.com>
Dan Wells [Thu, 9 Oct 2014 21:32:42 +0000 (17:32 -0400)]
LP#1379824 Make PermaCrud.js disconnect() actually disconnect
The disconnect() method in PermaCrud.js was meant to wrap the
underlying session disconnect, but it never actually disconnected
the session. This could lead to problems in long-living PermaCrud
objects, as they may think they are still connected when they are not
(the session remote_id is never cleared).
Also, remove a couple (now redundant) manual session.disconnect() calls.
Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Yamil Suarez <yamil@yamil.com> Signed-off-by: Ben Shum <bshum@biblio.org>
Dan Scott [Thu, 10 Apr 2014 14:59:49 +0000 (10:59 -0400)]
LP#1305958 Change copy table header atts to scope attributes
Per http://webaim.org/techniques/tables/data, the current best practice for
marking up tables for accessibility is to use the "scope" attribute for
headers, rather than the error-prone and markup-heavy "headers" attribute on
table cells.
Signed-off-by: Dan Scott <dscott@laurentian.ca> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Ben Shum <bshum@biblio.org>
Mike Rylander [Fri, 18 Apr 2014 17:45:59 +0000 (13:45 -0400)]
LP#1309664: Add some fixed field seed data for COM and SER
There are a few useful fixed fields we're missing mapping data for,
so this branch adds three: Freq, Regl, and File. There are certainly
more, but here's a bit that's of use to folks in the wild using the
fixed field editor improvements.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Ben Shum <bshum@biblio.org>
Ben Shum [Fri, 26 Sep 2014 21:05:39 +0000 (17:05 -0400)]
LP#1306814: Make use of patron timeout setting for selfcheck
As described in the bug, the library setting "Self Check: Patron Login Timeout
(in seconds)" does not appear to work with the newer selfcheck interface.
It looks like some of it was already being pulled in, like the variable, but
the interface was not utilizing it.
This commit borrows from the old JS selfcheck and implements a default of
three minutes for selfcheck timeout otherwise handled by the library setting.
Signed-off-by: Ben Shum <bshum@biblio.org> Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Mike Rylander [Mon, 29 Sep 2014 16:40:32 +0000 (12:40 -0400)]
LP#1374091: Speed up metarecord version of unAPI mra call
The change to metabib.record_attr_flat in the previous commit caused
a regression in the plan used in unapi.mmr_mra. This commit addresses
that by unrolling the mra view when used in context with metarecords,
which are shaped differently and require slightly different access
patterns.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Ben Shum <bshum@biblio.org>
Mike Rylander [Thu, 25 Sep 2014 18:34:20 +0000 (14:34 -0400)]
LP#1374091: Redefine view to help PG make better plans
The metabib.record_attr_flat view previously pulled its data
through several other intermediate views. While this improves
maintenance overhead, it ends up being an optimization fence
for certain data sets. So, we pull the logic from the leaf
views up into the main view. And, poof, 2 orders of magnitude
speedup on large data sets.
Signed-off-by: Mike Rylander <miker@esilibrary.com> Signed-off-by: Ben Shum <bshum@biblio.org>
Galen Charlton [Tue, 7 Oct 2014 23:42:18 +0000 (16:42 -0700)]
LP#1378575: teach action::hold_request about behind_desk
This patch teaches the CDBI class for the action.hold_request
table about the newish behind_desk column, preventing errors
like this from being thrown if a recent OpenSRF version is in
use:
Processing of hold failed: Can't locate object method "behind_desk"
via package "action::hold_request" at /usr/local/share/perl/5.14.2/OpenILS/Application/Storage/CDBI.pm line 181.
Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Ben Shum <bshum@biblio.org>
Jeff Davis [Fri, 16 May 2014 22:14:43 +0000 (15:14 -0700)]
LP#1314827: On login, don't allow referer-based redirect to external site
On /eg/opac/login, if no redirect_to param is provided, the TPAC will
attempt to use the referer (if any) as the redirect destination. This
leads to undesirable behavior if the referring URL is from an external
site.
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca> Signed-off-by: Ben Shum <bshum@biblio.org>
* Exporter repairs : use export_to_level
* pcrud personality call argument mod repair
* log pcrud personality json_query attempts loudly to ease transition
* CStoreEditor anon/pcrud personality live test
* CStoreEditor anon pcrud default to undef authtoken:
The presence of an authtoken ("ANONYMOUS") in the editor can be
misleading at higher levels of the code, since it implies a
presumably functional authtoken has been provided somewhow.
Apply ANONYMOUS only as needed to API calls instead.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Mike Rylander <miker@esilibrary.com>