Commit graph

557 commits

Author SHA1 Message Date
Pasi Kallinen
030047da42 Bug 21248: Fix COinS carp in MARC details page on unknown record
Looking up a nonexistent record in the MARC details -page causes
the COinS to carp. The fix is trivial, just move the COinS call
couple lines, after the record existence check.

TEST PLAN
---------
1) reset_all for kohadevbox
2) log in to staff client - admin/admin
3) search catalogue for green
4) tweak the top URL to have a bad biblionumber (eg. 9999)
5) cat /var/log/koha/kohadev/plack-err.log
   -- floody! with errors.
6) echo | sudo tee /var/log/koha/kohadev/plack-err.log
7) restart_all
8) repeat steps 2 through 5.
   -- just nice starting messages, not floody.
9) run koha qa test tools

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-09-14 17:28:49 +00:00
43326754b1 Bug 20366: Add subscription info to the acq tab on the biblio detail page
On the "Acquisition details" tab of the bibliographic detail page, the
subscription information are missing.
This patch replace the call to GetHistory with Koha::Acquisition::Orders
in order to simplify the code and make use of new Koha::
packages/methods.

TODO: Add column settings (show/hide columns) to this table (?)

Sponsored-by: BULAC - http://www.bulac.fr/

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-08-30 13:48:09 +00:00
13cc5d3161 Bug 21125: Shortcut moredetail.pl on nonexistent biblionumber
This replaces the solution for 17.11 on bug 20927.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-08-10 12:23:04 +00:00
19227359a1 Bug 20919: Remove unecessary search calls on the biblio detail page
There is a countanalytics flag that is set for items used in analytical
biblio records. This flag is only used in the template when 'analyze'
has been passed to the script.
In order to avoid unecessary search calls (1 per item), $analyse must be
tested.

Test plan:
0. Do not apply the patch
1. tail -f /var/log/koha/kohadev/zebra-output.log
2. Hit a bibliographic record detail page with several items
3. Notice that the log has 1 line per item:
  11:30:36-14/06 zebrasrv(32) [warn] ir_session (exception)
4. Apply the patch
5. Hit the page again
6. There is nothing in the zebra log file

If you are familiar with analytic records, confirm that you are not
allowed to remove an item that is used in analytical biblio records.

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-13 10:34:29 +00:00
Julian Maurice
d38a040481 Bug 19502: Remove debug warn
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-12 13:04:22 +00:00
Julian Maurice
95b1983a25 Bug 19502: Retrieve index.max_result_window from ES
This avoid hardcoding '10000' in two different places and allow users to
adjust this setting.

Also, this patch fixes a bug when the search return less than 10000
results

Test plan:
1. Do a search that returns 10000+ records.
2. Note the warning above the pagination buttons
3. Go to the last page, no error
4. Change the ES setting:
   curl -XPUT http://elasticsearch/koha_master_biblios/_settings -d \
     '{"index": {"max_result_window": 20000}}'
5. Do another search that returns more than 10000 but less than 20000
6. Note that the warning does not show up
7. Go to the last page, still no error

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-12 13:04:21 +00:00
78b9a3e450 Bug 19502: (follow-up) Pass parameters to avoid making templates depend on search engine
https://bugs.koha-community.org/show_bug.cgi?id=19502

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-12 13:04:21 +00:00
cc131475ed Bug 19502: Limit pagination to first 10000 results when using ES
This patch is to avoid hitting an error page. We should eventually make the
max number returned configurable for ES.

To test:
1 - Have Koha running ES with 10,000+ records
2 - Search for '*'
3 - Click 'Last' to view last page of results
4 - 'Cannot perform search' error
5 - Apply patch
6 - Search again
7 - View 'Last' page
8 - No error, you go to the last of 10000
9 - Note the warning above the pagination buttons

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-12 13:04:20 +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
117e3a18f5 Bug 20934: Fix display of old checkouts in the checkout history page
Again a regression caused by
  commit fa54100dff
  Bug 18403: Use patron-title.inc when hidepatronname is used [SPECIFIC for issuehistory]

GetBiblioIssues does a union all with issues and old_issues, so we
should old_issues as well.
To make the join on the items table we need to define the item and
patron methods. For consistency the relationships have been redefined
(item instead of itemnumber, borrower instead of borrowernumber) in the
DBIx::Class definition.

This is not perfect but I think the best way to provide an easy to
backport patch.

It highlights that we need improvements in this area.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
The patch works as expected.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-06-22 12:47:48 +00:00
e5896f5683 Bug 20838: (bug 16735 follow-up) Fix search by group of libraries
In the last patches of bug 16735, we completely broke the feature!

The limit is using library_groups.id instead of branches.branchcode.

Test plan:
Create a group of library with the search feature
Search (OPAC and staff interfaces) using this limit

=> Without this patch you will see that the generated search query does
not contain branchcodes
=> With this patch applied you will see the branchcodes

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-06-04 13:40:36 -04:00
4c36d4beb6 Bug 20620: Remove warnings in moredetail.pl
Since 19995 warnings are displayed in moredetail.pl, we should get rid
of them.

Test plan:
Hit moredetail.pl with different biblionumbers and confirm you do no
longer see warnings in logs.

Make sure values for rentalcharge, item type, ccode and replacementprice
are displayed correctly.

Signed-off-by: Bouzid Fergani <bouzid.fergani@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:19:36 -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
Julian Maurice
8432735978 Bug 20539: Remove warnings in catalogue/search.pl
Test plan:
1. Start a search from intranet
2. See several warnings in logs
3. Apply patch (&& reload starman)
4. Start a new search
5. Confirm that warnings are gone and that the search still works

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-16 13:43:58 -03:00
84ce1fb592 Bug 19289: Use the ACQ framework to display bibliographic details
The ACQ MARC framework is only used for the ‘Item’ block.
This patch add the ability to define biblio fields (!= 995 or 952) to
customize the display of the bibliographic details when ordering.

This new feature is controlled by a new pref:
UseACQFrameworkForBiblioRecords

Test plan:
- Create a new installation to populate the ACQ framework correctly
- Set the pref UseACQFrameworkForBiblioRecords to "Use"
- Create a new order
=> You will see the lib from the ACQ framework
- Add/remove/update biblio subfields in the ACQ framework
- Create a new order
=> You should see the new subfields displayed

Note for QA: I though I would be able to refactor existing code to make
it more flexible, but it is a bit messy and lost a lot of time. I
finally decided to copy/paste the existing code. I simplified it as, I
think, we do not want the plugin, etc. like in the full biblio editor.

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

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-11 16:45:20 -03:00
Andreas Roussos
f8ce3d88b1 Bug 20083: Information disclosure when (mis)using the MARC Preview feature
The MARC Preview feature in the Staff client (catalogue/showmarc.pl) does not
check whether a user is logged in or not. As a consequence, it can be used to
obtain information that would normally be available to logged-in users only.
For example, you can view any bibliographic record by passing a value to the
'id' argument, but you can also view records as they were imported (normally
done via the 'Staged MARC management' tool).

All three 17.11 installations currently listed at
https://wiki.koha-community.org/wiki/Koha_Demo_Installations
are affected by this issue, as demonstrated by the URLs below:

http://koha.adminkuhn.ch:8080/cgi-bin/koha/catalogue/showmarc.pl?importid=1&viewas=html
http://pro.demo1711-koha.test.biblibre.eu/cgi-bin/koha/catalogue/showmarc.pl?id=1000&viewas=html
https://staff-kohademo.equinoxinitiative.org/cgi-bin/koha/catalogue/showmarc.pl?id=1&viewas=html

It should be noted that this only applies to XSLT-enabled installations.

Signed-off-by: Mark Tompsett <mtompset@hotmail.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-04 15:40:07 -03:00
Katrin Fischer
9007c6e858 Bug 20067: Fix other checks for linked authorised value categories
The same pattern was used in other files, this patch fixes it.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-26 17:01:10 -03:00
Katrin Fischer
1428615dad Bug 20067: Fix false display of authorised value for materials on staff detail page
Koha didn't check for a linked authorised value category for
Koha didn't check for a linked authorised value category for
items.materials correctly which led to displaying false information
on the detail page.

To test:
- before applying the patch:
- make sure sample data and configuration is loaded
- edit any item
- write 2 in the $3 materials specificed
- check the details page normal view - it will display 'restocking'
- apply patch
- check display, it should now show "2"
- link 952$3 (MARC21) to ORDER_CANCELLATION_REASON
- check display again, it should now show 'restocking'

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

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

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
070c327c98 Revert "Bug 20341: Use AuthorisedValues plugin on the staff side"
This reverts commit a67fdf3bd4.

I am not sure we already agreed on that: the UI let the ability to
choose different AV category for each frameworks. I think it should be
discussed widely before removing this possibility.
Even if I am pretty sure it is not handle correctly everywhere.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-19 15:40:09 -03:00
6d1525dbf1 Bug 20321: Remove get_biblionumber_from_isbn
To test:
1 - grep get_biblionumber_from_isbn
2 - verify all occurences are not actual calls (except for test)
3 - Apply patch
4 - grep get_biblionumber_from_isbn
5 - Verify it is removed

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-19 13:55:47 -03:00
Kyle M Hall
a67fdf3bd4 Bug 20341: Use AuthorisedValues plugin on the staff side
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-19 12:23:15 -03:00
4159512fc5 Bug 20341: Show authorized value description for withdrawn like damaged and lost
Actually catalog detail page shows for damaged and lost items the authorized value description if exists.
We must do the same for withdrawn information.

Test plan :
1) Set for items a subfield linked to items.withdrawn and using the authorized value category 'WITHDRAWN'
2) Edit the authorized value category to add value '2' and description 'Eaten by dog'
3) Edit an item to set this withdrawn value
4) Go to staff interface and look at items in record detail page /cgi-bin/koh/catalogue/detail.pl :
=> Without patch you see 'Withdrawn' and with patch you see 'Eaten by dog'
5) Go to OPAc and look at items in record detail page /cgi-bin/koha/opac-detail.pl :
=> Without patch you see 'Withdrawn' and with patch you see 'Eaten by dog'

Signed-off-by: delaye <stephane.delaye@biblibre.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-19 12:23:15 -03:00
e7aa94b782 Bug 20157: Do not display OPAC groups on the staff interface
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:42:22 -03:00
fa54100dff Bug 18403: Use patron-title.inc when hidepatronname is used [SPECIFIC for issuehistory]
On this page we do not have the patron object sent to the template,
let's pass it!

Test plan:
Go on the checkout history of a bibliographic record
(catalogue/issuehistory.pl)
You should not see patron's information that are not part of your group
if you
are not allowed to see them.

Signed-off-by: Signed-off-by: Jon McGowan <jon.mcgowan@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:41:39 -03:00
5f80977875 Bug 18403: Use patron-title.inc when hidepatronname is used
There is already a HidePatronName syspref to hide patron's information
on bibliographic
record detail pages and the hold list.

Test plan:
With the HidePatronName enabled, make sure the patron's information are
hidden from
the catalogue and hold list pages. If the logged in user is not allowed
to see the
patron's info, no link and no cardnumber will be displayed
With he HidePatronName disabled, make sure the patron's information are
displayed
if the logged in user is allowed to see the patron's info.

Technical note:
This patch improves the existing patron-title.inc include file to
display patron's
information. Using it everywhere patron's details are displayed will
permit to
homogenise the way they are displayed. The file takes now a patron
object (what
should be, in the future, the only way to use it), that way we can call
the new
method on it to know if patron's information can be shown by the logged
in used.

NOTE: I am not sure this syspref makes sense anymore. Should not we
remove it?

Signed-off-by: Signed-off-by: Jon McGowan <jon.mcgowan@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:41:38 -03:00
ad6a7aaf85 Bug 16735: Use libraries in all subgroups, not just immediate children
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:41:26 -03:00
2059f7d801 Bug 16735: Migrate library search groups into the new hierarchical groups
Test Plan:
1) Apply this patch set
2) Note your existing search groups have been ported over to the new
   __SEARCH_GROUPS__ group if you had any
3) Create the group __SEARCH_GROUPS__ if one does not already exist
4) Add some first level subgroups to this group, add libraries to those groups
5) Search the library group searching in the intranet and opac
6) Note you get the same results as pre-patch

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:41:25 -03:00
Zoe Bennett
cea818a56a Bug 19995: use Modern::Perl in Catalogue perl scripts
Test Plan:
- Check that it now says 'use Modern::Perl;' and not 'use strict; use
warnings;' in the following catalogue perl scripts.

MARCdetail.pl
export.pl
image.pl
imageviewer.pl
issuehistory.pl
labeledMARCdetail.pl
moredetail.pl
search.pl
showmarc.pl
updateitem.pl

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>

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
Victor Grousset
886b197b2d Bug 19807: Make IntranetCatalogSearchPulldown honor IntranetNumbersPreferPhrase
This patch
- fixes callnum and sn
- Removes unecessary syspref transmission to the template.
  As the template directly reads the syspref

Test plan:
1. Set sysprefs IntranetCatalogSearchPulldown and
   IntranetNumbersPreferPhrase to true
2. Go to staff:/cgi-bin/koha/catalogue/search.pl
3. "search for" → "call number" and write anything that won't match a
   call number in the field
4. Then you should see
   «No results match your search for 'callnum,phr: [...]»
5. Go to the staff homepage
6. Click on "Search the catalog"
7. Do the same search as previouly
8. Then you should see
   «No results match your search for 'callnum,wrdl: [...]»
   This shows that IntranetNumbersPreferPhrase isn't honored
9. Apply this patch
10. Redo the same two searches and see that phr will now be always used.
    So IntranetNumbersPreferPhrase is honored

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-01-02 12:58:55 -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
f0f3cb3288 Bug 18961: Use exact match for select filters on item search
The SQL operator LIKE is always used for filters when searching for
items.

If the filter is a select, we should search for an exact match.
That way we avoid problematic search like "%NFIC%" and "%FIC%" (one
includes the other one).

Test plan:
- Make sure you have collection codes 'Fiction' and 'Non-fiction'
- Do an item search
- Filter column 'Collection', select 'Fiction'
- Result: Column contains items from Fiction only

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-20 15:58:21 -03:00
fed86d5042 Bug 19440: Existing calls need to be done in scalar context
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-09 16:15:52 -03:00
Aleisha Amohia
69ee06a490 Bug 13205: [FOLLOW-UP] Fixing math and variable names
Have changed
  my $last_page = $pages * ( $results_per_page - 1 );
to
  my $last_page = ( $pages - 1) * $results_per_page;
which seems to fix the 'last' button offset! (Comment 10)

Will add the box to jump to a page in a separate patch.
Adding the pagination to the top on the staff client will be dealt with
in Bug 18916 as it is slightly out of the scope of this bug.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-09 16:15:49 -03:00
Aleisha Amohia
5fc0a1f5b1 Bug 13205: [FOLLOW-UP] Some extra logic
See Comment 8.

Test:
When on first page of results, confirm that the 'First' and 'Previous'
buttons do not show. Confirm they come back on the second page and every
page after.
When on last page of results, confirm that the 'Last' and 'Next' buttons
do not show. Confirm they come back on all previous pages.
Check on both staff side and OPAC.

Sponsored-by: Catalyst IT

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-09 16:15:49 -03:00
Aleisha Amohia
b97de5af12 Bug 13205: Last/first page options for result list paging
This patch adds first and last page buttons to the pagination at the
bottom of a page of catalog search results.

To test:
1) Apply patch
2) Do a number of searches
3) For each search, ensure that the first and last page buttons work as
expected

Sponsored-by: Catalyst IT

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-09 16:15:48 -03:00
347ade5c10 Bug 19367: $biblio variable redefined in same scope in ISBDdetail
The following warning is generated by ISBDdetail.pl:
my" variable $biblio masks earlier declaration in same scope
at ./catalogue/ISBDdetail.pl line 171.

This patch removes this unnecessary declaration, which removes the
warning.

_TEST PLAN_

After applying patch:

1) Check code compilation with "KOHA_CONF=/path/to/koha-conf.xml perl -c catalogue/ISBDdetail.pl"
2) Note the only message is "./catalogue/ISBDdetail.pl syntax OK"
2) On /cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=1,
view the source of the page and verify that the Javascript
contains a holdcount e.g. "var holdcount = 0".

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-09 16:02:54 -03:00
Dobrica Pavlinusic
f270c4a3b5 Bug 19334: Circulation history doesn't set biblionumber so left navigation is broken
Navigation on the left (Normal, MARC, etc...) needs biblionumber in
template variables to work.

Test:
1. go to checkout history for any biblio
2. verify that normal, MARC, etc links on the left no longer work
   due to missing biblionumber in URL
3. apply patch and test it again

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
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:58 -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
99b32717cd Bug 18854 - Protect from DOS
There was a bug that meant a very large offset in the search params
will cause the search script to run forever (or long enough to crash
the machine)

To test

1/ Get ready with sudo top so you can kill the thread before it causes
your machine to OOM
2/ Hit a page like yourdomain.com/cgi-bin/koha/opac-search.pl?q=1&offset=-9999999999999999999
3/ Notice the process runs for a long time
4/ Kill the process
5/ Apply the patch
6/ Hit the page again, notice the it loads (offset is set to zero)
7/ Do the same to search in the staff client

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: changed -2 to 0 in opac-search.pl.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-14 12:02:04 -03:00
Julian Maurice
2f7bad7039 Bug 18633: Remove remaining use of CGI.param in template
Signed-off-by: Marc Véron <veron@veron.ch>

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 17:55:18 -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
06c53f21db Bug 18260: [QA Follow-up] Always something left?
Remove second Koha::Biblios->find in imageviewer.pl

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:38 -03:00
fa48e204f2 Bug 18260: Handle nonexistent biblionumber in imageviewer.pl
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:38 -03:00
c73e269a13 Bug 18260: Koha::Biblio - Remove GetBiblio
C4::Biblio::GetBiblio can be replaced with Koha Biblio->find

Test plan:
Import batch, view issue history, search for items, see the image of a
bibliographic record, modify and delete records in a batch

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

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:38 -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
091d6c513b Bug 17843: Replace C4::Koha::getitemtypeinfo with Koha::ItemTypes
The C4::Koha::getitemtypeinfo subroutine did the almost same job as
GetItemTypes. On top of that it returned the imageurl value processed by
C4::Koha::getitemtypeimagelocation.
This value is only used from the 2 [opac-]shelves.pl scripts. Then it's
better not retrieve it only when we need it.

Test plan:
Play with the different scripts touched by this patch and focus on item
types. The same description as prior to this patch must be displayed.
Note that sometimes it is not the translated description which is
displayed, but that should be fixed on another bug report. Indeed we do
not expect this patch to change any behaviors.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2017-07-05 13:42:21 -03: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
Julian Maurice
6727a61578 Bug 18394: Add an option to item search to export a barcodes file
Test plan:
1. Go to item search (/cgi-bin/koha/catalogue/itemsearch.pl)
2. Fill the form with whatever you want
3. Leave the 'Output' option to 'Screen' and click 'Search'
4. Verify that the search still works
5. Click on 'Edit search' and set 'Output' to 'Barcodes file', click 'Search'
6. You should be able to download a 'barcodes.txt' file, open it and compare it
   to the previous search results
7. Now click on the 'Export results to barcodes file' button above the results,
   you should have the same result as in step 5
8. Verify that the CSV export still works

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-13 08:52:50 -04:00
Julian Maurice
8d25174117 Bug 18394: Remove useless code from item search
The item search was originally designed to work even with JS disabled.
Since bug 15111, the staff interface does not work at all without JS, so some
parts of this code are useless and should be removed

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-13 08:52:50 -04:00