Commit graph

4987 commits

Author SHA1 Message Date
Stéphane Delaune
f32b0e1243 Bug 9859: fix nsb_clean side effect
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
This sub was causing 2 bugs :
- tools/exports.pl --clean was removing Â
- authority search plugin used in cataloging was removing  in suggested authorities displayed dynamicly (using ajax)
After applying the patch,
- NSB/NSE are still removed by nsb_clean
- tools/exports.pl --clean is no more removing Â
- authority search plugins is no more removing Â

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-22 14:06:14 -03:00
22395e4168 Bug 12068: (rm followup) remove useless newline introduced on merging
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-22 09:31:01 -03:00
5dfc026fad Bug 13114: Prevent Shibboleth Patches from spamming logs
- The shibboleth patch introduced an undefined message into the error
  logs, when shiboleth is disabled.

Testplan

1. Ensure shibboleth is disabled.
2. Refresh any opac page
3. See 'Use of uninitialized value $ENV{"REMOTE_USER"} in string ne at
/home/koha/kohaclone/C4/Auth.pm line 711.' popup in the opac-error.log
4. Apply patch
5. Refresh opac page
6. Error should no longer appear

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-21 21:10:48 -03:00
Bernardo Gonzalez Kriegel
0ac72275aa Bug 12068 - label-create-pdf.pl Add support for RTL language
On top of Bug 8375

If you print a label using arabic/hebrew script,
letters are printed in logical direction, from left
to right, giving a mangled result

This patch will try to fix those cases adding a new
perl dependency, Text::Bidi, and using the automagic
feature if it's log2vis() function to rearrange chars
based on detected text 'direction'

To test:
1. Install Text::Bidi package
(apt-get install libtext-bidi-perl)

2. Try a batch, using Helvetica, with a mix of
ltr and rtl (arabic/hebrew) titles, chars are good,
but direction is bad

NOTE: I suggest changing the mapping for 'HO' font
on koha-conf.xml, from DejaVuSans-Oblique.ttf to
DejaVuSans.ttf to view 'title' chars

3. Apply the patch

4. Try again, now the result is good

Formerly a followup of Bug 8375, look sample pics
on that Bug.
Rebased following changes on Bug 8375

Note: Arabic titles will not be displayed, because
current code selects Oblique variant (unless you
change mapping as suggested on 2. )
Hebrew looks good.

Rebased and move use of new dependency to Labels.pm

Rebased on master

Signed-off-by: Karam Qubsi <karamqubsi@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with the help of Bernardo. With the patch
the characters of RTL strings appear in the correct
order in the generated PDF files.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-21 16:14:57 -03:00
Marc Véron
b47e0360d8 Bug 12914 - Wrong message 'Patron(..) is blocked for 2014-09-30 day(s).
The message in circulation.tt assumed to get days but date is given. Updated comments and message depending on expiration date or no expiration of restriction.

The message shows up on top of Bug 643 Allow override of 'debarred' status if a patron has a restriction.

Replaced date_format with date template (see comment #6)

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-21 16:13:28 -03:00
simith
e0c1476123 Bug 12424 - ddc sorting of call numbers truncates long Cutter parts
This patch increases the cn_sort field length to 255 chars.

Modified:

C4/ClassSortRoutine.pm                    - change the hardcoded cn_sort length to 255
installer/data/mysql/kohastructure.sql    - alter tables items and deleteditems,
                                            biblioitems and deletedbiblioitems
installer/data/mysql/updatedatabase.pl    - alter tables items and deleteditems,
                                            biblioitems and deletedbiblioitems

Testing:

Before applying the patch:
0) Select an item
1) Edit the item selected
2) Change "Full call number" option to 530 F435_1996 v2p1
3) Save changes
4) Valide 530_000000000000000_F435_1996_ (table items - cn_sort column).

After applying the patch:
5) Edit again the item selected in 0
3) Save changes
4) Valide 530_000000000000000_F435_1996_V2P1 (table items - cn_sort column).

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Works as described.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-18 10:50:07 -03:00
6d3f1c1caf BUG8446, QA Followup: Add Test::DBIx::Class to dependancies
- To correct tests after converting module to dbic, we need to add the
  Test::DBIx::Class module as a dependancy.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
The dependency will probably need to be packaged by us until
it can get into Debian proper.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:28:03 -03:00
fb90f71f71 BUG8446, QA Followup: Use DBIx::Class
- Convert Auth_with_shibboleth to use dbic stanzas.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:28:01 -03:00
31878e1973 BUG8446, QA Followup: Minor Code Tidies
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:27:59 -03:00
89ee1aeab7 BUG8446, QA Followup: Cleanup tabs and license
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:27:57 -03:00
ca86375872 BUG8446, Follow up: Refactor to clean up bad practice
- A number of issues were highlighted whilst writing sensible unit tests
  for this module.
  - Removed unnessesary call to context->new();
  - Global variables are BAD!
  - Croaking is a wimps way out, we should handle errors early and
    properly.

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:27:53 -03:00
3c9004357d BUG8446, Follow up: Improve local login fallback
- Local fallback was not very well implemented, this patch adds
  better handling for such cases allowing clearer failure messages
- This patch also adds the ability to use single sign on via the
  top bar menu in the bootstrap theme.

BUG8446, Follow up: Adds perldoc documentation

- Add some documentation to the Auth_with_Shibboleth module
  including some guidance as to configuration.

BUG8446, Follow up: Correct filenames to match guidlines

- Moved Auth_with_Shibboleth.pm to Auth_with_shibboleth.pm to match
  other files present on the system.

BUG8446, Follow up: Correct paths after file rename

BUG8446, Follow up: Implemented single sign out

- This follow up rebases the code against 3.16+ which managed to break
  some of the original logic.
- As a side effect of the rebasing, we've also implemented the single
  sign out element. Upon logout, koha will request that the shibboleth
  session is destroyed, and then clear the local koha session upon
  return to koha.  Due to the nature of shibboleth however, you will
  only truly be signed out of the IdP if they properly support Single
  Sign Out (which many do not). As a consequence, although you may
  appear to be logged out in koha, you might find that upon clicking
  'login' the IdP does NOT request your login details again, but instead
  logs you silently back into your koha session. This is NOT a koha bug,
  but a shibboleth implementation issue that is well known.

BUG8446, Follow up: Fixed bootstrap login via modal

- The bootstrap theme enable login from any opac page via modal. To
  enable this with shibboleth we had to make some template parameters
  globally accessible when shibboleth is enabled.

BUG8446, Follow up: Add template rules for Shibboleth and CAS

- Add template rules so that CAS and Shibboleth can coexist.

BUG8446, Follow up: Added default config to config file

BUG8446, Follow up: Embellished perldoc documentation

- Updated perldoc to correct detail about configuring shibboleth
  authentication.
- Updated perldoc to include subroutines and their respective functions.

BUG8446, Follow up: Enable configuration of match field

- Added clearer, more flexible, configuration of shibboleth attribute to
  koha borrower field matching for authentication
- Correcting of documentation to make it more clear to the current
  implementation
- Minor refactoring of code to reduce some code duplication

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:27:51 -03:00
Jesse Weaver
244cfaba71 BUG8446, Follow up: Remove unnecessary sysprefs, move to config
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:27:49 -03:00
8e09a48e8c BUG8446, Follow up: Adds Shibboleth authentication
- Use syspref OpacBaseURL instead of ENV{'SERVER_NAME'} as this wont
  work if koha is behind a reverse proxy.
  - To use multiple vhosts, set OpacBaseURL per vhost explicitly with
    'SetEnv OpacBaseURL Value' as per Bug 10325

BUG8446, Follow up: Adds Shibboleth authentication

- Ensure user is returned to requested page after authentication
  - Added querystring to the target path in shibboleth URL so
    that when a user is authenticated he/she is returned to the
    correct page they requested before authentication.
    Example where this is important: When a user clicks a direct
    biblio link of the form - /opac-detail.pl?biblionumber=12345

BUG8446, Follow up: Remove unused imports from scripts

- Remove import of deprecated C4::Utils module from shibboleth
  authentication module: Auth_with_shibboleth.pm

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:27:46 -03:00
Matthias Meusburger
400b538078 BUG8446: Adds Shibboleth authentication
- Use the shibbolethAuthentication syspref to enable Shibboleth authentication
 - Configure the shibbolethLoginAttribute to specify which shibboleth user
   attribute matches the koha login
 - Make sure the OPACBaseURL is correctly set

BUG8446, Follow-up: Adds Shibboleth authentication

 - Fix logout bug: shibboleth logout now occurs only when
   the session is a shibboleth one.
 - Do some refactoring: getting shibboleth username is now
   done in C4::Auth_with_Shibboleth.pm (get_login_shib function)

BUG8446, Follow-up: Adds Shibboleth authentication

 - Adds redirect to opac after logout

BUG8446, Follow-up: Adds Shibboleth authentication

 - Shibboleth is not compatible with basic http authentication
   in C4/Auth.pm. This patch fixes that.

BUG8446, Follow-up: Adds Shibboleth authentication

 - Use ENV{'SERVER_NAME'} instead of syspref OpacBaseURL in order to work with
   multiple vhosts.

BUG8446, Follow-up: Adds Shibboleth authentication

 - Adds missing protocol for $ENV{'SERVER_NAME'}

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jesse Weaver <pianohacker@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with the feide idp.
- LDAP login and logout are working
- local login/logout are still working
- CAS login/logout are still working

Instructions for setup can be found on the wiki:
http://wiki.koha-community.org/wiki/Shibboleth_Configuration

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 12:27:42 -03:00
31cff582d8 Bug 10126: (qa followup) fix tests
It seems the removal of global variables changes the behaviour
of Test::MockModule, and it now expects the namespace in front
of the statically called method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-16 10:24:10 -03:00
Jonathan Druart
a7f23c0afc Bug 10126: Remove my variables at module level
In C4::Reports::Guided, a lot of variables was defined at module level
and reused in subroutine.

I didn't find any problem with Plack, so I'm not sure this patch is
useful.

Test plan:
Verify there is no more ^my in the module and you don't find any
regression with the guided reports tools (with and without Plack)

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

I'm unsure if this is needed, but I have verified it causes no
regressions

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
No regressions spotted. I'd prefer this code to be fully refactored of course :-P
2014-10-15 18:21:14 -03:00
1d28da41fb Bug 11232: (followup) Configuration variable for enabling Zebra facets
This patch adds a variable to koha-conf.xml controlling the use of Zebra facets.

Usage:
 - use_zebra_facets = 1 | 0

Zebra facets work only on DOM.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-15 12:55:45 -03:00
4c1a9fbd39 Bug 11232: retrieve facets from Zebra's indexes in DOM
This patch adds the following routines to C4::Search

- GetFacets
   This is a wrapper routine, that given a ZOOM::ResultSet, extracts
   the relevant facets. To do the job, it uses the internal functions:
   _get_facets_from_records and _get_facets_from_zebra. The choice is done
   on querying the indexing mode: grs1 will use records, and dom zebra's facets.
- _get_facets_from_records
   Just refactoring the already existent main loop from getRecords into a function.
- _get_facets_from_zebra
   Given a result set, loop through all defined facets in C4::Koha::getFacets
   and call _get_facet_from_result_set for each, to build the facets
   information. It retrieves the facets from Zebra's facets.
- _get_facet_from_result_set
   Given a result set and a facet index name, retrieve the facets
   for the given index, and build the result for rendering.

To test this preliminay work:
- Apply the patches, install on DOM, using MARC21, NORMARC and UNIMARC.
- Reindex some DB with lots of records.
- Check facets work.

Note: UNIMARC is the only dialect that has more than one subfield (concatenated)
for facets values, so it is better to test on uNIMARC. The approach leaves room
for re-thinking facets in MARC21/NORMARC, but it is outside of the scope of the bug
(e.g. we could have more author facets)

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: David Cook <dcook@prosentient.com.au>

Seems to work with DOM and MARC21.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-15 12:55:42 -03:00
Chris Cormack
6f3741f69f Bug 12538: FOLLOW UP Remove Moose from the list of dependencies
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-11 16:59:13 -03:00
Jonathan Druart
cf2eb49448 Bug 12538: Remove Solr without breaking anything else
Since nobody is currently working on the zebra layer introduced by bug
8233, Solr won't never work.
Some code has been introduced in 3.10 to prove several search engines
can cohabit into Koha but no help/fund has been found to go ahead.
It is useless to keep this code and to maintain an ambiguous situation.

I think the indexes configuration page could be restore later if someone
else introduces a new search engine into Koha.

Test plan:
Look at the code introduced by bug 8233 and verify all is removed.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-11 16:59:04 -03:00
Jonathan Druart
d85f29661b Bug 12874: A DB field without a default mapping is set to a default value on editing
If an item is edited and a field is not mapped to Koha, it is to 0 or
NULL (depending on the default value defined).

This patch adds a check on the mapping before editing the item. It there
is no mapping, the DB value is not erased.

Test plan:
1/ Edit an item and fill a value for a field
2/ Unmap this field
3/ Edit the item
4/ Verify that the value is not erased (using the MySQL CLI)

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-11 12:57:11 -03:00
Robin Sheat
56844b81d7 Bug 9967 - include $branch_limit in the cache key
Make the caching more correct. Also removes a warn that got left behind.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-09 11:05:07 -03:00
Robin Sheat
1878cb0bdf Bug 9967 - Cache authorised value requests properly
Authorised values are now cached using the proper Koha::Cache mechanism,
rather than a simple internal cache. Memoize has been removed because it
didn't really work like we needed it to.

Test plan:
 * running a persistent environment:
 * load the edit item screen
 * refresh several times to ensure any process-based caches are filled
 * add a new LOC authorised value as fast as possible (prepare it on
   another tab.)
 * refresh the edit item page
 * note that the new LOC value may or may not be showing in the
   "shelving location"
 * if more than 5 seconds have passed since saving it, it must now show
   up.
 * refresh a few times to ensure that it's showing on all processes.

Note:
 * This patch depends on the caching changes of 9967.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-09 11:05:00 -03:00
Jonathan Druart
9daef6fb53 Bug 12876: Improve unit tests for CanReserveBeCanceledFromOpac
This patch fix the subroutine name and add a restriction on the
arguments: both argument are mandatory!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-23 20:46:57 -03:00
Rafal Kopaczka
e9eef04b95 Bug 12876 - Reserve in waiting/transfer status may be cancelled by user
User may cancel his own reservation at waiting or in transit status
through calling opac-modrequest.pl. Cancel button is disabled in
interface but possibility to cancel should be checked also in
opac-moderequest.pl, before calling CancelReserve().
Similar situation is with opac-modrequest-suspend.pl

This patch provides new soubroutine to chceck if user can cancel given
reserve. It's possible only when he's owner of hold and hold isn't in
transfer or waiting status.

Additionaly there are new test for this function in Reserves.t

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests, QA script and new tests.
Works as described, tested with:
.../cgi-bin/koha/opac-modrequest.pl?reserve_id=XXX

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-23 20:46:50 -03:00
3f2dda2f33 Bug 11672: Untranslatable dropdown on Guided Reports and dictionary
This patch removes hardcoded descriptions and sets them in the templates
using the variable content as id.

To test, create a new guided report and verify the 'module to report on' dropdown
shows as usual [1]. Functionality shouldn't get changed.

The patch also changes the dictionary pages where 'area' should be displayed/selectable
with the same strings as the guided reports. Try all the possible disctionary pages.

The last page when creating a dictionary now shows the 'area description' instead of the
code. The same happens to the dictionary list once you have dictionaries saved.

[1] The following texts get changed:
    Catalogue -> Catalog
    Acquisition -> Acquisitions

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-23 15:32:21 -03:00
Colin Campbell
04857ed68e Bug 11633 Return Correct status if patron blocked by fines
If the patron has amassed charges that block borrowing, but we
allow staff override the information that the patron cannot
issue should be included the patron information response

This patch sets the appropriate status fields in the patron object

It restores the fee_limit member to the patron object
and calls a local subroutine to set it.

This could be done more elegantly but that would require more
major refactoring of the rather messy initializer code
in ILS::Patron

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>
2014-09-23 15:30:12 -03:00
Colin Campbell
2bd151fab5 Bug 11633 : Block Issue if fines require staff override
If a patrons fines exceed noissuescharge and we allow
staff to allow issue at their discretion via an override
the SIP process allowed charges to go ahead.
This patch closes the loophole which allowed self issue
to subvert the usual library loan policy

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>
2014-09-23 15:30:05 -03:00
Julian Maurice
45f474abdf Bug 8868: ILS-DI: CancelHold needs to take a reserve_id
CancelHold takes two parameters: patron_id and item_id.
If item_id is considered as an itemnumber, holds on title can't be
canceled.
If item_id is considered as a biblionumber, all holds on this
biblionumber (for a borrower) will be canceled.

So CancelHold have to consider item_id as a reserve_id.

- Added subroutine C4::Reserves::GetReserve
- C4::ILSDI::Services::GetRecords now returns the reserve_id
- Fix the text in the ilsdi.pl?service=Describe&verb=CancelHold page
- Unit tests for CancelReserved and GetReserve
- Do not delete row in reserves table if insert in old_reserves fails

Signed-off-by: Leila and Sonia <koha.aixmarseille@gmail.com>
Signed-off-by: Benjamin Rokseth <bensinober@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signing off, while noting a style issue in the patch review

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Placed and cancelled a hold using ILS-DI successfully.
Adding a follow-up to also update the ils-di documentation
page in the bootstrap theme.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

EDIT: I removed the changes it did to the prog theme.
2014-09-18 09:48:41 -03:00
Jonathan Druart
e2b0454ed4 Bug 12609: Add some unit tests for C4::Ratings
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 22:08:57 -03:00
bb78928bef Bug 12609 - Replace use of DBI in C4::Ratings with DBIx::Class
Test Plan:
1) Apply this patch
2) prove t/db_dependent/Ratings.t
3) Note all unit tests pass

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Also tested:
- Adding a rating
- Rating displayed on detail
- Rating displayed on results
- Modifying a rating
- Change displayed correctly on detail and results

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 22:08:48 -03:00
Jonathan Druart
5af96e0f78 Bug 12827: NewOrder needs more unit tests
NewOrder should be more tested!

This patch moves the existing unit tests into a new file and adds some
unit tests.

Note that there is no DB field aqorders.subscription, so the test in
NewOrder can be removed.

Test plan:
  prove t/db_dependent/Acquisition/NewOrder.t
and
  prove t/db_dependent/Acquisition.t
should return green.

Signed-off-by: Zeno Tajoli <z.tajoli@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 21:22:56 -03:00
Jonathan Druart
2217f98b7c Bug 12827: NewOrder should not return basketno
Since the basketno parameter is needed to insert an order, it is useless
to return it.

This patch changes the prototype for the C4::Acquisition::NewOrder
subroutine. The return value is now a scalar containing the ordernumber
created.

Test plan:
Verify there is no regression on an acquisition workflow:
1/ Create an order with several items
2/ Modify the order
3/ Receive some items
4/ Cancel the receipt
4/ Receive some items
5/ Receive all remaining items
6/ Cancel the receipt

Signed-off-by: Zeno Tajoli <z.tajoli@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 21:22:26 -03:00
Jonathan Druart
55e5c82ab5 Bug 12891: NewOrder does not return ordernumber if ordernumber is defined
The behavior is quite weird, but
  $schema->resultset('Table')->create($data)->id
does not return the id inserted if $data contains the key.

To be more clear, in this case
  $schema->resultset('Aqorder')->create($new_order)->id
returns an empty string because $new_order->{ordernumber} is an empty
string!

This was not caught by the unit tests, I added one.

Test plan:
- AcqCreateItem set to ordering
- Create an order with items and verify items are correctly linked to the
  order.

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed that without the patch the created item is not linked to the
order (entry in aqorders_items). With the patch, it works as expected.
Passes tests and Koha QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 21:19:35 -03:00
Holger Meißner
b49bcfef09 Bug 11577: Code and intranet template changes
This patch adds a checkbox for "Automatic renewal" to the checkout page.
CanBookBeRenewed is modified to include two new errors:
- auto_renew (renewal shouldn't be done manually)
- auto_too_soon (renewal is premature and shouldn't be done manually)

To test:

1) Add or edit an issuing rule with "Automatic renewal" and another
   one without it.
2) Issue at least three items:
   - automatic renewal by issuing rule
   - automatic renewal by Checkbox on the checkout page
   - no automatic renewal
3) Test the following steps for both:
   Home > Circulation > Checkouts
   Home > Patrons > Patron details
4) Confirm that issues with automatic renewal cannot be renewed manually,
   even if there are still renewals left and it's not too soon to renew.
5) Confirm that "Scheduled for automatic renewal" and the remaining
   renewals are displayed. If no renewals are left "Not renewable" should
   be displayed.
6) Confirm that issues without automatic renewal behave as usual.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 19:23:14 -03:00
Dobrica Pavlinusic
3fa6bf051a Bug 12898 - Z39.50 title search doesn't work with multiple words
This fixes regression introduced by Bug 6536 so that multiple
words in title search will work.

Test scenario:

1. try z39.50 search with more than one word
2. verify that no results apper
3. apply patch and re-run search
4. verify that there are results

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-14 02:02:51 -03:00
3e78a908f0 Bug 10226 - suspended holds still show not available
If you suspend a hold, the item does not show Available.  It still shows
the person next in line, who isn't eligible for the hold yet because of
the suspension.  This is not the case for a delayed hold, where you
originally place the hold and tell it not to start until a future date.
If you do that, it shows as Available.  This is confusing and
inconsistent.

Test Plan:
1) Create an item level suspended hold for a record with no other holds
2) Note in the record details that the hold shows an item level hold
3) Apply this patch
4) Refresh the record details page, note the item is "Available"
5) Optional: prove t/db_dependent/Holds.t t/db_dependent/Reserves.t

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-14 02:02:51 -03:00
Jonathan Druart
a2786c6de7 Bug 12557: Partially received - the change should affect the new order
If the receipt in not on the whole order but only on a part of it, the
change should be done on the itemnumber linked to the "new order", the
one we are reverting.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-09 10:10:22 -03:00
Jonathan Druart
55ca3c5581 Bug 12557: Add a way to revert the changes made on items on receving
Bug 8307 introduces the AcqItemSetSubfieldsWhenReceived pref.
You can now update an item field on receiving (if you create items on
ordering).
But if the receipt is cancel, there is no way to revert these changes.

This patch adds a new pref AcqItemSetSubfieldsWhenReceiptIsCancelled to
allow to revert changes previously done on receiving

Test plan:
0/ Set the AcqCreateItems to 'ordering'
1/ Fill AcqItemSetSubfieldsWhenReceived with o=1 (UNIMARC) or 7=1
(MARC21).
2/ Fill AcqItemSetSubfieldsWhenReceiptIsCancelled with o=2 (UNIMARC) or
7=2 (MARC21)
3/ Create an order with some items
4/ Receive the order and verify the notforloan value is set to 1
5/ Cancel the receipt and verify the notforloan value is set to 2

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-09 10:10:07 -03:00
Jonathan Druart
0965dfcc15 Bug 12833: Patron search should search on extended attributes
Before Bug 9811, the patron search searched on extended attributes.

This patch restore this behavior.

Test plan:
0/ Create a patron attribute PA
1/ Create a patron A (cardnumber CNA) with PA="foo"
2/ Create a patron B (cardnumber CNB) with PA="foo bar"
3/ Search for CNA should redirect on the patron detail page.
4/ Search for "foo" should display the search result with 2 results.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
'Searchable' patron attributes can now be searched for again.
Works as described, passes stests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-09 10:08:59 -03:00
f6b770686f Bug 7817: Follow-up for original patch
This patch removes the commented line for permanent_location.
It adds a more general comment.
Adjusts the exists check on permanent_location.
Adds a reference to bug 12817 that will deal with paidfor similarly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-08 11:42:31 -03:00
Olli-Antti Kivilahti
6069ed645f Bug 7817 - Items Permanent location (shelving location) is set to NULL when item is edited
A quick fix to prevent more damages.
No perceived side-effects so far.

Signed-off-by: David Cook <dcook@prosentient.com.au>

This is actually a perfectly good fix for this issue. I've changed
the explanatory comment to explain why.

Another option would be to remove the 'exists' check in the sub
_do_column_fixes_for_mod(), but this is just as functional.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Detailed comment on Bugzilla.
Adding a small follow-up.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-08 11:42:20 -03:00
b0e5e2c749 Bug 12467 - Lost items marked as not on loan even if they are!
The cronjob longoverdue.pl does not require that an item marked as lost
be returned automatically, but there is a line in ModItem that
automatically marks the item's onloan as false if itemlost is set!

Test Plan:
1) Mark an item as lost with longoverdue.pl, without --mark-returned
2) Inspect the db, note that items.onloan is now 0
3) Apply this patch
4) Mark repeat step 1
5) Inspect the db, noe that items.onloan is still 1
6) Test marking an item as lost from staff interface,
   ensure there are no regressions.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works according to test plan and fixes a data loss bug.

Some notes:
- This patch would be nicer with a regression test.
- Also checked that returning the item removes lost status and onloan still.
- Tried to test with --mark-returned, but couldn't get it to
  return my item neither with nor without the patch. (see comment on
  bug report)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-08 11:34:01 -03:00
ead0d88c74 Bug 12788: (followup) minor optimization with proper tests
This patch removes the $facets_info calculation from the _get_facets_data_from_record
sub so it is not done for each record. It introduces a new sub, _get_facets_info
that is called from the getRecords loop, that does the job only once.

To test:
- Apply on top of the previous patches
- Run
  $ prove -v t/db_dependent/Search.t
=> SUCCESS: _get_facets_info gets tested and it passes for both MARC21 and UNIMARC.
  Facets rendering should remain unchaged on the UI.
- Sign off :-D

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-05 16:38:39 -03:00
eefef42abd Bug 12788: facets calculation should skip 100 if ind1=z
This patch adds a test for field 100, to skip it on facet calculation
if ind1=z.

To test:
- Have IncludeSeeFromInSearches set.
- Create a biblio record, when adding an author, create a new authority record
  that contains a 400$a field (see from).
- Rebuild zebra db.
- Search for the record making sure the search returns more than one record.
=> FAIL: the facets contain the 'see from' field.
- Run
  $ prove -v t/db_dependent/Search.t
=> FAIL: it fails
- Apply the patch
- Run
  $ prove -v t/db_dependent/Search.t
=> SUCCESS: it passes
- Re-run the search, notice the 'see from' doesn't show anymore on the facets.
- Sign off :-D

Edit: minor stylistic change

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-05 16:38:31 -03:00
62d3a286c1 Bub 12788: (regression test) refactor facet extraction code to allow testing
This patch refactors the facet extraction loop into a proper function.
The loop is changed so the MARC::Record objects are created only once
instead of the old/current behaviour: once for each defined facet (in
C4::Koha::getFacets).

To test:
- Apply the patch
=> SUCCESS: verify facets functionality remains unchanged.
- Run:
  $ prove -v t/db_dependent/Search.t
=> SUCCESS: tests for _get_facets_data_from_record fail, because
  100$a is considered for fields with indicator 1=z (field added
  by IncludeSeeFromInSearches syspref).
- Sign off :-D

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-05 16:38:26 -03:00
a8458630a7 Bug 12582 - Control of branch displayed in search results linked to HomeOrHoldingBranch
Some libraries would like the ability choose to display the home branch
on search results while having circulation rules based on the holding
branch. This is currently impossible because both the display of the
branch in search results, and the selection of the home or holding
branch for circulation rules are controlled by the same system
preference: HomeOrHoldingBranch. This preference is described as being
used only for circulation rules, and makes no mention of its use for
display control. The display control should be split off into a separate
preference.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Note the value of the new system preference StaffSearchResultsDisplayBranch
   matches the current value of HomeOrHoldingBranch
4) Set the preference to home branch
5) Perform a staff catalog search with results having items with differing home and
   holding branches.
6) Note the home branch displays
7) Set the preference to holding branch
8) Repeat step 5
9) Note the holding branch displays

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, logic is now tied to a new system preference.
Passes tests and QA script.
2014-09-05 12:15:57 -03:00
3c1f7dae0a Bug 8735 - Expire holds waiting only on days the library is open - Followup - Switch from C4::Calendar to Koha::Calendar
Test Plan:
 1) Set ExpireReservesMaxPickUpDelay
 2) Set ReservesMaxPickUpDelay to 1
 3) Place a hold, set it to waiting
 4) Using the MySQL console, modify the waiting date and set it to the
    day before yesterday.
 5) Set today as a holiday for the pickup branch in question.
 6) Run misc/cronjobs/holds/cancel_expired_holds.pl
 7) The hold should remain unchanged
 8) Remove today as a holiday
 9) Run misc/cronjobs/holds/cancel_expired_holds.pl again
10) The hold should now be canceled

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-05 11:51:01 -03:00
3b092a899f Bug 8735 - Expire holds waiting only on days the library is open
Signed-off-by: Leila <koha.aixmarseille@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-05 11:50:58 -03:00