]> git.evergreen-ils.org Git - Evergreen.git/commit
MFHD compressed holding fixes
authorDan Wells <dbw2@calvin.edu>
Tue, 19 Jul 2011 16:02:17 +0000 (12:02 -0400)
committerDan Wells <dbw2@calvin.edu>
Tue, 19 Jul 2011 16:02:17 +0000 (12:02 -0400)
commite9cd992fa4dbf1013346336193cb7469ecee10a8
treef656617eae50398cdd28c191de9be6ed80cc9e33
parent306775b7272d7b35abdd22014c67eef505fbcaa2
MFHD compressed holding fixes

1. Add new utility method to MFHD.pm:
    holdings_by_caption(): return all holdings attached to a
    given caption

2. Add 'passthru_open_ended' option to get_decompressed_holdings()
    Previously, attempts to decompress an open-ended holding
    would error out.  Now, in the absence of this option,
    open-ended holdings are discarded and you get a warning
    (since they cannot logically be decompressed), while if
    this option is 'true' they are passed back unaffected

3. compressed_to_last() on an open-ended holding now more
   correctly returns 'undef' rather than the unaltered holding

4. get_compressed_holdings() will now honor an open-ended holding
   by treating it as "infinite", and thus absorbing any holdings
   which would follow

5. Overloaded comparison operator now correctly detects "swap"
   cases (where only the second operand is a holding)

6. Overloaded comparison operator now consistently treats
   open-ended holdings as "greater-than" a single or closed
   holding which has the same starting point

7. Fix 2 thinkos in comparison operator for overlapping
   compressed holdings

8. Add new compressed_end() method to Holding.pm which can add
   or set a new ending to a holding, making compressed if needed

9. Correctly recognize partially compressed holdings
    If a holding is defined as:
        863 40 $81.1 $a1 $b2-10
    this actually means:
        863 40 $81.1 $a1-1 $b2-10
    so let's make sure to treat it that way.

9. Expand the MFHD test suite to better cover the improvements
   in this commit

There is also the beginnings of a _get_truncated_holdings()
method for handling odd cases where an open-ended holding is
followed by a single/closed holding, but it is currently
commented out, pending further design consideration.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm
Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Holding.pm
Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/test/mfhd.t
Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/test/mfhddata2.txt [new file with mode: 0644]