LP#1804038 Fix-ups for older 'clense' functions Way back when, we switched from a misspelled 'clense_ISO8601' to a corrected 'cleanse_ISO8601' in OpenSRF. This function has again moved, and is now part of OpenILS::Utils::DateTime, and is named 'clean_ISO8601'. This was done as part of LP bug #1552778. However, a few stragglers of the misspelling remained, so these were missed when the big changeover occurred. This hopefully catches them all! Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Jason Boyer <jboyer@library.in.gov>
LP#1552778: copy some date/time utils from OpenSRF As preparation for subsequent bugfixes, this patch copies several date/time routines from OpenSRF::Utils to a new module, OpenILS::Utils::DateTime. Specifically, the routines copied over are: * clean_ISO8601() (renaming of the OpenSRF cleanse_ISO8601) * gmtime_ISO8601() * interval_to_seconds() * seconds_to_interval() This move will allow us to fix bugs in this core routines without requiring a mandatory OpenSRF upgrade. Furthermore, with the exception of interval_to_seconds() (and in only one place), none of those routines are used by OpenSRF itself. To test ------- [1] Apply the patch. [2] Verify that unit tests pass. [3] Verify that all Perl services start correctly. [4] Verify that date/time and interval calculations continue to work as expected, particularly in circulation. Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1414197 Serial Item Delete Improvements If a serial item is received, then deleted without any further status, it can leave the system in an inconsistent state: 1) If from a multi-item unit, the unit contents are not updated. 2) If from a single-item unit, the unit is not deleted. 3) If the last holding of its kind, holdings summaries are not updated. Since 'resetting' items has all the necessary logic to handle the above needs, this commit runs each deleted item through the reset code before doing the actual delete. This also gives the benefit of keeping the logic centralized for future fixes/enhancements. Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1682296: Avoid database query error on serials batch receive To test ------- [1] Example Search -> Retrieve title by database ID -> Actions for this Record -> Serials Batch Receive -> Next -> this works as expected & receivable issues are listed. [2] Click on "Start Over"; you are prompted to "Enter an identifier for a bibliographic record" this is where the search fails Example enter "109242427" results in two errors. [3] Desired behavior - If you enter a database ID or ISSN in the "Enter an identifier for a bibliographic record" field the receivable issuances should be displayed Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca> Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP#1730470 Restore XUL serial receive compatibility The older XUL interface does not have quite the same fleshing as the new web-staff, so adding the 'move previous' code into the unitize function breaks the old interface. Since we already are looking up the distribution to get the setting, let's just tack it on when it is missing. To test ------- [1] Set up a serial subscription with predicted issuances, then from the XUL serials control view attempt to receive an issue. Note that there will be a crash. [2] Apply the patch and repeat step #1; this time, the issuance receive should work. [3] Verify that receiving issues via the web staff interface continues to work. Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Mike Rylander <mrylander@gmail.com>
LP#1708291: web staff client serials module This patch adds a serials module to the web staff client, implementing a unified serials interface allowing for the following actions supported by the XUL staff client: - creating subscriptions, distributions, and streams - creating and editing prediction patterns - receiving serial issues, with or without barcodes (units) - batch and quick receiving This module also implements some new features, including - the ability to save prediction pattern codes as templates that can be shared and reused within an Evergreen database - a more streamlined interface for managing subscriptions, distributions, and streams - it is no longer necessary to create a starting issue in order to predict a run of issues; the dialog box for generating a set of predicted issues now lets you specify the starting point directly. - the ability to more directly edit MFHDs The new serials interfaces can be accessed from the record details page via a Serials drop-down button that links to a subscription management page, a quick-receive action, and a MFHD management page. There is also a new Serials Administration page where prediction pattern and serial copy templates can be managed. To test ------- * Create, edit, and delete subscriptions, distribution streams, and routing lists. * Use the prediction pattern wizard to create patterns. * Save prediction pattern templates and use them to apply a pattern to new subscriptions. * Verify that sets of issues can be predicted and received. * Create and apply serial copy templates and verify that they are applied when receiving barcoded issues. This patch represents a group coding effort by Galen Charlton, Jason Etheridge, and Mike Rylander. Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org> Conflicts: Open-ILS/src/sql/Pg/950.data.seed-values.sql Open-ILS/web/js/ui/default/staff/cat/catalog/app.js Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Dan Wells <dbw2@calvin.edu>
LP#1708291: add API for safe deleting various serial records This adds routines for safely deleting subscriptions, distributions and streams. open-ils.serial.subscription.safe_delete open-ils.serial.distribution.safe_delete open-ils.serial.stream.safe_delete open-ils.serial.subscription.safe_delete.dry_run open-ils.serial.distribution.safe_delete.dry_run open-ils.serial.stream.safe_delete.dry_run Won't delete if there are attached serial.item records with a status other than Expected, or if there are any attached non-deleted serial.unit records. The dry_run variants behave exactly the same except they don't actually delete anything. Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Dan Wells <dbw2@calvin.edu>
LP#1425191 Restore summarization of serial units In a previous commit, code was added for force summaries to be limited to a certain type (to prevent cross type contamination of summaries). This had the negative side-effect of preventing summaries on units, as the units were not requesting a 'type' for their summary. While we could force the unit code to send a type, it seemed generally more flexible to restore the removed support for returning all summary information in the absense of a requested type. This could lead to cross-type summaries for units, but that is a larger issue altogether (i.e. how we can properly support cross-type units at all). Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1078593 Regenerate summaries when deleting issuances Both interfaces currently allow you to delete issuances even if they have items attached and have the delete cascade. While this might be a dangerous allowance, we should still make sure to keep our summaries updated when this happens. This commit adds automatic summary regeneration when deleting issuances in either serials interface. Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1078593 Add method for regenerating serial summaries Right now, serial summaries only update when receiving or resetting items. They need to update more often, so lets start by adding a method just for doing that. Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1078593 Assorted small Serial.pm fixes 1) fleshed_issuance_alter() changes - First, if one of the inner updates returns an event, abort early. Otherwise, we might overwrite the event while looping and lose the error. - Second, add authtoken to the created editor. This editor gets passed around, and other functions might look for it there. 2) pass $type down into _summarize_contents() - Right now, we have a bug where supplement/index contents in a merged MFHD record will get added to the basic contents (and vice-(vice-)versa). By passing in $type, we can assure that we only return the type of contents we are looking for. 3) _prepare_summaries() should acknowledge empty summaries - Under normal use, summaries will generally grow, and never shrink to nothing. However, we must still handle cases where we have discarded/deleted our last issuance, and in those cases, make sure we "empty" the generated_coverage field in our summary. Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1331127 Repair sort logic of previous issuances Ensure that the list of previous issuances is sorted correctly (on date_published) when looking for the previous serial.unit to update its copy location (when serial.prev_issuance_copy_location is enabled). The data comes sorted from the DB, but the sorting was lost during the process of unique-ifying the list. Ultimately, it was relying on the order of hash keys, which is undefined. Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Dan Wells <dbw2@calvin.edu>
LP#1081551 Serials batch recv. dupe barcode check Exit processing and return an event if the barcode on a new serial.unit collides with an existing serial.unit or asset.copy barcode in the serial receive API. In the UI, detect the dupe barcode event and provide an error message to the user. Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Jennifer Pringle <jpringle@sitka.bclibraries.ca> Signed-off-by: Ben Shum <bshum@biblio.org>
Serials: Support reader address information in routing slip template Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com> Signed-off-by: Dan Wells <dbw2@calvin.edu>
Tie in new MFHD method to serials module/MFHD tests for compressing, combining [This commit has been squashed for merging. LFW] * Now that we have a potentially better alternative, let's call get_combined_holdings() in place of get_compressed_holdings() in Serial.pm. * First, add a test for the new get_combined_holdings() method. Second, add a known problem case for get_compressed_holdings(). The fix will come in a subsequent commit. Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Post-2.5-m1 whitespace fixup This is an attempt at an automated whitespace cleanup for the m1 milestone of version 2.5. It was created using the following commands (run from Open-ILS/src/perlmods/lib): find . -name "*.pm" \ -exec sh -c 'sed "/<</s/\t/ /g" < {} \ | expand -t 4 > {}.fixed ; \ cp --no-preserve=mode,ownership {}.fixed {}; \ rm {}.fixed' \; Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Remington Steed <rjs7@calvin.edu>
Serials: MFHD::get_compressed_holdings() can reach infinite loop Even controlled serials holdings involve the internal creation of MFHD fields, upon which caculations are performed for such purposes as the display of holdings summaries in the OPAC. There are too many ways that incorrect MFHD (or MFHD that our code just can't yet handle) can lead our MFHD routines to crash. We can't address all these possibilities in a single bug fix. But we can avoid this infinite loop. A subroutine within open-ils.serial (_summarize_contents()) relies on MFHD::get_compressed_holdings(). When the latter went into an infinite loop the result would be an open-il.serial drone process consuming CPU time indefinitely and, depending on the data that provoked the loop, potentially writing repeating messages to stderr indefinitely. End users will still see the item receiving fail in these cases, and be obliged to work around the issue as before until more robust holdings summarization code can be written, but at least the overall condition of the running Evergreen system won't be affected, and there will be better information in the error logs. Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com> Signed-off-by: Remington Steed <rjs7@calvin.edu> Signed-off-by: Dan Wells <dbw2@calvin.edu>
Serials: Test method to identify holdings that lead to summarization bugs This adds a simple test method that allows testing of problem holdings. See the next commit. Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com> Signed-off-by: Remington Steed <rjs7@calvin.edu> Signed-off-by: Dan Wells <dbw2@calvin.edu>
Clean up and refine serial note support, part 1 This commit fixes a number of minor problems with serial notes: 1) Serial notes are currently returned in "random" (database) order. Adding a create_date sort is a sensible default. 2) If you have many notes, they start to display in a squashed and unreadable fashion. Switching from a groupbox to a styled vbox provides a simple workaround. 3) It is currently impossible to display newlines in notes. We can deal with this by changing the display style. Signed-off-by: Dan Wells <dbw2@calvin.edu>
Limit excess serial data fetching Overfetching and duplication of data in the interface is both inefficient and bug-inducing. This reduces a couple big offenders. First, in the items tab, we will store distribution and subscription data separately, rather than duplicating for every row. Second, we will only redraw rows as needed rather than refresh the whole list so often. Finally, we no longer need to lookup call numbers separately, as they are included in the one-time distribution fetch. Signed-off-by: Dan Wells <dbw2@calvin.edu>