erickson [Fri, 18 Feb 2011 14:35:03 +0000 (14:35 +0000)]
More user transaction retrieval API cleanup
Use consistent xact fleshing mechanism for circulations both for
less/cleaner code and to consistently take advantage of CSToreEditor for
authoritative support.
Added .flesh option to transaction history api calls, consistent with
non-history version.
Added a have_payments history call so we can limit retrieval to xacts
that had at least 1 payment
When making sub-req calls to payment API calls, call .authoritative as
appropriate
senator [Thu, 17 Feb 2011 20:53:36 +0000 (20:53 +0000)]
Booking: fix the targeter in the I'm-reserving-this-exact-resource-with-this-
exact-barcode case.
It should have always worked like this. This should better mirror the behavior
in the holds targeter when placing a copy-level hold. Basically don't fail
to target a resource for a reservation later just because it's not in an
available status right at this moment.
dbs [Thu, 17 Feb 2011 18:55:31 +0000 (18:55 +0000)]
Avoid mixed-content warnings due to HTTP link for Google Chrome Frame
We're hardcoding this to HTTPS for now to avoid the mixed-content warnings that
occur when content location is https:// and the linked script is at http:// but
a config-aware patch probably wouldn't be a bad idea.
dbs [Thu, 17 Feb 2011 03:27:53 +0000 (03:27 +0000)]
Teach maintain_901 trigger to respect the "Use record ID for TCN" global flag
Rather than relying on the Perl layer to set the correct TCN on the way in,
do it as part of the in-database indexing to ensure that we have consistent
results no matter how the record gets into the database.
miker [Wed, 16 Feb 2011 20:47:11 +0000 (20:47 +0000)]
Patch from Thomas Berezansky to implement circulation matchpoint value fallthrough, whereby specific rules can inherit values from generic rules.
Background, taken from https://bugs.launchpad.net/evergreen/+bug/635463:
Theory:
Make the things returned (circulate, duration_rule, recurring_fine_rule, max_fine_rule, hard_due_date, total_copy_hold_ratio, available_copy_hold_ratio and renewals) "fall through" when set to NULL.
The circ matrix edit screen has had some changes too, partially for showing "Inherited" in some places where appropriate, partially for field ordering and editing display and consistency. The fields that show up earlier contribute to tests that will be applied to the circulation attempt, while the "results" that do not change what rows are considered are grouped at the end.
Pros:
You can override a subset of those fields with a specific rule while allowing broader rules to fill in the holes.
This may result in less duplication of information across rules, making things easier to maintain.
Thus, this may result in less rules in general, and thus less processing time on sorting them overall.
Cons:
Manually figuring out the specifics of what will happen will take more time/effort.
Changing a single rule may have a greater unintended effect on other rules.
Staff would need training for when to have a rule fall through and when to set it specifically.
More time to return from the DB for any rule that is "falling through" to broader rules.
Examples for the following org tree:
CONS
-SYSA
--LIBC
--LIBD
-SYSB
--LIBE
--LIBF
Implementing the following "business" rules:
At the CONS level:
By default, everything circulates, uses DFLT_DUR duration, DFLT_RFINE recurring fine, and DFLT_MFINE max fine.
Circ Modifier "book" uses the duration BOOK_DUR
Reference flagged materials don't circulate
At the SYSA level there are no special rules.
At the SYSB level the max fine should be SYSB_MFINE.
At the LIBC level the recurring fine is LIBC_RFINE
At the LIBD level circ modifier "book" uses the DFLT_DUR duration instead of "BOOK_DUR"
At the LIBE level reference flagged materials circulate.
At the LIBF level there are no special rules.
The current method would require the following circ rules to implement those business rules:
erickson [Wed, 16 Feb 2011 15:07:04 +0000 (15:07 +0000)]
added option to open-ils.auth.session.retrieve to return the full cached object, which includes the auth time (cache timeout) of the cached user object
dbs [Mon, 14 Feb 2011 07:22:11 +0000 (07:22 +0000)]
Enable MFHD tests to find their testdata
When the MFHD tests wrapped in mfhd.t are invoked from outside of the directory,
they tests failed to find the mfhddata.txt file. Judicious use of the __FILE__
special literal and File::Basename::dirname() avoids that problem. Now we just
need to munge @INC to ensure that testlib.pm can be resolved (and hope that
no conflicts ever turn up).
dbs [Sun, 13 Feb 2011 03:14:21 +0000 (03:14 +0000)]
Teach authority_control_fields.pl about record ranges
Passing --record 10,000 times at the command line sucks, and
--all is not particularly realistic for large databases. Adding
--start_id and --end_id makes this script more usable.
Also provide reasonably full POD documentation, and rely on
Pod::Usage to provide help based on it when help is requested
or passed in options don't make sense.
dbs [Fri, 11 Feb 2011 21:39:48 +0000 (21:39 +0000)]
Normalize ISBNs by stripping hyphens in search methods and in reporter.materialized_simple_record
We weren't normalizing ISBNs in search or in reporter.materialized_simple_record
which required users to exactly match the form of the ISBN as entered in the
MARC record to get a successful search result - pretty hit or miss.
The longer term fix in 2.0 and above is to make the ISBN search search against
the identifier|isbn index, which also gets ISBN10/ISBN13 equivalence goodness.
But this patch will be relatively easy to backport through to 1.6.1 and plugs
some of the holes in our exposed APIs and search points in the short term.
miker [Thu, 10 Feb 2011 14:56:01 +0000 (14:56 +0000)]
Patch from Thomas Berezansky addressing his recent dynamic circ/hold field weighting patch.
Due to an oversight of auto-casting on my part dynamic weighting may incorrectly order similar rows that differ only in org unit or permission group.
Bad me for not testing for that case before now.
The attached patch should fix this. All it does is replace two functions, and in them replaces one INT variable with a NUMERIC(6,2) and a pile of integer constants with numeric constants (by virtue of adding .0 to them).
erickson [Wed, 9 Feb 2011 18:22:14 +0000 (18:22 +0000)]
allow item status update if either status-specific perm is allowed or UPDATE_COPY is allowed. fire off related A/T events after the initial transaction has been committed
miker [Tue, 8 Feb 2011 17:56:08 +0000 (17:56 +0000)]
Patch from Robert Soulliere to update settings-tester.pl
Changes include:
- Use Test::More perl module to replace eval/die tests for initial tests (as indicated in FIXME comment)
Note/question: should I add an install of the Test::More perl module in Makefile.install for Evergreen prerequisites?
- Add a statement to print postgresql version.
- Add an elsif during "driver" testing to say OK to SIP driver since this is used in telephony section. -- remove scary ERROR
- Add UUID::Tiny to perl module list of checks.
question: More perl module checks needed?
miker [Tue, 8 Feb 2011 17:22:00 +0000 (17:22 +0000)]
Patch from Thomas Berezansky addressing circ/hold config constraints, and their lack of usefulness.
The config.circ_matrix_matchpoint and config.hold_matrix_matchpoint tables have unique constraints that are intended to ensure that you have at most one entry in the table for each set of input conditions.
These constraints operate over a set of fields that can (in whole or part) be set to null, and thus don't do what they are intended to in most (if not basically all) cases.
[This patch] replaces the unique constraints with unique indexes. Nullable fields are coalesced into empty strings so that they can be matched against, and the index only applies to those rows set as active.
The included upgrade script cleans up the tables by taking each set of non-unique rows the unique index would fail on and setting all but the first (in id order) to active=false. If an administrator determines that the wrong row was left active they can toggle active off on the one that was left and back on for the correct one.
dbs [Tue, 8 Feb 2011 06:20:36 +0000 (06:20 +0000)]
Remove syntax error from O:A:Storage:Publisher:authority and add strict pragma
Came across a line of dead code while debugging a related problem, and
noticed that strict/warnings wasn't in place, so I culled the dead code
and added use strict/use warnings accordingly (now that we no longer
have the syntax error caused by the dead code).
dbs [Tue, 8 Feb 2011 06:12:24 +0000 (06:12 +0000)]
Create authorities that only contain controlled subfields (LP 712496)
Selecting "Create authority" on a field containing uncontrolled subfields
would generate an authority record that contained those uncontrolled
subfields. This would, in turn, prevent the "Validate" button from operating
correctly - if you added a 700 with $a and $c subfields, clicked "Create
authority", and then immediately clicked "Validate", the field would show
up as red.
Now we filter out the uncontrolled subfields before they get sent to
the "Create authority" function, avoiding this validation problem.
dbs [Tue, 8 Feb 2011 05:11:47 +0000 (05:11 +0000)]
Ensure new authority ID subfield is inserted in the correct XUL DOM location
Addresses LP 712499. After creating an authority via the context menu
in the MARC editor, the new ID subfield ($0) would be created right after
the subfield on which the context menu was invoked. It turns out that it
was being placed in the wrong location, and one symptom was that the
Validate button would not validate the controlled field against the newly
created authority.
Now we hunt through the parent DOM nodes until we find the 'sf_box' element
and then we append the ID subfield to that node. We also eliminate some
duplicate code by defining a common function so that the problem can be
fixed in one stroke...
dbs [Tue, 8 Feb 2011 03:49:36 +0000 (03:49 +0000)]
Prevent authority context menu on whitespace content
Continuing the refinement of LP 712538, if the subfield contains
only whitespace, treat it as though it were empty for the purposes
of the context menu.
dbs [Tue, 8 Feb 2011 03:43:08 +0000 (03:43 +0000)]
Prevent authority context menu from being displayed on empty content (LP 712538)
It's confusing to have the authority context menu - particularly the
"Create authority" options - appear for empty content. Check to ensure
that the subfield being clicked on actually has some content before
displaying the authority context menu.
erickson [Fri, 4 Feb 2011 00:14:26 +0000 (00:14 +0000)]
ported open-ils.actor.user.transaction.[fleshed.]retrieve to CStoreEditor both for cleanup and to take advantage of .authoritative. Use authoritative version in staff client
dbwells [Thu, 3 Feb 2011 16:47:49 +0000 (16:47 +0000)]
Two binding fixes for manage items
The first fix is more or less cosmetic. When selecting a target unit, both areas need to refresh in order to not show the selected unit's items in the main list.
The second fix involves handling cases where moving items from one unit to another does not empty the 'donor' unit. In those cases, we need to update the contents of both the new and the old unit.
dbs [Thu, 3 Feb 2011 14:15:47 +0000 (14:15 +0000)]
Authorities: control 610/611, do not control 4xx by default
The 4xx fields in bibliographic records have not been controlled
fields for some time (1988 for CAN/MARC, 1999 for USMARC per)
http://www.loc.gov/marc/bibliographic/bd4xx.html; and
http://www.oclc.org/bibformats/en/4xx/default.shtm also lists
these as obsolete. So, remove them from the default controlled
fields in Evergreen.
Also, add 610/611 to the controlled fields list (per LP #712467).
phasefx [Wed, 2 Feb 2011 19:34:36 +0000 (19:34 +0000)]
circ.claim_return.mark_missing was superceded with circ.claim_return.copy_status. It's still lingering in 1.6.1-2.0-upgrade-db.sql, and in other branches. Thanks to bshum for noticing
dbs [Wed, 2 Feb 2011 03:28:33 +0000 (03:28 +0000)]
Apply autogenerate barcode trigger to serial.unit to enable serial checkin
Serial checkin tried to use the '@@AUTO' macro to autogenerate barcodes,
but unfortunately the required trigger had only been defined on the parent
table asset.copy and not on the child table serial.unit. Here we define the
trigger on serial.unit to resolve that problem.
erickson [Tue, 1 Feb 2011 23:39:00 +0000 (23:39 +0000)]
make sure that inline overdue fines generation completes before we attempt to void overdues fines in checkin, otherwise it's possible to create multiple services (storage and cstore) competing for the same DB row mid-transaction, resulting in cstore timeouts and rollback of checkin. This could happen with backdated or amnesty checkins
senator [Tue, 1 Feb 2011 21:39:06 +0000 (21:39 +0000)]
Acq: Improving on r19351, don't let showCreatePane() be issued repeatedly to
fill the window with redundant dialogs, since a) it looks silly, and b) the
dialogs don't work when there are more than one of them. Thanks again Dan.
senator [Tue, 1 Feb 2011 21:15:22 +0000 (21:15 +0000)]
Acq: make the "new provider" button under Admin -> Server Admin ->
Acquisitions -> Providers not produce a dialog with a ton of mysterious
whitespace. Spotted by Dan Scott.
phasefx [Mon, 31 Jan 2011 18:53:20 +0000 (18:53 +0000)]
In actor.usr_purge_data, default destination user to admin (id=1).
Destination user is where we move things like reports and acq picklists when
purging staff members. However, if we tried to purge a patron that used to be
a staff member, then destination user was being set to null, which won't work
when updating things like requestor on holds. The purge UI checks for the
STAFF_LOGIN permission on the user to be purged for determining whether to
prompt for a destination user or not.
Some alternatives to this change might include:
1) always asking for a destination user (and defaulting to admin or the
logged in staff member), or
2) robustifying the stored procedure and surrounding code to raise an
expected exception whenever this edge case hits, prompting the UI to try
again after asking for a destination user.
dbs [Mon, 31 Jan 2011 03:30:42 +0000 (03:30 +0000)]
Add basic unit tests for Evergreen Perl modules
By "basic", I mean, "Can we use them without provoking a
syntax error?" and the answer is... all but one appear to
be clean, or have a legit reason for not being able to be
used normally. Stay tuned for the culprit...
dbs [Mon, 31 Jan 2011 02:14:37 +0000 (02:14 +0000)]
Make Evergreen Perl modules installable via Module::Build to match OpenSRF
Build.PL gives us an install-time check on dependencies; right now
the required versions are not set, but we can update these easily
to start catching some of the problematic modules that have tripped
sites up in the past.
Build.PL really seems to want a top-level "OpenILS.pm" so add a placeholder
accordingly.
Adjust references to /src/perlmods/ to /src/perlmods/lib/ even though
a number of the affected scripts are probably cruft.
Use autoconf to provide the default paths in O:WWW:Web and O:WWW:Method;
next step is probably to teach autoconf to ask Build.PL to do that for
us to make the OpenILS Perl modules more independent.
dbs [Sun, 30 Jan 2011 04:31:56 +0000 (04:31 +0000)]
Use the browse method instead of startwith for Manage Authorities, too
Now that the browse method is working properly, adopt it for the
Manage Authorities interface as well so that context around the
search term can be provided.
dbs [Sun, 30 Jan 2011 04:22:08 +0000 (04:22 +0000)]
Correct authority browsing for reals
First, restore the >= enable before and after ranges in
authority_tag_sf_browse(), after I mistakenly removed it in
r19131; the second storage request for $after does not
stomp on the prior $before results, it simply gets pushed
onto the carefully constructed list of $before results,
ensuring that our target is in the middle of page 0.
Second, we're treating all of the "tag" members in the
method registration as list references now (for the purpose
of searching against 4xx/5xx in the .refs. variants), but
that was blowing up when we registered just a single tag as
a string and tried to treat the scalar as a list reference.
I could have checked to see if what we had incoming was a
reference and dance accordingly, but opted to just define
all single-tag entries as single-element arrays instead.
Applied the same to startwith.
Finally, in r19331 I had used chop() to ensure that an
exact match for startwith would be returned as element 1 on
page 0, instead of appearing as the last element of page -1.
I had said that the right way to do this would be to naco_normalize()
the value to match the normalized afr.value, and so this is what
I have done. Rather than torturously using O:A:Storage:FTS to get
at the naco_normalize() definition, I moved the function into its
own Utils package and adjusted its usage accordingly through the
affected code. One step closer to single-sourcing the function
in the database, as well?
dbs [Sat, 29 Jan 2011 18:03:26 +0000 (18:03 +0000)]
For more predictable authority browse results, use startwith until browse is sorted out
authority_tag_sf_browse() was returning unexpected results when only a small
set of authority records was loaded. This may be an indication of a corner
case, but until we sort that out the more straightforward startwith should
be used.
Also, chop the final character of the incoming search value to ensure
that an exact match is returned on page 0 instead of page -1. For example,
'Bacon, Jono.' becomes 'Bacon, Jono' for the search. (The right thing to
do, come to think of it, is probably to naco_normalize the incoming value;
perhaps next patch).
senator [Fri, 28 Jan 2011 20:51:58 +0000 (20:51 +0000)]
Serials: Add some missing permacrud permissions to IDL
7 classes (sdistn, siss, sunit, sin, sbsum, sssum, sisum) were missing IDL
perms. Appropriate permissions were added to all but sin (serial_item_note).
For the sin class, since it's several leaps away from anything that points at
an org unit, and since no existing code deals with it via PermaCrud, its
PermaCrud section was simply removed.
Some classes retain open <retrieve /> permissions, and others do not.
No new permissions were created for this. All permissions are reused from
"higher" serials objects.
Credit to Mike Rylander for spotting the omissions.
phasefx [Fri, 28 Jan 2011 19:38:57 +0000 (19:38 +0000)]
Replace the native dump() function with a wrapper function that takes an optional 2nd parameter for log level (defaults to debug)
Log level: 0 None, 1 Error, 2 Warning, 3 Info, 4 debug
A global _dump_level variable gets consulted when the function is used. The default is 2, Warning.
So by default, until we start changing things, this will suppress most of the existing dump statements. Some are slipping through the cracks based on when the function replacement happens, but I'm happy with it. We also prepend the dump msg with a label for the log level.
_dump_level could be locally customized with server/skin/custom.js
miker [Fri, 28 Jan 2011 14:58:37 +0000 (14:58 +0000)]
Patch from Thomas Berezansky addressing logical importance of various circulation and hold matrix matchpoint components.
Previous to this commit, INDB circ and holds use a pre-defined weighting set for rule ordering. This can be changed via replacing the relevant "find" functions in the database, but this is not easily done for most people.
The weight set for circ matchpoints is obtained based on the context ou of the circ (aka, where the circ is happening).
The weight set for hold matchpoints is obtained based on the item's circ library (aka, where the item lives).
Optionally, add an enabled circ.holds.weight_owner_not_circ internal flag to have the weight set for hold matchpoints be obtained based on the item's owning library (owner of the call number).
TODO: discuss promotion of circ.holds.weight_owner_not_circ to a Global Flag; wikified or docbook'd documentation and use-case examples.
phasefx [Thu, 27 Jan 2011 20:58:41 +0000 (20:58 +0000)]
Make window.print() configurable. The "Mozilla Print" strategy is internally identified as 'webBrowserPrint', and it uses XPCOM for printing the contents of an HTML document. However, in some cases we override this with a 'window.print' strategy to workaround bugs. A problem with this has been that an actual bare javascript window.print() does not honor any of configured "gPrintSettings". However, it is informed by (and in turn informs) a Mozilla preference called print.print_printer. Right now window.print (if used from within the JSAN util.print library) only gets called in when in the Default printer context/role. So we force print.print_printer to equal the configured printer for the Default role. Have I mentioned that I hate printing in Mozilla?
senator [Wed, 26 Jan 2011 23:04:56 +0000 (23:04 +0000)]
Serials: add "clone subscription" functionality to alt serials control
This feature clones subscriptions and all the objects related to them
that don't describe holdings. Should help speed users' workflow when setting
up subscriptions.
gmc [Wed, 26 Jan 2011 21:58:47 +0000 (21:58 +0000)]
patch to edi4r
This is a patch to edi4r which has been submitted; sticking
it here temporarily since at the moment it's unclear whether
edi4r still has an active maintainer.
This patch fixes a bug where question marks in the bibiographic
description ended up being escaped three times over.
gmc [Wed, 26 Jan 2011 19:05:52 +0000 (19:05 +0000)]
remove redundant finalize
Already handled by OpenILS::Mapper, and has the effect
of making a parsing bug in edi4r worse by causing
question marks in the EDI data to be escaped multiple
times.
phasefx [Wed, 26 Jan 2011 15:36:49 +0000 (15:36 +0000)]
Staff client portal page replacement by Michael Peters, with a few tweaks.
Thanks!
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Signed-off-by: Michael Peters <mrpeters@library.in.gov>
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19305 dcc99617-32d9-48b4-a31d-7c20da2025e4
dbs [Tue, 25 Jan 2011 19:18:02 +0000 (19:18 +0000)]
Update README to include --admin-user / --admin-pass options for eg_db_config.pl
As the default Evergreen administrator account is now created with
a randomized user name and password, we have added the options to
eg_db_config.pl to reset those to something known and specific to
a given instance.
Also, Fedora 13 is getting close to retirement, update to Fedora 14 for
supported distros.
dbs [Tue, 25 Jan 2011 06:17:46 +0000 (06:17 +0000)]
Teach the i18n Makefile how to handle serial.properties
Also check in the POT for serial.properties and some other
foobar.label matches for foobar.accesskey (does not have
an effect on properties files but hopefully if we're
consistent then the pattern will be evident for entities).
Noting in passing that there are a number of "foobar(s)"
comined singular/plural labels that should be split to
support translation.
dbs [Tue, 25 Jan 2011 03:09:18 +0000 (03:09 +0000)]
Fix existing serial entities that didn't provide .label partners for .accesskey
The translate-toolkit project generates a POT file from an input DTD
that requires entities ending in .accesskey to have a corresponding
.label entity; this is a Mozilla convention for localization. Fix up
the serial interface strings that are localized to match this expectation.
Also remove two duplicate entities in lang.dtd that were flagged by
the build/i18n/tests/check_entities.py script (and which cause Launchpad
translation imports to break).