From 488ac1d576f39d859a9e510c5d8762ab5dae9081 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Wed, 16 Nov 2011 12:37:15 -0500 Subject: [PATCH] Bumping version numbers, adding Upgrade Script and Changelog Signed-off-by: Thomas Berezansky --- ChangeLog | 779 ++++++++++++++++- Open-ILS/src/perlmods/lib/OpenILS/Application.pm | 2 +- Open-ILS/src/sql/Pg/002.schema.config.sql | 1 + Open-ILS/src/sql/Pg/2.1.0-2.1.1.sql | 951 +++++++++++++++++++++ .../staff_client/chrome/content/main/about.html | 2 +- .../xul/staff_client/defaults/preferences/prefs.js | 2 +- README | 8 +- configure.ac | 4 +- 8 files changed, 1739 insertions(+), 10 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/2.1.0-2.1.1.sql diff --git a/ChangeLog b/ChangeLog index 3323187d13..7eabee947f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1 +1,778 @@ -#ChangeLog +2011-11-16 Mike Rylander + + * Open-ILS/src/sql/Pg/002.schema.config.sql, + Open-ILS/src/sql/Pg/upgrade/0650.function.copy_visibility_vs_peer_b + ibs.sql, Open-ILS/src/sql/Pg/upgrade/XXXX.temp.sql: Stamping upgrade + script for copy visibility vs peer-bibs fix Signed-off-by: Mike Rylander + +2011-10-24 Thomas Berezansky + + * Open-ILS/src/sql/Pg/999.functions.global.sql, + Open-ILS/src/sql/Pg/upgrade/XXXX.temp.sql: Distinct + cache_copy_visibility copy/record Because if you peer bib a copy to the bib it is on things don't like + you. Signed-off-by: Thomas Berezansky Signed-off-by: + Mike Rylander + +2011-11-15 Mike Rylander + + * Open-ILS/src/sql/Pg/002.schema.config.sql, + Open-ILS/src/sql/Pg/upgrade/0649.schema.fix_full_circ_count_view.sq + l, + Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_full_circ_count_view.sq + l: Stamped upgrade for full circ count view fix Signed-off-by: Mike Rylander + +2011-09-29 Thomas Berezansky + + * Open-ILS/src/sql/Pg/extend-reporter.sql, + Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_full_circ_count_view.sq + l: Use DISTINCT in counts to avoid dupes Otherwise you get: Legacy count + 2(normal count)(aged count) Signed-off-by: Thomas Berezansky Signed-off-by: + Mike Rylander + +2011-09-29 Dan Wells + + * Open-ILS/src/sql/Pg/extend-reporter.sql, + Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_full_circ_count_view.sq + l: Full Circ Count View Amplifies Legacy Circs The current extend_reported.full_circ_count sums the legacy circ + count column, but this results in amplifying the count by the number + of current circs in the system. This commit adds the legacy count + to the GROUP BY instead of summing it. Signed-off-by: Dan Wells Signed-off-by: Mike + Rylander + +2011-09-28 Lebbeous Fogle-Weekley + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm, + Open-ILS/web/opac/extras/circ/alt_holds_print.html, + Open-ILS/web/opac/extras/circ/alt_holds_print.js: Fix a problem in + the clear holds shelf list printer This is a "special" interface that you get to via Admin -> For + Developers -> Local Administration in the staff client. The addition features to one "side" of this hackish interface of + label affix and parts had caused breakage on the other "side." This + fixes that. Also improve document printing, making it less likely the progress + dialog itself gets printed. One day this will be replaced with something better. Signed-off-by: Lebbeous Fogle-Weekley + +2011-11-15 Mike Rylander + + * Open-ILS/src/sql/Pg/002.schema.config.sql, + Open-ILS/src/sql/Pg/upgrade/0648.function.merge_record_assets_meets + _acq.sql, + Open-ILS/src/sql/Pg/upgrade/XXXX.function.merge_record_assets_meets + _acq.sql: Stamped upgrade for asset.merge_record_assets fix Signed-off-by: Mike Rylander + +2011-09-13 Jason Etheridge + + * Open-ILS/src/sql/Pg/999.functions.global.sql, + Open-ILS/src/sql/Pg/upgrade/XXXX.function.merge_record_assets_meets + _acq.sql: LP#849143 fix some gaps in bib record merging Tweaks asset.merge_record_assets such that it considers acquisition + line items and user requests, serial subscriptions, booking resource + types, biblio monograph parts, and biblio peer bib copy maps. I'm + not handling vandelay.queued_record.imported_as or any other + vandelay tables, but we may wish to do that too. We're also leaving + acq.acq_lineitem_history alone. Signed-off-by: Jason Etheridge Signed-off-by: + Mike Rylander + +2011-11-01 Liam Whalen + + * Open-ILS/xul/staff_client/server/cat/marcedit.js: Aligned the MARC + editor subfields to 'start' fixes long subfield display When viewing a record in the MARC editor that has extremely long + entries in a subfield, the output would align in the center of the + subfield making the output hard to read. This patch adds an align: + 'start' option to both the subfield, and the subfield code elements + in the marcSubfield function to make the subfields align in a more + readable manner. Signed-off-by: Liam Whalen + Signed-off-by: Mike + Rylander + +2011-11-15 Mike Rylander + + * Open-ILS/web/js/ui/default/actor/user/register.js: Patch from Jeff + Davis (SITKA) fixing cardless patron updates Quoth the bug report + (https://bugs.launchpad.net/evergreen/+bug/851110): On our Evergreen 2.0.8 system, it sometimes arises that a patron's + card gets deleted. If it was the patron's only card, it becomes + impossible to add a new card to the account via the staff client. How to reproduce: 1. Retrieve a patron record for a patron who has no associated + card. 2. Click the Edit button. 3. Click Replace Barcode and enter a new barcode. 4. Click Save. This does not work - the process hangs, and if you + hit Reload, you will find that your changes were not saved. I believe this happens because some code in register.js assumes + the patron has at least one card. I have a potential fix that this + comment box is too small to contain ... uh, that is to say, I will + post it momentarily. Which he did, and I applied. Signed-off-by: Mike Rylander + +2011-10-19 Steven Callender + + * + Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/act + ion.pm: Reshelving update. Update to the reshelving code to make it faster and utilize the new + status change time field on asset.copy. Signed-off-by: Steven Callender + Signed-off-by: Mike Rylander + +2011-10-24 Bill Erickson + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm: Clear + shelf canceled holds notification fix After cancelling a batch of holds via the clear-shelf process, + before we send the holds off to action/trigger for potential + notification generation, re-fetch the holds from the DB to pick up + the calculated cancel_time value (i.e. get a real value for "now"). + Otherwise, A/T may die attempting to create a DateTime object by + parsing "now". Signed-off-by: Bill Erickson Signed-off-by: + Mike Rylander + +2011-10-23 Dan Scott + + * Open-ILS/src/c-apps/Makefile.am, Open-ILS/src/c-apps/idlval.c: + Make idlval build, rather than be dead code The tool "idlval" contained in Open-ILS/src/c-apps can be used to + check the correctness of fieldmapper definitions in files like + Open-ILS/examples/fm_IDL.xml - but currently does not have a build + target, nor does it compile cleanly due to the use of unspecified + OpenSRF header files. This commit adds a build target, fixes the + compile problems, and installs the tool in the bin directory. Signed-off-by: Dan Scott Signed-off-by: Mike + Rylander + +2011-11-08 Jason Stephenson + + * Open-ILS/examples/fm_IDL.xml: Add link to cbs from bre via + bre.source -> cbs.id in fm_IDL.xml. Signed-off-by: Jason Stephenson + Signed-off-by: Mike Rylander + +2011-11-08 Jason Etheridge + + * Open-ILS/xul/staff_client/chrome/content/cat/opac.js, + Open-ILS/xul/staff_client/server/cat/util.js, + Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js: + LP887822 mint_condition/Quality not set correctly during item creation. Specifically, the Javascript object for a new item (acp) does not + explicitly set the mint_condition field, leaving it null. The item + attribute editor treats the null as false (which it displays as + "Mediocre" for that field). The database has a not null constraint + the corresponding column in asset.copy, and defaults to true. So a + new item in the attribute editor will show "Mediocre", but when + actually created, will become "Good". This branch just sets mint_condition to true when an item is + created. Signed-off-by: Jason Etheridge Signed-off-by: + Mike Rylander + +2011-11-14 Lebbeous Fogle-Weekley + + * Open-ILS/web/js/dojo/openils/widget/HoldingCode.js: Serials: in + the holding code mini-wizard, offer a dropdown for seasons This spares the user from having to remember the MFHD code for the + season, when dealing with periodicals issued by season (21 - 24 for + Spring - Winter, respectively). This also applies sets the "scrollOnFocus" attribute to false for + the dijits within the mini wizard, as the jumpy behavior you get in + less-than-fullscreen staff client windows is otherwise maddening. Signed-off-by: Lebbeous Fogle-Weekley + Signed-off-by: Mike Rylander + +2011-10-11 Lebbeous Fogle-Weekley + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm, + Open-ILS/src/support-scripts/edi_pusher.pl: More filtering of + characters that could end up in PO JEDI template output Backslashes cause problems too. Let's JSON encode this thing and + get it right once and for all. Signed-off-by: Lebbeous Fogle-Weekley + Signed-off-by: Ben Shum Signed-off-by: Bill + Erickson + +2011-11-10 Lebbeous Fogle-Weekley + + * Open-ILS/web/js/dojo/openils/widget/HoldingCode.js, + Open-ILS/web/js/ui/default/serial/subscription/issuance.js: Serials: + allow freer input in holding code mini-wizard In the Subscription Details interface of the Alternate Serials + Control View, under the Issuance tab, if you create a new issuance + you can now enter things like "01/02" in (say) the month field to + denote a combined January/February issue. All those fields are now + free-form, whereas some of them used to be numeric only. Also, avoid an occasional issue where an error message about + dijit.form.DateTextBox not being a constructor would appear in the + JavaScript console. The problem was in a race condition among some + co-dependent JavaScript files that were all being loaded at the same + time. Signed-off-by: Lebbeous Fogle-Weekley + Signed-off-by: Dan Wells + +2011-11-10 Jason Etheridge + + * Open-ILS/examples/apache/eg_vhost.conf, + Open-ILS/web/opac/common/js/RemoteRequest.js, + Open-ILS/xul/staff_client/chrome/content/util/network.js: LP88653 + force SSL for requests from local XUL Modifies RemoteRequest.js to convert any http:// request URL to + https:// if the requesting location has a chrome:// protocol. Modifies util/network.js such that any use of util.network.request + (as opposed to util.network.simple_request) will assume "secure" for + the resulting request. Adds an example to the bottom of eg_vhost.conf for forcing SSL for + an entire site (OPAC and everything), courtesy of Dan Wells. Signed-off-by: Jason Etheridge Signed-off-by: + Dan Wells + +2011-11-09 Thomas Berezansky + + * Open-ILS/xul/staff_client/server/cat/marcedit.js: + XML.ignoreWhitespace causes syntax errors So remove it. Disabling pretty printing appears to be enough to fix the marc + editor. Signed-off-by: Thomas Berezansky Signed-off-by: + Jason Etheridge + +2011-11-07 Thomas Berezansky + + * Open-ILS/xul/staff_client/server/cat/marcedit.js: Fix vanishing + whitespace in marc editor XML.ignoreWhitespace and XML.prettyPrinting cause whitespace to + vanish. So disable them at the top of marcedit.js. Signed-off-by: Thomas Berezansky Signed-off-by: + Jason Etheridge + +2011-10-31 Galen Charlton + + * Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm: lp849447: trival + stylistic tweaks - rename variable avoid double-negative - avoid 'Variable declared in conditional statement' perlcritic + gripe Signed-off-by: Galen Charlton Signed-off-by: + Mike Rylander + +2011-09-14 Sarah E. Chodrow + + * Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm: Initial patch + from Sarah Chodrow on LP bug 849447. Also check for standing penalties and expired cards when checking if + it is ok for the patron to checkout, charge_ok. 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: Sarah E. Chodrow (sarah.chodrow@bibliotheca-itg.com) Signed-off-by: Jason Stephenson + Signed-off-by: Mike Rylander + +2011-11-08 Mike Rylander + + * : commit ebde03846cfa620ccbf857b7ea82cf68f005e771 Author: Mike + Rylander Date: Tue Nov 8 12:43:44 2011 -0500 + +2011-11-08 Galen Charlton + + * : Merge remote branch 'working/collab/dbs/rel_2_1-release_notes' + into rel_2_1 Signed-off-by: Galen Charlton + +2011-11-07 Dan Scott + + * README: README: Use consistent endings (none!) for + titles/subtitles Most, but not all, of the titles/subtitles had colons appended. This + looks really weird in the Table of Contents, so try to be + consistently unweird and have no appended colons. Signed-off-by: Dan Scott + +2011-11-07 Dan Scott + + * README: Backup the existing opensrf config files before copying Per a suggestion from Wolf Halton , create + backup versions of the opensrf configuration files when we're + copying the Evergreen example versions over, so that we can retrieve + the Jabber user names and passwords and domains from the backups (if + necessary). Signed-off-by: Dan Scott + +2011-11-07 Dan Scott + + * README: Add tarball download / untar instructions to README Per suggestions from Yamil Suarez and Martha + Driscoll and Wolf Halton + , restore the version-specific wget / untar + instructions to the README. Aside: Need to remember to update these links in the repo before + tagging a release. Signed-off-by: Dan Scott + +2011-10-27 Jason Etheridge + + * Open-ILS/web/js/ui/default/actor/user/register.js: LP874597 + password from phone # when cloning users Patron: password from phone # does not work when cloning users Signed-off-by: Jason Etheridge Signed-off-by: + Mike Rylander + +2011-09-27 Jason Etheridge + + * Open-ILS/web/opac/skin/default/js/holds.js: LP#860845 hold + placement UI can break hold placement UI can break and give misleading error on Submit Adds some defensive coding, but since I don't quite grok everything + going on here, may not be the best fix. Signed-off-by: Jason Etheridge Signed-off-by: + Lebbeous Fogle-Weekley + +2011-11-01 James Fournie + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm: This + prevents the acq unified_search method from returning anything other + than the objects of the expected type. This is to address LP 884991 in which Acq users get a perm error for + each result of a search that they don't have access to retrieve. + They shouldn't even know about the existence of anything they don't + have access to retrieve. Signed-off-by: James Fournie + Signed-off-by: Lebbeous Fogle-Weekley + +2011-09-20 James Fournie + + * Open-ILS/src/sql/Pg/002.schema.config.sql, + Open-ILS/src/sql/Pg/040.schema.asset.sql, + Open-ILS/src/sql/Pg/upgrade/0646.schema.lp854972_copy_counts_unshad + ow.sql: Previously invisible copies showed as beige in the staff + client, they stopped doing this in 2.0 This is because in 2.0 the copy counts logic was moved from + open-ils.storage.biblio.record_entry.copy_count.staff to an + in-database function wrapped in + open-ils.search.biblio.record.copy_count.staff. Both methods + returned various counts including an 'unshadow' count, however the + 'unshadow' in the new database function was not completed and it has + only been returning a simple copy count rather than a count of opac + visible copies as it should be to replicate the old behaviour. Signed-off-by: James Fournie + Signed-off-by: Lebbeous Fogle-Weekley + +2011-10-06 Lebbeous Fogle-Weekley + + * Open-ILS/web/js/dojo/openils/acq/nls/acq.js, + Open-ILS/web/js/ui/default/acq/common/li_table.js: Acq: better error + message if trying to create PO without provider or agency Before now, if you leave either the provider or ordering agency + fields blank in the "Create Purchase Order" dialog, you get a + nonsensical warning about prepayment. This fixes that. Signed-off-by: Lebbeous Fogle-Weekley + Signed-off-by: Bill Erickson + +2011-04-27 dbs + + * Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/OpenLibrary.pm: + Turn ebooks AC from OpenLibrary into usable HTML Add elements to turn URLs into links, and use the upper case + ebook format as the content of the link. "Read online" is the one + i18n-unfriendly exception, but this is a good start. Signed-off-by: Dan Scott git-svn-id: svn://svn.open-ils.org/ILS/trunk@20346 + dcc99617-32d9-48b4-a31d-7c20da2025e4 Signed-off-by: Lebbeous + Fogle-Weekley + +2011-04-27 dbs + + * Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/OpenLibrary.pm: + Teach OpenLibrary.pm how to extract ebook links from OpenLibrary + results If the Internet Archive has an available ebook, then OpenLibrary + will provide links to it in various formats. For now, we return the + results as a plain set of
elements with class attributes + denoting what kind of ebook was returned; i18n will have to take + care of providing an actual label. Oh, and I guess we want to turn + these into actual links... Signed-off-by: Dan Scott Signed-off-by: + Lebbeous Fogle-Weekley + +2011-11-03 Liam Whalen + + * Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql: Modified + authority.indexing_ingest_or_delete to update MARC data The authority.indexing_ingest_or_delete trigger in the update script + was missing a call to authority.propagate_changes which is + responsible for updating the MARC data of records affected by an + auhtority merge. This patch adds the call to + authority.propagate_changes as it appears in the + authority.indexing_ingest_or_delete trigger from the file + 999.functions.global.sql. Signed-off-by: Liam Whalen + Signed-off-by: Dan Scott + +2011-10-06 Lebbeous Fogle-Weekley + + * Open-ILS/web/js/ui/default/acq/common/li_table.js, + Open-ILS/web/js/ui/default/acq/search/unified.js: Acq: fix a bug + that sometimes prevents the general search page from loading Within Acquisitions General Search, javascript included from one + file in the relies on the variable "localeStrings" being + initialized by javascript included from a file in . Sometimes + the wrong javascript wins the race, you get an error about + localeStrings being undefined in the Javascript console, and the + page stops loading. Signed-off-by: Lebbeous Fogle-Weekley + Signed-off-by: Bill Erickson + +2011-11-01 Bill Erickson + + * Open-ILS/src/support-scripts/fine_generator.pl: Fine generator; + raise multi-session mode recv timeout When fetching the batch of overdue circ IDs to process for fine + generation, wait a little longer for the data to arrive, since it is + a longer running DB query than most. Signed-off-by: Bill Erickson Signed-off-by: + Lebbeous Fogle-Weekley + +2011-11-01 Jason Etheridge + + * Open-ILS/src/sql/Pg/002.schema.config.sql: forgot to update + upgrade_log Signed-off-by: Jason Etheridge + +2011-11-01 Jason Etheridge + + * Open-ILS/src/sql/Pg/upgrade/0645.schema.null_svf_protection.sql, + Open-ILS/src/sql/Pg/upgrade/XXXX.schema.null_svf_protection.sql: pin + upgrade script Signed-off-by: Jason Etheridge + +2011-11-01 Mike Rylander + + * Open-ILS/src/sql/Pg/030.schema.metabib.sql, + Open-ILS/src/sql/Pg/upgrade/XXXX.schema.null_svf_protection.sql: + Protect SVF normalizers against NULL values Signed-off-by: Mike Rylander Signed-off-by: + Jason Etheridge + +2011-11-01 Dan Scott + + * Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Amazon.pm: + Force Amazon AC requests to use 10-digit ISBNs Inspired by a patch submitted by Ian Bays + via https://bugs.launchpad.net/evergreen/+bug/870171, this patch + takes the incoming key and, if it is longer than 10 characters (a + 10-digit ISBN or Amazon ID), attempts to normalize it and return a + 10-digit ISBN. We don't normalize all incoming keys because some sites are horribly + abusing the 020 MARC field to include an Amazon ID instead of an + ISBN - but that works in practice and we'd rather not break working + installations if we can avoid it. Signed-off-by: Dan Scott + +2011-10-19 Jason Stephenson + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm: Use ne on + line 631 of Actor.pm. This is so that we stop getting errors like Argument "1319057146.8881216485.4819607085" isn't numeric in numeric + ne (!=) at /usr/local/share/perl/5.10.1/OpenILS/Application/Actor.pm + line 630. in /openils/var/log/open-ils.actor_stderr.log Signed-off-by: Jason Stephenson + Signed-off-by: Dan Scott + +2011-10-27 Michael Peters + + * Open-ILS/examples/apache/eg.conf: A tweak to eg.conf to prevent + against the BEAST exploit in TLS/SSL Based on recommedation from + + https://community.qualys.com/blogs/securitylabs/2011/10/17/mitigating-the-beast-attack-on-tlsSigned-off-by: Michael Peters + Signed-off-by: Galen Charlton + +2011-09-27 Jason Etheridge + + * Open-ILS/xul/staff_client/server/circ/checkin.js: LP#860685 List + Actions and Print List fix List Actions and Print List broken in Check In interface when not + using "Fast Entry (Asynchronous)", due to the way we're using + list.refresh_row. This fixes the internal list state for tracking + retrieved versus un-retrieved list rows. Signed-off-by: Jason Etheridge Signed-off-by: + Mike Rylander + +2011-10-05 Bill Erickson + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm: + Z39.50 local catalog fetch-more repairs Fixes the following problem: When paging through local catalog results in the Z39.50 interface, + paging off then end of the local results would result in an unknown + server error caused by trying to retrieve an empty list of records. $list->{count} in this context is the overall hit count, not the + counts in the current page of results. Note also if {count} is + zero, the list of IDs will be undef, so we use both. Signed-off-by: Bill Erickson Signed-off-by: + Jason Etheridge + +2011-10-06 Lebbeous Fogle-Weekley + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm: Avoid + a possible bug in selection list deletion This particularly matters for the "ephemeral," unnamed selection + list that Acquisitions General Search uses to hold bib records + represented as lineitems, as that list is deleted for the next run + of that kind of search. It's possible to get lineitems onto that list that are in a state + other than "new". Code that deletes this list first deletes the + lineitems that belong to it, but that code formerly assumed that + there are two types of lineitems. "new" ones (that should be + deleted) and ones that belong to purchase orders (that should be + deatched). That doesn't necessarily cover all possible lineitems on + the picklist, so deletion ultimately fails. This fixes that. [update: now this bugfix incorporates a bugfix, the need for which + was detected by Ben Shum. See LP #869581] Signed-off-by: Lebbeous Fogle-Weekley + Signed-off-by: Bill Erickson + +2011-10-16 Dan Scott + + * Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm: LP875819: Fix + SRU and Z39.50 default search index failures Per http://www.loc.gov/standards/sru/specs/cql.html : All parts of CQL are case insensitive [...] If any case insensitive + part of CQL is specified with both upper and lower case, it is for + aesthetic purposes only. So fold the SRU qualifier and relation to lower case. This then + matches the srw.serverchoice entry that we already have in + config.metabib_search_alias so that default searches will + successfully point to the keyword index. Signed-off-by: Dan Scott Signed-off-by: + Lebbeous Fogle-Weekley + +2011-10-19 Dan Scott + + * README: README: createunderscoredatabase.sql Fix another typo noted by Martha Driscoll Signed-off-by: Dan Scott + +2011-10-19 Dan Scott + + * README: README: Use rel_2_1_x for the staff client build ID Per a suggestion from Martha Driscoll to + have it match the release number - go halfway and at least match the + release numbering pattern. Signed-off-by: Dan Scott + +2011-10-19 Dan Scott + + * README: Fix README issues Martha Driscoll noted that the + create_database.sql script wasn't actually targeted by the psql + command, and also that there was an extraneous tag in the + OpenSRF start command. Signed-off-by: Dan Scott + +2011-10-19 Bill Erickson + + * Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm: + CStoreEditor batch_retrieve repairs 1. If the caller provides additional cstore params, like flesh, + flesh_fields, etc. make sure we only use the first component of the + search (the list of identifier values) for the cstore search. 2. Determine the identifier field from the class being retrieved + instead of hard-coding it to be "id" Signed-off-by: Bill Erickson Signed-off-by: + Lebbeous Fogle-Weekley + +2011-10-18 Galen Charlton + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm: add a + couple semicolons Not strictly required, but may as well save a picosecond of grief + for the next person who adds to this code. Signed-off-by: Galen Charlton + +2011-09-15 Bill Erickson + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm: + Create events for hold_request.cancel.patron When a patron cancels his/her own hold, create events for the (already-existing) hold_request.cancel.patron A/T hook. Signed-off-by: Bill Erickson Signed-off-by: + Galen Charlton + +2011-10-18 Bill Erickson + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm: + Re-fetch hold for cancel notify to correct timestamp Re-fetch the cancelled hold from the DB before passing it off to + action/trigger for notification processing. Otherwise, A/T attempts + to perform date math on "now" instead of a valid timestamp and + subsequently croaks. Signed-off-by: Bill Erickson Signed-off-by: + Lebbeous Fogle-Weekley + +2011-10-16 Dan Scott + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm: Cache + open-ils.fielder results by locale The problem was particularly visible in search facets, but existed + before: the cache key used for fielder results did not take locale + into account, so on a multi-locale system the first locale won and + populated the cache for all other locales. Use a session locale if provided, otherwise default to the locale + set in opensrf.xml Signed-off-by: Dan Scott Signed-off-by: + Thomas Berezansky + +2011-10-13 Jason Etheridge + + * Open-ILS/xul/staff_client/server/patron/display.js: Fix print_init + error in checkout interface Signed-off-by: Jason Etheridge Signed-off-by: + Thomas Berezansky + +2011-10-17 Dan Scott + + * Open-ILS/web/opac/locale/en-US/lang.dtd: Typo: It's MARC, not + Marc. Sheesh. Signed-off-by: Dan Scott + +2011-10-04 Thomas Berezansky + + * Open-ILS/web/opac/skin/default/js/adv_global.js: Add "submit on + enter" to all advanced search boxes Instead of just the one with an ID specified. Signed-off-by: Thomas Berezansky Signed-off-by: + Dan Scott + +2011-10-14 Jason Etheridge + + * Open-ILS/xul/staff_client/server/patron/bill2.js: LP873614 + print_init error printing bill history xulG.url_prefix needs to be present for anything using util/print.js + and the Mozilla print strategy. Alternately, we could duplicate the + logic behind url_prefix and bundle it into print.js :-/ Signed-off-by: Jason Etheridge Signed-off-by: + Jason Stephenson Signed-off-by: Dan Scott + + +2011-10-13 Dan Scott + + * Open-ILS/src/support-scripts/settings-tester.pl: Add MARC::Record + 2.0.1 minimum test to settings-tester.pl Wrap the use_ok() tests in a BEGIN block, per the recommendation of + the Test::More perldoc. Signed-off-by: Dan Scott + +2011-10-13 Dan Scott + + * Open-ILS/src/support-scripts/settings-tester.pl: + Settings-tester.pl whitespace Might as well complete the conversion of the file into modernity. Signed-off-by: Dan Scott + +2011-10-13 Dan Scott + + * Open-ILS/src/support-scripts/settings-tester.pl: Modernize + settings-tester.pl a bit * Add a section that checks for Evergreen services in + opensrf_core.xml * Ignore the qstore database credentials, as qstore is unused + currently * Split things off into subroutines for easier reading Signed-off-by: Dan Scott + +2011-10-13 Mike Rylander + + * Open-ILS/src/sql/Pg/002.schema.config.sql, + Open-ILS/src/sql/Pg/upgrade/0639.schema.asset_merge_record_assets.s + ql, + Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset_merge_record_assets.s + ql: Stamping upgrade for asset.merge_record_assets fix from dbs Signed-off-by: Mike Rylander + +2011-10-13 Dan Scott + + * Open-ILS/src/sql/Pg/999.functions.global.sql, + Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset_merge_record_assets.s + ql: Fix located URI merging in action.merge_record_assets() Perhaps due to the unexpected results of the XPath expression, which + returns a count of nodes for subfields, etc, rather than just a + count of the number of 856 datafields, NULL was being concatenated + onto a string - which of course made the string NULL. Use COALESCE() to prevent the NULLness from spreading and enable + action.merge_record_assets() to do the right thing. Signed-off-by: Dan Scott Signed-off-by: Mike + Rylander + +2011-10-12 Dan Scott + + * Open-ILS/xul/staff_client/server/index.xhtml: Give OrgTree.js a + locale, always We started generating locale-specific OrgTree.js files many moons + ago, and now no longer provide a "default" locale in the root of the + common/js directory. The result was that the index.xhtml page for + the staff client was throwing an "_l is undefined" exception; + largely meaningless, as it seems that the OrgTree isn't even used on + that page, but noise that doesn't need to be in the JavaScript + console. Here we correct that exception by providing a locale, and hopefully + prevent any further copy/paste mistakes. Signed-off-by: Dan Scott + +2011-10-11 Bill Erickson + + * Open-ILS/src/c-apps/oils_auth.c: Authentication block logging * Login too-many-auth-failures message at Info level instead of + Internal * Log the username getting blocked Signed-off-by: Bill Erickson Signed-off-by: + Galen Charlton + +2011-10-12 Mike Rylander + + * Open-ILS/src/sql/Pg/002.schema.config.sql, + Open-ILS/src/sql/Pg/990.schema.unapi.sql, + Open-ILS/src/sql/Pg/upgrade/0638.schema.unapi.sitem-fix.sql: Fix + cut-paste-o in unapi.sitem, re stream and unit subobjects Signed-off-by: Mike Rylander + +2011-09-16 Jason Stephenson + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm: + Fix z39.50 import isbn and issn searches on local catalog. Make cat_search_z_style_wrapper do identifier searches for isbn and + issn. Modify the_quest_for_knowledge to accept identifier searches for + isbn and issn. Signed-off-by: Jason Stephenson + Signed-off-by: Dan Scott + +2011-10-11 Dan Scott + + * README: README: Minor whitespace cleanup Just to get the indentation standardized on second and subsequent + lines of bullets. No big whoop. Signed-off-by: Dan Scott + +2011-10-11 Ben Shum + + * README: Change PostgreSQL 9 source for Ubuntu Lucid users. Currently, Ubuntu Lucid does not have backport options for + PostgreSQL 9. Instead, most community members who use Lucid have + been using Martin Pitt's PPA as an external repository source. + Signed-off-by: Ben Shum Signed-off-by: Dan Scott + +2011-09-27 Bill Erickson + + * Open-ILS/src/support-scripts/marc_stream_importer.pl: Read STDIN + up to record separator then stop The initial (and only known) target for the importer is OCLC + Connexion exports, which export 1 record at a time, with each record + ending with the standard record separator. There is no end-of-file + / end-of-transmission indicator, so the while() loop always blocks + and fails on the timeout alarm after the first record is read. Until a more flexible solution is in place, roll back support for + reading multiple records via STDIN. The original commit was 679506975f0efb6e2f6f17b0c19e3c53c5bfda44 Note, the feature being rolled back was not actually necessary to + implement the feature in the commit (file-based imports). It was + just an added bonus. Signed-off-by: Bill Erickson Signed-off-by: + Galen Charlton + +2011-10-10 Dan Scott + + * Open-ILS/src/extras/Makefile.install: Give CentOS / RHEL a chance + at installing PostgreSQL 9.0 Evergreen 2.1 requires PostgreSQL 9.0, and we accordingly updated + the package names back in the summer to point at PostgreSQL 9.0, but + nobody running CentOS / RHEL brought to our attention that the repo + target needed to be updated as well. This, although untested, at + least gives CentOS / RHEL users a fighting chance of installing + Evergreen master / 2.1 on their system. Signed-off-by: Dan Scott Signed-off-by: Galen + Charlton + +2011-10-10 Dan Scott + + * Open-ILS/src/extras/Makefile.install: Fix broken + Net::Z3950::SimpleServer 1.14 install Pin the install of Net::Z3950::SimpleServer to the + known-to-work-with yaz 3.0.x version, 1.12. 1.14 introduced + dependencies on yaz 4.1.x that can't be easily worked around. Signed-off-by: Dan Scott Signed-off-by: Galen + Charlton + +2011-10-10 Mike Rylander + + * Open-ILS/src/sql/Pg/002.schema.config.sql, + Open-ILS/src/sql/Pg/100.circ_matrix.sql, + Open-ILS/src/sql/Pg/upgrade/0637.schema.renewal_checkout_counting.s + ql: Fix, as provided by Doug Kyle, for LP#822918 Signed-off-by: Mike Rylander + +2011-10-10 Galen Charlton + + * RELEASE_NOTES.txt: additional serial enhancements for 2.1 release + notes Credit: Lebbeous Fogle-Weekley Signed-off-by: Galen Charlton + +2011-10-10 Galen Charlton + + * RELEASE_NOTES.txt: add table of new permissions in 2.1 Signed-off-by: Galen Charlton + +2011-10-10 Galen Charlton + + * RELEASE_NOTES.txt: tweaks to the serials enhancements release + notes Thanks to Dan Wells for the input. Signed-off-by: Galen Charlton + +2011-10-10 Galen Charlton + + * RELEASE_NOTES.txt: serials enhancements for 2.1 release notes Signed-off-by: Galen Charlton + +2011-10-07 Galen Charlton + + * RELEASE_NOTES.txt: remove trailing colons from headings Signed-off-by: Galen Charlton + +2011-10-07 Dan Scott + + * : commit d1daa4452d8839313d13b8326762893b77019a9c Author: Dan + Scott Date: Fri Oct 7 15:07:28 2011 -0400 + +2011-10-07 Galen Charlton + + * RELEASE_NOTES.txt: start expanding list of new configuration + settings Signed-off-by: Galen Charlton + +2011-10-07 Galen Charlton + + * RELEASE_NOTES.txt: update release notes re: perl module install + destination Signed-off-by: Galen Charlton + +2011-10-07 Galen Charlton + + * RELEASE_NOTES.txt: add list of new library settings to release + notes Signed-off-by: Galen Charlton + +2011-10-06 Galen Charlton + + * Open-ILS/src/c-apps/oils_auth.c: fix authentication failure Ensure that the auth_limit values are read when open-ils.auth + initializes, not during oilsAuthInit(). This solves a problem + observed on brick-based setups where authentication could + incorrectly fail because the drone that processes + open-ils.auth.authenticate.complete didn't have the the block count + value initialized yet. Also fixed type nit when compare the fail count to the block limit. Signed-off-by: Galen Charlton Signed-off-by: + Bill Erickson + +2011-10-04 Lebbeous Fogle-Weekley + + * Open-ILS/web/js/ui/default/acq/common/li_table.js, + Open-ILS/web/js/ui/default/acq/common/li_table_pager.js, + Open-ILS/web/js/ui/default/acq/search/unified.js: Really add + *entire* selection list to a purchase order, when desired, and generally do what a user would expect when, in Acq, the user + executes an operation on "all items". This addresses LaunchPad bug #810030. The fundamental issue is that an AcqLiTable, which is used in + several different ways in different interfaces, may be representing + items on a selection list (for example), but it doesn't necessarily + know all of the items that belong to that selection list. It only + knows what it has drawn. This addresses that deficiency by teaching the getSelected() method + some new tricks so that it can consult the server in the various + ways appropriate to getting a list of /all/ the items on a selection + list, a purchase order, a virtual PO, a set of search results, etc. Signed-off-by: Lebbeous Fogle-Weekley + Signed-off-by: Mike Rylander + +2011-10-05 Dan Scott + + * README: Fix copy-paste-o: "su - postgres" to become postgres Thanks to sal_ in IRC who caught this nugget! Signed-off-by: Dan Scott + +2011-10-05 Dan Scott + + * RELEASE_NOTES.txt: Document hold-driven recalls Signed-off-by: Dan Scott + +2011-10-05 Dan Scott + + * RELEASE_NOTES.txt: Add basic Release Notes in AsciiDoc format Basically, walked through the commit log since the git era to try + and isolate changes of interest. I'm sure there's plenty more to + cover! Signed-off-by: Dan Scott + +2011-10-05 Dan Scott + + * README: README: Explicitly identify accounts for commands Add a preamble to the beginning listing all of the accounts + referenced in the instructions (Linux accounts, PostgreSQL accounts, + Evergreen administrator accounts). Also move the Developer + Instructions to the start to follow the natural order of operations. Signed-off-by: Dan Scott + +2011-10-05 Bill Erickson + + * Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm: + Avoid collecting facet data for non-facet fields If a config.metabib_field (Admin -> Server Admin -> MARC + Search/Facet Fields) starts out as a facet field but is later + changed, data for that facet can still bubble up since it has + already been extracted. This patch prevents facets for + config.metabib_field entries whose facet_field=false from getting + collected/cached for search results. Signed-off-by: Bill Erickson Signed-off-by: + Lebbeous Fogle-Weekley + +2011-09-07 Dan Wells + + * Open-ILS/src/perlmods/lib/OpenILS/Utils/Configure.pm: Clear + org_unit cache fix for autogen.sh autogen.sh is not properly clearing the org_tree cache. It is + unclear how this hasn't caused a problem before, but this fix works + for me and should be at least harmless in other enviroments. Signed-off-by: Dan Wells Signed-off-by: Lebbeous + Fogle-Weekley + +2011-10-04 Dan Scott + + * Open-ILS/web/opac/locale/en-US/lang.dtd: Fix typo in lang.dtd: + "instantenous" Signed-off-by: Dan Scott + +2011-10-04 Dan Scott + + * build/i18n/po/lang.dtd/es-ES.po: i18n: Fix es-ES illegal use of + '%' in lang.dtd The '%' character is used to include previously defined blocks in + DTD files; would be nice if translate-toolkit gave a more obvious + error to alert us to this rather than saying the en-US doesn't + validate and dying. Signed-off-by: Dan Scott + +2011-08-20 Dan Scott + + * Remove cache-generator.sh from Makefile.am In a previous commit, we removed cache-generator.sh. Now we remove + the remaining reference to it in the Makefile.am that was generating + an error (reported by Ben Webb). Signed-off-by: Dan Scott + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application.pm index cd4dbbf9c0..5028d627b4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application.pm @@ -6,7 +6,7 @@ use base qw/OpenSRF::Application/; sub ils_version { # version format is "x-y-z", for example "2-0-0" for Evergreen 2.0.0 # For branches, format is "x-y" - return "HEAD"; + return "2-1-1"; } __PACKAGE__->register_method( diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 37b6713353..e8f7cbb479 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -58,6 +58,7 @@ CREATE TABLE config.upgrade_log ( ); INSERT INTO config.upgrade_log (version) VALUES ('0650'); -- tsbere/miker +INSERT INTO config.upgrade_log (version) VALUES ('2.1.1'); CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/2.1.0-2.1.1.sql b/Open-ILS/src/sql/Pg/2.1.0-2.1.1.sql new file mode 100644 index 0000000000..87ef6b5e5f --- /dev/null +++ b/Open-ILS/src/sql/Pg/2.1.0-2.1.1.sql @@ -0,0 +1,951 @@ +--Upgrade Script for 2.1.0 to 2.1.1 +BEGIN; +INSERT INTO config.upgrade_log (version) VALUES ('2.1.1'); +-- Patch from Doug Kyle re: https://bugs.launchpad.net/evergreen/+bug/822918 + +INSERT INTO config.upgrade_log (version) VALUES ('0637'); + +CREATE OR REPLACE FUNCTION action.item_user_circ_test( circ_ou INT, match_item BIGINT, match_user INT, renewal BOOL ) RETURNS SETOF action.circ_matrix_test_result AS $func$ +DECLARE + user_object actor.usr%ROWTYPE; + standing_penalty config.standing_penalty%ROWTYPE; + item_object asset.copy%ROWTYPE; + item_status_object config.copy_status%ROWTYPE; + item_location_object asset.copy_location%ROWTYPE; + result action.circ_matrix_test_result; + circ_test action.found_circ_matrix_matchpoint; + circ_matchpoint config.circ_matrix_matchpoint%ROWTYPE; + out_by_circ_mod config.circ_matrix_circ_mod_test%ROWTYPE; + circ_mod_map config.circ_matrix_circ_mod_test_map%ROWTYPE; + hold_ratio action.hold_stats%ROWTYPE; + penalty_type TEXT; + items_out INT; + context_org_list INT[]; + done BOOL := FALSE; +BEGIN + -- Assume success unless we hit a failure condition + result.success := TRUE; + + -- Need user info to look up matchpoints + SELECT INTO user_object * FROM actor.usr WHERE id = match_user AND NOT deleted; + + -- (Insta)Fail if we couldn't find the user + IF user_object.id IS NULL THEN + result.fail_part := 'no_user'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + RETURN; + END IF; + + -- Need item info to look up matchpoints + SELECT INTO item_object * FROM asset.copy WHERE id = match_item AND NOT deleted; + + -- (Insta)Fail if we couldn't find the item + IF item_object.id IS NULL THEN + result.fail_part := 'no_item'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + RETURN; + END IF; + + SELECT INTO circ_test * FROM action.find_circ_matrix_matchpoint(circ_ou, item_object, user_object, renewal); + + circ_matchpoint := circ_test.matchpoint; + result.matchpoint := circ_matchpoint.id; + result.circulate := circ_matchpoint.circulate; + result.duration_rule := circ_matchpoint.duration_rule; + result.recurring_fine_rule := circ_matchpoint.recurring_fine_rule; + result.max_fine_rule := circ_matchpoint.max_fine_rule; + result.hard_due_date := circ_matchpoint.hard_due_date; + result.renewals := circ_matchpoint.renewals; + result.grace_period := circ_matchpoint.grace_period; + result.buildrows := circ_test.buildrows; + + -- (Insta)Fail if we couldn't find a matchpoint + IF circ_test.success = false THEN + result.fail_part := 'no_matchpoint'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + RETURN; + END IF; + + -- All failures before this point are non-recoverable + -- Below this point are possibly overridable failures + + -- Fail if the user is barred + IF user_object.barred IS TRUE THEN + result.fail_part := 'actor.usr.barred'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END IF; + + -- Fail if the item can't circulate + IF item_object.circulate IS FALSE THEN + result.fail_part := 'asset.copy.circulate'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END IF; + + -- Fail if the item isn't in a circulateable status on a non-renewal + IF NOT renewal AND item_object.status NOT IN ( 0, 7, 8 ) THEN + result.fail_part := 'asset.copy.status'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + -- Alternately, fail if the item isn't checked out on a renewal + ELSIF renewal AND item_object.status <> 1 THEN + result.fail_part := 'asset.copy.status'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END IF; + + -- Fail if the item can't circulate because of the shelving location + SELECT INTO item_location_object * FROM asset.copy_location WHERE id = item_object.location; + IF item_location_object.circulate IS FALSE THEN + result.fail_part := 'asset.copy_location.circulate'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END IF; + + -- Use Circ OU for penalties and such + SELECT INTO context_org_list ARRAY_ACCUM(id) FROM actor.org_unit_full_path( circ_ou ); + + IF renewal THEN + penalty_type = '%RENEW%'; + ELSE + penalty_type = '%CIRC%'; + END IF; + + FOR standing_penalty IN + SELECT DISTINCT csp.* + FROM actor.usr_standing_penalty usp + JOIN config.standing_penalty csp ON (csp.id = usp.standing_penalty) + WHERE usr = match_user + AND usp.org_unit IN ( SELECT * FROM unnest(context_org_list) ) + AND (usp.stop_date IS NULL or usp.stop_date > NOW()) + AND csp.block_list LIKE penalty_type LOOP + + result.fail_part := standing_penalty.name; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END LOOP; + + -- Fail if the test is set to hard non-circulating + IF circ_matchpoint.circulate IS FALSE THEN + result.fail_part := 'config.circ_matrix_test.circulate'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END IF; + + -- Fail if the total copy-hold ratio is too low + IF circ_matchpoint.total_copy_hold_ratio IS NOT NULL THEN + SELECT INTO hold_ratio * FROM action.copy_related_hold_stats(match_item); + IF hold_ratio.total_copy_ratio IS NOT NULL AND hold_ratio.total_copy_ratio < circ_matchpoint.total_copy_hold_ratio THEN + result.fail_part := 'config.circ_matrix_test.total_copy_hold_ratio'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END IF; + END IF; + + -- Fail if the available copy-hold ratio is too low + IF circ_matchpoint.available_copy_hold_ratio IS NOT NULL THEN + IF hold_ratio.hold_count IS NULL THEN + SELECT INTO hold_ratio * FROM action.copy_related_hold_stats(match_item); + END IF; + IF hold_ratio.available_copy_ratio IS NOT NULL AND hold_ratio.available_copy_ratio < circ_matchpoint.available_copy_hold_ratio THEN + result.fail_part := 'config.circ_matrix_test.available_copy_hold_ratio'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END IF; + END IF; + + -- Fail if the user has too many items with specific circ_modifiers checked out + IF NOT renewal THEN + FOR out_by_circ_mod IN SELECT * FROM config.circ_matrix_circ_mod_test WHERE matchpoint = circ_matchpoint.id LOOP + SELECT INTO items_out COUNT(*) + FROM action.circulation circ + JOIN asset.copy cp ON (cp.id = circ.target_copy) + WHERE circ.usr = match_user + AND circ.circ_lib IN ( SELECT * FROM unnest(context_org_list) ) + AND circ.checkin_time IS NULL + AND (circ.stop_fines IN ('MAXFINES','LONGOVERDUE') OR circ.stop_fines IS NULL) + AND cp.circ_modifier IN (SELECT circ_mod FROM config.circ_matrix_circ_mod_test_map WHERE circ_mod_test = out_by_circ_mod.id); + IF items_out >= out_by_circ_mod.items_out THEN + result.fail_part := 'config.circ_matrix_circ_mod_test'; + result.success := FALSE; + done := TRUE; + RETURN NEXT result; + END IF; + END LOOP; + END IF; + + -- If we passed everything, return the successful matchpoint + IF NOT done THEN + RETURN NEXT result; + END IF; + + RETURN; +END; +$func$ LANGUAGE plpgsql; + + + +INSERT INTO config.upgrade_log (version) VALUES ('0638'); -- miker + +CREATE OR REPLACE FUNCTION unapi.sitem ( obj_id BIGINT, format TEXT, ename TEXT, includes TEXT[], org TEXT, depth INT DEFAULT NULL, slimit INT DEFAULT NULL, soffset INT DEFAULT NULL, include_xmlns BOOL DEFAULT TRUE ) RETURNS XML AS $F$ + SELECT XMLELEMENT( + name serial_item, + XMLATTRIBUTES( + CASE WHEN $9 THEN 'http://open-ils.org/spec/holdings/v1' ELSE NULL END AS xmlns, + 'tag:open-ils.org:U2@sitem/' || id AS id, + 'tag:open-ils.org:U2@siss/' || issuance AS issuance, + date_expected, date_received + ), + CASE WHEN issuance IS NOT NULL AND ('siss' = ANY ($4)) THEN unapi.siss( issuance, $2, 'issuance', evergreen.array_remove_item_by_value($4,'sitem'), $5, $6, $7, $8, FALSE) ELSE NULL END, + CASE WHEN stream IS NOT NULL AND ('sstr' = ANY ($4)) THEN unapi.sstr( stream, $2, 'stream', evergreen.array_remove_item_by_value($4,'sitem'), $5, $6, $7, $8, FALSE) ELSE NULL END, + CASE WHEN unit IS NOT NULL AND ('sunit' = ANY ($4)) THEN unapi.sunit( unit, $2, 'serial_unit', evergreen.array_remove_item_by_value($4,'sitem'), $5, $6, $7, $8, FALSE) ELSE NULL END, + CASE WHEN uri IS NOT NULL AND ('auri' = ANY ($4)) THEN unapi.auri( uri, $2, 'uri', evergreen.array_remove_item_by_value($4,'sitem'), $5, $6, $7, $8, FALSE) ELSE NULL END +-- XMLELEMENT( name notes, +-- CASE +-- WHEN ('acpn' = ANY ($4)) THEN +-- (SELECT XMLAGG(acpn) FROM ( +-- SELECT unapi.acpn( id, 'xml', 'copy_note', evergreen.array_remove_item_by_value($4,'acp'), $5, $6, $7, $8) +-- FROM asset.copy_note +-- WHERE owning_copy = cp.id AND pub +-- )x) +-- ELSE NULL +-- END +-- ) + ) + FROM serial.item sitem + WHERE id = $1; +$F$ LANGUAGE SQL; + + +-- Evergreen DB patch XXXX.schema.asset_merge_record_assets.sql +-- +-- + +INSERT INTO config.upgrade_log (version) VALUES ('0639'); + +-- Dupe function replace removed + +INSERT INTO config.upgrade_log (version) VALUES ('0645'); + +CREATE OR REPLACE FUNCTION biblio.indexing_ingest_or_delete () RETURNS TRIGGER AS $func$ +DECLARE + transformed_xml TEXT; + prev_xfrm TEXT; + normalizer RECORD; + xfrm config.xml_transform%ROWTYPE; + attr_value TEXT; + new_attrs HSTORE := ''::HSTORE; + attr_def config.record_attr_definition%ROWTYPE; +BEGIN + + IF NEW.deleted IS TRUE THEN -- If this bib is deleted + DELETE FROM metabib.metarecord_source_map WHERE source = NEW.id; -- Rid ourselves of the search-estimate-killing linkage + DELETE FROM metabib.record_attr WHERE id = NEW.id; -- Kill the attrs hash, useless on deleted records + DELETE FROM authority.bib_linking WHERE bib = NEW.id; -- Avoid updating fields in bibs that are no longer visible + DELETE FROM biblio.peer_bib_copy_map WHERE peer_record = NEW.id; -- Separate any multi-homed items + RETURN NEW; -- and we're done + END IF; + + IF TG_OP = 'UPDATE' THEN -- re-ingest? + PERFORM * FROM config.internal_flag WHERE name = 'ingest.reingest.force_on_same_marc' AND enabled; + + IF NOT FOUND AND OLD.marc = NEW.marc THEN -- don't do anything if the MARC didn't change + RETURN NEW; + END IF; + END IF; + + -- Record authority linking + PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_authority_linking' AND enabled; + IF NOT FOUND THEN + PERFORM biblio.map_authority_linking( NEW.id, NEW.marc ); + END IF; + + -- Flatten and insert the mfr data + PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_metabib_full_rec' AND enabled; + IF NOT FOUND THEN + PERFORM metabib.reingest_metabib_full_rec(NEW.id); + + -- Now we pull out attribute data, which is dependent on the mfr for all but XPath-based fields + PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_metabib_rec_descriptor' AND enabled; + IF NOT FOUND THEN + FOR attr_def IN SELECT * FROM config.record_attr_definition ORDER BY format LOOP + + IF attr_def.tag IS NOT NULL THEN -- tag (and optional subfield list) selection + SELECT ARRAY_TO_STRING(ARRAY_ACCUM(value), COALESCE(attr_def.joiner,' ')) INTO attr_value + FROM (SELECT * FROM metabib.full_rec ORDER BY tag, subfield) AS x + WHERE record = NEW.id + AND tag LIKE attr_def.tag + AND CASE + WHEN attr_def.sf_list IS NOT NULL + THEN POSITION(subfield IN attr_def.sf_list) > 0 + ELSE TRUE + END + GROUP BY tag + ORDER BY tag + LIMIT 1; + + ELSIF attr_def.fixed_field IS NOT NULL THEN -- a named fixed field, see config.marc21_ff_pos_map.fixed_field + attr_value := biblio.marc21_extract_fixed_field(NEW.id, attr_def.fixed_field); + + ELSIF attr_def.xpath IS NOT NULL THEN -- and xpath expression + + SELECT INTO xfrm * FROM config.xml_transform WHERE name = attr_def.format; + + -- See if we can skip the XSLT ... it's expensive + IF prev_xfrm IS NULL OR prev_xfrm <> xfrm.name THEN + -- Can't skip the transform + IF xfrm.xslt <> '---' THEN + transformed_xml := oils_xslt_process(NEW.marc,xfrm.xslt); + ELSE + transformed_xml := NEW.marc; + END IF; + + prev_xfrm := xfrm.name; + END IF; + + IF xfrm.name IS NULL THEN + -- just grab the marcxml (empty) transform + SELECT INTO xfrm * FROM config.xml_transform WHERE xslt = '---' LIMIT 1; + prev_xfrm := xfrm.name; + END IF; + + attr_value := oils_xpath_string(attr_def.xpath, transformed_xml, COALESCE(attr_def.joiner,' '), ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]]); + + ELSIF attr_def.phys_char_sf IS NOT NULL THEN -- a named Physical Characteristic, see config.marc21_physical_characteristic_*_map + SELECT m.value INTO attr_value + FROM biblio.marc21_physical_characteristics(NEW.id) v + JOIN config.marc21_physical_characteristic_value_map m ON (m.id = v.value) + WHERE v.subfield = attr_def.phys_char_sf + LIMIT 1; -- Just in case ... + + END IF; + + -- apply index normalizers to attr_value + FOR normalizer IN + SELECT n.func AS func, + n.param_count AS param_count, + m.params AS params + FROM config.index_normalizer n + JOIN config.record_attr_index_norm_map m ON (m.norm = n.id) + WHERE attr = attr_def.name + ORDER BY m.pos LOOP + EXECUTE 'SELECT ' || normalizer.func || '(' || + COALESCE( quote_literal( attr_value ), 'NULL' ) || + CASE + WHEN normalizer.param_count > 0 + THEN ',' || REPLACE(REPLACE(BTRIM(normalizer.params,'[]'),E'\'',E'\\\''),E'"',E'\'') + ELSE '' + END || + ')' INTO attr_value; + + END LOOP; + + -- Add the new value to the hstore + new_attrs := new_attrs || hstore( attr_def.name, attr_value ); + + END LOOP; + + IF TG_OP = 'INSERT' OR OLD.deleted THEN -- initial insert OR revivication + INSERT INTO metabib.record_attr (id, attrs) VALUES (NEW.id, new_attrs); + ELSE + UPDATE metabib.record_attr SET attrs = attrs || new_attrs WHERE id = NEW.id; + END IF; + + END IF; + END IF; + + -- Gather and insert the field entry data + PERFORM metabib.reingest_metabib_field_entries(NEW.id); + + -- Located URI magic + IF TG_OP = 'INSERT' THEN + PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_located_uri' AND enabled; + IF NOT FOUND THEN + PERFORM biblio.extract_located_uris( NEW.id, NEW.marc, NEW.editor ); + END IF; + ELSE + PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_located_uri' AND enabled; + IF NOT FOUND THEN + PERFORM biblio.extract_located_uris( NEW.id, NEW.marc, NEW.editor ); + END IF; + END IF; + + -- (re)map metarecord-bib linking + IF TG_OP = 'INSERT' THEN -- if not deleted and performing an insert, check for the flag + PERFORM * FROM config.internal_flag WHERE name = 'ingest.metarecord_mapping.skip_on_insert' AND enabled; + IF NOT FOUND THEN + PERFORM metabib.remap_metarecord_for_bib( NEW.id, NEW.fingerprint ); + END IF; + ELSE -- we're doing an update, and we're not deleted, remap + PERFORM * FROM config.internal_flag WHERE name = 'ingest.metarecord_mapping.skip_on_update' AND enabled; + IF NOT FOUND THEN + PERFORM metabib.remap_metarecord_for_bib( NEW.id, NEW.fingerprint ); + END IF; + END IF; + + RETURN NEW; +END; +$func$ LANGUAGE PLPGSQL; + + +INSERT INTO config.upgrade_log (version) VALUES ('0646'); + +CREATE OR REPLACE FUNCTION asset.staff_ou_record_copy_count (org INT, rid BIGINT) RETURNS TABLE (depth INT, org_unit INT, visible BIGINT, available BIGINT, unshadow BIGINT, transcendant INT) AS $f$ +DECLARE + ans RECORD; + trans INT; +BEGIN + SELECT 1 INTO trans FROM biblio.record_entry b JOIN config.bib_source src ON (b.source = src.id) WHERE src.transcendant AND b.id = rid; + + FOR ans IN SELECT u.id, t.depth FROM actor.org_unit_ancestors(org) AS u JOIN actor.org_unit_type t ON (u.ou_type = t.id) LOOP + RETURN QUERY + SELECT ans.depth, + ans.id, + COUNT( cp.id ), + SUM( CASE WHEN cp.status IN (0,7,12) THEN 1 ELSE 0 END ), + SUM( CASE WHEN cl.opac_visible AND cp.opac_visible THEN 1 ELSE 0 END), + trans + FROM + actor.org_unit_descendants(ans.id) d + JOIN asset.copy cp ON (cp.circ_lib = d.id AND NOT cp.deleted) + JOIN asset.copy_location cl ON (cp.location = cl.id) + JOIN asset.call_number cn ON (cn.record = rid AND cn.id = cp.call_number AND NOT cn.deleted) + GROUP BY 1,2,6; + + IF NOT FOUND THEN + RETURN QUERY SELECT ans.depth, ans.id, 0::BIGINT, 0::BIGINT, 0::BIGINT, trans; + END IF; + + END LOOP; + + RETURN; +END; +$f$ LANGUAGE PLPGSQL; + +CREATE OR REPLACE FUNCTION asset.staff_lasso_record_copy_count (i_lasso INT, rid BIGINT) RETURNS TABLE (depth INT, org_unit INT, visible BIGINT, available BIGINT, unshadow BIGINT, transcendant INT) AS $f$ +DECLARE + ans RECORD; + trans INT; +BEGIN + SELECT 1 INTO trans FROM biblio.record_entry b JOIN config.bib_source src ON (b.source = src.id) WHERE src.transcendant AND b.id = rid; + + FOR ans IN SELECT u.org_unit AS id FROM actor.org_lasso_map AS u WHERE lasso = i_lasso LOOP + RETURN QUERY + SELECT -1, + ans.id, + COUNT( cp.id ), + SUM( CASE WHEN cp.status IN (0,7,12) THEN 1 ELSE 0 END ), + SUM( CASE WHEN cl.opac_visible AND cp.opac_visible THEN 1 ELSE 0 END), + trans + FROM + actor.org_unit_descendants(ans.id) d + JOIN asset.copy cp ON (cp.circ_lib = d.id AND NOT cp.deleted) + JOIN asset.copy_location cl ON (cp.location = cl.id) + JOIN asset.call_number cn ON (cn.record = rid AND cn.id = cp.call_number AND NOT cn.deleted) + GROUP BY 1,2,6; + + IF NOT FOUND THEN + RETURN QUERY SELECT ans.depth, ans.id, 0::BIGINT, 0::BIGINT, 0::BIGINT, trans; + END IF; + + END LOOP; + + RETURN; +END; +$f$ LANGUAGE PLPGSQL; + + +INSERT INTO config.upgrade_log (version) VALUES ('0648'); + +CREATE OR REPLACE FUNCTION asset.merge_record_assets( target_record BIGINT, source_record BIGINT ) RETURNS INT AS $func$ +DECLARE + moved_objects INT := 0; + source_cn asset.call_number%ROWTYPE; + target_cn asset.call_number%ROWTYPE; + metarec metabib.metarecord%ROWTYPE; + hold action.hold_request%ROWTYPE; + ser_rec serial.record_entry%ROWTYPE; + ser_sub serial.subscription%ROWTYPE; + acq_lineitem acq.lineitem%ROWTYPE; + acq_request acq.user_request%ROWTYPE; + booking booking.resource_type%ROWTYPE; + source_part biblio.monograph_part%ROWTYPE; + target_part biblio.monograph_part%ROWTYPE; + multi_home biblio.peer_bib_copy_map%ROWTYPE; + uri_count INT := 0; + counter INT := 0; + uri_datafield TEXT; + uri_text TEXT := ''; +BEGIN + + -- move any 856 entries on records that have at least one MARC-mapped URI entry + SELECT INTO uri_count COUNT(*) + FROM asset.uri_call_number_map m + JOIN asset.call_number cn ON (m.call_number = cn.id) + WHERE cn.record = source_record; + + IF uri_count > 0 THEN + + SELECT COUNT(*) INTO counter + FROM oils_xpath_table( + 'id', + 'marc', + 'biblio.record_entry', + '//*[@tag="856"]', + 'id=' || source_record + ) as t(i int,c text); + + FOR i IN 1 .. counter LOOP + SELECT '' || + array_to_string( + array_accum( + '' || + regexp_replace( + regexp_replace( + regexp_replace(data,'&','&','g'), + '>', '>', 'g' + ), + '<', '<', 'g' + ) || '' + ), '' + ) || '' INTO uri_datafield + FROM oils_xpath_table( + 'id', + 'marc', + 'biblio.record_entry', + '//*[@tag="856"][position()=' || i || ']/@ind1|' || + '//*[@tag="856"][position()=' || i || ']/@ind2|' || + '//*[@tag="856"][position()=' || i || ']/*/@code|' || + '//*[@tag="856"][position()=' || i || ']/*[@code]', + 'id=' || source_record + ) as t(id int,ind1 text, ind2 text,subfield text,data text); + + uri_text := uri_text || uri_datafield; + END LOOP; + + IF uri_text <> '' THEN + UPDATE biblio.record_entry + SET marc = regexp_replace(marc,'(]*record>)', uri_text || E'\\1') + WHERE id = target_record; + END IF; + + END IF; + + -- Find and move metarecords to the target record + SELECT INTO metarec * + FROM metabib.metarecord + WHERE master_record = source_record; + + IF FOUND THEN + UPDATE metabib.metarecord + SET master_record = target_record, + mods = NULL + WHERE id = metarec.id; + + moved_objects := moved_objects + 1; + END IF; + + -- Find call numbers attached to the source ... + FOR source_cn IN SELECT * FROM asset.call_number WHERE record = source_record LOOP + + SELECT INTO target_cn * + FROM asset.call_number + WHERE label = source_cn.label + AND owning_lib = source_cn.owning_lib + AND record = target_record; + + -- ... and if there's a conflicting one on the target ... + IF FOUND THEN + + -- ... move the copies to that, and ... + UPDATE asset.copy + SET call_number = target_cn.id + WHERE call_number = source_cn.id; + + -- ... move V holds to the move-target call number + FOR hold IN SELECT * FROM action.hold_request WHERE target = source_cn.id AND hold_type = 'V' LOOP + + UPDATE action.hold_request + SET target = target_cn.id + WHERE id = hold.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- ... if not ... + ELSE + -- ... just move the call number to the target record + UPDATE asset.call_number + SET record = target_record + WHERE id = source_cn.id; + END IF; + + moved_objects := moved_objects + 1; + END LOOP; + + -- Find T holds targeting the source record ... + FOR hold IN SELECT * FROM action.hold_request WHERE target = source_record AND hold_type = 'T' LOOP + + -- ... and move them to the target record + UPDATE action.hold_request + SET target = target_record + WHERE id = hold.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- Find serial records targeting the source record ... + FOR ser_rec IN SELECT * FROM serial.record_entry WHERE record = source_record LOOP + -- ... and move them to the target record + UPDATE serial.record_entry + SET record = target_record + WHERE id = ser_rec.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- Find serial subscriptions targeting the source record ... + FOR ser_sub IN SELECT * FROM serial.subscription WHERE record_entry = source_record LOOP + -- ... and move them to the target record + UPDATE serial.subscription + SET record_entry = target_record + WHERE id = ser_sub.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- Find booking resource types targeting the source record ... + FOR booking IN SELECT * FROM booking.resource_type WHERE record = source_record LOOP + -- ... and move them to the target record + UPDATE booking.resource_type + SET record = target_record + WHERE id = booking.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- Find acq lineitems targeting the source record ... + FOR acq_lineitem IN SELECT * FROM acq.lineitem WHERE eg_bib_id = source_record LOOP + -- ... and move them to the target record + UPDATE acq.lineitem + SET eg_bib_id = target_record + WHERE id = acq_lineitem.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- Find acq user purchase requests targeting the source record ... + FOR acq_request IN SELECT * FROM acq.user_request WHERE eg_bib = source_record LOOP + -- ... and move them to the target record + UPDATE acq.user_request + SET eg_bib = target_record + WHERE id = acq_request.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- Find parts attached to the source ... + FOR source_part IN SELECT * FROM biblio.monograph_part WHERE record = source_record LOOP + + SELECT INTO target_part * + FROM biblio.monograph_part + WHERE label = source_part.label + AND record = target_record; + + -- ... and if there's a conflicting one on the target ... + IF FOUND THEN + + -- ... move the copy-part maps to that, and ... + UPDATE asset.copy_part_map + SET part = target_part.id + WHERE part = source_part.id; + + -- ... move P holds to the move-target part + FOR hold IN SELECT * FROM action.hold_request WHERE target = source_part.id AND hold_type = 'P' LOOP + + UPDATE action.hold_request + SET target = target_part.id + WHERE id = hold.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- ... if not ... + ELSE + -- ... just move the part to the target record + UPDATE biblio.monograph_part + SET record = target_record + WHERE id = source_part.id; + END IF; + + moved_objects := moved_objects + 1; + END LOOP; + + -- Find multi_home items attached to the source ... + FOR multi_home IN SELECT * FROM biblio.peer_bib_copy_map WHERE peer_record = source_record LOOP + -- ... and move them to the target record + UPDATE biblio.peer_bib_copy_map + SET peer_record = target_record + WHERE id = multi_home.id; + + moved_objects := moved_objects + 1; + END LOOP; + + -- And delete mappings where the item's home bib was merged with the peer bib + DELETE FROM biblio.peer_bib_copy_map WHERE peer_record = ( + SELECT (SELECT record FROM asset.call_number WHERE id = call_number) + FROM asset.copy WHERE id = target_copy + ); + + -- Finally, "delete" the source record + DELETE FROM biblio.record_entry WHERE id = source_record; + + -- That's all, folks! + RETURN moved_objects; +END; +$func$ LANGUAGE plpgsql; + + + +INSERT INTO config.upgrade_log (version) VALUES ('0649'); + +CREATE OR REPLACE VIEW extend_reporter.full_circ_count AS + SELECT cp.id, COALESCE(c.circ_count, 0::bigint) + COALESCE(count(DISTINCT circ.id), 0::bigint) + COALESCE(count(DISTINCT acirc.id), 0::bigint) AS circ_count + FROM asset."copy" cp + LEFT JOIN extend_reporter.legacy_circ_count c USING (id) + LEFT JOIN "action".circulation circ ON circ.target_copy = cp.id + LEFT JOIN "action".aged_circulation acirc ON acirc.target_copy = cp.id + GROUP BY cp.id, c.circ_count; + + + +INSERT INTO config.upgrade_log (version) VALUES ('0650'); + +CREATE OR REPLACE FUNCTION asset.cache_copy_visibility () RETURNS TRIGGER as $func$ +DECLARE + add_front TEXT; + add_back TEXT; + add_base_query TEXT; + add_peer_query TEXT; + remove_query TEXT; + do_add BOOLEAN := false; + do_remove BOOLEAN := false; +BEGIN + add_base_query := $$ + SELECT cp.id, cp.circ_lib, cn.record, cn.id AS call_number, cp.location, cp.status + FROM asset.copy cp + JOIN asset.call_number cn ON (cn.id = cp.call_number) + JOIN actor.org_unit a ON (cp.circ_lib = a.id) + JOIN asset.copy_location cl ON (cp.location = cl.id) + JOIN config.copy_status cs ON (cp.status = cs.id) + JOIN biblio.record_entry b ON (cn.record = b.id) + WHERE NOT cp.deleted + AND NOT cn.deleted + AND NOT b.deleted + AND cs.opac_visible + AND cl.opac_visible + AND cp.opac_visible + AND a.opac_visible + $$; + add_peer_query := $$ + SELECT cp.id, cp.circ_lib, pbcm.peer_record AS record, NULL AS call_number, cp.location, cp.status + FROM asset.copy cp + JOIN biblio.peer_bib_copy_map pbcm ON (pbcm.target_copy = cp.id) + JOIN actor.org_unit a ON (cp.circ_lib = a.id) + JOIN asset.copy_location cl ON (cp.location = cl.id) + JOIN config.copy_status cs ON (cp.status = cs.id) + WHERE NOT cp.deleted + AND cs.opac_visible + AND cl.opac_visible + AND cp.opac_visible + AND a.opac_visible + $$; + add_front := $$ + INSERT INTO asset.opac_visible_copies (copy_id, circ_lib, record) + SELECT DISTINCT ON (id, record) id, circ_lib, record FROM ( + $$; + add_back := $$ + ) AS x + $$; + + remove_query := $$ DELETE FROM asset.opac_visible_copies WHERE copy_id IN ( SELECT id FROM asset.copy WHERE $$; + + IF TG_TABLE_NAME = 'peer_bib_copy_map' THEN + IF TG_OP = 'INSERT' THEN + add_peer_query := add_peer_query || ' AND cp.id = ' || NEW.target_copy || ' AND pbcm.peer_record = ' || NEW.peer_record; + EXECUTE add_front || add_peer_query || add_back; + RETURN NEW; + ELSE + remove_query := 'DELETE FROM asset.opac_visible_copies WHERE copy_id = ' || OLD.target_copy || ' AND record = ' || OLD.peer_record || ';'; + EXECUTE remove_query; + RETURN OLD; + END IF; + END IF; + + IF TG_OP = 'INSERT' THEN + + IF TG_TABLE_NAME IN ('copy', 'unit') THEN + add_base_query := add_base_query || ' AND cp.id = ' || NEW.id; + EXECUTE add_front || add_base_query || add_back; + END IF; + + RETURN NEW; + + END IF; + + -- handle items first, since with circulation activity + -- their statuses change frequently + IF TG_TABLE_NAME IN ('copy', 'unit') THEN + + IF OLD.location <> NEW.location OR + OLD.call_number <> NEW.call_number OR + OLD.status <> NEW.status OR + OLD.circ_lib <> NEW.circ_lib THEN + -- any of these could change visibility, but + -- we'll save some queries and not try to calculate + -- the change directly + do_remove := true; + do_add := true; + ELSE + + IF OLD.deleted <> NEW.deleted THEN + IF NEW.deleted THEN + do_remove := true; + ELSE + do_add := true; + END IF; + END IF; + + IF OLD.opac_visible <> NEW.opac_visible THEN + IF OLD.opac_visible THEN + do_remove := true; + ELSIF NOT do_remove THEN -- handle edge case where deleted item + -- is also marked opac_visible + do_add := true; + END IF; + END IF; + + END IF; + + IF do_remove THEN + DELETE FROM asset.opac_visible_copies WHERE copy_id = NEW.id; + END IF; + IF do_add THEN + add_base_query := add_base_query || ' AND cp.id = ' || NEW.id; + add_peer_query := add_peer_query || ' AND cp.id = ' || NEW.id; + EXECUTE add_front || add_base_query || ' UNION ' || add_peer_query || add_back; + END IF; + + RETURN NEW; + + END IF; + + IF TG_TABLE_NAME IN ('call_number', 'record_entry') THEN -- these have a 'deleted' column + + IF OLD.deleted AND NEW.deleted THEN -- do nothing + + RETURN NEW; + + ELSIF NEW.deleted THEN -- remove rows + + IF TG_TABLE_NAME = 'call_number' THEN + DELETE FROM asset.opac_visible_copies WHERE copy_id IN (SELECT id FROM asset.copy WHERE call_number = NEW.id); + ELSIF TG_TABLE_NAME = 'record_entry' THEN + DELETE FROM asset.opac_visible_copies WHERE record = NEW.id; + END IF; + + RETURN NEW; + + ELSIF OLD.deleted THEN -- add rows + + IF TG_TABLE_NAME = 'call_number' THEN + add_base_query := add_base_query || ' AND cn.id = ' || NEW.id; + EXECUTE add_front || add_base_query || add_back; + ELSIF TG_TABLE_NAME = 'record_entry' THEN + add_base_query := add_base_query || ' AND cn.record = ' || NEW.id; + add_peer_query := add_peer_query || ' AND pbcm.peer_record = ' || NEW.id; + EXECUTE add_front || add_base_query || ' UNION ' || add_peer_query || add_back; + END IF; + + RETURN NEW; + + END IF; + + END IF; + + IF TG_TABLE_NAME = 'call_number' THEN + + IF OLD.record <> NEW.record THEN + -- call number is linked to different bib + remove_query := remove_query || 'call_number = ' || NEW.id || ');'; + EXECUTE remove_query; + add_base_query := add_base_query || ' AND cn.id = ' || NEW.id; + EXECUTE add_front || add_base_query || add_back; + END IF; + + RETURN NEW; + + END IF; + + IF TG_TABLE_NAME IN ('record_entry') THEN + RETURN NEW; -- don't have 'opac_visible' + END IF; + + -- actor.org_unit, asset.copy_location, asset.copy_status + IF NEW.opac_visible = OLD.opac_visible THEN -- do nothing + + RETURN NEW; + + ELSIF NEW.opac_visible THEN -- add rows + + IF TG_TABLE_NAME = 'org_unit' THEN + add_base_query := add_base_query || ' AND cp.circ_lib = ' || NEW.id; + add_peer_query := add_peer_query || ' AND cp.circ_lib = ' || NEW.id; + ELSIF TG_TABLE_NAME = 'copy_location' THEN + add_base_query := add_base_query || ' AND cp.location = ' || NEW.id; + add_peer_query := add_peer_query || ' AND cp.location = ' || NEW.id; + ELSIF TG_TABLE_NAME = 'copy_status' THEN + add_base_query := add_base_query || ' AND cp.status = ' || NEW.id; + add_peer_query := add_peer_query || ' AND cp.status = ' || NEW.id; + END IF; + + EXECUTE add_front || add_base_query || ' UNION ' || add_peer_query || add_back; + + ELSE -- delete rows + + IF TG_TABLE_NAME = 'org_unit' THEN + remove_query := 'DELETE FROM asset.opac_visible_copies WHERE circ_lib = ' || NEW.id || ';'; + ELSIF TG_TABLE_NAME = 'copy_location' THEN + remove_query := remove_query || 'location = ' || NEW.id || ');'; + ELSIF TG_TABLE_NAME = 'copy_status' THEN + remove_query := remove_query || 'status = ' || NEW.id || ');'; + END IF; + + EXECUTE remove_query; + + END IF; + + RETURN NEW; +END; +$func$ LANGUAGE PLPGSQL; + +COMMIT; diff --git a/Open-ILS/xul/staff_client/chrome/content/main/about.html b/Open-ILS/xul/staff_client/chrome/content/main/about.html index 2609bb6b3f..82c95f8bdf 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/about.html +++ b/Open-ILS/xul/staff_client/chrome/content/main/about.html @@ -1,7 +1,7 @@

Evergreen

Target Server ID:

-

$HeadURL$

+

http://git.evergreen-ils.org/Evergreen.git?h=refs/heads/rel_2_1_1

What is Evergreen?

diff --git a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js index 19dcd2a91f..f11517b3f6 100644 --- a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js +++ b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js @@ -11,7 +11,7 @@ pref("toolkit.singletonWindowType", "eg_main"); pref("open-ils.enable_join_tabs", true); // We'll use this one to help brand some build information into the client, and rely on subversion keywords -pref("open-ils.repository.headURL","$HeadURL$"); +pref("open-ils.repository.headURL","http://git.evergreen-ils.org/Evergreen.git?h=refs/heads/rel_2_1_1"); pref("open-ils.repository.author","$Author$"); pref("open-ils.repository.revision","$Revision$"); pref("open-ils.repository.date","$Date$"); diff --git a/README b/README index 95621e52d7..8a4a541159 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for Evergreen 2.1.0a +README for Evergreen 2.1.1 =========================== Preamble: referenced user accounts @@ -38,8 +38,8 @@ the following commands as the *user* Linux account: [source, bash] ------------------------------------------------------------------------------ -wget -c http://evergreen-ils.org/downloads/Evergreen-ILS-2.1.0a.tar.gz -tar xzf Evergreen-ILS-2.1.0a.tar.gz +wget -c http://evergreen-ils.org/downloads/Evergreen-ILS-2.1.1.tar.gz +tar xzf Evergreen-ILS-2.1.1.tar.gz ------------------------------------------------------------------------------ Preamble: Developer instructions @@ -172,7 +172,7 @@ Installation instructions + [source, bash] ------------------------------------------------------------------------------ -make STAFF_CLIENT_STAMP_ID=rel_2_1_0 install +make STAFF_CLIENT_STAMP_ID=rel_2_1_1 install ------------------------------------------------------------------------------ + 2. The server portion of the staff client expects `http://hostname/xul/server` diff --git a/configure.ac b/configure.ac index dd0b098b5f..56663b50e0 100644 --- a/configure.ac +++ b/configure.ac @@ -20,8 +20,8 @@ export PATH=${PATH}:/usr/sbin AC_PREREQ(2.61) -AC_INIT(Open-ILS, trunk, open-ils-dev@list.georgialibraries.org) -AM_INIT_AUTOMAKE([OpenILS], [trunk]) +AC_INIT(Open-ILS, 2.1.1, open-ils-dev@list.georgialibraries.org) +AM_INIT_AUTOMAKE([OpenILS], [2.1.1]) AC_REVISION($Revision: 0.1 $) AC_CONFIG_SRCDIR([configure.ac]) AC_PREFIX_DEFAULT([/openils/]) -- 2.11.0