Commit graph

630 commits

Author SHA1 Message Date
2414a4e705 Bug 21009: Fix max length of inputs on editing/adding items
There is a "max length" value you can define at framework level to
limit the size of the input. But it is not taken into account on the
add/edit item form.

It is a regression that has been introduced by
  commit 47d2de9c02
  Bug 12176: Remove HTML from additem.pl

max_length vs maxlength

Test plan:
- Define a maximum length for an item subfield
- Add or edit an item
=> Without this patch the maxlength attribute of the inputs are not
defined (maxlength="")
=> With this fix you will see the maxlength attributes correctly set
with the value you defined in the framework

Note:
We could/should set this value to the size of the DB column when mapped
For instance 952$u is mapped with items.uri, which is a varchar(255).
This length restriction should done at framework level

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-12 12:57:25 +00:00
a2993e82e9 Bug 20697: Bind calling GetAnalyticsCount to pref EasyAnalyticalRecords
If you do not use the EasyAnalyticalRecords feature (introduced with
bug 5528), you will have a lot of warnings in zebra-output.log like:

zebrasrv(1096) [request] Search biblios ERROR 114 1 1+0 RPN @attrset Bib-1 @attr 1=8911 259186

They come from C4::Items::GetAnalyticsCount called by catalogue/detail.pl.
This sub starts a Zebra search on index 'hi' (Host-Item-Number).
If you do not use this field at all (related to 773$9 in MARC21), Zebra
returns an Unsupported Use attribute error (114).

In making this change, I added one minor change:
[1] Remove the commented GetAnalyticsCount in additem.pl and correcting
    indentation in that loop (removing tabs). So no change at all there.

NOTE: I will propose to bind the GetHostItemsInfo call in detail.pl and two
other scripts to this preference too on report 20702.

Test plan:
[1] If you use EasyAnalytics, verify that there is no change.
[2] If you do not, check the zebra-output.log. You should no longer see
    searches for Host-Item-Number with 1=8911. (As well as ERROR 114 on
    this index.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-06-29 20:03:31 +00:00
564e9ce1ee Bug 20829: Handle non-existent barcode when linking to host item
Since commit 2c9aeb9b0f
  Bug 18277: Remove GetBiblionumberFromItemnumber - linkitem

$item is not defined if the barcode is invalid, we should not call
method on it in that case.

Test plan:
- Turn on EasyAnalyticalRecords
- Go to a detail page
- Edit > Link to host item
- Enter an invalid barcode
=> With the patch you get a friendly error message
=> Without this patch it explodes with
Can't call method "itemnumber" on an undefined value at
/home/vagrant/kohaclone/cataloguing/linkitem.pl line 86.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-06-08 09:48:11 -04:00
Mark Tompsett
6db7ab6b93 Bug 20477: Silence floody noise on fast cataloging
TEST PLAN
---------
See comment #0 to reproduce.
apply this patch
restart_all

echo | sudo tee /var/log/koha/kohadev/place-error.log
restart_all
cat /var/log/koha/kohadev/plack-error.log
-- just restart information

log into staff client again, home -> circulation -> fast cataloging

cat /var/log/koha/kohadev/plack-error.log
-- just restart information

run qa test tools

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-05-04 09:25:58 -03:00
Julian Maurice
b6c739ae9c Bug 20304: (QA follow-up) Remove unwanted 'my'
'my' creates a new '$value' variable, and prevented the '$value' in
outer scope to be modified

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-05-03 12:47:17 -03:00
4f8add9613 Bug 20304: Remove warnings from cataloguing scripts
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-05-03 12:47:17 -03:00
fe5f6c8efd Bug 20047: (follow-up) Retrieve only biblio/authority servers as appropriate
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-20 13:34:41 -03:00
23d4233658 Bug 20047: Add Koha::Z3950Server Oject and use it to get server count
To test:
1 - prove t/db_dependent/Koha/Z3950Servers.t
2 - Load cataloging and authority home pages
3 - Verify you can add form z395 on each page
4 - Delete all z3950 servers
5 - Viery option to add from Z3950 is removed on both pages

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-20 13:34:41 -03:00
d32791b5db Bug 19974: Make MarkLostItemsAsReturned multiple
Given the confusion regarding this behaviour it sounds better to make it
configurable.
This pref will take 4 different values, 1 per place an item can be
marked as lost.

Test plan:
Mark items as lost and confirm the item is returned or not, depending on
the value of the system preference.

- from the longoverdue cronjob (--mark-returned takes precedence if set)
- from the batch item modification tool
- when cataloguing an item
- from the items tab of the catalog module

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-20 11:57:31 -03:00
8d8dc55241 Bug 19974: (QA follow-up) Move lost logic to else branch
If an error is raised for the barcode, we should not try to perform the
lost logic succeeding it.
Futhermore there is no need to go to GetMarcFromKohaField etc. if we just
use the output of ModItemFromMarc.

Note: It seems unnecessary to clear $itemnumber, but I can understand
the anxiety about passing it to the template with op=additem. So just
leaving it here.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-20 11:57:31 -03:00
charles
6fc6715350 Bug 19974: Marking an item as 'lost' in additem.pl will not modify the current item
TEST PLAN:

    1) Log in with your superlibrarian account
    2) Borrow any book
    3) Visit your Checkouts page, and click 'Show Checkouts'
    4) Click on the item's barcode to visit the item's page
    5) On the item's page, click the 'Edit' button, and choose 'Edit items'
    6) In the items table, click the 'Actions->Edit' button of the item you borrowed
    7) Mark that item as lost (it should be the first row of the form) and click the button 'Save changes'
    8) Visit your Checkouts page. The item should still be there, despite BZ12363 claiming it should've been automagically returned
        8.1) Your koha-log should also output a warning message: 'DBIx::Class::Storage::DBI::select_single(): Query returned more than one row...'
        8.2) If you visit the item's page, the modification had no effect. It should not be marked as lost.
    9) APPLY PATCH
    10) Start back from step 2), but this time, after marking the item as lost, the item's page should
        reflect the change, and the item you borrowed should've been automatically returned to the library

Signed-off-by: Jean-Manuel Broust <jean-manuel.broust@univ-lyon2.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Using $item->{itemnumber} instead of new variable.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-20 11:57:31 -03:00
297529c251 Bug 18904: Advanced editor - Rancor - Add authority support
This patchset adds the ability to use the authorities search to select
or clear fields in the advanced editor

To test:
 1 - Open a record in the advanced cataloging editor
 2 - Press 'Ctrl+L' while in a field that shuold not be linked to
authorities (300 for instance)
 3 - Nothing should happen
 4 - Try it in a field that should be linked
 5 - You should get the authorities pop-up
 6 - Values in pop-up should be populated from values in record (as
        appropriate for authority type)
 7 - Correct authority type should be selected ( PERSO_NAME for 100,
        TOPIC_TERM for 650, etc.)
 8 - Press 'Clear', field should be blanked
 9 - Search again and select an authority
10 - Field should be correctly populated

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-12 10:50:36 -03:00
Joachim Ganseman
031604f59b Bug 9701: Configure default indicator
This patch adds the possibility to define default indicators in
the MARC frameworks. It adds 2 columns in the marc_tag_structure table in
the database in order to accomplish this. All files that reference this
table have also been updated to reflect these added fields.

Test: Add or edit a MARC framework. In the Field list should be 2 extra
columns. It should be possible to add default indicators (1 character)
    in these fields. Nothing else should have changed in the meantime.
    The default indicator values are not yet visible in the cataloguing module.

The default values are also loaded in the cataloguing form.

Test: Define default values in some MARC framework. Go to cataloguing
and create a new record using this framework. Verify that the defined
defaults are visible when set. Verify the default is empty (as before)
    if no default was set. Verify that if the default is changed, the
    record is saved with the manually changed value. Verify that upon
    changing such a new record, the manually set indicator value is used
    and not the default one from the framework.

Don't forget to run database and database schema update

Signed-off-by: Eugene Jose Espinoza <eugenegf@yahoo.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-12 10:50:34 -03:00
d5afc40805 Bug 20494: Remove unused code in neworderempty.pl and addbiblio.pl
Should be sufficient to read code and see all lines were commented and
that this patch removes useless lines

To be thorough, ensure that your can add an order to a basket and add a
biblio.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-02 18:07:45 -03:00
423fa9cc8f Bug 18593: Move suggestions when bibliographic records are merged
When bibliographic records are merged, the suggestions.biblionumber
field should be replaced with the new record.
Ideally we should have kept an history of the merges, to know what was
the original record. Now we cannot fix the broken links.

Test plan:
1) Create a suggestion in OPAC
2) Accept the suggestion in staff
3) Add order from this suggestion
4) Go to cataloguing search and search for the record and another
5) Merge the suggestion record with the catalog record - catalog record wins (should be the more common case when a patron suggests something that already exists)
6) Verify that after merging, the new title displays in the acquisition record
7) Verify that the suggestion info no longer displays in basket

From Katrin's test plan:
8) Verify that the new title doesn't display in suggestions. The old title will still show as suggested (not updated)
=> This is the title from suggestions.title, I think it makes sense to show this one.
Maybe we should open a new bug report to improve the display of the suggestion, and link to the bibliographic record

Signed-off-by: Lucie Gay <lucie.gay@ens-paris-saclay.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-26 17:01:10 -03:00
cb336e633b Bug 18255: Koha::Biblio - Replace GetBiblioItemByBiblioNumber with Koha::Biblio->biblioitem
The subroutine GetBiblioItemByBiblioNumber considers that we have a 1-N
relation between biblio and biblioitems, which is wrong (it's 1-1).
So the calls can be replaced with Koha::biblio->biblioitem, it will ease
the read of the code.

Test plan:
1. Use the ILSDI service to display info of a bibliographic record,
biblioitems fields must be displayed
2. Search for items, biblioitems info must be displayed as well in the
result table

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-23 11:45:38 -03:00
205c55b1d2 Bug 19996: (RM follow-up 2) Remove commented use warnings;
This one is easy to fix.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-15 11:23:51 -03:00
262f6f3d4c Bug 19996: (RM follow-up) Remove commented use warnings;
These plugins are very noisy, badly written and I have no idea what they
do.
t/db_dependent/FrameworkPlugin.t outputs a log of warnings about "
uninitialized value".

Let fix them later.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-15 11:22:23 -03:00
Katrin Fischer
f477c078d8 Bug 19996: (QA follow-up) Remove commented use warnings;
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-05 09:45:47 -03:00
Grace Smyth
70b4176b19 Bug 19996: use Modern::Perl in cataloguing perl scripts
Test Case:
Check the following files have been updated from
use strict;
use warnings;
to
use Modern::Perl;

addbiblio.pl
addbooks.pl
additem.pl
linkitem.pl
moveitem.pl
value_builder/normarc_field_007.pl
value_builder/normarc_field_008.pl
value_builder/normarc_leader.pl
value_builder/unimarc_field_010.pl
value_builder/unimarc_field_100.pl
value_builder/unimarc_field_105.pl
value_builder/unimarc_field_106.pl
value_builder/unimarc_field_110.pl
value_builder/unimarc_field_115a.pl
value_builder/unimarc_field_115b.pl
value_builder/unimarc_field_116.pl
value_builder/unimarc_field_117.pl
value_builder/unimarc_field_120.pl
value_builder/unimarc_field_121a.pl
value_builder/unimarc_field_121b.pl
value_builder/unimarc_field_122.pl
value_builder/unimarc_field_123a.pl
value_builder/unimarc_field_123d.pl
value_builder/unimarc_field_123e.pl
value_builder/unimarc_field_123f.pl
value_builder/unimarc_field_123g.pl
value_builder/unimarc_field_123i.pl
value_builder/unimarc_field_123j.pl
value_builder/unimarc_field_124.pl
value_builder/unimarc_field_124a.pl
value_builder/unimarc_field_124b.pl
value_builder/unimarc_field_124c.pl
value_builder/unimarc_field_124d.pl
value_builder/unimarc_field_124e.pl
value_builder/unimarc_field_124f.pl
value_builder/unimarc_field_124g.pl
value_builder/unimarc_field_125.pl
value_builder/unimarc_field_125a.pl
value_builder/unimarc_field_125b.pl
value_builder/unimarc_field_126.pl
value_builder/unimarc_field_126a.pl
value_builder/unimarc_field_126b.pl
value_builder/unimarc_field_127.pl
value_builder/unimarc_field_128a.pl
value_builder/unimarc_field_128b.pl
value_builder/unimarc_field_128c.pl
value_builder/unimarc_field_130.pl
value_builder/unimarc_field_135a.pl
value_builder/unimarc_field_140.pl
value_builder/unimarc_field_141.pl
value_builder/unimarc_field_210c.pl
value_builder/unimarc_field_210c_bis.pl
value_builder/unimarc_field_225a.pl
value_builder/unimarc_field_4XX.pl
value_builder/unimarc_field_686a.pl
value_builder/unimarc_field_700-4.pl
value_builder/unimarc_leader.pl
z3950_auth_search.pl
z3950_search.pl

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-05 09:45:47 -03:00
Grace Smyth
01af3bb7dd Bug 19987: If no z39.50/SRU servers the button should not show
Test plan:
[1.] Load the patch and make sure you have some Z39.50/SRU servers
     (Administration => Z39.50/SRU servers administration)
[2.] Then go to authorities and notice that the 'New from
     Z39.50/SRU' button is there
[3.] Next go to cataloging and notice that the 'New from Z39.50/SRU'
     button is there too
[4.] Now make sure you have no Z39.50/SRU servers (remove the
     servers)
     (Administration => Z39.50/SRU servers administration)
[5.] Go to authorities and notice that the 'New from Z39.50/SRU'
     button is not there
[6.] Lastly go to cataloging and notice that the 'New from Z39.50/SRU'
     button is not there too

:)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

I added a missing [% END %] during signoff. Hope no one minds!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-01-19 15:13:32 -03:00
129ffee791 Bug 19968: Add missing use Date::Calc statement
It has been reported than the missing use statement can cause a
compilation error:
Undefined subroutine &Date::Calc::Today called at
/usr/share/koha/intranet/cgi-bin/cataloguing/value_builder/unimarc_field_100.pl
line 75.

Test plan:
Use this UNIMARC plugin and make sure it fixes the error or at least
does not break it

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-01-15 13:46:44 -03:00
0c4d23a193 Bug 19595: Clicking plugin link does not fill item's date acquired field
This patch updates the dateaccessioned plugin for the item edit form to
return functionality which was removed in a previous patch.

To test, apply the patch and open an item for editing. Clicking the
"..." link next to the "Date acquired" field should insert the current
date, overwriting the existing date.

Open a blank item add form. Putting the cursor in the "Date acquired"
field should automatically insert the current date.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Added a comment line in set_to_today.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-07 10:09:51 -03:00
4eebaabc2e Bug 18833: Plugin unimarc_field_210c pagination error
In plugin unimarc_field_210c, the editors search results have pagination.
First page works but not other pages.

The main problem whas mainly because $startfrom var was missused. It is defined in C4::Output::pagination_bar as page number.
This patch corrects by using a $offset var.
Also removes dead code, obsoleted by using C4::Output::pagination_bar.
Also changes hardcoded results per page from 19 to 20.

Test plan :
- Use UNIMARC catalogue
- Define in framework value builder unimarc_field_210c on 210$c
- Create autority type EDITORS with heading 200$b
- Create 22 authorities of that type
- Index those new authorities
- Create a new biblio record
- Click on 210$c plugin
- Click on "Search"
- You see 20 results
- Click on page 2
=> Without patch you get empty table
=> With patch you get 2 results
- Check that you see "Results 21 to 22 of 22"
- Delete 2 autorities and retest

Works as intended.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-07 09:37:10 -03:00
3d6e33134e Bug 19528: (QA follow-up) Adjust language for readability
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-27 14:09:04 -03:00
7f7a6879b2 Bug 19528: Fix a few typos like corrosponding
[1] Replace corrosponding => corresponding
[2] Replace containts => contains
[3] Replace item_level-itypes => item-level_itypes
[4] Replace Managment => Management
[5] Replace should returns => should return

Test plan:
Note that this patch only deals with POD lines or test descriptions.
So there is nothing to test, just read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Patch amended by RM: The release notes should not be modified

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-27 14:09:04 -03:00
58b6e95763 Bug 12363: Add a switch to mark|do not mark items as returned when lost
There are several ways to mark an item an lost:
- item list view (catalogue/moredetail.pl, "Items" tab)
- cataloguing (cataloguing/additem.pl)
- Batch item modification tools (tools/batchMod.pl)
- The long overdue cronjob (misc/cronjobs/longoverdue.pl)

So far only the cronjob is configurable, the others mark the item as
returned (does the checkin).

This behaviour should be controlable using a syspref, to let libraries
choose what fit best for them.

Test plan:
Use the 2 options of the pref, mark checked out items as lost using the
different possibilities, and confirm that the behaviours make sense to
you

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-27 13:57:14 -03:00
5705c13d38 Bug 13912: Add DefaultCountryField008 syspref
This syspref is going to be used for populating field 008, range 15-17
with a desired default. It is currently hardcoded to 'xxu'. If not set,
it will still fallback to 'xxu'.

Signed-off-by: m23 <black23@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-29 16:49:48 -03:00
c84d03c582 Bug 15173: Restore SubfieldsToAllowForRestrictedEditing
Bug 7673 introduced SubfieldsToAllowForRestrictedEditing but bug 12176
broke it assuming that only selects were impacted by this feature.

Test plan:
Go back on bug 7673 and confirm that
SubfieldsToAllowForRestrictedEditing is working as expected with this
patch applied.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
For clarification, the item fields that are entered in
SubfieldsToAllowForRestrictedEditing should EXCLUDE the desired
fields you want to disable.

Test plan (updated to test the scenario in the bug Description):
1. Create a patron with only the following permissions:
    - catalogue (Required for staff login)
    - editcatalogue -> edit_catalogue
    - editcatalogue -> edit_items
    - editcatalogue -> edit_items_restricted
2. Navigate to Administration -> Global system preferences -> Cataloging
    -> Record Structure -> SubfieldsToAllowForRestrictedEditing
3. In the input field for SubfieldsToAllowForRestrictedEditing enter in
    all the 952 fields EXCEPT the ones desired to be disabled. In this
    case, we want to disallow editing of 952$2, 952$a, 952$b, 952$e, 952$h,
    and 952$o so we enter the following into the
    SubfieldsToAllowForRestrictedEditing (without quotes) "952$0 952$1
    952$3 952$4 952$5 952$7 952$8 952$c 952$d 952$f 952$g 952$i 952$j
    952$p 952$t 952$u 952$v 952$w 952$x 952$y 952$z"
4. Click Save all Cataloging preferences
5. Login to the staff client as the created restricted editing patron
6. Edit an item
7. Note that all fields except for the ones excluded from the syspref
    are editable

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-29 12:35:59 -03:00
Aleisha Amohia
17c5b76597 Bug 16204: Show friendly error message if trying to edit record which no longer exists
To test:
1) Create a record
2) Click Edit -> Edit record. open this in another tab
3) Delete the record in the original tab
4) Refresh the edit form in the other tab. Notice the software error
5) Apply patch and refresh page
6) There should be a nice error message with the form fields and buttons
hidden. Confirm links work as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-19 11:47:33 -03:00
b36a0e1a59 Bug 10132: Add ability to set MARC Organization Code at library level
Test plan:
0. Apply patches
1. Update database
2. Go to administration -> libraries, try to update some library and
fill in some value into Marc Organization code field
3. Save this library and edit again - the code should be stored
correctly
4. Go to system preferences and fill in some value into MARCOrgCode
preference, note there is enhanced description mentioning the ability to
set organization code on library level
5. Set active library to the one with own org code stored
6. Go to cataloguing, create new empty record and click into field 003 -
there should be the code you filled for that library
7. Set active library to one withou marc org code
8. Go to cataloguing, create new empty record and click into field 003 -
there should be the code from system preference
9. Go to system preferences again and set AutoCreateAuthorities to
'generate' and BiblioAddsAuthorities to 'allow'
10. Go to cataloguing and create some biblio record, fill in any author
in to create its authority record, save the biblio
11. Go to authorities and find this created authority, go to details and
check the fields: 003, 040$a, 040$c, 670$a - there should be used right org code
12. prove t/db_dependent/AuthoritiesMarc.t t/db_dependent/Biblio.t t/db_dependent/Koha/Libraries.t

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-19 09:47:27 -03:00
Mark Tompsett
d5986c9b97 Bug 19040: Refactor GetMarcBiblio parameters
Change parameters to a hashref.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Looks good to me.
Two calls in migration_tools/22_to_30 still in old style.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-08-25 10:23:42 -03:00
bd3b1c1a33 Bug 18262: Koha::Biblio - Remove GetBiblioData - part 1
Most of the time C4::Biblio::GetBiblioData is used to retrieve the title
and/or the author of a bibliographic record.

This patch replaces the easy occurrences of GetBiblioData, the ones
where the 2 joins are needed, but only data from biblio and biblioitems
table are.

Test plan:
It will be hard to test everything, I'd suggest a QAer to review this
patch and confirm that the difference occurrences of GetBiblioData have
been correctly replaced by calling Koha::Biblios->find or
$biblio->bibioitem

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-14 12:22:23 -03:00
2b90ea2cb0 Bug 17829: Move GetMember to Koha::Patron
GetMember returned a patron given a borrowernumber, cardnumber or
userid.
All of these 3 attributes are defined as a unique key at the DB level
and so we can use Koha::Patrons->find to replace this subroutine.
Additionaly GetMember set category_type and description.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 13:14:19 -03:00
2c9aeb9b0f Bug 18277: Remove GetBiblionumberFromItemnumber - linkitem
Test plan:
Enable EasyAnalyticalRecords and link an item to another one (Edit >
link to host item)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 13:03:37 -03:00
fa467223ea Bug 18277: Remove GetBiblionumberFromItemnumber - Easy ones
To retrieve a biblionumber from an itemnumber, we can use:
  Koha::Item->biblio->biblionumber

This is only what this patchset does.
Doing that we will be able to get rid of the
C4::Biblio::GetBiblionumberFromItemnumber subroutine.

Test plan:
- Acquisition module: cancel a receipt
- Export a record to CSV
- Modify items in a batch

Item's info should be correct

Other changes with be checked by QA team, by reading the code.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 13:03:37 -03:00
6eade474ed Bug 18276: Remove GetBiblioFromItemNumber - Easy ones
The subroutine C4::Biblio::GetBiblioFromItemNumber was wrong for several
reasons:
- badly named, we can get biblio info from a barcode
- SELECT * from items, biblio and biblioitems
makes things hard to follow and debug, we never know where do come from
the value we display
- sometimes called only for trivial information such as biblionumber,
author or title

This patchset suggests to replace it with calls to:
- Koha::Items->find for item's info
- $item->biblio for biblio's info
- $item->biblio->biblioitem for biblioitem's info

Test plan:
Item's info should correctly be displayed on the following pages:
- circulation history
- transfer book
- checkin
- waiting holds

QA will check the other changes reading the code, it's trivial

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 12:22:29 -03:00
48f847025d Bug 18254: Remove call to GetItemsByBiblioitemnumber call from additem.pl
The code from additem to delete all the items of a bibliographic record
is very ackward.
This patch simplifies the algorithm and make the code more readable.

Test plan:
Remove all the items of a bibliographic records
If at least 1 item is checked out you should get an error.

No change with the current behavior is expected.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-15 15:56:00 -03:00
f466a856a9 Bug 18295: C4::Items - Remove get_itemnumbers_of
The code from scripts and subroutines using this subroutine was not very
elegant. Most of the time the code was unnecessarily complex.
This patch removes this subroutine and adapt the code to use
Koha::Items instead.

1. C4::Items::get_hostitemnumbers_of
I did not understand why the code was so complicated, it seems that we
only want to know if a given item has a given biblionumber
2. cataloguing/merge.pl
We want to retrieve the itemnumber for a given biblio.
We could also have done that with:
  Koha::Biblios->find( $biblionumber )->items;
3. labels/label-item-search.pl
We want to loop over the items for a given biblio, no need to use
get_itemnumbers_of and GetItemInfosOf.
We just need to use:
  Koha::Items->search({ biblionumber => $biblionumber })
4. reserve/request.pl
We want to retrieve the itemnumbers of the biblio's items
We could also have done that with:
  Koha::Biblios->find( $biblionumber )->items->get_column('itemnumber');

Test plan:
1.You need to create analytical record relationships (
EasyAnalyticalRecords needs to be set). Link an item to a biblio using
the 'Edit > Link to host item' menu from the biblio detail page.
From the staff interface place a hold on the biblio. You should see the
items from the biblio and the one you just linked
2. Merge two bibliographic records (with items), the resulting record
should contain items from both original records
3. Create a new label batch, edit it.
Add items to this batch ('Add items' button).
Fill the input with a barcode.
You should see all the items of a biblio.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-05 11:43:16 -03:00
Chris Cormack
da172a560f Bug 18432 : Follow up - Updating to use they/them
Updating to use they/them and skipping the ones changed to it

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-21 10:56:43 -04:00
phette23
553ce38225 Bug 18432: code comments assume male gender
Comments throughout the Koha codebase assume that
all librarians or borrowers are male by using the
pronoun 'he' universally. This patch changes to
'he or she' / 'him or hers'.

Testing plan:

- ensuring modifying tests still pass:
	+ C4/SIP/t/06patron_enable.t
	+ t/db_dependent/Circulation.t
	+ t/db_dependent/Koha/Patrons.t
	+ t/db_dependent/Reserves.t

Sponsored-By: California College of the Arts

No code changes detected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-21 10:56:43 -04:00
8d5b4306e0 Bug 17835: Replace GetItemTypes with Koha::ItemTypes
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Lari Taskula <lari.taskula@jns.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-14 10:43:51 -04:00
Jacek Ablewicz
5693f10220 Bug 17233 - Add 008 value builder plugin for MARC21 classifications
This patch adds 008 cataloguing value builder for MARC21 classifications
records (LCC, DDC/Dewey, UDC and so on).

For most practical purposes, MARC21 classification records
(<https://www.loc.gov/marc/classification/>) are quite similar to regular
MARC21 authority records, so handling them in Koha is (almost) achievable
by means of the built-in 'regular' MARC21 authority records related
functionalities, but there are some notable differences - in particular,
008 field length and format is not the same.

To test:

1) apply patch
2) link the new plugin (marc21_field_008_classifications.pl) to the 008
field in the existing (or cloned, ..) authority framework of your choice
3) try to add, edit, re-edit 008 field using this "authority" framework,
ensure that the new plugin behaves as it should according to the
Library of Congress specifications for MARC21 classification records
008 field format (<https://www.loc.gov/marc/classification/cd008.html>).

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-03-31 13:48:16 +00:00
Julian Maurice
95e94766af Bug 17922: Use correct number of digits when replacing date placeholders
This patch also fixes a typo ("<<MM><" should be "<<MM>>")

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-02-07 17:52:56 +00:00
b664d68ca4 Bug 17629: Koha::Biblio - Remove ModBiblioframework
There is only one call to C4::Biblio::ModBiblioframework, it's called
just before C4::Biblio::ModBiblio in cataloguing/addbiblio.pl
At first glance this call does not seems useful: all the subroutines
called from ModBiblio send the frameworkcode in parameter.

I'd go to remove it, but I'd like to get confirmation by others.

No test plan here, you need a good pair of eyes and deep into the
C4::Biblio code.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-13 12:37:08 +00:00
b133b0e94d Bug 16203: Convert item plugins to new style (see bug 10480)
Converts item plugins to new style (with builder and launcher).
See also bugs 10480 and 13437.

The following plugins have been adjusted:
barcode_manual.pl
barcode.pl
callnumber-KU.pl
callnumber.pl
cn_browser.pl (Added license statement too)
dateaccessioned.pl
macles.pl
stocknumberam123.pl
stocknumberAV.pl
stocknumber.pl

Test plan:
Connect the plugin to an item field.
Verify that the plugin still works.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested if all plugins compile okay.
Ran most of them thru FrameworkPlugin.t.
Tested them in the item editor.

Note: the form for macles.pl comes up, further hard to test.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-16 11:55:27 +00:00
8f436a5075 Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks
C4::Koha::getframeworks returned a hashref of biblio frameworks.
It was mainly used to generate the dropdown list of frameworks.
The scripts modified in this patch did not necessary order the element
by description (frameworktext), the displays were not consistent from
one screen to another.
Using the same search method everywhere:
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
We will know always get the framework in the same order.

Test plan:
Following the different pages modified by this patch, and make sure the
frameworks are displayed correctly in the dropdown list:
1/ acqui/z3950_search.pl - Create an order from an external source.
2/ admin/fieldmapping.pl - Define some mappings keyword / MARC field
3/ admin/marctagstructure.pl - On the MARC frameworks admin page, select
another framework than the default one and click on the 'Search' button
4/ catalogue/MARCdetail.pl - On the MARC defail page, change the
framework you want to use to display the record
5/ cataloguing/addbiblio.pl - Add or edit a biblio record, change its
framework. When editing, the framework of the record should be selected
by default
6/ cataloguing/addbooks.pl - Go on the cataloguing home page and click
on the "New record" button. You should see all the frameworks
7/ cataloguing/merge.pl - Select 2 biblio records to merge. On the first
step (select the merge reference), you should be allowed to select the
framework to use.
8/ tools/inventory.pl - On the inventory page, the "Item statuses" part
should be populated as before this patch
9/ tools/manage-marc-import.pl - Stage records for import. Before
importing them into the catalog, you should see the framework dropdown
list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works Ok.
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 12:04:59 +00:00
ba8ee98e1b Bug 16358: Do not redirect to the editor when deleting records
The "Delete record" button goes to addbiblio.pl?op=delete, which
incorrectly redirects to Rancor when selected.

Test plan:
0/ Enable EnableAdvancedCatalogingEditor
1/ Edit a record
2/ Switch to the Advanced editor
3/ click on "View the record"
4/ Delete the record
=> Without this patch you are redirected to the editor
=> With this patch you are redirected to the advanced search

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-17 23:02:26 +00:00
bd0d1dd6b1 Bug 17206: Fix switch to default framework
When editing a bibliographic record, if you switch the framework to
default, the page is reloaded but the framework is not changed.
From the pl script, you can see that the frameworkcode is set to the one
of the biblio if set to false. The empty string, which means default,
should be taken into account.

Test plan:
- Create a record using the Fast add framework
- Save the record
- Open the record for editing
- Use the "Settings" pull down to change the framework to default
- Try another framework
- Try changing to default from there

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-12 09:02:35 +00:00
c840c93835 Bug 15758: Koha::Libraries - Ultimate duel for C4::Branch
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:04 +00:00