There are 2 prefs to drive this feature: StaffAuthorisedValueImages and
AuthorisedValueImages. AuthorisedValueImages is not added by
sysprefs.sql and does not appear in updatedatabase.pl, we could easily
imagine that nobody uses it.
With XSLT enabled, the feature is only visible on a record detail page
at the OPAC, if AuthorisedValueImages is set. Otherwise you need to turn
the XSLT off. In this case you will see the images on the result list
(OPAC+Staff interfaces) and OPAC detail page, but not the Staff detail
page.
This patch suggests to remove completely this feature as it does not
work correctly.
The ability to assign an image to an authorised value is now always
displayed, but the image will only be displayed on the advanced search
if defined.
Test plan:
Confirm that the authorised value images are no longer visible at the
opac and the staff interfaces.
The prefs should have been removed too.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
subroutines should not take $dbh in parameter.
C4::Biblio::TransformMarcToKoha has it and does not use it.
Test plan:
Look at the patch and confirm that all occurrences of
TransformMarcToKoha have been modified.
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
The items.new column is badly named, the Koha::Item->new accessor will
never returns this value, but the constructor will be called instead.
This patch renames it with new_status to avoid the ambiguity.
Test plan:
0/ Do not apply this patch
1/ Define some rules in the "Automatic item modifications by age" tool
with at least one items.new field used
2/ Apply this patch
3/ Execute the update DB entry
4/ Reload the tool page and confirm that the changes have been taken
into account
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Mainly a
perl -p -i -e 's/^.*3.07.00.049.*\n//' **/*.pm
Then some adjustements
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
perl -p -i -e 's/^(use vars .*)\$VERSION\s?(.*)/$1$2/' **/*.pm
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
The commit b5ecefd485
Date: Mon Feb 3 18:46:00 2003 +0000
had a funny description:
Added function to check if a MARC subfield name is "koha-internal"
(instead of checking it for 'lib' and 'tag' everywhere); temporarily
added to Koha.pm
"Temporarily", since 2003, everything is relative, isn't it? :)
The thing is that GetMarcStructure returns hash like
field_200 => {
subfield_a => {
%attributes_of_subfield_a
},
%attributes_of_field_200
}
The attributes for field_200 can be 'repeatable', 'mandatory', 'tag', 'lib'.
We don't want to loop on these values when looping on subfields.
Since there are just { k => v } with v is a scalar (string), it's easier
to test if we are processing a subfield testing the reference.
At some places, we don't need to test that, we are looping on values
from MARC::Field->subfields which are always valid subfields.
Test plan:
1/ Edit items using the batch item mod tool
2/ display and edit items via the cataloguing module.
You should not see any changes between before and after the patch
applied.
Tech notes:
We need to check what we are processing when we loop on 'subfields' from
GetMarcStructure, not from MARC::Field->subfields.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
This patch adds:
- a new DB field items.new.
- a new page to configure this new status
(tools/toggle_new_status.pl).
- a new cronjob script (misc/cronjobs/automatic_item_modification_by_age.pl
was misc/cronjob/toggle_new_status.pl)
Why this status is useful for some libraries ?
The use cases are:
- to know easily what are the new items (with a simple sql query).
- to display an icon in the search results.
- issuing rules can be adapt for new items. Automatically (using the
cronjob script), the status change (depending the configuration) and
the item can be issued, for example.
- a RSS/Atom feeds can be created on these new items.
Test plan:
- log in with a librarian having the tools > items_batchmod permission.
- navigate to Home > Tools > Automatic item modifications by age (was: Toggle new status)
- click on the edit button
- there are 3 "blocks":
* duration: the duration during an item is considered as new.
* conditions: the status will change only if the conditions are meet.
* substitutions: if there is no substitution, no action will be done.
You can add some change to apply to the matching items.
E.g. ccode=3
new=''
If the value is an empty string (in other words, the input does not
contain anything), the field will be deleted.
You can create as many rules as you want.
- test the interface : add/remove rule, conditions, substitutions,
submit the form, edit, etc.
(There is a looot of JS everywhere, so certainly a looot of bugs...).
- when you have your rules defined, you can now launch the cronjob
script without any parameter.
A report will be displayed with the matching itemnumber and the
substitutions to apply. Verify results are consistent.
- launch the script with the -c argument and verify values have been
modified depending the substitution rules.
Signed-off-by: juliette et remy <juliette.levast@iepg.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023: Add the ability to specify fields from biblioitems table.
Test plan:
Same as before but try with fields from the biblioitems table.
Signed-off-by: juliette et remy <juliette.levast@iepg.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023: Add UT for C4::Items::ToggleNewStatus
Test plan:
prove t/db_dependent/Items/ToggleNewStatus.t
Signed-off-by: juliette et remy <juliette.levast@iepg.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023: FIX - condition on biblioitems table does not work
If a rule contains a condition on the biblioitems table, the match won't
work. This patch fixes this issue.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023: Use DBIx-Class to retrieve column names
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023: Don't use the biblioitems fields for the subtitution
It's dangerous to allow a change on the biblioitems fields with this
feature.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023: Rename the duration parameter with 'age'
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023: The age parameter should be a number
The template should check if the age parameter is correctly filled
(should be a number).
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023: Change the name of the feature
Originaly this feature only permits to update the "new" field.
Now all item fields can be updated.
The name of the feature is now "Automatic item modifications by age".
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023 [QA Followup]
* Update DB version
* Fix capitalization error
* Rename misc/cronjobs/toggle_new_status.pl to misc/cronjobs/automatic_item_modification_by_age.pl
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 11023 [QA Followup] - Complete the renaming of "toggle new status" to "automatic item modification by age"
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Position 05 of the leader in MARC 21 indicates the record's status.
A lower case 'd' indicates that the record is to be deleted
(http://www.loc.gov/marc/authority/adleader.html).
This patch adds a cronjob script that may be run nightly to delete
records where position 05 of the leader is set to 'd'.
Test Plan:
1) Edit one or more records, and set the leader position 05 to 'd'.
2) Run misc/cronjobs/delete_records_via_leader.pl -c -v
3) Those records should either be deleted, or an error message should
state why they were not.
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Works as advertised. Edited a record with an item to have leader05 = d,
then ran delete_records_via_leader.pl with -c and got a message that
the record could not be deleted because of the item. Removed the item
and the script deleted the record. Tried with another record with an
item, this time with the -i option and the record was deleted.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(See comment #23)
This patch removes stray C4::Dates (date_fromat...) from
C4/Items.pm
C4/Log.pm
C4/Serials.pm
serials/acqui-search-result.pl
t/DateUtils.t
t/db_dependent/Items/GetItemsForInventory.t
tools/koha-news.pl
Some of them were inside comments etc.
To test:
- git grep 'C4::Dates' should give no result
- git grep 'format_d' should give no result
Exception: in one cron job there exists an own sub format_date, and occurences not
related to C4::Dates
- Search for regressions
http://bugs.koha-community.org/show_bug.cgi?id=14870
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
serials/acqui-search-results.pl looks like it should be revisited,
containing code that might not be needed. Searching a vendor
in serials still works witout a problem.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
prove t/db_dependent/Items.t
Undefined subroutine &C4::Languages::getlanguage called at C4/Items.pm line 1304.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Test plan:
1/ update the Schema (misc/devel/update_dbix_class_files.pl)
2/ Translate templates for some languages (es-DE, de-DE for instance)
3/ Enable them in the pref (search for 'lang') for the staff interface
4/ Go on the item type admin page (admin/itemtypes.pl)
5/ Edit one
6/ Click on the 'translate for other languages' link
7/ You are now on the interface to translate the item type's description
in the languages you want. So translate some :)
8/ Go back on the item type list view (admin/itemtypes.pl)
9/ You should see the original description (non translated)
10/ Switch the language
11/ You should see the translated description in the correct language.
If the description is non translated, the original description is
displayed.
12/ On the different page where the item type is displayed, confirm that
the translated description appears.
Think further / Todo:
1/ Update all occurrences of the item type's description (DONE)
2/ Implement for authorised values
3/ Implement for syspref value (at least textarea)
4/ Implement for branch names
5/ Centralize all the translation on a single page in the admin area
...
N/ Implement a webservice to centralize all the translations and give
the ability to sync the item types/authorised values description with
the rest of the world (push and pull).
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
As noted in the bug report, there is a typo.
This corrects that typo in documentation.
TEST PLAN
---------
1) perldoc C4::Items
2) Find GetItemsForInventory
-- note that status is spelt incorrectly.
3) Apply patch
4) repeat steps 1-2
-- note that status is spelt correctly now.
5) git diff origin/master
-- note only that line changed.
6) run koha qa tools
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
This typo patch could hit the highway to master at high speeds.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: add a comma at the end of the line
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The permanent_location should not be set to CART or PROC when the item
is edited.
Otherwise we lost an important info.
Test plan:
0/ Set the ReturnToShelvingCart pref
1/ Create an item with location "on_my_shelf"
2/ Check the item in and out
3/ Look at the DB values, location should be "CART" and
permanent_location unchanged (on_my_shelf)
4/ Edit the item, add a note for instance
5/ Without this patch, the permanent_location is erased with 'CART' and
you have definitely lost the info.
With this patch, the permanent_location is unchanged.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Test plan: See Bugzilla.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
The permanent_location is correctly filled when an item is added from
the cataloguing module (routine set_item_default_location from
cataloguing/additem.pl).
But when records are imported, this filled is not managed. It's only on
editing (_do_column_fixes_for_mod called from ModItem).
This patch set the permanent_location item fields to the location value for all
items created, even the imported ones.
Test plan:
0/ Do not apply this patch
1/ Import a record with items using the "Stage MARC for import" tool
2/ Check the values for the permanent_location in the items table.
They are set to NULL
3/ Apply this patch
4/ Repeat 2 and confirm that now the permanent_location values are set
to the location values.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Same as previous patch for 3 other tables.
Test plan:
Same as before but the hold should exist to the 3 tables before the
move.
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
If an item is moved from a biblio to another, the holds should be
updated too.
See discussion on the bug report for more information.
Test plan:
1/ Place a item-level hold on biblio1
2/ Move the item to biblio2
3/ Confirm that the hold still exists and point to the biblio2
This patch should not change the existing behavior for bib-level holds.
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
The script acqui/check_uniqueness.pl has been introduced by bug 7178.
But bug 11425 added a call to a new subroutine SearchItemsByField in
order to refactore some code. This subroutine calls SearchItems with an
arrayref, which is not what SearchItems is expecting.
This broke the duplicate check done on creating items in the acquisition
module.
To reproduce the issue:
1/ Fill the pref UniqueItemFields with "barcode" and AcqCreateItem with
"placing an order"
2/ Create a new basket
3/ Create a new order
4/ Close the basket
5/ Receive items and set barcode with one already in your DB
6/ Save
7/ Nothing happen on the interface, but an error should have been added
in your Koha log file:
Can't use an undefined value as an ARRAY reference at
/home/koha/src/acqui/check_uniqueness.pl line 48.
Test plan:
1/ Repeat steps 1-6
2/ You should see a warning on the interface
Note that this should also happen with AcqCreateItem set to "creating an
order".
Works well, no errors.
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Most of them were found and fixed using codespell.
Fix also some related grammar issues.
In C4/Serials.pm a variable was renamed to make future codespelling
checks easier.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
http://bugs.koha-community.org/show_bug.cgi?id=14383
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch is a rough start. I believe it runs exponentially
faster, but its equality to the previous version needs to be
tested before I clean it up to acceptable standards.
Nested hashes of hashes was being a debugging nightmare.
Moved the SQL select to C4::Koha.
Changed the GetItemsForInventory to have a hashref parameter.
Added interface, in case there is a need for 'opac' vs. 'staff'.
Added t/db_dependent/Items/GetItemsForInventory.t
Added t/db_dependent/Koha/GetKohaAuthorisedValuesMapping.t
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
http://bugs.koha-community.org/show_bug.cgi?id=9987
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch implements the use of Koha::FrameworkPlugin in Cataloguing,
Authorities, Acquisition, Serials and Tools.
The main change is architectural: see the commit message of the previous
patch. No changes in behavior are expected, but the support of new events
may provide additional functionality in the future. Some small bugs are
resolved along the way.
The change primarily focuses on the MARC and items editor in Cataloguing.
But the MARC editor for Authorities and the item editor in Acquisition,
Serials and Tools are touched too. This commit message gives some comments
per module.
NOTE FOR CATALOGUING:
A new plugin without popup (or other click event code) now shows the title
No popup when hovering over the tag editor image. The image alerts the
user on a plugin, the title tells about its status. The noclick property
allows for further style modifications in the template. Note that a
follow-up patch will clean up the old style plugins too with the same
effect.
Some additional code in cataloging.js makes it possible to clone subfields
with plugins (although only theoretically useful). The clones use the
same javascript functions but event.data contains an updated id.
This effectively resolves bug 13306. Note that if old plugins do not use
the javascript parameter for the id but the perl variable, cloning does
still operate on the wrong field (with and without this patch set).
In the absence of report 12176 in master, it is not yet necessary to modify
additem.tt. When it gets pushed, it should be an easy rebase.
New style item plugins will no longer need an extra parameter. (The code in
the FrameworkPlugin object actually takes care of that.)
NOTE FOR AUTHORITIES:
This patch also adds class name tag_editor to the buttonDot anchors. This
effectively makes the same tag editor image appear as in Cataloguing.
Futhermore it removes the button from the tab sequence if there is no click
event (really effective after conversion to the new style, since the old
style plugins contain empty onclicks and launchers).
Both small adjustments increase consistency between auth and bib edits.
NOTE FOR ACQUISITION:
In Acquisition two scripts use an item editor, but in a different way.
The scripts addorderiso2709 and neworderempty both rely on the routine
PrepareItemrecordDisplay in C4::Items, but neworderempty creates item
blocks dynamically via an ajax call to services/itemrecorddisplay.pl.
In order to make the dynamic item blocks work with plugins, some code
changes were needed in additem.js. (Normally the event binding is done
at document ready time; now it must be done later.)
At this moment the routine in Items.pm contains the html tags, and this
makes changes to the following templates not necessary for now:
* acqui/addorderiso2709.tt
* services/itemrecorddisplay.tt
Report 13397 has been opened to address moving the html to the templates.
NOTE FOR SERIALS:
Script serial-edit relies also on C4::Items (just as in Acquisition).
This makes changes to serials/serials-edit.tt not necessary for now.
NOTE FOR TOOLS:
The current code in tools/batchMod.pl allows the use of plugins for batch
modification of items. This patch just converts that code to use the new
object. Most item plugins however may not be very useful for operating on
multiple items at once.
PERFORMANCE:
I have benchmarked build_tabs in addbiblio to see how especially the
additional processing of the javascript in the FrameworkPlugin object
would impact performance. Testing default MARC21 framework with 8 plugins
gave the following figures:
- Old situation: 851 ms
- New situation: 942 ms (+10,7%)
- New situation after plugin cleanup: 881 ms (+3,4%)
Note also that adding lines for event binding is compensated by removing
lines for unused events. Page load should essentially be the same.
TEST PLAN:
Suggestion: If you also apply the next patch with the EXAMPLE plugin, you
can test with a rather harmless plugin (with popup) on various places :)
But your test should also include old style plugins, with[out] popups.
If you want to test a new plugin without popup, rename/remove Click$id
in the javascript code of the $builder definition (temporarily).
[1] Test Cataloguing:
- Add/Edit biblio. Try plugins with and without popup.
- Add/Edit items. (EXAMPLE can be used as an item plugin with popup.)
- Clone a subfield with plugin (use EXAMPLE): Verify that the plugin
works on both original and clone with the respective field values.
Is the value put back in the right field too?
[2] Test Authorities:
Edit an authority record. Try plugins with an without popup.
[3] Test Acquisition:
Set system preference AcqCreateItem to "placing an order".
Check the item editor in the following two places:
a- addorderiso2709: Open a basket, add an order from a staged file.
Select a file, click Add orders, and go to tab Item information.
b- neworderempty: Open a basket, add an order from a new empty record.
[4] Test Serials:
Check the item editor on serials-edit. Go to subscription detail.
Click Receive. Choose "Click to add item". (Note that this subscription
should create an item record when receiving this serial.)
[5] Test Tools:
Check the item editor for batch item modification. Enter a few valid
barcodes and press Continue to reach the item editor.
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch removes the order by filter on the items lost report.
The sort can now be done by DataTables.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This enhancement adds new column to display the call number on the
items lost report.
On the way, DataTables and ColVis are added on the table.
Test plan:
1/ Go on the items lost report (reports/itemslost.pl) and verify that the
call number column is correctly filled.
2/ On the way, verify that the 'Library' and 'Current location' now contain
the name instead of the code.
3/ Go on the columns configuration in the admin module
(admin/columns_settings.pl), play with the ColVis plugin and confirm
that all works correctly.
Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4::Reserves:
* Added OnShelfHoldsAllowed() to check issuingrules
* Added OPACItemHoldsAllowed() to check issuingrules
* IsAvailableForItemLevelRequest() changed interface, now takes
$item_record,$borrower_record; calls OnShelfHoldsAllowed()
opac/opac-reserve.pl and opac/opac-search.pl:
* rewrote hold allowed rule to use OPACItemHoldsAllowed()
* also use OnShelfHoldsAllowed() through
* IsAvailableForItemLevelRequest()
templates:
* Removed AllowOnShelfHolds and OPACItemHolds global flags, they now
only have meaning per item type
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
I have tested this patch left, right and upside down for the last
several months. All tests have passed.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Test plan:
1. Add 4 item search fields (in Administration › Items search fields):
a. 1 biblio field linked to a DB field
b. 1 biblio field not linked to a DB field
c. 1 item field linked to a DB field
d. 1 item field not linked to a DB field
2. Make sure you have some data in those fields to search on.
3. Go to item search page and do a search using these new fields, make
sure the result is correct.
Signed-off-by: Nick <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This is introduced by Bug 12874.
Without this patch, it's not possible to clear (set to an empty string)
an item field.
This appended for field linked to an AV list but even if it's not.
The regex tried to prefix 'my_field' with 'items.' to have
'items.my_field'. It wanted to take care of the case where the prefix
already exists (Actually only 1: 'items.cn_source').
The regex is changed to: "add the prefix only if the string does not
contain a dot".
Moreover an ambiguity existed on the prefix: in marc_subfield_structure,
the kohafield is prefixed, but not in the key of the hash sent to
ModItemFromMarc.
Test plan:
- edit an item, set a status that is controlled by an authorized value
examples tested: damaged, not for loan
- check the status saved correctly
- edit the item again, reset the status to empty
- check the status saved correctly
- edit the item again, reset fields, edit fields
- check the fields saved correctly
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
These 2 bugs are in conflict.
The first one always join the issue table, the second one join on this
table too if the OnSiteCheckouts pref is enable.
So DBI raises an error if the pref is enabled (2 joins on the same
table).
This patch removes the conditional join.
Test plan:
Go on a detail record page with items and verify that items are list and
that the error no more appears in the log file.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Reproduced the problem, the patch fixes it, no noticeable regression found.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, items are visible again.
Passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No commit message
No test plan.
No regressions found on opac/staff item display
No improvements either, but could be just my test data
No koha-qa errors
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Passes tests and QA script.
Tested detail and item pages in OPAC and staff, no regressions found.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
In inventory results, CSV or screen, the item withdrawn information is missing.
This information can be usefull to understand why an item was not scanned.
Test plan :
- Check you have in default framework an item subfield mapped with items.withdrawn
- Create a biblio with default framework
- Create an item with barcode='000AAA1', callnumber='ZZZAAA1' and withdrawn=0
- Create an item with barcode='000AAA2', callnumber='ZZZAAA2' and withdrawn=1
- Go to inventory tool : /cgi-bin/koha/tools/inventory.pl
- Enter item callnumber between 'ZZZ' and 'ZZZZ'
- Submit
=> You see a column 'Withdrawn' with withdrawn value
- Go to inventory tool : /cgi-bin/koha/tools/inventory.pl
- Enter item callnumber between 'ZZZ' and 'ZZZZ'
- Check 'Export to CSV file'
- Submit
- Open exported file
=> You see a column 'Withdrawn' with withdrawn value
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
package Koha::Item::Search::Field
function C4::SQLHelper::GetColumns
function C4::Items::SearchItems
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tests run without error
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Item search is available at catalogue/itemsearch.pl (link is in
catalogue/search.pl)
It only uses SQL (not Zebra)
* Use DataTables and server-side processing to be able to filter on
individual columns after the first search is done.
* Allow to export results in CSV
* With Javascript disabled, search form still works (and CSV export too)
There is the possibility to define "Custom search fields" in a new admin
page admin/items_search_fields.pl (link is in admin/admin-home.pl)
A custom item search field is defined by:
* a name: its unique identifier
* a label: the text displayed to the user
* a MARC field/subfield: the field/subfield to query (it uses
ExtractValue)
* an authorised values list (optional): if defined the list is displayed
in the search form
New Perl dependency: Template::Plugin::JSON::Escape
Test plan:
1/ Apply the patch and run updatedatabase.pl
2/ Go to advanced search (staff interface), then click on "Go to item
search"
3/ Play with the search form! :)
In the 3rd fieldset you can add as many fields as you want and combine them with
boolean operators (AND, OR). You can use SQL jokers characters (%, _)
You can output to screen (in a DataTables table) or to a CSV file.
4/ In the DataTables table, play with filters and try sorting columns.
5/ Disable Javascript (with Firefox: extensions NoScript or YesScript,
or in about:config 'javascript.enabled' = false
6/ Reload the search page and do some searches on screen output. (there
is no sorting or filtering features, but there is still pagination)
7/ Try again CSV output.
8/ You can re-enable Javascript.
9/ Go to Administration > Items search fields
10/ Add a new field. Example for title (in UNIMARC):
Name: title
Label: Title
MARC field: 200
MARC subfield: a
Authorised values category: None
(add another field with an authorised values category to see the
difference).
11/ As you are there try to update and delete some fields.
12/ Go back to items search form. You can see in the 3rd fieldset that
your fields have appeared in the selects.
13/ Try searching on them.
14/ I think you're done :)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. Good new option.
No koha-qa errors
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
- capitalization fix "Checked out"
- display new tabs only when feature is activated
- fixes a qa script complaint about POD in Items.pm
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch implements the In-House Use feature for Koha.
It adds:
- 2 new sysprefs:
'In-House Use' to enable/disable this feature
'In-House Use Forced' to enable/disable the feature for *all* users.
- 2 new columns issues.inhouse_use and old_issues.inhouse_use
- Datatable on the circulation history pages (readingrec) at the OPAC
and the intranet.
A new checkbox in the Circulation tab. If checked, the issue become a
in-house use (in the statistics and issues tables).
When you check it, the due date changes to the today date.
The syspref "In-House Use Force" allows to force the in-house use to
permit the checkout even if the borrower is debarred or others problems.
In the issue table, a new string (in red) marks the issue as "in-house use".
The circulation history contains 3 tabs : "all", "checkout" and
"in-house use" (OPAC and intranet).
The cronjob script:
If AutomaticItemReturn if off, a library would like not to do a transit
operation manually. This script (to launch each night) do returns
for a specific branches.
Test plan:
1/ Execute the updatedatabase entry
2/ Enable the 'In-House Use' pref.
3/ Checkout a biblio for a patron and check the 'in-house use' checkbox.
4/ Check that the due date is the today date (with 23:59) and is not modifiable.
5/ Click on the check out button and check that the new check out
appears in the table bellow with the "(In-house use)" string.
6/ Go on the circulation history pages (readingrec and opac-readingrec)
and try the 3 tabs. In the last one, your last checkout should appear.
7/ Check in.
8/ Check readingrec pages.
9/ Choose a debarred patron and check that you cannot checkout a biblio
for him.
10/ Switch on the 'In-House Use Forced' pref
11/ You are now allowed to checkout a biblio for the debarred patron.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
If an item is edited and a field is not mapped to Koha, it is to 0 or
NULL (depending on the default value defined).
This patch adds a check on the mapping before editing the item. It there
is no mapping, the DB value is not erased.
Test plan:
1/ Edit an item and fill a value for a field
2/ Unmap this field
3/ Edit the item
4/ Verify that the value is not erased (using the MySQL CLI)
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch removes the commented line for permanent_location.
It adds a more general comment.
Adjusts the exists check on permanent_location.
Adds a reference to bug 12817 that will deal with paidfor similarly.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
A quick fix to prevent more damages.
No perceived side-effects so far.
Signed-off-by: David Cook <dcook@prosentient.com.au>
This is actually a perfectly good fix for this issue. I've changed
the explanatory comment to explain why.
Another option would be to remove the 'exists' check in the sub
_do_column_fixes_for_mod(), but this is just as functional.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Detailed comment on Bugzilla.
Adding a small follow-up.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The cronjob longoverdue.pl does not require that an item marked as lost
be returned automatically, but there is a line in ModItem that
automatically marks the item's onloan as false if itemlost is set!
Test Plan:
1) Mark an item as lost with longoverdue.pl, without --mark-returned
2) Inspect the db, note that items.onloan is now 0
3) Apply this patch
4) Mark repeat step 1
5) Inspect the db, noe that items.onloan is still 1
6) Test marking an item as lost from staff interface,
ensure there are no regressions.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works according to test plan and fixes a data loss bug.
Some notes:
- This patch would be nicer with a regression test.
- Also checked that returning the item removes lost status and onloan still.
- Tried to test with --mark-returned, but couldn't get it to
return my item neither with nor without the patch. (see comment on
bug report)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch removes only instance in this file
To test:
1. Apply the patch
2. (Esay way) Put on staff URL
/cgi-bin/koha/services/itemrecorddisplay.pl?biblionumber=N&itemnumber=M
3. Code replaced corresponds to pulldowns, verify information
is correct (check with another item edit view)
PrepareItemrecordDisplay() in Items.pm is filled with chunks of
HTML code that must be put on TT file. For now scrolling_list
is the only removed.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested different item edit displays and the URL given above,
no regressions found. Also passes all tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
DelItem should return 1 if the item has been deleted, otherwise 0.
Test plan:
Verify that t/db_dependent/Items/DelItem.t returns green
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
To delete an item, only the itemnumber should be mandatory. The DelItem
routine can retrieve the biblionumber from the itemnumber.
Test plan:
Verify that t/db_dependent/Items/DelItem.t passes
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Since C4::Context->dbh shares the DB handler, it's useless to pass it to
routines.
Test plan:
Try to remove an item from the Koha interface.
Verify that unit tests pass.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch fixes some potential SQL syntax errors, which can cause
fatal software errors in Koha when the environmental variable DEBUG
is on.
_TEST PLAN_
Before applying:
0) Ensure that you don't have "SetEnv DEBUG 1" in your Apache config
1) Create a new bib record
2) Click on the "Holds" tab before creating any items
3) Note the message "Cannot place hold: this record has no
items attached."
4) Add "SetEnv DEBUG 1" to your Apache config
5) Restart Apache
6) Refresh your page
7) Note the following Software Error: "DBD::mysql::st execute failed:
You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to
use near ')' at line 3 at /koha/lib/C4/Koha.pm line 835.
8) Apply the patch
9) Refresh your page
10) Note the message from Step 3
Thorough tester:
11) Remove "SetEnv DEBUG 1" from your Apache config, restart Apache,
and refresh your page. You should see the message from Step 3.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Error reproduced, patch fixes it.
Tested following test plan, no koha-qa errors.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The changes made by Bug 7720 ("Ambiguity in OPAC Details location")
broke the display of OPAC branch information tooltips by making changes
to the markup which the tooltip plugin needs to function.
This patch corrects the markup to enable tooltips to work again. This
patch also makes changes to Items.pm so that branch information tooltips
can be shown for both home and holding branches (which are optionally
displayed now via the changes by Bug 7720). Before this patch the
tooltip would always display the information for the holding branch
regardless of the OpacLocationBranchToDisplay setting.
This patch also changes the footer include, adding an alias for the
jQueryUI tooltip function to prevent conflict with Bootstrap's function
of the same name.
To test, you must have at least two libraries configured with "OPAC
info" for display in the OPAC.
Modify the holdings of a title so that there is at least one item which
has different holding and home branches matching your library configured
above.
View the detail page for that record under various values of the
OpacLocationBranchToDisplay system preference:
- "holding library" : The table of holdings should show a column for
only the holding library. Hovering your cursor over the library name
should display the branch information you configured for that library
in a tooltip .
- "home and holding library" : The table of holdings should show columns
for both home and holding library. Hovering your cursor over each
should show the corresponding library information tooltips.
- "home library" : The table of holdings should show a column for
only the home library. Hovering your cursor over the library name
should display the branch information you configured for that library
in a tooltip.
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Works with all settings of OpacLocationBranchToDisplay.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The QA follow-up which adds GetURL to the TT branches
plugin means that GetItemsInfo no longer needs to be changed.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
[1] Fix capitalization
[2] Move logic for getting the home library name URL to the
Branches TT plugin
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Currently, in opac-detail.pl, there exists a column named 'Location'.
This column lists the name of the holding branch, and the item's
location description. This can cause confusion to borrowers, as
they may assume that the holding branch is the *owning* branch
(homebranch) of an item.
This could cause a situation where a borrower waits for an
item to be returned to his or her library, only to find that
the library never owned that item, and it was transferred back
to its homebranch. It could also lead a borrower to falsely
assume that his or her home library does not own a copy of a
particular item because the borrower does not see an his or her
home library listed for any of the items on the record.
In addition, even when the holding branch is different
than the home branch, the item's shelving location is displayed,
even though that branch may not use that location.
This commit makes the item details table equivalent to the intranet
details page by adding a "Home Library" column, which displays the
item's home library, as well as the shelving location.
If singleBranchMode is enabled, this column disappears and the
"Location" column displays the shelving location only.
This commit adds two new system preferences:
OpacLocationBranchToDisplay, which defines whether
to display the holding library, the home library,
or both for the opac details page.
OpacLocationBranchToDisplayShelving, which defines
where the shelving location should be displayed,
under the home library, the holding library, or both.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work as described. Tested all variations.
No koha-qa errors.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
In serials/serials-edit.pl, if an item field is hidden from the OPAC,
it will not display in the editor, even if the field is marked as
visible in the staff intranet and editor. However, the field is still
displayed correctly in the items editor ( additem.pl ).:
Test Plan:
1) Select an item-level field ( e.g. non-public note )
2) Create a serial using the default framework ( or one of your choice )
3) For that framework, mark the chosen field as visible from the
intranet and editor, but not the opac.
4) Receive an item for this serial, note your field does not display
5) Use the biblio item editor to add an item ( additem.pl ), not the
field displayes
6) Apply this patch
7) Repeat step 4, not the field displayes
Signed-off-by: Kim Schwant <kim.schwant@courts.in.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
PrepareItemrecordDisplay is only used for editor (-4 < hidden < 4)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This is just some code cleanup, no behavior change expected.
Also replacing errstr with err in testing the results. (See DBI.)
Test plan:
Modify an item and save it.
Followed test plan. No problems found.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch adds the words 'biblio' and 'item' to the 'info'
of the cataloguing logs which were missing them (such as biblio
delete, biblio mod, item mod, upload cover image).
This patch also adds 'authority' for authority mod.
_TEST PLAN_
Before applying:
1) Create/view mods for items, biblios, and authorities.
2) Create/view biblio deletion
3) Create/view upload cover image log
4) Note that none of these contain the words 'biblio','item',or
'authority' in their "Info" columns.
Apply patch.
5) Repeat steps 1-3
6) Note that the new logs contain 'biblio','item', and 'authority'
in their "Info" column, while the past ones don't.
7) Note also that 'biblio' and 'item' will have 'Biblio' and 'Item'
appear in their "Object" column for the new logs
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
The method of checking the logged in user for superlibrarian privileges
is obtuse ( $userenv && $userenv->{flags} % 2 != 1 ) to say the least.
The codebase is littered with these lines, with no explanation given. It
would be much better if we had one subroutine that returned a boolean
value to tell us if the logged in user is a superlibrarian or not.
Test Plan:
1) Apply this patch
2) Verify superlibrarian behavior remains unchanged
Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
In C4::Items::DelItemCheck, there are two SQL queries: one to check
if item is on loan, the other if item is reserved.
Those two queries use "SELECT * FROM table", fetch the data with
"$var = $sth->fetchrow", and use "$var" as a boolean condition.
This is not correct, SQL query should be "SELECT COUNT(*) FROM table".
As a consequence, it was possible to delete an item without warning to
the operator even if it was waiting on the hold shelf or in transit to
fill a hold.
This patch corrects the SQL queries and sets my ($var) to show that
fetchrow returns an array.
Test plan :
- Set an item A onloan
- Set an item B reserved and the reserve waiting
- Go to items cataloguing : cgi-bin/koha/cataloguing/additem.pl?biblionumber=XXX
- Try to delete item A
=> You get an alert and item is not deleted
- Try to delete item B
=> You get an alert and item is not deleted
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Works, and has the added bonus of being a tiny bit faster.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes t, xt and QA script tests.
Also tried deleting via batch delete - correct warnings are displayed.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
When item is transfered from items table to deleted items, all fields
must be copies but "timestamp".
This value must be updated to know when the item was deleted.
Test plan:
- Look a an item timestamp :
mysql> select timestamp from items where itemnumber = 2690;
+---------------------+
| timestamp |
+---------------------+
| 2011-09-09 15:30:21 |
+---------------------+
1 row in set (0.00 sec)
- Delete this item in cataloguing module
- Check it is not in items table anymore :
mysql> select timestamp from items where itemnumber = 2690;
Empty set (0.00 sec)
- Look in deleteditems table :
mysql> select timestamp from deleteditems where itemnumber = 2690;
+---------------------+
| timestamp |
+---------------------+
| 2013-12-05 15:33:20 |
+---------------------+
1 row in set (0.00 sec)
=> timestamp as been set to actual date/time
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Patch set passes koha-qa.pl, works as advertised!
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This is supplementary to the main patch for
bug 6331. Having removed the attribute marc from
items DelItem, we should not try to populate it.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Add date fields to track when an item was marked as lost or withdrawn.
Display those fields on catalogue/moredetail.pl
Test Plan:
1) Apply patch
2) Run updatedatabase.pl
3) Pick a record with items, browse to the 'items' tab ( moredetail.pl )
4) Mark an item as lost, verify the field "Lost on:" displays below
the "Lost status" field with todays date.
5) Mark the item as not lost, verify the field no longer displays
6) Repeat steps 4 and 5 with the Withdrawn field.
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Mandatory item fields are not indicated the same way in all places. This
patch corrects two places where required fields were shown in bold
rather than using the standard "required" class: When adding an order
from a staged file and when adding an item for a new issue of a serial.
This patch also normalizes the text input size on item entry forms: In
some places it was 50, others 67. I have changed the latter to 50.
Unrelated changes: Added $KohaDates formatting of date and time and
corrected capitalization on a heading on the add order from staged file
page.
It would be nice to be able to use the same method for displaying the
item form as we use on neworderentry.tt -- pulling in the form from a
separate include. However that system is designed for handling multiple
items and would need to be adapted for these cases.
To test, you must have a staged file from which to add an order. Open an
existing basket or create a new one and choose to add an order "From a
staged file." Choose a staged file from which to order. The item entry
form under the "Import all" heading should show required fields in red.
To test in serials: Begin the process for receiving an item from an
existing subscription. On the serials-edit page, find the "Click to add
item" links and click to open the item edit forms. There should be one
under the numbered issue and the supplemental issue forms. In both cases
the item edit screen should show the mandatory item fields in red.
Confirm that the cataloging add item form looks correct and works
correctly.
Revision: Left out the "required" note which should appear after each
required field.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
The clear js function parses input text, but input filled to a plugin
does not contain the type attribute.
Test plan:
- fill the barcode field to the barcode plugin
- go on the new order page
- verify the barcode plugin works as before
- verify the clear link clears the barcode field and all others fields.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected, passes all tests and QA script.
Template change only.
Barcode and date acquired are now also cleared with the
'clear' link.
But: it only works when you enter a barcode manually currently,
because the AutoBarcode functionality is broken on master (bug 11273).
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This followup fixes some QA issues:
- replace the MySQLism SQL_CALC_FOUND_ROWS
- use Koha::DateUtils instead of C4::Dates
- replace "branch" and "location" with "library"
- fixe wrong capitalisation on "Clear all" and "Select all"
and fixes some behaviors:
- the inventory tools can be used without barcode file (fixed for the
csv export too).
- mark as not scanned a non scanned item.
- update the datelastseen 1 time per biblio (and fixes the displayed
count)
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Koha Team Amu <koha.aixmarseille@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
* when a file was uploaded and the comparison with catalogue range
requested, the comparison was wrong: the logic was wrong
* items that were not supposed to be scanned (ie: supposed to be on another shelf)
didn't had the author and title, it was hard to retrieve them on the shelved
* some useful fields were missing, like homebranch, location, status
* the CSV export contained all the item information. It should contain the same
informations as the screen
Behaviour now:
* scan a list of barcode & select a range of location
* if a barcode has been scanned and should not be (misplaced item),
the information is displayed
* if you choose "compare barcodes list to result option", the
resulting list contains all items that have been scanned and those
that were supposed to be. Any item not in both list appears with a
specific message on the last column
Signed-off-by: Leila <koha.aixmarseille@gmail.com>
Signed-off-by: Koha Team Amu <koha.aixmarseille@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
A lot of tests were just a call to a funtion without any arguments,
whereas the function expect at least one argument.
These tests were kept, but all return values are now undef when a
mandatory argument is missing, so return values are consistent.
The part where subscription periodicity is changed could not work
because of ',' appended to each key in ModSubscription call. So it's
rewritten, taking into account the new API for subscription frequencies.
This script should leave your database intact because it revert any
modification made.
Also fix some warnings in C4::Serials and in C4::Items.
And fix a typo in koha-tmpl/.../subscription-numberpatterns.tt
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work as described. No errors
Tested, again, without trouble.
With a suscription, tests successful.
No koha-qa errors
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch adds a renewal tool that functions similar to the returns where a
librarian can continuously scan items for renewal. This script blocks
renewals that are impossible, and allow the same renewal overrides
as circulation.pl
Test plan:
1) Apply the patches for bug 8798
2) Apply this patch
3) Browse to /cgi-bin/koha/circ/renew.pl
4) Enter an invalid barcode, you should get an error message
5) Enter a valid, but not checked out barcode, you should get an error
message.
6) Enter a valid barcode that is checkout out and should be renewable,
you should get a success message.
7) Enable AllowRenewalLimitOverride
8) Enter a barcode for an item that has been renewed too many times
9) You should get a warning which you can override.
10) Disable AllowRenewalLimitOverride
11) Repeat steap 8
12) You should get a blocking error message
11) Enter a barcode for an item with unfilled holds on it,
you should get an overridable warning
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Passes all tests and QA script, some issues have been
addressed in follow-ups.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch adds several unit tests for GetHiddenItemnumbers and fixes the POD for it.
It also wraps the tests for rollback, modernizes and adds a license text to it.
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
There should be a:
"require YAML;"
or
"use YAML qw/Load/;"
as the GetHiddenItems routine has a reference to YAML::Load.
This was discovered while adding a GetHiddenItems() call into
opac/opac-MARCdetail.pl. I believe this problem dates back to
bug 6488 or bug 5984.
I also added an optimization to GetHiddenItems to prevent
processing if there is nothing in the system preference. Test
by searching for a biblio which has some or all of its items
hidden.
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Maybe
return () unless $yaml =~ /\S/;
or
return () if $yaml =~ /^\s*$/;
would have been easier to read.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch updates the wthdrawn field in items and deleteditems to be
withdrawn instead. No functional changes are made.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Save for translation files (that will be fixed on next release),
only occurrence of wthdrawn is on updatedatabase.pl
No koha-qa errors.
This touch many files, and I did not test everything,
but all seems normal. I think that any problem could
be fixed later.
Perhaps both entries in updatedatabase.pl could be joined
into one, but thats for QA.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch updates the example template syntax in the POD for
C4::Items::GetItemStatus() to use Template Toolkit syntax.
To test, view the POD for C4::Items::GetItemStatus() and confirm that it
looks correct.
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
This patch works as advertised (verified with "perldoc C4::Items"),
for GetItemStatus, but it does not fix a a similar example for
GetItemLocation in the same file, which still has the old template
syntax. So a followup or separate bug for that is called for.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
It seems the default option is not in used in templates.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Test Plan:
1) Enable IndependantBranches
2) Apply this patch
3) Run updatedatabase.pl
4) Verify that the system preference still functions correctly
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Simply revert order of 2 lines in Items.pm. Previous line write to
variable used in next line as function argument.
To Test:
Give an item a special restricted value, define one if you have to
in the authorised values.
Observe that, without this patch, statuses are not shown in the
OPAC in parentheses. My example was an item that had a restricted
value of "Library Staff Only"
It should have been shown under status on the detail page of the
OPAC, but was not.
Apply the patch, observe that restricted values are now shown
for your item, for example:
Available (Library Staff Only) in the status column.
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and test plan.
Simple change fixing a display problem, no string changes.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Test Plan:
1) Enable IndependantBranches
2) Set HomeOrHoldingBranch to holding branch
3) Delete an item whose holding branch is your logged in branch, and
whose home branch is not
4) Apply this patch
5) Repeat step 3, it should fail
6) Try to delete another items whose home branch is your logged in
branch, and whose holding branch is a different branch. This
deletetion should succeed.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Change is logical, only homebranch should determine if the item
can be deleted.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
The SQL query build in C4::Items::_koha_modify_item performs an update on a row of items table identified by itemnumber.
Actually the query is build using a hash of datas :
for my $key ( keys %$item ) {
$query.="$key=?,";
push @bind, $item->{$key};
}
But this hash contains 'itemnumber' key, so you get an update including the primary key.
It is actually harmless but may be dangerous.
This patch simply skips itemnumber key in above loop.
Test plan :
Check you can create and modify items.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 9902 introduced an issue in the C4::Items::PrepareItemrecordDisplay
routine. The existence of $defaulvalue hashref should be tested before
getting to the branchcode key.
Test plan:
Before applying the patch, an error occurred when you try to create an
order from a staged file.
After applying the patch, the error does not appear anymore.
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Test Plan:
1) Create a new serial with a default location, call number, and library
( the library will need to be any but the one you are logged in as )
2) Click the "Recieve" button for this serial
3) Click "Click to add item"
4) Note those values are not populated
5) Apply the patch
6) Reload the page
7) Click "Click to add item"
8) Note those values are now populated
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass!
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This seems to restore the former behaviour.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Removed NoZebra vestiges. This comprises several code blocks that depend on the NoZebra syspref and NZ related functions/methods.
C4::Biblio->
GetNoZebraIndexes
_DelBiblioNoZebra
_AddBiblioNoZebra
C4::Search->
NZgetRecords
NZanalyse
NZoperatorAND
NZoperatorOR
NZoperatorNOT
NZorder
C4::Installer->
set_indexing_engine
Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Some variables are useless in C4::Items::PrepareItemrecordDisplay.
This patch removes its.
Test plan:
Syspref AcqCreateItem = "receive an order" and try to receive an order.
Check there is no regression.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
The homebranch and holdingbranch ddl in item block are not default selected.
I just put the default choice as the login branch.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Before the patch, orderreceive.pl showed the branches alphabetically.
After the patch, it automatically selects the branch I'm logged in to.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
In a librairies network, we would like to declare specific values just
for one (or more) library.
Here we implement the ability to associate categories, patron attributes
types and/or authorised_values with librairies (branches).
This patch adds 3 new association tables:
- categories_branches ( association table between categories and branches )
- authorised_values_branches ( association table between
authorised_values and branches )
- borrower_attribute_types_branches (association table between
borrower_attribute_types and branches )
Plan test:
- Create (or modify) categories, patron attributes and
authorised_values and link it with one (or more) library.
- Set one of these librairies
- Go to one of the multiple pages where this specific value must be displayed
and check that it does appear.
- Set a library not concerned.
- Check on the same pages this value is doest not appear.
A page list:
cataloguing/addbiblio.pl
cataloguing/additems.pl
members/members-home.pl
members/memberentry.pl
acqui/neworderempty.pl
tools/modborrowers.pl
and others :)
Please say me if filters don't work on some pages.
Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com>
Signed-off-by: Koha Team Lyon 3 <koha@univ-lyon3.fr>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Passed-QA-by: Marcel de Rooy <M.de.Rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
"return" statement with explicit "undef" at line 508, column 44. See page 199 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 2267, column 5. See page 199 of PBP. (Severity: 5)
Variable declared in conditional statement at line 2642, column 21. Declare variables outside of the condition. (Severity: 5)
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
If the ReturnToShelvingCart syspref is on, and something needs to go in transit,
the shelving cart setting is overriding the transit.
What seems to be happening is this:
* Item is checked in, and flagged as needing to go in transit from A to B.
* Item is immediately flagged as shelving cart, though. Current display says both shelving cart and in transit.
* After the cart-to-shelf script runs, item comes out of transit and
shows as being available at the destination library, although it hasn't
arrived yet and no one has manually checked it in.
http://bugs.koha-community.org/show_bug.cgi?id=3701
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This simplifies code, and has nice side-effect that memoize of
C4::Koha functions will be more effective.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Due to a dependency cycle between C4::Search and C4::Items, searches
in the OPAC die spectacularly under Plack. This counter-patch extends
dpavlin's solution and replaces use with require for C4::Search in
C4::Items and for C4::Items in C4::Search.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Based on patch submitted by Ian Walls
Items were sorted by branch, then date accessioned, in GetItemsInfo. While this can be
helpful in some circumstances, more often it is useful for items to be sorted first by
their enumchron (volume/issue, if applicable) then by their copy number. This patch changes the
sort on GetItemsInfo to branch, enumcrhon, copynumber then date accessioned.
As sorting on copynumber will be incorrect based on standard sorting ( e.g. 1, 10, 2, 20 ),
the copynumber is now padded with leading zeros to correct the sorting ( e.g. 01, 02, 10 20 ).
This function appears to be a standard SQL function and not a mysql-ism. I have verfified
that is available in MySQL, Postgres, and Oracle.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Passed t xt
Item sorts appear to be correct to me based on the rubric of branch, enumchron, copynumber, then date accessioned.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Move SQL code from Perl script to Perl module
Replace SHOW COLUMNS by $dbh->column_info()
Update total on neworderempty.pl when adding or deleting items
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested ok for ordering and receiving items.
Total updated correctly.
Note: There are lots of errors in the logs before and after applying
the patch. A follow up is needed.
Adding back "use C4::Search;" in Items.pm fixes the problem.
I think this is probably related to the denesting efforts.
Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
New function was actually returning an arrayref, so made
perldoc and function usage consistent.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Adds a new subroutine in C4::Items, GetItemnumbersForBiblio, which takes a
single biblionumber, and returns an array of all the corresponding itemnumbers.
This patch also replaces the usage of get_itemnumbers_of in C4::Reserves::CanBookBeReserved
with this new subroutine, as the output is more consistent with what we were
lookng for (this is what fixes the bug issue).
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This bug was uncovered by @mglavica during HackFest in Marseille
It also showed it's ugly head during my plack presentation there.
Following chang removes circural dependecy introduced by commit
b65efdaacaf77fb53fee479da7f2e990ba0adeed which is part of Bug 6027
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This adds the -dedupbarcode option that allows bulkmarkimport to erase
a barcode but keep the item of any items it finds with duplicate
barcodes.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
In current version of code, it gets initialized too late, so it produces
unitialized warnings for hidden fields (which is non-fatal) and breaks
generated JavaScript for AJAX value_builders (which is fatal)
This bug was introduced in ticket 6106 which is modification of 5955
which didn't have this particular problem.
Since then, this code moved to C4::Items because of de-nesting patches.
Test scenario:
1. define 952$i plugin: stocknumberam123.pl (this is ajax value_builder)
2. go to one of following pages and verify that plugin works:
acqui/addorderiso2709.pl
acqui/neworderempty.pl
acqui/orderreceive.pl
serials/serials-edit.pl
For stocknumberam123.pl plugin to work, you have to have at least
one item with stocknumber in format which this plugin expects:
capital letters, space, some number
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, thanks for the great test plan.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Optionally delete bibliographic record when batch deleting items, if no items remain on the record.
Adds deleting of reserves to DelBiblio. Since subscriptions are deleted automatically,
it made sense for deletion of reserves to maintain the same behavior.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
I like the way this works, and it does. Passes tests.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Removing 'use C4::Branch' in favour of a subroutine-specific 'require C4::Branch'
causes the GetBranchName subroutine to return an error, as it's not defined
in C4::Items. Adding "C4::Branch::" scoping fixes the error, which is what's done here.
To confirm problem:
1. Attempt to run bulkmarcimport.pl before applying the patch. You should get
ERROR: Adding items to bib 435 failed: Undefined subroutine &C4::Items::GetBranchName
called at /home/sekjal/kohaclone/C4/Items.pm line 656, <GEN13> line 435.
To test:
2. apply patch
3. run bulkmarcimport again. Error should disappear.
Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Note that this problem only appears when importing records with item (952)
fields.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
the sub _find_value is used only in PrepareItemRecord sub, that has been moved to Items package
This patch moves the _find_value in Items as well.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Editing an already arrived serial issue with an attached item
resulted in an error. After applying the patch it's fixed.
C4::Branch is used only in CheckItemPresave, moving from a use to a require in the sub
C4::Reserve:
This package is loaded just for C4::Reserves::CheckReserves called in C4::Items::GetItemsInfo
The GetItemsInfo stores the result of CheckReserves in a hash entry, count_reserve, that is used only in opac_detail to display the status of a hold. We could remove the reserve_count hash entry and inline C4::Reserves::CheckReserves directly from opac-detail.pl page
in opac-detail.pl, instead of
if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
write :
if ( C4::Reserves::CheckReserves(<<parameters>>) eq "Waiting"){ $itm->{'waiting'} = 1; }
C4::Acquisition is used only in MoveItemFromBiblio, a sub that is rarely called. Moving from a use to a require in the sub
C4::Charset is used only in _parse_unlinked_item_subfields_from_xml. Moving from a use to require in the sub
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Checked opac-detail and cataloging. Code looks good.
C4::Biblio is used in many many places. The goal of this cleaning is to do from C4::Biblio a package with as many dependancies as possible.
* C4::Heading is called only in 1 place, highly rarely used (only in 1 misc/link_bibs_to_authorities.pl), moving to require
* PrepareItemrecordDisplay is a sub that is more related to Items, moving it here. It means some scripts that used this sub must be checked against use C4::Items
* C4::Items is needed in EmbedItemsInMarcBiblio, moving it only in this sub, and switching to require
* 2 subs are totally useless z3950_extended_services and set_service_options, removing them
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
No test plan included, but tested some opac and cataloging functions.
Code looks good. Marked as Passed QA.
Changed searchResults() interface
Added trailing \n when parsing OpacHiddenItems to make YAML happy
XSLTParse4Display() and buildKohaItemsNamespace() take hidden
items as input param
Removed numbering from the search results, looks wrong with
hidden items
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tested by recieving multiple items with the AcqCreateItem
preference set to 'placing and order' and 'receiving an item'
In both cases the pricing and vendor is brought over to the
item record so I'm signing off.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Not sure the brackets are nessecary, but I think I remember learning
bitwise operators have a lower priority than other relational
operators so wanted to make sure we notted the result of the bitwise
and, not the flag
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
To test:
Create 4 holds on a bib, for patrons A, B, C, and D,
Check in the item to mark hold as waiting for patron A
Check out the item to patron B -> reserve for patron B should be removed
Check in the item to mark hold as waiting for patron A
Check out the item to Patron A, hold should complete normally
Check in the item to mark hold as waiting for patron C
Check out the item to patron D -> reserve for patron D should be removed.
Check in the item to mark hold as waiting for patron C
Check out the item to patron C, hold should complete normally
Check in the item -> there should be no more reserves.
We also tested:
Created 4 holds on a bib with two items, for patrons A, B, C, and D
All worked as expected.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This patch doesn't fix the origial request to add the renewal date
to the list of checked out items, but follows the other bug commenter's
suggestion that the information be added to the item details page
(moredetail.pl).
The other part of this request, to add the checkout date, has already
been fixed by another patch.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Currently, when you delete an item, the timestamp column in deleteditems is
updated with current time. (This comes from an [unintentional] additional
update statement in DelItem.) It makes deletion time visible.
In the past, the marcxml was updated too at that moment, resulting in an
updated timestamp in biblioitems too. The timestamp in biblio was not touched.
If you delete a biblio however, the timestamps in deletedbiblio and
deletedbiblioitems do not reflect time of deletion. They still show the time of
last update before the record was deleted. This last update can be extracted
from MARC field 005 too.
This behavior is not consistent nor logical. I would suggest to add a statement
in DelBiblio to force updating the timestamp in deletedbiblio(items) too. It
makes the time of deletion visible in the record too. The time of deletion of a
biblio can be very useful for e.g. synchronizing purposes.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
If the AcqCreateItem preference is set to "ordering" and the barcode for
the new item is already in use, no error is returned, but an invalid
itemnumber is saved in the aqorders_items table and the item is never
created.
This patch adds a duplicate barcode verification in neworderempty.pl
_koha_add_item is also modified so it won't return an invalid ID when
an item can't be added.
http://bugs.koha-community.org/show_bug.cgi?id=6963
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan on second patch.
- all items attached to the order are deleted
- if there is no more items, and if the biblio is not in other orders and no subscriptions and no holds then the biblio is proposed to deletion
Now whe have 2 links : "delete order" and "delete order and catalog record", the second one appears only if the deletion is possible.
Note that if an hold is related to the item or if the item is unique for the biblio the link "Delete order" is canceled due to hold remaining.
On mouse over explanations are shown with count.
More lines of warnings with count are shown depending of the case.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Configuration:
AcqCreateItem = on order
Test cases and results:
1) Order new record with 2 items
a) From basket
- delete order: only deletes items, OK!
- delete order and catalog record: deletes record and items, OK
b) From shipment/receive
- delete order: only deletes items, OK!
2) Order 1 additional item for existing record with 1 item
a) From basket:
- delete order: works, existing item and record remain, OK
- Can't delete order and catalog record, 1 item left, OK!
3) Order new record with 1 item, title level hold on record
a) From basket:
- delete order: not possible, OK!
- delete orer and catalog record: not possible, OK!
b) From shipment/receive page
- Cancel: Deletes order, record and hold silently.
NO WARNING. NOT OK. See note below.
4) Order 1 additional item for existing record with 1 item,
item level hold on existing item
a) From basket:
- delete order: works, hold and existing item remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment/receive page
- Cancel: on order item is deleted, other item and hold remain.
5) Order new serial record, create subscription
a) From basket:
- delete order: works, record and subscription remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment/receive page:
- Cancel: Subscription and record are silently deleted. NOT OK.
6) Order additional item for existing record with other on order items
a) From basket:
- delete order: works, existing on order items remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment:
- Cancel: deletes order and ordered item. OK.
Changes made:
I changed the wording of the error messages a bit in the template.
I changed the message 'Can't delete order and catalog record' to not be
shown as a link, as the link does nothing. Tooltip still appears.
I attached a screenshot to the bug showing some of my changes.
Hope that's ok.
Necessary enhancements:
Cancelling orders when receiving items should work the same as from the
basket summary page. We need the same checks and messages there before
deleting records and items automatically.
I am signing off on this, but to go into Koha it needs a follow-up for the
order receive page.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Call LostItem() whenever item is lost.
LostItem() new arg - mark returned.
Disabled Lost Status on catalogue item edit.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
For follow up we need to explain how to hide the 952$1 (lost) from
the framework by putting it in the 'ignore' tab.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
When IndependantBranches syspref is enabled, a 'regular' user can only
delete items belonging to his/her library. But a superlibrarian should
have the permission to delete items from all libraries. He can't for the
time being. This is fix by this patch.
How to test?
- On a multi-libraries Koha, activate IndependantBranches
- Log in with a superlibrarian user
- Find a biblio with one item from another library than the user home
library
- Click on Edit > Edit Items
- On the list of items, all lines have Delete link
- If you try to delete an item from another library than the user home
library, deletion will fail.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Display links to parent biblios, show linked items in holdings, allow holds on
linked items. This uses MARC to maintain relationships.
Sponsored by the Mississippi Department of Archives and History and RapidRadio
Solution. Originally developed by Savitra Sirohi and Amit Gupta at OSSLabs, with
UNIMARC support added by Zeno Tajoli. Commits squashed and merge conflicts
resolved by Chris Cormack from Catalyst. Respect for NORMARC and some small
framework portability fixes made by Jared Camins-Esakov of C & P Bibliography
Services.
IMPORTANT NOTE: A bug in the 773 coding for MARC21 was corrected from the
original OSS Labs code. The 773s generated by the pre-release code did not have
the first indicator set to '0', which means that they were not supposed to
display. Going forward, the first indicator will be set correctly, but existing
records created with this code will no longer appear (they appeared before only
due to another bug). To correct this, you could globally (or, to make sure you
only modify records created with the Analytics tool, for records with 773$0)
change the first indicator of the 773 from blank to '0'.
== Background ==
An analytic record for an item is a more detailed, monographic biblio for an
item attached to a serial record . This is often used for special issues of a
journal that are released as books on their own (assigned an ISBN, as well as an
ISSN/volume/issue). It is important for researchers to be able to search for
these items both as issues of the serial, and as monographs. It is equally
important for the library to not have duplicate item records for the item in
question to have to keep synchronized.
== Establishing relationships ==
Analytical records are connected to items belonging to parent or host
bibliographic records. This can be accomplished by:
* From an analytical bibliographic record linking to an host item by providing
the item barcode as input
* From a host item by using option "analyze", this creates a new empty
bibliographic record with field 773 (MARC21) populated
* Running a new CLI script that establishes a relationship between the
analytical record and the host item identified by the barcode in the
analytical record's 773$o (MARC21)
== Connecting Records ==
The relationships are maintained in the MARC records, we have not used database
tables at all.
== MARC Representation ==
In MARC21/NORMARC we have used:
* 773$9 to store the Koha item number of the host item
* 773$0 to store the Koha biblio number of the host bibliographic record
The above fields are used to display the relationships in various screens in the
OPAC and the staff interface. Additionally, when populating field 773 with host
item's details, we have used following MARC 21 mapping:
* 'a' <= 100/110/111 $a (author main)
* 'b' <= 250$a (edition)
* 'd' <= 260$a, 260$b, 260$c (place, publisher, year)
* 'o' <= barcode
* 't' <= 245$a (title)
* 'w' <= (003)001 --> if no 001 is available, we can populate biblionumber
* 'x' <= 022$a (issn)
* 'z' <= 020$a (isbn)
In UNIMARC, this code uses:
* 461$9 to store the Koha item number of the host item
* 461$0 to store the Koha biblio number of the host bibliographic record
When populating field 461 in UNIMARC, the following mapping is used:
* 't' <= 200$a (title)
== Treatment of Holds ==
A key requirement was to allow holds to be placed on host items from the
analytical record. We have accomplished this by allowing holds on specific
copies only. Biblio level holds are not allowed. This ensures that holds are
placed on specific items that are relevant to the analytical record.
== Deleting host items with linked analytical records ==
As we have not used database tables to maintain relationships, we had to use
search to find out if any linked analytical records are present. If 1 or more
analytical are present, we do not allow deletion of items. This is similar to
what we see when we try to delete authority records.
== Importing analytical records ==
Analytical records can be imported using bulkmarcimport or the GUI tools. The
new CLI script can be executed after the import to establish relationships with
host items. The script will establish relationships using the host item's
barcode, the barcode must be present in 773$o of the analytical record.
== What if there are two or more copies of the host item? ==
The current design will require that there be two host (773) fields, one for
each copy.
== What if there is no barcode available for the host item? ==
It is still possible to establish a relationship, by populating 773$9 with the
host's item number. However the CLI script uses barcode in 773$o to establish
relationships so it won't work where barcodes are unavailable. Also from an
analytical record, it is possible to establish a relationship to a host item by
providing the barcode as input, this option will not be available as well.
Commits that added the following features were squashed by Chris Cormack (this
is not a list of every commit):
* Display links to host records from biblio detail screens
* Support for UNIMARC, respecting the system preference 'marcflavor'
* Support holds from the OPAC
* Ability to link to items belong to host records from a analytical record
* Display items belonging to host records in the moredetail page
* Ability to edit items belonging to host records, also ability to delink from
them
* Move get host items code into a C4 routine, also calling the new routine in
related perl scripts
* Move host field population to a C4 routine, all changes in pl files to call
new routine
* Allow only specific copy holds for analytical records plus changes to use new
C4 routines
* Support for holds on items linked via host records
* Storing bibnumber and itemnumber in subfields 0 and 9, plus other mapping
changes
* New command line script that establishes relationships between analytical
records and host items and bibs. The script looks for host field (MARC21 773)
in records, and based on barcode in subfield 'o' populates host bibnumber in
subfield '0' and host itemnumber in subfield '9'. The script can be run after
an import of analytical records, it can also be run in the crontab to maintain
the relationships
* Ability to create analytical records from items, to view linked analytics, and
prevent deletion of items that have linked analytics
* New template for catalogue/detail.pl (NOTE: not a new template file, just a
new way of displaying analytics), template displays linked analytics and
allows creation of analytical records
* New zebra index for item number in host fields. This index will be used to
display links to analytical records from host records
* Display title of host record instead of the phrase host record
* Using detail.tmpl for analytics tab instead of a new template file
* Improved qualification info prepration in Prephostmarcfield
* Check for linked analytics before deleting item
* Display link to host record and more meaningful anchor text for edit item link
* Analytical record: Unimarc index in record.abs and help in
create_analytical_rel.pl
* Adding a sys pref that controls display of options to create analytical
relationships
* Add host entry in XSLT stylesheet in staff item detail
* Added host record support to OPAC detail XSLT
* Adding 773$0 and 773$9 to all frameworks
* Adding 773 subfields 0 and 9 to default marc framework via updatedatabase.pl
* Display create analytics and used in links in catalog detail
* Fixed problem where analytical records not showing in OPAC search results
because GetMarcBiblio now needs a flag to add item records
* Fixed problem where analytics count was set to 1 for all records, not just
those with analytics
* Fixed catalogue detail page not to show analytics counts if count is 0
Conflicts:
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
kohaversion.pl
Co-author: Savitra Sirohi <savitra.sirohi@osslabs.biz>
Co-author: Zeno Tajoli <tajoli@cilea.it>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
GetItemsInfo in Items.pm includes this join:
LEFT JOIN branches ON items.homebranch = branches.branchcode
This means that the branch URL (from the branches table) comes out
as the URL for items.homebranch, thus the URL in the holdings
output is the item's home branch even though the display might
be showing a different current location.
This patch changes the join to use items.holdingbranch. The join
was originally added to fix Bug 3702, and based on the description
of that feature I'm assuming this change is not harmful to other
usages. However, it does make the assumption that the item's
current (holding) branch is the branch we want to see information
about.
Signed-off-by: Nicole Engard <nengard@gmail.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
The date last seen field (952 $r) and replacement price date (952 $w) were being
ignored on import, being replaced with NOW() as a hardcoded value. This patch will
allow a value to be imported, but if none is, it will use the ISO date of import
as a default.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bugfix for problems when shelving cart used without In Processing settings
To test, with InProcessingToShelvingCart off, NewItemsDefaultLocation blank,
and ReturnToShelvingCart on, create a new item. Check the contents of the
location and permanent_location fields in its item record -- the same value
should be in both. Then run the item through checkin, and look at those fields
again. The location field should now be set to CART while permanent_location
should still have the original value. After the cart_to_shelf cron job runs
with the proper timing, check the item record again. Both location and
permanent_location should again be identical.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Do not misleadingly document or pass an unused second parameter
makes all calls use the single parameter call as the C4
routines already did
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Had effect of breaking item record changes when the
CatalogingLog system preference is on.
(Note to people reviewing patches - please do not modify the content
of patches that you are signing off on unless you are *sure* you
know *exactly* what you doing. The process of patch review should
not be introducing yet more bugs.)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Remove the following routines which used to
handle embedding item data in the bibliographic record:
C4::Items::_replace_item_field_in_biblio
C4::Items::_add_item_field_to_biblio
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
* no need to record full bib MARC when logging
change to an item record
* IDEA: set up a separate ItemLog syspref
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
* when item changes
* when new item is added
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
* Must signal both bibs to be reindexed
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This is a squash of four patches by Henri-Damien Laurent
starting work on removing the copy of item record information
in the 9XX field of bibliographic records. The reason
for doing this is primarily to improve performance, in particular,
the expense of having to add/modify the bib record whenever an
item changes. Now, whenever an item changes, the bib record is
put in the queue to be reindexed; when the bib is indexed, the 9XX
fields are inserted into the version of the bib that Zebra indexes.
Since rebuild_zebra.pl runs in a separate process, the processing of the
bib record will not delay (e.g.) circulation.
As part of upgrading to 3.4, the following batch script should be run:
misc/maintenance/remove_items_from_biblioitems.pl --run
This should be followed by a complete reindexing of the bib records, e.g.,
misc/migration_tools/rebuild_zebra.pl -b -r
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Lists in the OPAC, and Cart on both sides, show the LOC code for items, rather
than the appropriate Description from Authorised Values. This is because the
code uses GetItemInfo, which is a very heavy-weight call to only retrieve some
of the desired information.
This patch introduces a new subroutine in C4::Items, GetItemsLocationInfo, which
returns the branch names for both home- and holdingbranches, the location code,
both opac and intranet location descriptions, itemcallnumber and cn_sort. This
should be used instead of GetItemsInfo in any case where the locational
information is all that's required, as it's much more streamlined and efficient.
In the OPAC Lists, this only applies if OPACXSLTResultsDisplay is 'off' (set to
'normal').
Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
The field was missing in Items.pm.
It will still act strangely if you enter a stocknumber that
already exists in the database. (see Bug 5860)
Adding/editing items with stocknumbers you have not used before
should work as expected.
[F. Demians] Was able to reproduce the bug on an UNIMARC DB. The patch works.
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Squashed commit of the following:
commit 66cdb8804136803a3f626d183c8f192f61f3c7b1
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date: Fri Feb 4 12:55:10 2011 +1300
Bug 5691: Updating copyright statement
commit 79ef6c269afc9c644c51709a7657542a0fc6d7d6
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date: Fri Feb 4 12:52:13 2011 +1300
Bug 5691 - Fixing a syntax error and tidying up some formatting
commit a66485dba113c05ed51a3b4ff19f788e335aa1f6
Author: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Date: Tue Oct 5 17:23:55 2010 +0200
(MT #1365) Delete all items
Using DelItemCheck in cataloguing/additem.pl
when deleting all items
commit fe845fd48ab22ff82ad6d8971c468c327b49f3c4
Author: Christophe Croullebois <christophe.croullebois@biblibre.com>
Date: Wed Sep 22 11:39:28 2010 +0200
(MT #1365) Delete all items
Now if IndependantBranches is on and a user try to delete all items, only the items of his branch will be deleted.
A message explain this fact.
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Followup: (MT #1365) Fixing up the English idiom
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
MT3947: items.timestamp were not updated on edition
If items.timestamp is used in the framework and hidden
the fact that it is NOT deleted before update is done would input the previous timestamp,
which is not the desired behaviour.
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Squashed commit of the following:
commit f441094d5095d165eab18340c983a831cce8f6e0
Author: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Date: Mon Jul 5 20:33:23 2010 +0200
bug4263 followup : Can't blank subfields
Previous bug4263 reintroduced bug 2466: fix clearing item field
This keeps bug4263 followup to be assigned (donot blank dateaccessioned)
But also allow to blank item subfields.
commit 92889b766c41b48bdd0e3a33ca4b183b1e259805
Author: Nahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Date: Fri Apr 23 13:54:30 2010 +0200
(bug #4263) dateaccessionned is cleaned on item modification
Every item modification, date accessionned is cleaned, if there is no modification made, we must'nt reset to "undef" the value.
commit 5abb2db16b2564d32e84b7cc680acbc301d73179
Author: Nahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Date: Tue Mar 2 09:57:33 2010 +0100
(bug #4263) fix the edition of items with repeatable subfields
The subfield management in item level is broken, fields are concatenated in one field, and if the librarian edit it, the values are not selected.
This big patch fix three things:
1) saving fields that are stocked in SQL(using koha2marc mapping) are now well cut and separated in _REAL_ subfields
2) loading records with repeatable subfields are now well returned
3) Editing items with repeatable fields works well
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Bug 4263 Removing extranious block of code
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Squashed commit of the following:
commit 105de81639cbac5084e4a5c099b19569043e69ff
Author: Nahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Date: Tue Jul 13 11:58:01 2010 +0200
(bug #4931) fix forgottens input in buttons
the previous patch missed an hidden input in next buttons that break next page. This fix it.
commit db00295a6b9d1d36fc888ba6a0558011fd6884ba
Author: Nahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Date: Fri Jul 2 15:27:59 2010 +0200
(bug #4931) add the ability to choose home or holding branch in stocktaking
This add radio box in stocktaking to base it on home or holdingbranch
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Bug 4391 Followup: Adding back lost declaration of $branchcode
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This adds display of "Use restrictions" authorized values
to the OPAC and the staff client for available and
not-for-loan items.
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Should fix any remaining warnings with 'podchecker'
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
if you have a marc field, mapped to items.stocknumber, it's not saved properly in items.stocknumber
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
* GetItemsInfo now includes a notforloan_per_itemtype key
with the value of the item type's notforloan setting, correctly
set based on the value of the item-level_itypes syspref
* Adjusted OPAC details item status display to use that
notforloan_per_itemtype key
NOTE: one of the assumptions of item-level_itypes is that
you can have either bib-level item types or item-level
item types, but not both in the same database. In particular,
it does not establish a hierarchy where Koha checks the
item-level itemtype first, then the bib-level.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Also fix the barcode not found problem (due to empty lines)
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This patch filters all non itemrelated fields in the marcrecord before making update
AddItemhad the same problem as ModItem
They would try and take fields which would not be item fields
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
The inventory tool was using itemcallnumber, title to sort; modified
Items.pm to use cn_sort, itemcallnumber, title so that call numbers
sorted on the padded sort field instead.
The default sort order for items attached to a title in staff mode is
items.dateaccessioned desc. This means that a particular library's holdings
will be scattered through the list -- a special problem when it comes to serial
issues. I've done a change to Items.pm that makes the sort order branch
description followed by dateaccessioned. Thus, a library's holdings will be
grouped together in the display.
* added POD
* removed optional $barcode argument - in all cases,
itemnumber is known, and we should stick with
itemnumber when retrieving an existing item
* use ModItem to do the update so that indexer
will know to reindex bib - otherwise, can't
do an accurate search of items that are on
the shelving cart.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Allows temporary locations corresponding to 'in processing' and 'shelving'
so that newly-created items, and newly-returned items do not show
immediately as a available. Three new system preferences govern the usage
of these features.
NewItemsDefaultLocation. If system pref NewItemsDefaultLocation is set to a location code,
all newly catalogued items will be set to the location set in this preference.
Location code must be a valid LOC authorized value type.
InProcessingToShelvingCart. if the system pref InProcessingToShelvingCart is turned on,
any items run through returns.pl with a location code for 'PROC', will be modified to
have a new location code of 'CART'.
ReturnToShelvingCart. If the syspref ReturnToShelvingCart is turned on,
all items returned other than confirmed holds will have a new location code of 'CART'.
Any item issued is automatically taken of the shelving cart.
Adds a cron script shelf_to_cart.pl which should be run hourly.
Updates all items with a location of CART to the item's permanent location.
The original location code is stored in the new items column 'permanent_location'.
Original Author: PTFS Contractor <dbavousett@ptfs.com>
This work co-sponsored by
Middletown Township Public Library, Middletown, NJ USA and
East Brunswick Public Library, East Brunswick, NJ USA
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Previous conditional check with if ($restype) is not needed because a true
result for one item will result in subsqeuent items defaulting to this true
value.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Before this patch, we used to test for flags == 1, which was wrong when patron had all privileges.
This patch just adds a %2 to check that patron has superlibrarian privilege, and maybe something else we don't care.
I think I fixed it everywhere except in acquisition, that will be addressed by BibLibre new acquisition module.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch fix 3 things:
* fix order by
* take care of item_level-itype
* use join in sql query
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This correct the html select default in additem.pl, and enforces use of
biblioitems.itemtype as the default in Items::AddItem. The code in
Items is to catch items added through MARC record staging.
Thanks to Joe Atzberger for suggestion.
[RM note: this patch means that an item's item-level item type,
once that item is added or updated via additem.pl,
now cannot be blank or NULL unless the biblio-level item type
is blank.]
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
* 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>
Introduced C4::Items module to separate items API
from biblio API. Details on changes will be
put in later commit messages.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>