Commit graph

261 commits

Author SHA1 Message Date
a16a750180 Bug 17642: Add and use get_descriptions_by_koha_field
Ok I am silly, we needed to replace to use the cache mechanism for
search_by_koha_field, not find_by_koha_field...
Let's create another subroutine

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 15:52:00 +00:00
baf78b2a33 Bug 17253: Koha::AuthorisedValues - Remove GetKohaAuthorisedValues
This patch replaces the call to C4::Koha::GetKohaAuthorisedValues with
Koha::AuthorisedValues->search_by_koha_field

Test plan:
AV descriptions should be displayed on the following pages:
- XSLT view - location and ccode
- Bibliographic detail, moredetail and OPAC pages - location, ccode, copynumber
- returns - location
- opac-basket - ccode, location
- The 3 reports: catalogue_stats.pl, issues_stats.pl and
  reserves_stats.pl - location, ccode

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:35:34 +00:00
f1298dc782 Bug 17367 - Showing all items must keep show holdings tab in OPAC details
In OPAC details page, when record as too many items (depending on syspref OpacMaxItemsToDisplay), they are not displayed in holdings tab.
You can click on link "Click here to view them all" to show them : page reloads with a new arg viewallitems=1.
Also you can choose which tab is shown by default using syspref opacSerialDefaultTab.

The bug is that when default tab is not holdings, clicking on link to show all items will show another tab. So one must reclick on holings tab to see all items.

This patch corrects by forcing holdings tab when arg viewallitems is defined.

Test plan :
- Create a serial record with more items than syspref OpacMaxItemsToDisplay (or decrease this syspref)
- Select "Subscriptions tab" for syspref opacSerialDefaultTab
- Go to opac details on this record : /cgi-bin/koha/opac-detail.pl?biblionumber=xxx
=> You see Subscriptions tab selected
- Click on Holdings tab
=> You see no items but a link "Click here to view them all"
- Click on this link
=> Without patch you see Subscriptions tab selected
=> Wih patch you see Holdings tab selected and the items

Signed-off-by: Juliette <juliette.levast@iepg.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-17 23:47:27 +00:00
Aleisha
7da5fb8175 Bug 16507: Show play media tab first if record has no holdings
To test:
1) Go to Admin -> Global sysprefs
2) Turn on HTML5MediaEnabled and HTML5MediaYouTube
3) Go to Cataloging and create a new record
4) Catalogue a YouTube link in 856$u and save record. Do not add any items (click Normal tab)
5) Confirm that Play media tab is the selected tab by default
6) View record on OPAC and confirm Play media tab is selected by default
7) Go back to staff client, add an item then go back to Normal tab
8) Confirm that Holdings tab is now selected by default
9) Confirm Holdings tab is selected by default on OPAC

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-09 12:10:40 +00:00
54044e05c5 Bug 15839: Koha::Reviews - Remove C4::Review residue
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-09 10:31:00 +00:00
ba8f552ab6 Bug 15839: Koha::Reviews - Remove getreviews
The C4::Reviews::getreviews subroutine retrieved the reviews for a given
record, depending on their status.
This can be achieve with a call to Koha::Reviews->search.
There were 2 calls to this subroutine. The one from opac-ISBDdetail.pl
does not look in used: the reviews are not display on this page. It
certainly comes from an old copy/paste from opac-detail.pl.
The one from opac-detail only asked for the approved reviews. So the
logged in user does not see its own review if it is pending approval.
Actually this pending approval review is only displayed when the user
submits it (because of a unecessary complex text replacement done in
JS).
With this patch, the approved reviews AND the unaproved review from the
logged in user will be displayed.
It will allow a future enhancement to add a way to delete our own
reviews.

Moreover, the reviews were retrieved even if they were not displayed (if
reviewson is off), it's now fixed.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-09 10:29:53 +00:00
70a31874a7 Bug 17089: Koha::Ratings - Remove GetRating
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-09 09:31:29 +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
df97814f30 Bug 15758: Koha::Libraries - Remove GetBranches
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:03 +00:00
19a977dc7b Bug 15758: Koha::Libraries - Remove GetBranchName
This is the fourth and last patch set to remove C4::Branch.
The real purpose of this patch is to standardise and refactor some code
which is related to the libraries selection/display.
Its unconfessed purpose is to remove the C4::Branch package.

Before this patch set, only 6 subroutines still existed in the C4::Branch
package:
- GetBranchName
- GetBranchesLoop
- mybranch
- onlymine
- GetBranches
- GetBranch

GetBranchName basically returns the branchname for a given branchcode.
The branchname is only used for a display purpose and we don't need to
retrieve it in package or pl scripts (unless for a few exceptions).
We have a `Branches` template plugin with a `GetName` method which does
exactly this job.
To achieve this removal, we will use this template plugin and delete the
GetBranchName from pl and pm files.
The `Branches.all()` will now select the library of the logged in user
if no `selected` parameter has been passed.
This new behavior could cause regressions, for instance there are some
places where we do not want an option preselected (batch item
modification for instance), keep that in mind when testing.

GetBranchesLoop took 3 parameters: $branch and $onlymine.
The first one was used to set a "selected" flag, for a display purpose:
select an option in the libraries dropdown lists.
The second one was useless: If not passed or set to 0, the
`C4::Branch::onlymine` subroutine was called.
This onlymine flag was use to know if the logged in user was able to see
other libraries infos.
A patron can see the infos from other libraries if IndependentBranches
is not set OR if he has the superlibrarian permission.
Prior to this patch set, the "onlymine test" was done on different
places (neworderempty.pl, additem.pl, holidays.pl, etc.), including the
Branches TT plugin. In this patch set, this test is only done on one
place (C4::Context::only_my_library, code moved from
C4::Branch::onlymine).
To accomplish the same job as this subroutine, we just need to call the
`Branches.all()` method from the `Branches` TT plugin. It already
accepts a `selected` parameter to set a flag on the option to select.
To avoid the repetitive
  [% IF selected %]<option selected="selected">[% ELSE %]<option>[% END %]
pattern, a new `html_helpers` TT include file has been created, it
defines an `options_for_libraries` block, which takes a `selected`
parameter. We could imagine to use this include file for other
selects.

The 'mybranch` and `onlymine` subroutines of the C4::Branch package have
been moved to C4::Context. onlymine has been renamed with
only_my_library. There are only 4 occurrences of it, against 11 before
this patch set.
There 2 subroutines are Context-centric and it makes sense to put them
in `C4::Context` (at least it's the least worst place!)

GetBranches is the tricky part of this patch set: It retrieves all the
libraries, independently of the value of IndependentBranches.
To keep the same way as the existing calls of `Branches.all()`, I have
added a `unfiltered` parameter. If set, the `Branches.all()` will call
a usual Koha::Libraries->search method, otherwise
Koha::Libraries->search_filtered will be called. This new method will
check if the logged in user is allowed to see other libraries or only
its library.
Note that this `GetBranches` subroutine also created a `category` key:
it allowed to get the list of groups (of libraries) where this library
existed. Thanks to a previous patch set (bug 15295), this value was
not used anymore (I may have missed something!).

Note that the only use of `GetBranch` was buggy (see bug 15746).

Test plan (for the whole patch set):
The best way to test this whole patch set is to test with 2 instances: 1
with the patch set applied, 1 using master, to be sure there is no
regression.
It would be good to test the same with `IndependentBranches` and the
without `IndependentBranches`.
No difference should be found.
The tester must focus on the library dropdowns on as many forms as
possible.
You will notice changes in the order of the options: the libraries will
now be ordered by branchname (instead of branchcode in some places).
A special attention will be given to the following page:
- acqui/neworderempty.pl
- catalogue/search.pl
- members/members-home.pl (header?)
- opac/opac-topissues.pl
- tools/holidays.pl
- admin/branch_transfer_limits.pl
- admin/item_circulation_alerts.pl
- rotating_collections/transferCollection.pl
- suggestion/suggestion.pl
- tools/export.pl

Notes for QA:
- There are 2 FIXMEs in the patch set, I have kept the existing behavior,
but I am not sure it's the good one. Feel free to open a bug report and
I will fill a patch if you think it's not correct. Otherwise, remove the
FIXME lines in a follow-up patch.
- The whole patch set is huge and makes a lot of changes.
But it finally will tremendously reduce the number of lines:
716 insertions for 1910 deletions

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:01 +00:00
39487d634e Bug 11592: (QA followup) Add missing framework code to ViewPolicy filter calls
This patch adds the frameworkcode option param, using each record's frameworkcode
as expected by the filter. Otherwise the ViewPolicy filter falls back to the
default framework.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 11:54:22 +00:00
ea27569334 Bug 11592: (QA followup) Simplify code
Koha::RecordProcessor and the defined filters are supposed to bring us
joy and happiness. Let's keep the code compact, simple and clean.

This patch removes record cloning all over the place.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 11:54:22 +00:00
Mark Tompsett
6cbae9c3cb Bug 11592: Applying filtering to opac interface.
Applying the filtering and then...
Debugging opac/opac-detail.pl filtering
Debugging opac/opac-ISBDdetail.pl more
Debugging opac/opac-export.pl
Tweak opac/opac-export.pl fix variable declarations, conditional assignments
Debugging opac/opac-showmarc.pl

https://bugs.koha-community.org/show_bug.cgi?id=11592

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 11:54:21 +00:00
49acdc73d3 Bug 15263: (QA followup) Use the new XSLTParse4Display everywhere
Edit: fixed catalogue/detail.pl and opac/opac-detail.pl so they use the right
XSLT syspref.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-04 13:40:35 +00:00
85e7d186ec Bug 16167: Remove Authorised value images prefs
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>
2016-04-29 13:59:58 +00:00
78605bceb3 Bug 16041: Turn off StaffAuthorisedValueImages by default
This feature is enabled by default, but the users are not aware of it
and it costs a lot of time processing to get the images.

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.

The idea of this patch is to introduce a quick switch if the feature is
not used by the library.

Test plan:
1/ Turn the pref on and set authorised_values.imageurl to NULL
Execute the DB entry
=> The pref have been turned off
2/ Turn the pref on and set an image for an authorised value
Execute the DB entry
You will get a warning
3/ Turn the pref off and set an image for an authorised value
Execute the DB entry
You will get a warning
4/ Turn the pref off and set authorised_values.imageurl to NULL
Execute the DB entry
You won't get a warning

Note that the opac detail page now checks the pref before retrieving the
images.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Fixed update message 'that means'.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 13:47:26 +00:00
Henri-Damien LAURENT
05486da41f Bug 5979 : OPAC : using OPACISBD systempreference to display link
The OPACISBD system preference is used in order to be able to have one ISBD for OPAC another one for intranet.
But the link ISBD at OPAC was depending on the presence or absence of value in ISBD which is for intranet.
This patch fixes the behaviour to depend on the correct system preference at OPAC

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified that new system preference is added cleanly and
ISBD view can be configured independently for staff and OPAC
using OPACISBD and viewISBD system preferences.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

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

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
2016-04-22 03:14:21 +00:00
9af429c33e Bug 14544: Get rid of C4::VirtualShelves and C4::VirtualShelves::Page
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 09:58:02 -03:00
a628b3ca10 Bug 14544: Get rid of GetBibliosShelves
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 09:58:01 -03:00
30667f0555 Bug 14100: (follow-up) Language overlay for item types
Display the translated description for item types in the following pages:
> admin/smart-rules.pl
> catalogue/detail.pl
> catalogue/itemsearch.pl
> catalogue/moredetail.pl
> reports/acquisitions_stats.pl
> reports/bor_issues_top.pl
> reports/cat_issues_top.pl
> reports/catalogue_out.pl
> reports/catalogue_stats.pl
> reports/issues_avg_stats.pl
> reports/issues_stats.pl
> reports/itemslost.pl
> reports/manager.pl
> reports/reserves_stats.pl
> suggestion/suggestion.pl
> tools/export.pl

> Opac:
> opac-detail.pl
> opac-MARCdetail.pl
> opac-search.pl

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>
2015-10-27 12:34:06 -03:00
Julian FIOL
468d3d9c83 Bug 14496: Improving opac-detail.pl performances
Get notes and subjects from MARC record
ONLY when XSLT is not activated.

It's useless doing it when XSLT is activated,
because XSLT takes care of it by its own.

=> With this patch, we are saving precious
milliseconds

I compared the display of some records in XSLT view with and without patch, was the same (as expected).
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
On a slower server, I saw a time save of 0.0274 to 0.0908 seconds (with XSLT).
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-10 10:53:48 -03:00
Jonathan Druart
baea0a79d5 Bug 7976: Remove the borrow permission
The borrow permission was used but uselessly.
For instance, at the opac, the flagsrequired parameter was set to
'borrow' but the 'authnotrequired' was set also (which means no auth
required).
At the end, this permission was used at only 1 place: for the basket,
intranet side.
This can be replaced with the catalogue permission (which is used to
search).

Test plan:
1/ Confirm that you are able to show/download/sent the cart (intranet side)
with the catalogue permission.
2/ At the OPAC, you should be able to access the same pages as before
with any other permissions.

Concretely it is quite difficult to test this patch, you should have a
look at the code.

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@gmail.com>
2015-06-05 13:43:34 -03:00
Jonathan Druart
6af69c2648 Bug 8992: Interfacing with the Idref webservice
On the detail page (in the opac), if the biblio comes from the Sudoc,
you must have a link (on the right of the author link) which open a popup with
informations about this author (publications by role).

To test:

1/ Switch on the Idref system preference

2/ Simulate a SUDOC record:
  Fill a 7..$3 field with a ppn (032581270 for example).
  Fill the 009 field with an integer

3/ Go to the opac detail page of this notice.
You should see the IDREF link.
If you click on it, a popup displays a loading icon and after a few
seconds (depending of the productivity of the authority :)), a list of
roles. For each role, a table displays all his corresponding publications.

4/ On the right, you have 2 links: 1 for a koha search for this result
and 1 for a SUDOC link

Signed-off-by: valerie bertrand <valerie.bertrand@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-28 15:46:26 -03:00
Jonathan Druart
a6c9bd0eb5 Bug 9978: Replace license header with the correct license (GPLv3+)
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>
2015-04-20 09:59:38 -03:00
Jonathan Druart
27b534dc56 Bug 11337: Remove the C4::Serials::GetSubscriptions routine
Since SearchSubscriptions is the way to search subscriptions, each call
to GetSubscriptions could be replaced by a call to SearchSubscriptions.

Test plan:
Verify following pages display the same thing as before this patch:
- catalogue/detail.pl
- opac/opac-ISBDdetail.pl
- opac/opac-detail.pl

Verify the following page returns correct results:
- serials/checkexpiration.pl

Verify the Serials UT file still passes:
- prove t/db_dependent/Serials.t

Note: The title filter on checkexpiration now only searches on the title
DB field. I don't think it is a regression, it should be the way to use
this field. Maybe should we add new search fields on this form.
Bug 5337 reintroduces a bug fixed by bug 5864, this patch restore the
right way to search subscription (based on biblionumber).

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-13 10:36:19 -03:00
ebccf4099f Bug 5786 [QA Followup]
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-25 10:33:31 -03:00
Srdjan
1802aa9153 Bug 5786 - Move AllowOnShelfHolds and OPACItemHolds system prefs to the Circulation Matrix
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>
2015-03-25 10:33:14 -03:00
Jonathan Druart
f01e616a72 Bug 11944: Fix problems introduced by bug 11515
The game continue...
Patch for bug 11515 introduced regression on this patch set.
To reproduce: search with utf8 characters at the opac
Test plan:
Verify that the issue described on bug 11515 is still fixed and that no
regression is found at the OPAC.

Note that I am pretty sure this patch is not enough.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:55 -03:00
Jonathan Druart
e20270fec4 Bug 11944: use CGI( -utf8 ) everywhere
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:21 -03:00
Jonathan Druart
053ee5c955 Bug 13346: OpacExportOptions becomes multiple
The list of options is limited, the interface could be more ergonomic.

Test plan:
- verify that you are still allowed to change (add/remove) options for the
  OpacExportOptions pref.
- At the OPAC, verify the selected options appear correctly (check the
  3 pages opac-ISBDdetail.pl, opac-MARCdetail.pl and opac-detail.pl).

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-04 12:36:45 -03:00
260c423be8 Bug 11515 - Encoding problem with OpacBrowseResults
When OpacBrowseResults syspref is on, the detail page contains a results browser.
When search terms contains non-ASCII character, the search query is not well encoded in this browser.

This patch adds the URI-coding to search terms into session to avoid any encoding problem with diacritics and URI specific characters like ?,& ...
So that TT parameter 'busc' is already URI encoded and can be used to recreate seach URL.

Test plan :
- Set OpacBrowseResults on
- At OPAC, perform a search with a diacritique. For example 'déjà'
- Go to detail page of a result
=> You see browser under "Browser results"
- Click on "Back to results"
=> You get same results and same search term with correct encoding

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug still present on master. I note that latin characters are taken by ISO-8859-1 encoding
(Perl's default) and that's why real UTF8 ones don't break (Perl notices they are UTF-8).
2014-11-21 15:54:05 -03:00
afd2418d73 Bug 11349: Change .tmpl -> .tt in scripts using templates
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.

This patch changes the occurences of '.tmpl' in favour of '.tt'.

To test:
- Apply the patch
- Install koha, and verify that every page can be accesed

Regards
To+

P.S. a followup will remove the glue code.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-17 11:05:49 -03:00
Galen Charlton
bed4c27184 Bug 11169: (follow-up) only count orders that have been placed
This patch ensures that only orders that have been placed (i.e.,
orders whose basket is closed) are counted in the OPACAcquisitionsDetails
display.

To test:

[1] Turn on OPACAcquisitionsDetails and set AcqCreateItem to 'ordering'.
[2] Create an order for a record, but do not close the basket.
[3] View the record in the OPAC.  It should not display any order count.
[4] Close the bakset.
[5] View the record in the OPAC again.  This time, it should display
    the count of items on order.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-06-15 11:12:46 -03:00
Jonathan Druart
e330b4672d Bug 11169: Display acquisition details in the OPAC
This patch adds a new system preference 'OPACAcquisitionDetail'.
If it is enabled, information about items on order will be displayed on
the OPAC detail page.

Test plan:
- switch on the OPACAcquisitionDetails pref.
- set the AcqCreateItems pref to 'receiving'.
- create some orders on 1 or more items.
- go to the opac detail page and verify the "Holdings" tab contains the
  line "X item are on order." (at the bottom of the table containing the
  item list).
- receive the items.
- verify the number of items has decreased.
- set the AcqCreateItems pref to 'ordering'.
- create some orders on 1 or more items.
- go to the opac detail page and verify the item list contains the items
  with the "on order" status.
- receive the items.
- verify the received items no longer have the the "on order" status.

To test completely this feature, you should verify there is no
regression on the pref OpacMaxItemsToDisplay, OpacSeparateHoldings and
OpacSeparateHoldingsBranch.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Also removed some blank lines from the original patch and bumped up
the DBRev.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-06-15 11:12:24 -03:00
09ce37d349 Bug 7720: add options for controlling display of an item's home and/or holdings location
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>
2014-05-26 02:12:06 +00:00
Galen Charlton
15a5140f36 Bug 10195: (follow-up) tidying up code and eliminate warning if record does not have 942$n
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 15:50:45 +00:00
Mirko Tietgen
f2ad0d7424 Bug 10195: hide bib details page for OPAC-suppressed bibs
Records hidden with OpacSuppression are filtered from the search
results, but the opac-detail page is still visible if you know the
biblio number. This patch hides the detail page for suppressed biblios
by redirecting (controlled by the syspref OpacSuppressionRedirect)
either to opac-blocked (default), explaining that the record is blocked
(including optional explanatory text from the syspref
OpacSuppressionMessage) or to Koha's 404 page, giving no hint that a
biblio with that number exists in the system.

Test plan:

Make sure you have at least one record with 942$n == 1.
Set OpacSuppression to "Don't hide".

Do an OPAC search that should bring up your hidden record and other
records.
  Observe that your record is found.
Open the detail page for the record.
  Observe that it is accessible. Copy the URL for later(!).

Set OpacSuppression to "Hide".
Leave OpacSuppressionByIPRange blank.
Set OpacSuppressionRedirect to "an explanatory page ('This record is
blocked')."
Leave OpacSuppressionMessage blank for now.
Disable queryparser(!) (because of bug 10542).

Do a full zebra reindex.

Do an OPAC search that should bring up your hidden record and other
records.
  Observe that your record is not found.
Open the opac-detail URL of the record (the one you copied before).
  Observe that you are redirected to opac-blocked and it displays a
short standard message.

Edit OpacSuppressionMessage and input some text.
Open the opac-detail URL of the record again (the one you copied
before).
  Observe that the text you entered in OpacSuppressionMessage is
displayed under the standard text you have seen before.

Set OpacSuppressionRedirect to "the 404 error page ('Not found')."
Open the opac-detail URL of the record again (the one you copied before).
  Observe that you are redirected to Koha's 404 error page.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 15:32:53 +00:00
9d9a002432 Bug 11516: make OPAC search term highlighting work in results browser
When OpacHighlightedWords syspref is on, the current search terms are
highlighted in results and detail pages.

This workes in detail page with the URL param 'query_desc'.

This parameter must be managed in results browser (appears when
OpacBrowseResults syspref is on) links.

This patch adds query_desc parameter in results list and changes next
nd previous links to be build into TT instead of perl to manage
query_desc parameter only into TT.

Test plan :
- Edit sysprefs :  OpacHighlightedWords on, OpacBrowseResults on.
- Perform a search with a term existing into title
=> You see the term highlighted in search results
- Go to detail of a result with highlight
=> You see the term highlighted
- Click on "Next"
=> you see query_desc in URL, and if search term is present it is
   highlighted
- Same for "Previous"
- Click on "Browse results"
- Click on a result
=> you see query_desc in URL, and if search term is present it is
   highlighted

Signed-off-by: Aurélie <aurelie.fichot@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-03-10 21:30:38 +00:00
Jonathan Druart
31b732b830 Bug 11256: Opac: Set a number of items to display on a biblio detail page.
Currently, the number of items to display is hardcoded (50).
But the perl script loads all items before to check if the number of
items is oversized.

This patch adds a new pref OpacMaxItemsToDisplay (default to 50). If the
*total* number of items for a biblio is greater, no item is displayed
and a link allows to display all items.

Test plan:
1/ search a biblio with many items
2/ set the pref according the number of items you want to display
3/ verify the items are not displayed if the number of items is greater
the pref value
4/ enable the OpacSeparateHoldings pref and verify the items are
displayed in different tabs (if items have different locations).

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2014-02-21 18:34:27 +00:00
e536fd087d Bug 9823: QA follow-up for GetReservesFromBiblionumber calls
The template params holds and holdcount are not used in the ISBD template.
Removed the associated code from catalogue/ISBDdetail.pl.
Same applies for catalogue/MARCdetail.pl and labeledMARCdetail.pl.
Same applies also for catalogue/imageviewer.pl.
Same applies also for catalogue/moredetail.pl.

In catalogue detail.tt only the number of holds is used. Removed the code
that passed the holds array to the template.

For consistency opac-detail should also incorporate future holds into its
holds count; added the all_dates parameter for that reason.

The Reserves module is no longer needed in moredetail. Removed it. Checked
the other scripts also.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-01-30 16:23:34 +00:00
Jonathan Druart
8b685c1e80 Bug 9823: Refactor return from GetReservesFromBiblionumber
The return from GetReservesFromBiblionumber contains an unnecessary
extra variable. In scalar context an array returns its element count.
Maintaining a separate count can lead to unforeseen bugs
and imposes ugly constructions on the subroutine's users.

Remove the useless count variable from the return

This patch also changes the parameters: now the routine takes a hashref.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Placed biblio holds, future holds and item holds. Works as expected.
Tested Holds.t and Reserves.t. Pass.
Tested /cgi-bin/koha/ilsdi.pl?service=GetRecords&id=999 with two holds on
one item. Fine.
C4/SIP/ILS/Item.pm: Looked for "whatever" and "arrayref" and could not find
them anymore. Looks good.
Handled a few unneeded calls in QA follow-up.
Left only one point to-do for serials/routing-preview.pl. See Bugzilla.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-01-30 16:19:55 +00:00
Srdjan
ec206d1898 Bug 11183: get rid of some log noise from the OPAC
To test in OPAC:
* With the OPAC System Preference EnableOpacSearchHistory set
  to Keep, a simple search triggers the warning patched on
  line 626 of opac-search.pl
* Selecting a search result item with no Collection Code
  set triggers the warning patched on line 576 of opac-detail.pl
* Have an item with Collection Code. Check that the Collection
  Code shows.
* Collection Code is set by editing an item in the staff client
  (952$8)

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-29 14:41:03 +00:00
Jonathan Druart
363e986c60 Bug 10283: Hide "many items" on second tab when using OpacSeparateHoldings
If there are over 50 items in the holdings or Other holdings tab, the
warning and link 'This record has many physical items. Click here to
view them all.' is only shown for the first tab.

Test plan:
- Switch on the OpacSeparateHoldings pref.
- Go on a biblio detail page at the OPAC with more than 50 items
- Check that the 'view all' link appears on the second tab.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 16:53:56 +00:00
ded9896ec2 Bug 10829: fix browsing across pages breaks for OPAC bibs-linked-to-authority searches
Test plan
1. Do an authority search in the OPAC (A search for 'an:49' perhaps..
that should bring up results for authority number 49, hopefully there
are multiple pages of results, if not try again and find one that
gives you multiple pages of results)
2. Click the final result on any page of results (there must be more
results to follow for this to work)
3. Try clicking the 'Next' button in the 'Browse results' pane on
the right of the page.
4. It should take you to the next result in the search list (i.e
the first result from the next page of results) - Double check it is
correct, we found that it was often not.

5. Apply patch and run same process, this time you should get the
correct paging.

Signed-off-by: Koha Team Amu <koha.aixmarseille@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I reproduce the issue and I confirm this patch fixes it!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-23 14:45:54 +00:00
ff7b4d4aa3 Bug 10856: (Follow-up) improve behavior of the "close shelf browser" link
In Firefox at least, the shelf browser cannot be reopened after
hiding it with the "close shelf browser" link. This followup improves
the behavior of the "close shelf browser" link so that the shelf browser
can be redisplayed.

To test, open a bibliographic detail page in the OPAC and click a
"browse shelf" link. Click the "close shelf browser" link--the shelf
browser should be hidden. Click the original "browse shelf" link and the
shelf browser should reappear without reloading the page.

Test with Firefox and Chrome (at least).

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.

Testing notes:
- New unit tests in t/db_dependent/ShelfBrowser.t pass.
- System preference  OPACShelfBrowser still works as expected.
- Closing and opening the shelf browser works as expected.
- Next and Previous links show new and nicer behaviour.
- Logs are clean.

Tested with Firefox and Chromium under Ubuntu.

Notes: The currently displayed record could maybe be highlighted
a bit better.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-04 15:57:35 +00:00
Jonathan Druart
5c0fa5ec3d Bug 10856: Improve the previous and next items on the shelf browser
The next and previous links should completely refresh the shelf.

For example:
[<] [1] [2] [3] [4] [5] [6] [>]
Before this patch, the next and previous links were the same as the 1
and 6.
With this patch, after clicking on next, we will get:
[<] [7] [8] [9] [10] [11] [12] [13] [>]

This patch adds a new AJAX script to get the shelf browser block.

Test plan:
- On a detail biblio page, click on a "Browse shelf" link.
- Play with the next and previous links.
- Deactivate Javascript (using NoScript for example) and check that you
  get the same behavior (but the page is reloaded).
- Launch the unit tests: prove t/db_dependent/ShelfBrowser.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-04 15:56:35 +00:00
Mark Tompsett
e191bb02bf Bug 10584 - Hide OPAC biblio details if all items are hidden
If there are items for a given biblio number, and they are all
hidden, then biblio needs to be hidden. If the biblio needs to
be hidden, it immediately redirects to a 404.pl page, just as
if the biblionumber does not exist.

Arrays used to represent all the items were relocated and used,
added if they didn't exist. Arrays representing the hidden
items were relocated and used if they existed, added if they
didn't exist.

Upon debugging the opac-MARCdetail.pl modification, it was
discovered the reason getHiddenItems was failing was because
'use YAML qw/Load/;' was not mentioned in C4::Items, and other
libraries were triggering the loading of YAML to compensate
for opac-detail.pl and opac-ISBDdetail.pl files.

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-18 15:31:04 +00:00
dbaefb626c Bug 10550: Fix database typo wthdrawn
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>
2013-09-08 01:58:41 +00:00
Mark Tompsett
3f77efcc1d Bug 10584 - Hide OPAC biblio details if all items are hidden
If there are items for a given biblio number, and they are all
hidden, then biblio needs to be hidden. If the biblio needs to
be hidden, this is done by setting the biblionumber to 0, which
triggers the same output as if the biblionumber does not exist.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.
2013-09-07 21:12:50 +00:00
Jonathan Field
7d0aea7c39 Bug 10704: make OPAC highlighting work across previous/next travel
To test

Enable 'OpacHighlightedWords'

1) Run a search with multiple results
2) Click on a title of one of the results to get the full record
display. Hit highlighting SHOULD work on this page.
3) Use either the "Next" or "Previous" buttons on this page
(opac-detail) to move to the next or previous record.
4) Moving forward or back, the highlighting should still be working on
the page.

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>
2013-08-19 14:14:09 +00:00