This code is intended to replace current value_builder code in 3.2, but
it does not affect it directly (yet) and is safe to include in 3.0.
This structure will be used to handle more complicated formats, like those
with checkdigits. Please note that "incremental" format is still STRONGLY
recommended because it will always perform the best, and most flexibly.
The desire to include other information (like branchcode) should compel
the proper use of the barcode generator to print the info ON the barcode,
not IN the barcode.
One of the nicer features of this structure is that you are able to
create a new barcode (of the same type) based on any previous Barcodes object.
That means you can create an array of 51 consecutive barcodes like:
my $x = C4::Barcodes->new('annual'); # for example
my @set = ($x);
for (1..50) {
push @set, $x=$x->new;
}
Importantly, this can happen without referencing the database after the
first constructor.
The "transfers to receive" report included
unused code to delete a transfer. Since the
"transfers to receive" report is still useful
to give a library a report of items that it should
expect to receive, I am retaining the report. However,
since the cancel transfer functionality would not
work even if it were uncommented in the template, that
portion is removed.
This hold request and transfer report no longer
works now that hold requests are processed via
checking items in.
This patch removes the report; please consult
the koha-devel message re "RFC - remove circ/transferstodo.pl prior to general release"
for more details.
bug 2297: improve ModBiblio() to avoid duplicate item fields
Prior to this patch, ModBiblio() would append
item tags from the previous version of the bib record
to the incoming bib record before saving the results,
even if the incoming bib record already has embedded
item tags.
For example, if a bib is retrieved using GetMarcBiblio() then
saved using ModBiblio(), the caller was obliged
to delete any item tags first to avoid duplication.
ModBiblio() now deletes item tags supplied in the
incoming MARC record. This eliminates the possibility
of duplication, and removes any implication that
ModBiblio() can or should be used to modify item
records - ModItem() should be used for that.
test suite add_biblios: don't use zebraqueue_daemon
The add_biblios() routine now reindexes all bibs
in batch instead of waiting for zebraqueue_daemon - this
is moderately faster. A separate set of test
cases for zebraqueue_deamon will be witten.
No documentation changes.
Signed-off-by: Andrew Moore <andrew.moore@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Test cases in KohaTest/Search/SimpleSearch.pm assumed
that they were the first to call add_biblios(); as
this is not necessarily true when the entire test
suite is run, test now counts how many 'Finn Test'
bibs already exist.
No documentation changes.
Signed-off-by: Andrew Moore <andrew.moore@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
bug 2293: better validation in overdue rules editor
If a rule should not be saved because a delay is
given but no letter or debar action is specified
for that delay, an error message is now reported.
Also:
* use "dialog alert" CSS class for confirmation
that form was saved
* if form input is saved, retrieve the settings from the
database again when displaying the form - this will
help turn up any bugs where the script is not
saving the overdue rules correctly.
* fix display of patron category in error messages
Joe Atzberger [Wed, 25 Jun 2008 23:21:28 +0000 (18:21 -0500)]
Script to correct faulty statistics table entries.
This is the first iteration of this script, likely to be expanded
if other mappings are determined. Currently it populates the
itemtype for all statistics that have itemnumbers and then pulls
borrownumbers from old_issues (or issues). This has the benign
side effect of ignoring whether or not itemtype was a different
value at the time of the transaction.
It then tries to populate null borrowernumbers using a fairly
conservative approach, only where exactly one match exists, else warns.
The process of updating statistics is needlessly complex based on the
lack of a reliable primary key. ALL such tables should have a numerical
primary key. The impression that the timestamp and any other fields
are enough to combine for a "unique enough" key is wrong. For example,
running SIP tests will add multiple transactions that might share
borrowernumber, itemnumber and timestamp. Key uniqueness should be
logically inherent, not de facto.
Andrew Moore [Mon, 23 Jun 2008 17:55:31 +0000 (12:55 -0500)]
bug: 2269 - adding a perltidyrc file
This patch adds xt/perltidyrc, a suggested perltidy configuration file.
It's in the xt directory because I'd like to eventually tie it in with Test::Perl::Critic
to run automated tests on tidyness and other Perl::Critic policies. That stuff belongs in
the xt directory since it's testing for developers use only.
I have only turned on a few directives based on the suggestions by MJ, historical discussion on
the mailing lists, and what I was told when I started contributing to koha. There are many other
directives in this file that are commented out. They are supposed to represent the defaults and
can be adjusted in the future if desired.
Use of this file is encouraged, but not required. It would be really nice if you could at least run
it on new files that you contribute. I would recommend not running it on files that are already
part of koha without writing some tests for those files and discussing your intentions to reformat
entire files in bulk.
Andrew Moore [Mon, 23 Jun 2008 17:35:58 +0000 (12:35 -0500)]
bug: 2272 - remove warning from C4::Koha::getitemtypeimagedir
I changed getitemtypeimagedir to set a default on its argument so that it would not complain if not passed 'opac'.
I improved the documentation on the method.
I edited the t/icondirecotries.t test script to explicitly pass an argument to both getitemtypeimagedir calls.
- and I adjusted one line of whitespace to make similar things look similar
I added a test module for C4::Koha
I added a test module for C4::Koha::getitemtypeimagedir.
ILS::Patron is where most of the intelligence for SIP's representation
is lodged. Currently there is difficulty with C4::Members functions.
GetMemberDetails is required for the needed flags, but it returns
empty structure on bad barcodes, where it should be undef.
Galen Charlton [Wed, 25 Jun 2008 16:30:03 +0000 (11:30 -0500)]
bug 2254 [3/3]: add authority type check
Added a test to the MARC framework checks to
verify that all authority types used in a framework
are defined.
Documentation changes: possible new screenshots
and text to describe the new test.
NOTE: This patch adds strings to the checkmarc template, and thus
violates the string freeze for 3.0. I'm submitting anyway
because 2254 is a blocker, but if no exception is made,
it is safe to not apply this patch for 3.0.
Corrected two errors found in the authority types used
in the MARC21 frameworks:
* one subfield that used "Meeting Name" instead of "MEETI_NAME"
* various subfields that used "CORP0_NAME" instead of "CORPO_NAME"
The biggest visible consequence of this change is that corporate
name headings (110, 610, 710, 810, etc.) will now link correctly
to their authority records.
In addition, brought the fr-FR MARC21 framework scripts up-to-date
with respect to the changes made to the English versions.
Galen Charlton [Wed, 25 Jun 2008 16:30:01 +0000 (11:30 -0500)]
bug 2254 [1/3]: fixed GetAuthType(); avoid crash
Improved C4::AuthoritiesMarc::GetAuthType() so that
it returns either a hashref (if the authority type exists)
or undef (if it does not exist). The same
accessor should not be used to either return a single
value or all values of a settings list. Note that
all existing clients of GetAuthType are expecting
either a single hashref or undef; none of them
expected the arrayref that could be returned by
the previous version of the accessor.
When BiblioAddsAuthorities is ON, addbiblio.pl
now checks the return value of GetAuthType and
no longer crashes as follows if the MARC framework
specifies an invalid authority type for a given subfield:
Can't coerce array into hash at .../cataloging/addbiblio.pl line 738.
Galen Charlton [Tue, 24 Jun 2008 22:12:23 +0000 (17:12 -0500)]
bug 2206: always have $9 for headings fields
If a field can be linked to an authority record (i.e.,
an authtypecode is defined for subfield $a), always
include the subfield $9 in a (readonly) input element even
if it is marked hidden per the MARC framework.
Prior to this patch, a $9 marked hidden per the framework
would not be included in the form, causing the authority record
number link to not be added when choosing a heading from the authority
finder. In other words, with BiblioAddsAuthorities OFF,
any authorized headings in bibs added via the MARC editor
would not have the subfield $9, and thus would appear
to not be used by any bibs.
Note that subfield $9 is set to be readonly, as changing the
authority number link does not currently change the
heading stored in the bib record.
Galen Charlton [Tue, 24 Jun 2008 15:21:12 +0000 (10:21 -0500)]
clean up old-style calls to GetMemberDetails
GetMemberDetails() returns only one hashref now,
not two. In all cases where the caller was
expecting two output values, the $flags return
was ignored anyway.
Galen Charlton [Mon, 23 Jun 2008 20:33:32 +0000 (15:33 -0500)]
bug 2252: item-level hold not waiting until priority = 0
When returning an item that has an item-level hold on it,
CheckReserves() will not consider it waiting unless the
priority has been set to 0 (i.e., the item has specifically
been marked as filling the request.)
Galen Charlton [Mon, 23 Jun 2008 16:15:01 +0000 (11:15 -0500)]
bug 2273: not-for-loan item should not fill hold request
If an item is not for loan (i.e., items.notforloan is not null),
do not use it to fill a title-level hold request when
item is checked in. Prior to this patch, a notforloan item
could fill a request - CheckReserves() was checking only
the item's item type's not for loan flag.
Galen Charlton [Mon, 23 Jun 2008 15:01:33 +0000 (10:01 -0500)]
new automated test for template translatability
This test verifies that the English OPAC and staff templates
can be processed by the string extractor (tmpl_process3.pl)
without error. If a template contains a parsing error
(at least as far as tmpl_process3.pl is concerned), it may
not be correctly converted when a language translation
is applied.
Galen Charlton [Fri, 20 Jun 2008 22:37:05 +0000 (17:37 -0500)]
bug 2248 [2/2]: import item status display in search results
The in transit status now displays as such in the
OPAC search results. In the non-XSLT version, the status
is checked only for bibs having 20 or fewer items to avoid
extra hits on the database during result set presentation.
In the XSLT version, all items are checked.
Note that because an item's transfer status is not
stored in the MARC record, the transfer status
has no effect when limiting a search by item
availability. For a future version, the transit status
should be added to the Zebra index.
This prevents the following log entries:
error EXPR:at pos 42: non-initialized variable OPACViewOthersSuggestions
EXPR must NOT be used unless the author can guarantee ALL names referenced
will be defined at the BEGINNING of TMPL execution. That suggests that in
.inc files, only variables populated by get_template... are valid, since
the author cannot guarantee what other templates might include the file.
Joe Atzberger [Fri, 20 Jun 2008 19:36:29 +0000 (14:36 -0500)]
Remove EXPRs. Also added all jacket images to Overdue tab.
Standardized table layout with colspan=2 for Title header,
the first being the icon or jacket image. Discovered a bug
when I fixed the "toggle/highlight" code to work (using loop
context var __odd__), namely that the highlight styling overrides
the red overdue styling. Commented out that conditional with a
FIXME.
Andrew Moore [Fri, 20 Jun 2008 19:58:42 +0000 (14:58 -0500)]
bug: 2176 - database fix
I had the create table statements in the wrong order, so they would not apply cleanly.
This is an update to database version 091, and does not take a new number.
Galen Charlton [Fri, 20 Jun 2008 18:59:33 +0000 (13:59 -0500)]
bug 1710 and 1739: availability for item-level holds
Fixed rules for determining whether an item is
available for an item-level hold request. Create a
new function in C4::Reserves, IsAvailableForItemRequest(),
that checks whether an item is potentially available for
an item-level hold request.
An item is considered available if:
* it is not lost AND,
* it is not marked not for loan AND,
* it is not withdrawn AND,
* it is not damaged (unless the AllowHoldsOnDamagedItems syspref is ON), AND
* it is not on loan (unless the AllowOnShelfHolds syspref is ON)
Preventing a hold request on withdrawn items is bug 1739, as is
the new preference on whether to allow holds on damaged items.
Removing the condition that an item cannot be requested if
it has already been requested by another patron is the topic of bug 1710.
Note that this patch does not change the behavior where if
independent branches is on and the canreservefromotherbranches
syspref is off, a staff operator is prevented from placing
an item-level hold request on an item from a different branch.