Commit graph

52 commits

Author SHA1 Message Date
Michael Hafen
96412f1863 Add option to inventory tool to ignore copies on loan
This adds an option to the inventory tool causing it to ignore copies
currently on loan.  This is good if you want to do inventory, but don't
want to update the date-last-seen on items currently on loan.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-25 16:32:30 -06:00
Michael Hafen
ee7499d9d6 tweak Inventory tool and sub in C4/Items so call number min and max are not required
This changes the setting if default values in the inventory tool where
the min and max call number are concerned.  Also changes how the query
is formed in C4/Items so that these two are not required.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-09 13:53:07 -06:00
Joe Atzberger
cdb4b60d93 Bug 2747 for staff interface itemtype display.
Prefer accuracy over graphical icon.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-07 15:13:43 -06:00
Galen Charlton
db59418c2c patch followup: restore test in GetMarcItem
Change made to GetMarcItem to quell a warning
changed sense of a test; defined($foo) is *not*
the same as $foo ne ''.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-06 18:55:01 -06:00
Henri-Damien LAURENT
80781eedeb Using Warns would cause problems with NoZebra
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-05 16:04:52 -06:00
Michael Hafen
5076ee4251 bugfix: Sort previous borrowers descending in Items.pm for moredetail.pl
The list of previous borrowers on moredetail.pl shows the three oldest
rather than the three most recent as I expected.  This changes the sql
to order descending so we get the three most recent.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-10-16 14:47:11 -05:00
Michael Hafen
edd50a3b51 Don't pull all of biblioitems in GetItemsInfo
Pulling marc and marcxml for some 1200 copies takes a lot of RAM.  Lets
not do that.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-10-16 13:44:55 -05:00
Galen Charlton
6f295f997e bug 2466: fix clearing item field
When editing an item in the cataloging and serials
item editors, clearing a field now works.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-08-28 09:23:04 -05:00
Jesse Weaver
7da895cda7 fix for bug 1771: Template errors with remote itemtype image
This adds a new function, getitemtypeimagelocation, that returns the image
unmodified for absolute urls and returns the proper intranet or opac path
otherwise. It also updates all of the relevant files to use that function.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-08-21 16:50:29 -05:00
Chris Nighswonger
6e714ce442 kohabug 2427 Correcting C4::Items:: _koha_new_item to populate items.copynumber
The INSERT was missing the copynumber parameter. moredetail.pl was also not setting
the copyvol template variable. This patch corrects these issues so that the copynumber
is both inserted when a new item is created (including during a bulkmarcimport.pl run)
and displayed properly on moredetail.pl

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-08 06:10:26 -05:00
Andrew Moore
f64f8f98bb Bug 1953 [3/3]: documentation changes for C4::items::GetItemsForInventory
This patch corrects what appears to me to be a few defficiencies in the documentation
for C4::items::GetItemsForInventory. I noticed them while writing test methods for this sub.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-27 06:11:00 -05:00
Andrew Moore
22d9133268 Bug 1953 [2/3]: refactoring SQL in C4::Items::GetItemsForInventory to use placeholders
The SQL in C4::Items::GetItemsForInventory wasn't using placeholders and
bind parameters, possibly leaving itself open ot SQL injection attacks. This
patch changes that.
I've also incliuded a test module for C4::items::GetItemsForInventory.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-27 06:10:53 -05:00
Joshua Ferraro
5c2ba65541 This patch fixes the OPAC view and holdability of items:
1. restores a check to itemtype.notforloan to set the norequests flag
2. changes improper boolean OR with AND for checking conditions of setting norequests
3. displays 'Not for loan' for item-level itypes when the itemtype is set to notforloan
4. restores items.notforloan values < 0 allowing holds (ordered items for instance)

We still need a notforhold flag set at the itemtype, and items level
2008-07-25 11:32:06 -05:00
Ryan Higgins
0411957f73 Update holdings sort to sort by items.enumchron if there's no serial record and the biblio.serial flag is set.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-24 11:26:02 -05:00
Andrew Moore
31ad99e2b5 Bug 2094: fixing two bugs in lost items report
* I guess the limit by item type was never working. I made it look for the right database column
* I fixed the error that was returned with no items were returned.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 06:48:51 -05:00
Andrew Moore
20fd87d59b Bug 2094: cleanup of lost items report
Just some code cleanup of C4::Items::GetLostItems and reports/itemslist.pl.
Some whitespace changes, perltidy, and documentation improvements.
Also, I rewrote and SQL statement to try to reduce possibilities of SQL injection attacks.

No documentation or functional changes necessary with this patch.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 06:48:49 -05:00
Andrew Moore
57b3b951c1 Bug 2047: adding images to arbitrary authorized values
I've refactored the subs I added in the previous commit so that they make a little
more sense and are in better places in the code base. I was really hoping to make use
of existing subs, but they all seemed so specific to particular uses.

The icons now show up on the OPAC item details page.

TODO: The icons still don't show up in the OPAC search results page.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-30 20:10:43 -05:00
Andrew Moore
722a9a9d1e bug 2058: removing spurious warnings from C4::Items::AddItem
just remove a couple unnecessary warn statements.
no documentation or functionality changes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-25 15:00:33 -05:00
paul
7be6d1f12b IMPROVEMENT : serialsadditems at subscription level (bump 071)
The patch update the DB by adding a row in the subscription table (serialsadditems), that is filled with the value of the syspref.
then, the syspref is deleted.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 17:34:33 -05:00
Henri-Damien LAURENT
288b74cf3a Bug Fixing : Forcing USMARC format for xml
using as_xml uses default MARC::File::XML format which is UNIMARC for marcflavour UNIMARC
And thus, causing a problem when encoding simple items marc records.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-11 16:56:30 -05:00
Ryan Higgins
ce41d8d27a add items.enumchron to _koha_new_item.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-10 02:59:23 -05:00
Henri-Damien LAURENT
dcebae55dd Bug Fixing : Editing items was broken when using diacritics.
Encoding was wrong

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-07 15:53:08 -05:00
Darrell Ulm
8cafcef8bf All patches to Koha 3 beta to date. All work with branches.
Billing.pl     -- new, gives bills that occur in a range, works
 pendingreserves.pl  -- fixed, works now, with branches also
 reserveratios.pl  -- indicates distressed reserves
 itemslost.pl  -- Fix to this to make it more useful and fix bugs
 Itmes.pm -- small change to work for itemslost, should not affect
             anything else
 and all tmpl files.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-03 14:42:07 -05:00
Galen Charlton
afb36c429e refactor C4::Log::logaction
This fix should resolve in whole or in part several bugs
characterized by the error message 'Can't use string ("0")
as a HASH ref while "strict refs" in use', including
bugs 1101, 1899, and 1910.

There are some possibilities for future work:

[1] Dealing with an operator override, e.g., where
    a circ operator needs to get a supervisor
    to enter a login and password and escalate
    the original operator's privileges for a
    transaction, e.g., to forgive a fine.  This
    is an enhancement, of course.
[2] Creating a dummy operator to represent
    batch job runs; or alternatively, give
    each batch job an option to log its work
    under a specified user ID.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-19 06:34:10 -05:00
Galen Charlton
9222f7a6ca created old_issues and old_reserves tables
The new tables have the same structure and constraints
as the tables they archive with the following exceptions:

* borrowernumber and biblionumber in old_reserves can be
  NULL
* the FK constraints (e.g., for itemnumber) on old_reserves
  set the child column to NULL if the parent row is deleted
  instead of deleting the child row.
* there is no FK constraint on old_issues.branchcode, allowing
  a branch to be deleted without changing archived requests.

Some miscellaneous cleanup was done as part of this patch:

* GetMemberIssuesAndFines (C4::Members) now uses bind variables
* fixed POD for GetMemberIssuesAndFines

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-15 08:36:31 -05:00
Ryan Higgins
bd8f90387b Add Local-use statistical patron category_type
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-10 05:27:37 -05:00
Paul POULAIN
309f4face9 bugfixing inventory
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-11 16:13:33 -06:00
Galen Charlton
b549d7e1f1 added StripNonXmlChars to C4::Charset
Added invocations of StripNonXmlChars to uses
of new_from_xml() that involve records
saved to Koha fields via MARC::Record->as_xml();
for batch jobs that work on MARC XML files
coming from external sources, StripNonXmlChars
should not necessarily be used, as it may
be better to reject a file or record if it
contains that kind of encoding error.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-08 20:22:42 -06:00
Galen Charlton
396f998788 more items work; handle unlinked subfields (DB rev => 048)
As a consequence, the items table now remains authoritative
for all item information: any subfields not explicitly mapped
in the framework are still stored.

In addition, the additional unlinked subfields are now retained
during a call to ModItem.

Two additional points of note:

* an upgrade script from 2.2 and earlier 3.0 instllations is needed
  to populate items.marc_subfields_xml; I am working on this.
* A behavour of bulkmarcimport.pl has now changed; any item subfields
  not explicitly mapped to a Koha items field were dropped; they are
  now retained and are stored in items.more_subfields_xml.  This can
  affect data migrations.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-22 07:24:13 -06:00
Galen Charlton
ff5bc241ff C4::Items -- removed two warns
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-22 07:23:32 -06:00
Galen Charlton
c9041ce21a editorial changes to C4/Items.pm
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-22 07:23:31 -06:00
Henri-Damien LAURENT
a2e3be3462 prevent AddItem death if no marcrecord is given.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-22 07:23:29 -06:00
Henri-Damien LAURENT
7521b75420 Important Commit For UNIMARC Items.
Nonetheless, you are right to consider items table as the reference.
We need one, and we agree on this principle.

What is done with this commit is :
- adding support for marc subfields not linked to items table.

+ removing some $dbh parameters in some function signature.
I think this is rel2_2 style programming and may be avoided using C4::Context->dbh.
Or there is a reason using dbh parameter that you know and not me.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-22 07:23:26 -06:00
Paul POULAIN
265c0ab79b display notforloanvalue correctly
Not displaying Available if itemnotforloan is set (& item is not for loan)
The description of the status is enough (being repaired, excluded from loan, ...)

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-14 16:46:17 -06:00
Ryan Higgins
8db4bc73a0 Use serialitems table to link to serial in Items.pm
Also update staff client with serialseq and publisheddate for serial items.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-09 14:49:46 -06:00
Ryan Higgins
f18482f172 CHANGE TO PREVIOUS .046 DATABASE UPDATE
This commit changes .046 updatedatebase , where itemnumber was changed
to int and keyed on items table.  As there is code in serials module that
uses itemnumber (text) as a list of itemnumbers, this change would cause data
loss if that field had multiple items in it.
Instead, we add a new table to link serial and items tables, so that
(1) we can have many items per serial issue, and
(2) staged upgrades that use the serial.itemnumber (text) list won't be affected.
Further commits will make use of the serialitems linking table.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 16:13:17 -06:00
Ryan Higgins
3de59aba27 Serials updates to link item record to serial table.
This commit makes db changes to subscription, serials tables:
  allow subscriptions larger than 127 issues
  link serial to item uniquely.
MARC Framework:
  Adding MARC tag 942$s (990$s unimarc) to map biblio.serial
Udate biblio.serial on new-subscription.
Use biblio.serial to check if Items.pm should return
  pubdate and enumeration text string from serials table with items.
Update opac-detail so serial items are sorted most recent first.
Adding link from items table to serial table.

Allows sorting of serials in details pages, and removes
enum data from itemnotes field.
Also fixes  visibility in serials item editor

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 11:11:45 -06:00
Joe Atzberger
bf0d43acb1 Items.pm - BEGIN block VERSION and vars related to export. Also 2 sanity checks.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-07 20:02:29 -06:00
Galen Charlton
15015f6a54 item rework: correct '' for various status fields
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:26:47 -06:00
Galen Charlton
c2a0ed8077 item rework: replaced AddBiblioAndItems
Replace C4::Biblio::AddBiblioAndItems with two
things:

* An option to C4::Biblio::AddBiblio to defer writing
  biblioitems.marc and biblioitems.marcxml.  This
  option was created to give a significant
  speed boost to bulkmarcimport.pl, but is *not*
  recommended for general use.
* C4::Items::AddItemBatchFromMarc

This refactoring removes the need to have functions
in C4::Biblio and C4::Items that call each other's
private functions.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:26:16 -06:00
Galen Charlton
9d4d8897b2 item rework: various changes
* Move CheckItemPreSave to C4::Items (from C4::Biblio)
* Modified C4::Biblio::AddBiblioAndItems to use appropriate
   internal routines from C4::Items
* Moved GetItemnumberFromBarcode to C4::Items
* Removed duplicate C4::Biblio::_koha_new_items
* Removed disused C4::Biblio::MARCitemchange

Currently AddBiblioAndItems is a special routine that
uses private subs from both C4::Biblio and C4::Items.
This needs to be refactored.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:25:42 -06:00
Galen Charlton
82df05847a removed 'use' that was causing redefined sub warning
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:25:13 -06:00
Galen Charlton
3b43e43e49 item rework: moved DelItem
Moved from C4::Biblio to C4::Items

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:25:07 -06:00
Galen Charlton
8e41022b0d item rework: moved various accessor functions
Moved following functions from C4::Biblio to
C4::Items:

    GetItemStatus
    GetItemLocation
    GetLostItems
    GetItemsForInventory
    GetItemsCount
    GetItemInfosOf
    GetItemsByBiblioitemnumber
    GetItemsInfo
    get_itemnumbers_of

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:25:05 -06:00
Galen Charlton
526eafe4e1 check for undefined values when mapping item to MARC
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:24:33 -06:00
Galen Charlton
8f377faa76 item rework: POD and comments improvement
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:24:21 -06:00
Galen Charlton
9d71bbb461 _replace_item_field_in_biblio now handles missing item field
If an item field with the appropriate itemnumber does not
exist in the MARC bib, the incoming item field is now
just added instead of being ignored.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:24:19 -06:00
Galen Charlton
9e7c94bf96 item rework: moved GetItem
Moved from C4::Biblio to C4::Items.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:24:04 -06:00
Galen Charlton
7ed543b8a7 item rework: moved GetMarcItem
Moved this function from an exported function in
C4::Biblio to a public but unexported function
in C4::Items.  Added comment noting that this
is used only by additem.pl.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:23:56 -06:00
Galen Charlton
bc9ee0cff9 item rework: moved ModItemInMarc
* Moved exported ModItemInMarc from C4::Biblio to
  C4::Items and renamed to _replace_item_field_in_biblio.
  Function is now private and is not exported, as
  ModItem is now the sole entry point for updating
  an item record.
* Replaced calls to ModItemInMarc in C4::Circulation
  with appropriate ModItem calls.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:23:23 -06:00