]> git.koha-community.org Git - koha.git/log
koha.git
10 years agoBug 7518: certain searches with quotation marks don't work
Fridolyn SOMERS [Thu, 7 Mar 2013 15:02:55 +0000 (16:02 +0100)]
Bug 7518: certain searches with quotation marks don't work

Under certain circumstance, a search term without quotation marks
returns the expected results while the same search with a
double quote embedded in it would fail.

Koha should ignore the quotation marks and return results anyway.

This appears when  QueryWeightFields syspref is activated (and
QueryAutoTruncate is off), as field weighting builds a complex CCL
query using double quotes around search words.  This patch simply
replaces double quotes in search words by a space.

Test plan :
- Set QueryAutoTruncate off (you may also need to set QueryFuzzy to off)
- Set QueryWeightFields off
- Perform a serch on two words where you have results, like : centre "ville
=> you get results
- Set QueryWeightFields on
- Perform same serch
=> you get the same results

Signed-off-by: Leila <koha.aixmarseille@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 868855df4b674b495966c022392068c2fdd3a35f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 years agoBug 7518: regression test double-quote in search operand
Galen Charlton [Tue, 17 Dec 2013 16:32:09 +0000 (16:32 +0000)]
Bug 7518: regression test double-quote in search operand

Under certain circumstances, namely where QueryParser is off,
QueryWeightFields is on, and QueryFuzzy and QueryAutoTruncate are
off, a search with a double-quote embedded in it can fail: for
example

    web application

would return results where

    web "application

does not.

This patch adds an automated regression test.

To test:

[1] Apply this patch and run prove -v t/db_dependent/Search.t;
    two tests should fail.
[2] After applying the main patch that fixes the bug, the
    prove -v  t/db_dependent/Search.t should succeed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 437f06624759c464d667107d9f73ec05283f6892)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 years agoBug 11249: DBRev 3.14.02.001
Fridolin Somers [Mon, 27 Jan 2014 11:27:35 +0000 (12:27 +0100)]
Bug 11249: DBRev 3.14.02.001

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 years agoBug 11249: Add Db indexes on borrowers names
Fridolyn SOMERS [Thu, 14 Nov 2013 13:29:51 +0000 (14:29 +0100)]
Bug 11249: Add Db indexes on borrowers names

The borrowers search is by default on columns surname, firstname,
othernames and cardnumber.

(See C4::Members::_express_member_find).

Adding DB indexes will really increase the query speed.

This patch adds DB indexes on surname, firstname, othernames (cardnumber
has already an index).

Those indexes must be defined with a size because columns are mediumtext.

Test plan :
Test with mysql client :
mysql> explain select * from borrowers where surname like 'A%';
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
| id | select_type | table     | type  | possible_keys | key         | key_len | ref  | rows | Extra       |
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
|  1 | SIMPLE      | borrowers | range | surname_idx   | surname_idx | 767     | NULL |  395 | Using where |
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
=> key show the index is used

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, changes from updatedatabase and in kohastructure match.
I think deletedborrowers can be left out, as it's not queried when doing
patron searches. Patron deletes still work as expected.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 19b5c9b4cecf935c1cf17649796debe80ae7b3a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 years agoBug 11277: fix errors with search facet links in Bootstrap theme
Frédéric Demians [Tue, 26 Nov 2013 09:16:41 +0000 (10:16 +0100)]
Bug 11277: fix errors with search facet links in Bootstrap theme

This patch fixes the following rwo errors:

  1. When selecting 'show more' above a facet, the advanced search page
     is displayed.
  2. When restricting search on a library facet, all the biblio records
     of this library are returned.

The patch fixes the way URL are encoded with TT filter. See:

http://search.cpan.org/~abw/Template-Toolkit-2.25/lib/Template/Manual/Filters.pod#url

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works nicely. Tests done:
- 'More' link on facets redirects to advanced search before applying
  the patch. After appyling the link works correctly.
- In my tests, the facet links themselves worked nicely, limiting the
  search as expected.
- Availability search works ok for me with patch applied.
- Also made sure to click on some links containing diacritcts (German
  umlauts).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4e64ea8870cca3715f838ae3b577cb05da2f7879)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 years agoIncrement version for 3.14.2 release v3.14.02
Fridolin SOMERS [Thu, 23 Jan 2014 17:57:00 +0000 (18:57 +0100)]
Increment version for 3.14.2 release

Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoMerge remote-tracking branch 'translator/3.14.02-translate' into 3.14.x
Fridolin SOMERS [Thu, 23 Jan 2014 17:52:32 +0000 (18:52 +0100)]
Merge remote-tracking branch 'translator/3.14.02-translate' into 3.14.x

10 years agoUpdate release notes for 3.14.2 release
Fridolyn SOMERS [Thu, 23 Jan 2014 17:45:09 +0000 (18:45 +0100)]
Update release notes for 3.14.2 release

Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoTransaltion updates for 3.14.02 release
Bernardo Gonzalez Kriegel [Wed, 22 Jan 2014 04:01:12 +0000 (01:01 -0300)]
Transaltion updates for 3.14.02 release

10 years agoBug 8018: DBRev 3.14.00.005
Fridolin SOMERS [Thu, 16 Jan 2014 16:55:10 +0000 (17:55 +0100)]
Bug 8018: DBRev 3.14.00.005

Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8018: (follow-up) fixing some wrong capitalization
Katrin Fischer [Mon, 23 Dec 2013 18:49:14 +0000 (19:49 +0100)]
Bug 8018: (follow-up) fixing some wrong capitalization

Fixes capitalization in 2 places:

- Delete a subfield - Yes/No options
- Edit a subfield - Edit subfield

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3b9d8074b85b7d06c555491a75a48ac751560ec2)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8018: (followup) make the default more explicit
Tomas Cohen Arazi [Thu, 12 Dec 2013 15:24:11 +0000 (12:24 -0300)]
Bug 8018: (followup) make the default more explicit

This patch:
- Makes the new subfield tab show maxlength=9999 as default (instead of
  empty-then-zero).
- Updates the help to make exlpicit that 0 or empty defaults to 9999.
- Assumes all the subfields created with maxlength=0 inadvertedly are
  meant to mean "no limit" and hence update the database to reflect
  that.

To test (this patch and Pablo's):
- Edit a MARC framework, edit some field's subfields.
- Use the 'New' tab to create a new subfield (choose an unused letter).
- See in "More constrains" that the "Max length" field is empty. Leave
  it as-is.
- Save the changes (the new subfield).
- Edit the field again, verify that "Max length" is 0.
- Try tu use the framework and the the field/subfield just created
  > FAIL
- Apply the patches, upgrade
- Try to use the framework/field/subfield > SUCCESS (0 was converted to
  9999)
- Repeat from the begining, "Max length" should show 9999 on the new
  subfield tab.
- Leave it empty, it is saved as 9999.

Edit: small typo

Sponsored-by: Universidad Nacionald de Cordoba
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests in t and xt.
Tested:
- deleting an existing subfield
- adding a new subfield with new default 9999
- editing the new subfield, changing value to 8888
- deleting new subfield
- adding new subfield, using 8888 as length

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit b5eab7c20bb8c2d07966bf1f68eaf0a7f953222e)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Conflicts:
installer/data/mysql/updatedatabase.pl

10 years agoBug 8018: MARC framework max subfield length should default to 9999
Pablo Bianchi [Wed, 11 Dec 2013 18:54:54 +0000 (15:54 -0300)]
Bug 8018: MARC framework max subfield length should default to 9999

The default value for the marc_subfield_structure.maxlenght is 9999
in the DB. Currently the template passes an empty value which is casted to
0 by the CGI.

This simple patch validates the input and converts to the default (9999)
if not defined or 0.

Another approach could be changing the 9999 default and/or treating 0 as
'no-limit'.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works by defaulting 0 or "" to 9999.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1ebbf40ecc07b9474e81e20ec1598659ab027d7a)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11419: display Z39.50 search errors more completely
Kyle M Hall [Wed, 18 Dec 2013 19:44:53 +0000 (14:44 -0500)]
Bug 11419: display Z39.50 search errors more completely

When a z39.50 server isn't able to be searched successfully, the yellow
error box came up empty.  This patch fixes the problem.

Test Plan:
1) Go to Administration/z39.50 servers
2) Create a fake z39.50 server with a made up address
3) Go to cataloging, search only that server
4) Note the empty yellow alert box
5) Apply this patch
6) Re-run the search, not the alert box has a message in it now

Signed-off-by: Nora Blake <nblake@masslibsystem.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Works according to test plan.
When one of the selected servers gives result no dialog
box is shown before and after applying the patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0fc114eee3f649abea88a62502211c595c2867b8)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11439: (follow up) add missing rollback call
Tomas Cohen Arazi [Thu, 9 Jan 2014 18:51:11 +0000 (15:51 -0300)]
Bug 11439: (follow up) add missing rollback call

This UT got wrapped inside a transaction with autocommit=0 but
the rollback call was inadvertedly ommited. Adding it.

[RM note: an explicit rollback is not required, as the
 transaction will roll back automatically at the end of
 the DB session. Nonetheless, it hurts nothing to have
 it be explicit.]

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d6979f71a3f0d8ba2dc82d378ca903527f0d6ab9)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11439: UT: Improve XISBN.t
Jonathan Druart [Tue, 24 Dec 2013 09:11:32 +0000 (10:11 +0100)]
Bug 11439: UT: Improve XISBN.t

The tests should be executed into a transaction and the SimpleSearch
routine correctly mocked.

Test plan:
Verify that prove t/db_dependent/XISBN.t returns green.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0d71139fff68523beee3f14ea26e0d670eb7c409)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11439: UT: fix XISBN.t test failure
Jonathan Druart [Tue, 24 Dec 2013 09:09:10 +0000 (10:09 +0100)]
Bug 11439: UT: fix XISBN.t test failure

A unit test fails in t/db_dependent/XISBN.t, the get_xisbn routine, if
ThingISBN is enabled, returns the 3rd biblionumber, not the second one.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 81133cf2c2238aaff3b3594b95211c689d2dae61)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11338: (follow-up) take IndependentBranches into account for DelItemCheck() test
Galen Charlton [Fri, 27 Dec 2013 00:12:41 +0000 (00:12 +0000)]
Bug 11338: (follow-up) take IndependentBranches into account for DelItemCheck() test

Fixes a test failure if the test database happens to have
IndependentBranches set to true.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit cea5f944a961ae99b73480290556d76733b415ca)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11412: fix potential bulkmarcimport crash when searching for duplicates in author...
Matthias Meusburger [Wed, 18 Dec 2013 10:20:05 +0000 (11:20 +0100)]
Bug 11412: fix potential bulkmarcimport crash when searching for duplicates in authorities

bulkmarcimport.pl can crash when searching for duplicates if the 005
field from the incoming or local record is not defined. This patch
fixes it.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Test plan
1/ Create a record with no 005 field
2/ Try to import it checking for duplicates, notice it crashes
3/ Try with a record with a 005 field, but the one in Koha missing
one, still crashes
4/ Apply patch
5/ No more crash

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Patch fixes the problem described for importing authorities
with the bulkmarcimport.pl when trying to match with existing
records.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 28d97e322805a42680527232b151754b4778aed8)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11282: fix overwriting of existing restrictions when adding new one
Kyle M Hall [Fri, 22 Nov 2013 13:31:31 +0000 (08:31 -0500)]
Bug 11282: fix overwriting of existing restrictions when adding new one

This patch fixes a bug where using the patron editor to add a new
restriction overwrote the first existing one.

Test Plan:
1) Edit a patron, add a restriction
2) Edit the patron again, add a second restriction
3) Note the first restriction has disappeared!
4) Apply this patch
5) Edit the patron again, add another restriction
6) Note the previous restriction is not longer removed

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested:
- Adding and removing multiple restrictions from
  - the details tab
  - the checkouts tab
  - the edit patron form
All works as expected.
Patch passes all tests in t, xt, and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f35fa3d4541a83e8cafeaf5f396e4aacc684e63f)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11535: sanitize input from patron self-registration form
Galen Charlton [Mon, 13 Jan 2014 21:51:56 +0000 (21:51 +0000)]
Bug 11535: sanitize input from patron self-registration form

This patch adds the use of C4::Scrubber to the processing of input
from the patron self-registration form, thereby closing off one
avenue for Javascript injection.

To test:

[1] Use the OPAC self-registration form to enter a new patron,
    and set its address to something like:

    <span style="color: red;">BAD</span>

[2] In the staff interface, bring up the new patron record.  The
    address will show up in red, indicating a successful HTML
    injection.
[3] Apply the patch and use self-registration to enter a new
    patron with a similar case of unwanted HTML coding.
[4] Bring up the second patron in the staff interface.  This time,
    the undesirable HTML tag should not be present.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tags are not present on testing.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed bug and that the patch fixes it.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5c3f36279b93e13be4773c7b88df39c99f8b2aca)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10453: fix unintended password reset when updating child to adult
Jonathan Druart [Tue, 24 Dec 2013 13:35:36 +0000 (14:35 +0100)]
Bug 10453: fix unintended password reset when updating child to adult

ModMember supposes the password given in parameter is the
password string, so if it receives the encrypted password,
it will encrypt it again! By simply deleting the password key
from the hash, ModMember leaves the password unchanged.

Test plan:
1/ Create or choose a child patron
2/ Update it to an adult category using the
   "Update child to adult patron" link
3/ Try to log in at the OPAC with this patron: It is not
   possible, the password has changed
4/ Apply the patch and try again previous steps

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed the problem and tested the patch fixes it.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3c5b4712717d082b66376915c47b6b5880695d31)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11252: remove deprecated -munge-config switch from rebuild_zebra.pl
Galen Charlton [Thu, 14 Nov 2013 18:48:07 +0000 (18:48 +0000)]
Bug 11252: remove deprecated -munge-config switch from rebuild_zebra.pl

The -munge-config switch has been deprecated for years, and
trying to use it would either not work at all or, if it did "work",
almost certainly damage one's Zebra configuration for Koha.

This patch removes this switch.

To test:

[1] Run rebuild_zebra.pl and verify that no mention is made
    of -munge-config.
[2] Run rebuild_zebra.pl to index records in one's test database
    and verify that there are no regressions.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Removing a really dangerous option

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Ran rebuild_zebra.pl with various options and confirmed
that data was reindexed successfully.
No regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit b26870e53dc1b00e2966187b9b5298360af6024e)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11338: prevent deletion of items that are captured for holds
Fridolyn SOMERS [Wed, 4 Dec 2013 16:05:32 +0000 (17:05 +0100)]
Bug 11338: prevent deletion of items that are captured for holds

In C4::Items::DelItemCheck, there are two SQL queries: one to check
if item is on loan, the other if item is reserved.

Those two queries use "SELECT * FROM table", fetch the data with
"$var = $sth->fetchrow", and use "$var" as a boolean condition.

This is not correct, SQL query should be "SELECT COUNT(*) FROM table".

As a consequence, it was possible to delete an item without warning to
the operator even if it was waiting on the hold shelf or in transit to
fill a hold.

This patch corrects the SQL queries and sets my ($var) to show that
fetchrow returns an array.

Test plan :
- Set an item A onloan
- Set an item B reserved and the reserve waiting
- Go to items cataloguing : cgi-bin/koha/cataloguing/additem.pl?biblionumber=XXX
- Try to delete item A
=> You get an alert and item is not deleted
- Try to delete item B
=> You get an alert and item is not deleted

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Works, and has the added bonus of being a tiny bit faster.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes t, xt and QA script tests.
Also tried deleting via batch delete - correct warnings are displayed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d000a716352fb61dc0dae7715eda15896b53b4e7)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11338: add unit tests for DelItemCheck
Galen Charlton [Wed, 25 Dec 2013 17:07:53 +0000 (17:07 +0000)]
Bug 11338: add unit tests for DelItemCheck

This patch adds unit tests for two parts of DelItemCheck: checking
if the item is on loan, and checking if it is waiting on the hold
shelf.

To test:

[1] Verify that prove -v t/db_dependent/Circulation/IsItemIssued.t
    is successful.
[2] Verify that prove -v t/db_dependent/Reserves.t is *not*
    successful -- as it turns out, there was a latent bug where items
    waiting on the hold shelf or in transit to fill a hold could still
    be deleted without any warning.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 18888359b6744a1e65e34649c927e7c146f628f8)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11004: Make xmlControlfield.js use the marcflavour syspref to look for XML files
Magnus Enger [Mon, 7 Oct 2013 13:14:08 +0000 (15:14 +0200)]
Bug 11004: Make xmlControlfield.js use the marcflavour syspref to look for XML files

Currently, xmlControlfield.js is hard coded to look for XML files for
MARC21:

  url: this.themelang + "/data/marc21_field_" + this.tagfield + ".xml",

This patch makes this code use the value from the marcflavour syspref,
as a preparation for making the NORMARC value builders use the XML
technique employed by the MARC21 value builders for 006 and 008.

To test:
- Make sure you have a MARC21 installation
- Set marcflavour = NORMARC
- Go to Cataloguing and start a new record with the default framework
- Open the value builders for 006 and 008 and observe that they still work, showing
  the coded values for MARC21
- Apply this patch
- Check the value builders for 006 and 008 and observe that you get a truncated view
  with an empty "Select a type of material" dropdown
- Use e.g. the Net console in Firebug to observe requests to
  http://localhost/intranet-tmpl/prog/en/data/normarc_field_008.xml
  that result in a 404 status
- Set marcflavour = MARC21
- Observe that the value builders for 006 and 008 are now fully working
- 006 and 008 should be the only value builders affected by this change, since
  they are the only ones using xmlControlfield.js, but please also verify that
  other value builders are still working as expected

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3ec4a02418a9c3372c590b8eb614e8c6466ff45e)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10834 - Add Sort 1 and Sort 2 to list of searchable patron fields
Kyle M Hall [Fri, 6 Sep 2013 16:54:40 +0000 (12:54 -0400)]
Bug 10834 - Add Sort 1 and Sort 2 to list of searchable patron fields

Some libraries would like to be able to search on the sort1 and sort2
fields of patron records.

Test Plan:
1) Apply this patch
2) Add various values for sort1 and sort2 some patrons
3) Browse to members-home.pl
4) Run searches on sort1 and sort2

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 53c4129027f7d996c763da31303173c8b134a67a)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 9940: (follow-up) add language-original to QP search field list
Galen Charlton [Wed, 25 Dec 2013 15:49:48 +0000 (15:49 +0000)]
Bug 9940: (follow-up) add language-original to QP search field list

This patch adds language-original to the list of search fields
recognized by QueryParser.

To test:

[1] After doing the tests in the main patch, copy the configuration
    file etc/searchengine/queryparser.yaml into place, turn on the
    UseQueryParser system preference, and verify that searching on
    language-original still works.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e4912a20f9b6f59fb57955777abd1e62d785a1fd)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 9940: (follow-up) FIX comment: language-original is 101$c, not $h
Jonathan Druart [Tue, 24 Dec 2013 10:27:52 +0000 (11:27 +0100)]
Bug 9940: (follow-up) FIX comment: language-original is 101$c, not $h

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a573ac1fa8edd13535e2f785750fc5b5f61686aa)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 9940: Add a new index for the original language of a document
Mathieu Saby [Sun, 28 Apr 2013 12:44:21 +0000 (14:44 +0200)]
Bug 9940: Add a new index for the original language of a document

It could be useful to index the original language of a document (i.e.
"fre" for the English translation of a French novel).

This patch renames the Bib-1 use attribute 1095 from
Code-language-original to language-original and uses it to index:

- MARC21 041$h subfield
- UNIMARC 101$c subfield

It adds "language-original" in the list of index in Search.pm.

Test plan :
A. in a MARC21 GRS1 environment
1. Copy Zebra config files (zebradb/biblios/etc/bib1.att,
   zebradb/ccl.properties, marc_defs/marc21/biblios/record.abs) from
   your source etc/ directory to your main koha etc/ directory
2. Reindex zebra
3. Make some searches, like "language-original:fre"
B. in a MARC21 DOM environment
4. Copy Zebra config files (zebradb/biblios/etc/bib1.att, zebradb/ccl.properties,
   marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl) from your source etc/
   directory to your main koha etc/ directory
5. Reindex zebra
6. Make some searches, like "language-original:fre"
C. in a UNIMARC GRS1 environment
7. Copy Zebra config files (zebradb/biblios/etc/bib1.att,
   zebradb/ccl.properties, marc_defs/unimarc/biblios/record.abs) from
   your source etc/ directory to your main koha etc/ directory
8. Reindex zebra
9. Make some searches, like "language-original:fre"
A. in a UNIMARC DOM environment
10. Copy Zebra config files (zebradb/biblios/etc/bib1.att,
    zebradb/ccl.properties, marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl)
    from your source etc/ directory to your main koha etc/ directory
11. Reindex zebra
12. Make some searches, like "language-original:fre"

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 451f67c05593461d2756a161032c39113d282c25)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 6331: DBRev 3.14.01.004
Fridolin SOMERS [Fri, 3 Jan 2014 08:47:30 +0000 (09:47 +0100)]
Bug 6331: DBRev 3.14.01.004

Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 6331: (follow-up) update DBIC schema classes
Galen Charlton [Mon, 23 Dec 2013 16:39:58 +0000 (16:39 +0000)]
Bug 6331: (follow-up) update DBIC schema classes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e4f846a866d24779ff18634bd1da2e0c00086fe4)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Conflicts:
Koha/Schema/Result/Deleteditem.pm

10 years agoBug 6331: (follow-up) update timestamp when deleting items
Fridolyn SOMERS [Thu, 5 Dec 2013 14:34:44 +0000 (15:34 +0100)]
Bug 6331: (follow-up) update timestamp when deleting items

When item is transfered from items table to deleted items, all fields
must be copies but "timestamp".

This value must be updated to know when the item was deleted.

Test plan:
- Look a an item timestamp :
mysql> select timestamp from items where itemnumber = 2690;
+---------------------+
| timestamp           |
+---------------------+
| 2011-09-09 15:30:21 |
+---------------------+
1 row in set (0.00 sec)
- Delete this item in cataloguing module
- Check it is not in items table anymore :
mysql> select timestamp from items where itemnumber = 2690;
Empty set (0.00 sec)
- Look in deleteditems table :
mysql> select timestamp from deleteditems where itemnumber = 2690;
+---------------------+
| timestamp           |
+---------------------+
| 2013-12-05 15:33:20 |
+---------------------+
1 row in set (0.00 sec)
=> timestamp as been set to actual date/time

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Patch set passes koha-qa.pl, works as advertised!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit cada676ef3439d2567fa21da415d939f0fc22ee6)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 6331: (follow-up) do not populate deleteditems.marc
Colin Campbell [Tue, 3 Dec 2013 11:39:43 +0000 (11:39 +0000)]
Bug 6331: (follow-up) do not populate deleteditems.marc

This is supplementary to the main patch for
bug 6331. Having removed the attribute marc from
items DelItem, we should not try to populate it.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2249ee1216ed004e61a34bc821d216f3471ef87b)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 6331: remove obsolete column deleteditems.marc
Fridolyn SOMERS [Wed, 20 Nov 2013 13:42:04 +0000 (14:42 +0100)]
Bug 6331: remove obsolete column deleteditems.marc

There is a difference between "items" and "deleteditems" tables
in "kohastructure.sql"
"deleteditems" has a field "marc" not existing in "items".

This patch removes this obsolete column.

Test :
- after deleting an item, check that the deleted item is properly
  stored in deleteditems table
- check that the column marc has been deleted from deleteditems table

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e1fb1a658c89ef1356d3b42e264efed71cf81f9f)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11391: DBRev 3.14.01.003
Fridolin SOMERS [Fri, 3 Jan 2014 08:34:04 +0000 (09:34 +0100)]
Bug 11391: DBRev 3.14.01.003

Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11391: (follow-up) update DBIC schema classes
Galen Charlton [Fri, 13 Dec 2013 01:11:06 +0000 (01:11 +0000)]
Bug 11391: (follow-up) update DBIC schema classes

This patch updates the DBIC schema class for Suggestion
to reflect the dropped default value for the suggesteddate
column.

To test:

[1] Create an empty Pg database and use the deployment script
    being worked in in bug 11390.  The deployment shoudl
    succeed without reporting any errors regarding the
    suggestions table.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d540016b19bc35e56733e3d2bb36a04bc038e420)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11391: drop default value on suggestions.suggesteddate column
Galen Charlton [Fri, 13 Dec 2013 01:06:12 +0000 (01:06 +0000)]
Bug 11391: drop default value on suggestions.suggesteddate column

The 'default 0' clause got translated as an invalid constant
default of '0000-00-00' when DBIx::Schema is used to deploy
the suggestions table into a Pg database.  This patch drops
the default.

To test:

[1] Apply the patch and run the SQL specified in the database
    updated.
[2] Verify that the suggestions table no longer has an
    explicit default value for the suggesteddate column.
[3] Verify that prove -v t/db_dependent/Suggestions.t
    passes.
[4] Verify that installer/data/mysql/kohastructure.sql runs
    cleanly in an empty database.
[5] Verify that there are no visible regressions of the
    purchase suggestions functionality.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Having a default of 0 on a date seems like a mad thing to do anyway,
so good to get rid of it

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a6b2f6a16175229ba603ed65cfeaf4e0c0a525ce)

10 years agoBug 11384: DBRev 3.14.01.002
Fridolin SOMERS [Fri, 3 Jan 2014 08:26:30 +0000 (09:26 +0100)]
Bug 11384: DBRev 3.14.01.002

Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11384: (follow-up) update DBIC schema classes
Galen Charlton [Wed, 11 Dec 2013 16:55:31 +0000 (16:55 +0000)]
Bug 11384: (follow-up) update DBIC schema classes

This patch updates the DBIC schema class for CollectionTracking
to reflect the new name of its primary key column.

To test:

The CollectionTracking class is not currently used, but
if you *really* want to test this, take a look at the following
branch: http://git.librarypolice.com/?p=koha-galen.git;a=shortlog;h=refs/heads/pg

Then, set up a PostgreSQL database, update koha-conf.xml to point to it,
then run pg/deploy and verify that the collections_tracking table is created
in the Pg database.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7a52759b0f1f48661d357a0738cb68f6cb17edae)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11384: rename the collections_tracking.ctId column
Galen Charlton [Wed, 11 Dec 2013 16:49:01 +0000 (16:49 +0000)]
Bug 11384: rename the collections_tracking.ctId column

'ctId' as a column name conflicts with one of the system
columns that PostgreSQL uses for each table, and consequently
needs to be renamed to enable deploying the schema to a Pg
database.  This patch makes this change.

To test:

[1] Apply the patch and run the SQL specified in the database
    updated.
[2] Verify that the collections_tracking table no longer has
    a ctId column, but now has collections_tracking_id.
[3] Verify that prove -v t/db_dependent/RotatingCollections.t
    passes.
[4] Verify that installer/data/mysql/kohastructure.sql runs
    cleanly in an empty database.

This patch does not affect user-visible behavior given the fact
that the rotating collections feature is currently disabled.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5f015d050281a676670b592831f5b1bd11c81f47)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Conflicts:
installer/data/mysql/updatedatabase.pl

10 years agoBug 11155: remove old PostgreSQL schema and MARC framework scripts
Galen Charlton [Fri, 13 Dec 2013 01:29:09 +0000 (01:29 +0000)]
Bug 11155: remove old PostgreSQL schema and MARC framework scripts

This patch removes the legacy Pg schema and MARC framework scripts
as they're out of date.  They will be replaced by use of DBIx::Class
to deploy the schema.  Loading the sample data and settings will be
accomplished either by making the current scripts in installer/data/mysql
DBMS-independent (or, at least, able to be processed by both MySQL and Pg),
converting them to flat text files and writing code to load them, or a
combination of the two approaches.

To test:

[1] Verify that installer/data/Pg is removed.  There is some code
    in C4::Installer that refers to that directory, but it cannot
    be reached through normal means.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 458ef35a6a5c7da5523e8c1c208fdf3fee5ae4b6)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 9948: fix creation/updating of items when partially receiving an order
Jacek Ablewicz [Sat, 14 Dec 2013 11:07:11 +0000 (12:07 +0100)]
Bug 9948: fix creation/updating of items when partially receiving an order

Problem summary: when doing partial receives for the given order -
1) if AcqCreateItem is set to 'ordering', various item data (price,
dateaccessioned, replacementprice, replacementpricedate) are getting
erroneously updated on the wrong (yet to be received == not the ones
being currently received) item records
2) if AcqCreateItem is set to 'receiving', newly received
item records are being created without the aforementioned fields
set to the proper values

This (trivial) patch should deal with both cases, hopefully without
breaking enything else.

To test:
- apply the patch,
- create some orders with 2+ quantity
- test partial & non-partial receives for those orders
- ensure the received item records are getting modified
(for AcqCreateItem set to 'ordering') and/or created (for AcqCreateItem
set to 'receiving') correctly for both partial and non-partial receives
- receiving orders with quantity = 1 / receiving orders in non-partial
mode should be still working fine for 1) & 2) scenarios (i.e.,
AcqCreateItem set to 'ordering' / AcqCreateItem set to 'receiving')

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Works as I'd expect now! Awesome patch.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Also: t/db_dependent/Acquisition/
      t/db_dependent/Acquisition.t

Created 2 orders with 3 items each for both settings
of AcqCreateItem (on receive, on order) with the patches
applied. No regressions found.

Closed baskets and received shipments for each, with
AcqCreateItem set according to how the order was created.

First recreated the problem without the patches, reloaded
database and confirmed that the patch fixes it.

No problems found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 95e2754af6a2dbd5f042a1c3504488f5de8c8d23)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10735: prevent koha-dump from aborting if backupdir undefined
Robin Sheat [Tue, 19 Nov 2013 02:26:02 +0000 (15:26 +1300)]
Bug 10735: prevent koha-dump from aborting if backupdir undefined

Older versions of Koha didn't have <backupdir>...</backupdir> defined in
koha-conf.xml. The koha-dump script is aware of this, and checks to see
if it's there. However, if it's not, xmlstarlet returns a non-0 error
code which causes the script to abort due to running under set -e.

Test plan:
 * Remove backupdir from koha-conf.xml
 * Run koha-dump, notice that it doesn't do backups
 * Apply patch
 * Run koha-dump again, notice that it does do backups

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The fallback method works as described. It might be made more robust
like checking for dir existence (thinking of older instances upgrades).
But it certainly belongs to another bug report.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
As Tomas said, it would be better to alert the user if the backupdir tag
does not exist (or contains a nonexistent directory) in the config file.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 266f2a3a9f3d67fed0e0b35d267419a901345b92)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10905: fix links to author tracings when UseAuthoritiesForTracings is on
Tomas Cohen Arazi [Tue, 17 Sep 2013 18:14:20 +0000 (15:14 -0300)]
Bug 10905: fix links to author tracings when UseAuthoritiesForTracings is on

Quotation marks in MARC21slim2OPACDetail.xsl break author tracings in
OPAC.  This patch fixes that for the prog theme; the Bootstrap theme
is not affected.

To reproduce:
- Enable UseAuthoritiesForTracings
- Search in the OPAC and go to the detail page of a record that has
  links to authorities.
- Click on the magnifier icon
- You get a 404 error page.

To test the fix:
- Apply the patch
- Search in the OPAC and go to the detail page of a record that has
  links to authorities.
- Click on the magnifier icon
- You are sent to the corresponding authority record.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: David Noe <drnoe@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, trivial change

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit bc7071f3705bc43878975efadd9c0c0067c6ad37)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10797: Move styling of simple search from element to CSS file
Katrin Fischer [Wed, 4 Dec 2013 14:41:39 +0000 (15:41 +0100)]
Bug 10797: Move styling of simple search from element to CSS file

This patch moves the styling of the #transl1 element from an
inline style attribute to the CSS file to make it easier to
tweak.

To test:
- Switch to prog theme, problem doesn't exist in Bootstrap theme
- Take a look at the simple search input field
- Apply patch
- Refresh page
- Make sure field has the same length and size

You can also use Firebug to make sure the same styles
are applied to the element before and after the change.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7f74d5909f790d08bdbd0ca11f1bc280bf197b9b)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11410: ensure cataloging search finds results for searches with ampersands
Kyle M Hall [Tue, 17 Dec 2013 21:04:10 +0000 (16:04 -0500)]
Bug 11410: ensure cataloging search finds results for searches with ampersands

When QueryParser is off, the cataloging search is passing the incorrect
variable to SimpleSearch.  I'm sure this is causing other issues, but
the one I have identified is that any searches with an "&" in them
return no results.  This patch corrects the bug.

Test Plan:
1) Catalog a new record titled "Cats & Dogs"
2) Rebuild your zebra index so this record is indexed
3) Browse to cataloguing/addbooks.pl
4) Search for "Cats & Dogs"
5) Notice you get no results
6) Apply this patch
7) Repeat the search
8) Notice your result now shows up!

Signed-off-by: Heather Braum <hbraum@nekls.org>
Signed-off-by: Suzanne Fayle <sfayle@roseman.edu>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works as described, passes all tests and QA script.
Note: Because $query = $builtquery when the QueryParser is used,
this problem is only visible when UseQueryParser is set to "Don't try".

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2a4e193c242372f488892591a72752dfd4ffb138)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11383: Add help file for MARC modification templates
Nicole C. Engard [Sat, 14 Dec 2013 18:34:00 +0000 (12:34 -0600)]
Bug 11383: Add help file for MARC modification templates

This patch adds the missing help files to the MARC modification
templates tool. To test:

* Visit Tools > Marc modification templates
* Click 'Help' in the top right
* Confirm that help is there and right

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 94690b264b6316da3da63b9544cf4a396bad0c43)

10 years agoBug 11166: make library filter in funds administration page more precise
Fridolyn SOMERS [Wed, 30 Oct 2013 09:28:49 +0000 (10:28 +0100)]
Bug 11166: make library filter in funds administration page more precise

In funds administration, admin/aqbudgets.pl, there is a combobox for
filtering by library code.

The bug is that the filter uses a pattern match  instead of equals :
  next unless $budget->{budget_branchcode} =~ m/$filter_budgetbranch/;

In this case, if there is a library with code '1' and one with code '12',
filtering by library '1' will also show funds of library '12'.

Test plan :
- Create a library with code '1' and one with code '12'
- Create funds in both libraries
- Go to admin/aqbudgets.pl
- Filter by branch '12'
=> You see only funds of this library
- Filter by branch '1'
=> You see only funds of this library

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 484d1490925d736f99a430a6933c96e42ea4e768)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10626: (follow-up) replace use of KohaAuthorisedValues in the Bootstrap theme
Galen Charlton [Fri, 20 Dec 2013 04:22:20 +0000 (04:22 +0000)]
Bug 10626: (follow-up) replace use of KohaAuthorisedValues in the Bootstrap theme

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e334aed702634b8c73aa28c467b585202c7ab117)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Conflicts:
koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc

10 years agoBug 10626: (follow-up) remove final invocation of KohaAuthorisedValues
Katrin Fischer [Sat, 7 Sep 2013 17:43:57 +0000 (19:43 +0200)]
Bug 10626: (follow-up) remove final invocation of KohaAuthorisedValues

Removes USE KohaAuthorisedValues plugin from
item-status-schema-org.inc as it does not seem to be used
in the file.

Couldn't detect regressions removing it on OPAC detail page.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0c19c582187f59eda19b2b97865d0d5a3b13a8dd)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10626: (follow-up) replace an instance of KohaAuthorisedValues
Kyle M Hall [Tue, 27 Aug 2013 17:12:11 +0000 (13:12 -0400)]
Bug 10626: (follow-up) replace an instance of KohaAuthorisedValues

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Trying to write my own test plan here:

1) AllowNotForLoanOverride = Allow
   Mark single item not for loan and try to check it out.
   Check item not for loan status shows up correctly in message:
   Item is normally not for loan (Staff Collection). Check out anyway?

2) Toggle AllowNotForLoanOverride = Not Allow
   Try to check out your not for loan item again.
   Message has changed, but not for loan status should still show:
   Item not for loan (Staff Collection).

3) Check out item that is marked damaged.
   Check damaged status shows correctly in list of checkouts.

4) Mark item as lost and check it out.
   Check lost status shows up correctly in message:
   This item has been lost with a status of "Lange überfällig (Verloren)".

5) Create your own custom SUGGEST_STATUS and check that it shows
   up correctly on the suggestion page.

6) Test item status show up correctly on OPAC detail page (lost, not
   for loan, damaged, etc). Requires follow-up patch to be applied.

7) Mark a suggestion with your custom status and make sure it shows
   up in the patron account in OPAC correctly.

Passes tests and QA script - needs a follow up for item-status-schema-org.inc.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0958ec11ce00a6274e8257ddb5cd2f2539b9069a)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10626: Remove doubled up TT plugins - Merge KohaAuthorisedValues and AuthorisedValues
Kyle M Hall [Thu, 19 Dec 2013 17:13:23 +0000 (12:13 -0500)]
Bug 10626: Remove doubled up TT plugins - Merge KohaAuthorisedValues and AuthorisedValues

This patch removes the KohaAuthorisedValues TT plugin; uses of it are
replaced by the AuthorisedValues plugin, which does the same thing.

Test Plan:
1) Apply this patch
2) View the pages that this patch has modified, make sure the branch
   name is still visible

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit b5b3d4c403f3df91578a3d49ed15811cd1386e52)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10626: (follow-up) replace another use of KohaBranchName
Kyle M Hall [Tue, 27 Aug 2013 17:14:12 +0000 (13:14 -0400)]
Bug 10626: (follow-up) replace another use of KohaBranchName

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
To test:
Make sure
- independentbranches is turned on
- Your user doesn't have superlibrarian permission
Then
- Try to check out an item with home and holding branch !=
  logged in branch

Patch works alright.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4a7bb58b1daf5edc47581f17b3dfef1e7beac601)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10626 - Remove doubled up TT plugins - Merge KohaBranchName and Branches
Kyle M Hall [Tue, 23 Jul 2013 13:52:08 +0000 (09:52 -0400)]
Bug 10626 - Remove doubled up TT plugins - Merge KohaBranchName and Branches

Looking at the TT plugin directory I notice we have some plugins that
seem to do the same thing:

KohaBranchName.pm
Branches.pm

This patch drops KohaBranchName in favor of Branches

Test Plan:
1) Apply this patch
2) View a basket group, note the branch name is displayed
3) View a subscription's details, note the branch name is displayed
4) View suggestions, note the branch names are displayed
5) Return an item that needs transfered, note the branch name is displayed
6) Run 'prove t/db_dependent/Koha_template_plugin_Branches.t'

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Also tested with a branch name with umlauts.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6000bfdf87db3f7f43feb21efd3cac8b7de9c048)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10852: (follow-up) update the POD for C4::Serials::SearchSubscriptions
Galen Charlton [Sat, 14 Dec 2013 00:33:25 +0000 (00:33 +0000)]
Bug 10852: (follow-up) update the POD for C4::Serials::SearchSubscriptions

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 945dbfc490e7bc8849f7b5f741856131c765cc75)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10852: (follow-up) regression tests
Galen Charlton [Sat, 14 Dec 2013 00:24:06 +0000 (00:24 +0000)]
Bug 10852: (follow-up) regression tests

This patch adds regression tests for the changes to
C4::Serials::SearchSubscriptions().

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 659ac6a904dbfe9c5e535963a4717fd183ffb7e6)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10852: (follow-up) fix POD for C4::Serials::NewSubscription
Galen Charlton [Sat, 14 Dec 2013 00:21:48 +0000 (00:21 +0000)]
Bug 10852: (follow-up) fix POD for C4::Serials::NewSubscription

The error in the POD was discovered in the course of writing
test cases for the main patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8a5ce95916fad6f73b8d5be2908ead65b78a7f2f)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10852: (follow-up) tweak wording of serials search form
Galen Charlton [Sat, 14 Dec 2013 00:10:46 +0000 (00:10 +0000)]
Bug 10852: (follow-up) tweak wording of serials search form

* "Callnumber" => "Call number"
* "Expire before" => "Expires before"

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c88d7d831877895cc74c5bf90730530a65cc9f98)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10852: (follow-up) switch from KohaAuthorisedValues to AuthorisedValues
Kyle M Hall [Fri, 13 Dec 2013 20:34:17 +0000 (15:34 -0500)]
Bug 10852: (follow-up) switch from KohaAuthorisedValues to AuthorisedValues

Bug 10626 will remove the KohaAuthorisedValues plugin and keep the
AuthorisedValues plugin.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 28e4a4a69946c3e30c054467ca3465e835841aac)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10852: (follow-up) rename the "expiration date" filter name
Jonathan Druart [Wed, 4 Dec 2013 13:42:22 +0000 (14:42 +0100)]
Bug 10852: (follow-up) rename the "expiration date" filter name

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d20489c874fb62415ad0aa9489aa07817d5a7091)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10852: serials search improvements
Jonathan Druart [Tue, 20 Aug 2013 13:06:08 +0000 (15:06 +0200)]
Bug 10852: serials search improvements

This patch adds 3 filters for the serials search:
- location
- callnumber
- expiration date

To test:
- Search serials by location and/or callnumber and/or expiration date
  and check that results are consistent.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4651bbff213996c3c1e9364855de02de568596f4)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoRevert "Bug 8230: Display acquisition details on the catalogue detail page"
Fridolin SOMERS [Mon, 30 Dec 2013 08:49:01 +0000 (09:49 +0100)]
Revert "Bug 8230: Display acquisition details on the catalogue detail page"

This reverts commit 72aad868b2385d60ec59cab045aeda133a233435.

10 years agoRevert "Bug 8230: (follow-up) reflect the fact that order statuses are now alphabetic...
Fridolin SOMERS [Mon, 30 Dec 2013 08:48:52 +0000 (09:48 +0100)]
Revert "Bug 8230: (follow-up) reflect the fact that order statuses are now alphabetic codes"

This reverts commit a2a87e04e20e98374225de87a84c5db6043f1f55.

10 years agoRevert "Bug 8230: DBrev 3.14.01.002"
Fridolin SOMERS [Mon, 30 Dec 2013 08:48:42 +0000 (09:48 +0100)]
Revert "Bug 8230: DBrev 3.14.01.002"

This reverts commit 7870c0d8fe715fabc5dd7df87337f2300dedcc1b.

10 years agoRevert "Bug 8230: (follow-up) don't link to basket unless user has appropriate permis...
Fridolin SOMERS [Mon, 30 Dec 2013 08:48:33 +0000 (09:48 +0100)]
Revert "Bug 8230: (follow-up) don't link to basket unless user has appropriate permissions"

This reverts commit ca75ea2959988b2fbc831b77c0c9bdc7aadaea75.

10 years agoRevert "Bug 8230: (follow-up) fix detection of cancelled orders"
Fridolin SOMERS [Mon, 30 Dec 2013 08:48:21 +0000 (09:48 +0100)]
Revert "Bug 8230: (follow-up) fix detection of cancelled orders"

This reverts commit 0929a7e2b6625de40c560619a68ec91c1615852a.

10 years agoRevert "Bug 8230: (follow-up) repair regression on order search"
Fridolin SOMERS [Mon, 30 Dec 2013 08:48:11 +0000 (09:48 +0100)]
Revert "Bug 8230: (follow-up) repair regression on order search"

This reverts commit 896a62b43b3556e49fdff2fd941f122e75e85f28.

10 years agoRevert "Bug 8230: (follow-up) update POD for C4::Acquisition::GetHistory"
Fridolin SOMERS [Mon, 30 Dec 2013 08:47:58 +0000 (09:47 +0100)]
Revert "Bug 8230: (follow-up) update POD for C4::Acquisition::GetHistory"

This reverts commit 303cad8f1fa1fc633be0d0ae79e4f830462d343e.

10 years agoBug 11414: warn user about dangerous MARC modification rules
Jonathan Druart [Wed, 18 Dec 2013 11:18:52 +0000 (12:18 +0100)]
Bug 11414: warn user about dangerous MARC modification rules

Test plan:
On the MARC modification tool:

Add/edit a new action on a field and define a condition on the same
field.

Verify that you get a warning message in red.

See bug 11413 for more information

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Tested adding and editing a template with the same field in the
action and the condition.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7137ee91e0a9c5278d15c116612c62d2c2bd1926)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8230: (follow-up) update POD for C4::Acquisition::GetHistory
Galen Charlton [Fri, 13 Dec 2013 23:51:18 +0000 (23:51 +0000)]
Bug 8230: (follow-up) update POD for C4::Acquisition::GetHistory

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit bfc0a2cb812636c5eb9cc10e3cf5bfba8eee8e61)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8230: (follow-up) repair regression on order search
Galen Charlton [Fri, 13 Dec 2013 23:42:26 +0000 (23:42 +0000)]
Bug 8230: (follow-up) repair regression on order search

This patch repairs a regression introduced by the main
patch where it became impossible to search for cancelled
orders from the advanced order search form.

This patch also tweaks the wording on the order status
drop-down on the order search form to clarify that the
default status filter is orders that have any status
except cancelled.

To test:

[1] Before applying this patch, perform an advanced
    order search (acqui/histsearch.pl) for orders
    with status cancelled.  Observe that no hits are returned.
[2] Apply the patch and run the search again.  This time,
    the cancelled orders should be returned.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 44eb83388928a020812d6fc375d565b0b2d6f9d3)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8230: (follow-up) fix detection of cancelled orders
Galen Charlton [Fri, 13 Dec 2013 23:19:55 +0000 (23:19 +0000)]
Bug 8230: (follow-up) fix detection of cancelled orders

This patch fixes a problem where the quantity / items column
in the acquisitions detail table would display ilnks to
items for cancelled orders.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit da3e33bff37a92caeb00f69db7e83b17e60eada6)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8230: (follow-up) don't link to basket unless user has appropriate permissions
Galen Charlton [Fri, 13 Dec 2013 23:04:59 +0000 (23:04 +0000)]
Bug 8230: (follow-up) don't link to basket unless user has appropriate permissions

With this patch, the basket number on the bib details page is linked
to the basket management page only if the staff user has the appropriate
permissions.

To test:

[1] Log in as a user with the acquisition/order_manage permission.
    Bring up a bib record that is attached to an order and verify
    that the basket number is an active link.
[2] Log in as a user that doesn't have the acquisition/order_manage
    permission.  Verify that the basket number displayed on the bib
    details page is not a hyperlink.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a050ca83b717c0212e4ae7d102ea1d1f13208edb)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8230: DBrev 3.14.01.002
Fridolin SOMERS [Tue, 24 Dec 2013 13:27:12 +0000 (14:27 +0100)]
Bug 8230: DBrev 3.14.01.002

Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8230: (follow-up) reflect the fact that order statuses are now alphabetic codes
Jonathan Druart [Fri, 18 Oct 2013 13:05:11 +0000 (15:05 +0200)]
Bug 8230: (follow-up) reflect the fact that order statuses are now alphabetic codes

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised. No regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ba3bb0a4f80bf565d784cb151a5623725ae4e3cf)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8230: Display acquisition details on the catalogue detail page
Jonathan Druart [Wed, 18 Sep 2013 12:30:05 +0000 (14:30 +0200)]
Bug 8230: Display acquisition details on the catalogue detail page

This patch adds a new tab "Acquitition details" on the catalogue detail
page. It provides a list of order made for this biblio.

New system preference:

AcquisitionDetails: Hide/Show the new tab.  The default for
new and upgraded installations is to display the new tab.

Test plan:
1/ Apply the patch.
2/ Select the "placing an order" value for the AcqCreateItem pref.
3/ Create a new order with X items.
4/ Go on the catalogue detail page for the selected biblio.
5/ Click on the "Acquisition details" tab and check that your order is
displayed. Itemnumbers are present in the last column. Check that links
are not broken.
6/ Close your basket.
7/ Status become "Ordered"
8/ Receive X-1 items.
9/ Come back on the catalogue detail page. There are 2 orders: 1
complete and 1 partial. The complete one has a receive date.
10/ Receive the last item.
11/ Now you have 2 orders with a complete status.
12/ Cancel the last receipt.
13/ You have 1 ordered and 1 complete (2 items).
14/ Cancel the first receipt.
15/ You have 1 ordered (3 items).
16/ Delete your order
17/ You have 1 deleted order.
18/ Switch the AcqCreateItem pref to "receiving an order"
19/ Do again steps 3 to 17.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7180eb1153cbb2849b0171014cf84eda0993b465)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Conflicts:
installer/data/mysql/updatedatabase.pl

10 years agoBug 11124: QA Follow-up adding optional dependency HTTPD::Bench::ApacheBench
Marcel de Rooy [Fri, 6 Dec 2013 09:15:52 +0000 (10:15 +0100)]
Bug 11124: QA Follow-up adding optional dependency HTTPD::Bench::ApacheBench

This dependency is used in load testing (misc/load_testing/*)

Test plan:
Check if you see the dependency listed on About/Perl modules.
Verify if the version information is correct.

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>
(cherry picked from commit f90cca4831dc90c74f4b6c18e415b1cce361fdb2)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11124: QA Follow-up resolving a warning and three typos
Marcel de Rooy [Fri, 6 Dec 2013 10:13:41 +0000 (11:13 +0100)]
Bug 11124: QA Follow-up resolving a warning and three typos

Resolves warning on uninitialized author in split on line 128.
Just adds the same behavior for title on line 129 for completeness.
Fixes typo on occurrences and two other minor typos.

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>
(cherry picked from commit 1219b3153ee3501d61f22a767b7b3e68c7c8933e)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11124: disallow trying to run the staff benchmark script as the DB account
Jonathan Druart [Wed, 23 Oct 2013 14:48:14 +0000 (16:48 +0200)]
Bug 11124: disallow trying to run the staff benchmark script as the DB account

On step 6 (at least), the circulation and return page redirect to the
select branch page and nothing is done.

The script should die if the user used is the sql administrator account.

Test plan:
Suppose that the sql admin account is root/root and koha/koha a
superlibrarian account.

1/
perl misc/load_testing/benchmark_staff.pl --steps=6
--url=http://admin.koha.local/cgi-bin/koha/
--password="koha" --user="koha"
should produce:
  ...
  Step 6
  ...

2/
perl misc/load_testing/benchmark_staff.pl --steps=1
--url=http://admin.koha.local/cgi-bin/koha/
--password="root" --user="root"
should produce:
Authentication successful
You cannot use the database administrator account to launch this script

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>
(cherry picked from commit 4604f595d66f65ba15d6625b2366acb147797ffc)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11255: allow "relevance ascending" as a sort option
Jonathan Druart [Fri, 15 Nov 2013 10:10:04 +0000 (11:10 +0100)]
Bug 11255: allow "relevance ascending" as a sort option

This patch fixes a problem where if a staff member sets the
*defaultSortField/*defaultSortOrder system preferences to relevance
ascending while QueryParser is enabled, default keyword search
would break -- the query parser config did not declare relevance asc
as a possible "modifier".

Note that setting the sort order to relevance ascending does not
actually make catalog search return results with the least relevant
records showing up first; Zebra does not support such a mode.  In other
words, relevance ascending acts exactly the same as relevance descending.

Test plan:

0/ Create some biblio with "history" in the title and
   ensure that the QueryParser system preference is enabled.
1/ Define prefs defaultSortField = relevance and defaultSortOrder = asc
2/ Search "history" on the staff interface
3/ Note that no result is returned.
4/ Apply the patch
5/ Verify the queryparser config file in use takes the modification into
account (see the queryparser_config value in your $KOHA_CONF file).
6/ Relaunch the search and verify results are returned

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 54937c5eb34c511e00de8d0831141516422885c7)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11261: make sample serial frequencies mandatory during installation
Jonathan Druart [Fri, 6 Dec 2013 14:44:52 +0000 (15:44 +0100)]
Bug 11261: make sample serial frequencies mandatory during installation

Test plan:
Verify all sample_frequencies.* files have been moved from optional
to mandatory directories.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 97b270aa2e08089bfa888c191d32d0a9af075ffe)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11261: make sample serial numbering patterns mandatory during installation
Jonathan Druart [Tue, 19 Nov 2013 14:21:25 +0000 (15:21 +0100)]
Bug 11261: make sample serial numbering patterns mandatory during installation

Test plan:
Verify all sample_numberpatterns.* files have been moved from optional
to mandatory directories.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All sample files for numbering patterns are moved from optional
to mandatory.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3c2e45a05816d69965445509d5ecd9db7ab3b98d)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 9224: Make acqui/finishreceive.pl Plack-compatible
Jacek Ablewicz [Wed, 16 Oct 2013 15:31:04 +0000 (17:31 +0200)]
Bug 9224: Make acqui/finishreceive.pl Plack-compatible

Under Plack/mod_perl wrapping, sub update_item() will become a closure,
so after the 1st run it will retain its own private instances of the
following variables: $booksellerid, $datereceived, $unitprice, $rrp,
$biblionumber.

I.e., in case update_item() gets invoked 2nd+ time (inside
the same process, but for different-subsequent receives) it may
incorrectly flag the (old, wrong) biblionumber for Zebra reindexing,
and erronously modify the current item[s] with the previously
used (wrong) values.

This simple patch should make acqui/finishreceive.pl Plack-compatible.

Test plan:
Test patched acqui/finishreceive.pl script (create and receive some
orders w/ items, etc.). Ensure items are gettting added and/or modified
correctly during receiving process.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised, no regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6dcc34c1b44f72a8602c4ee95540836e6cd1e7bd)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8334: (follow-up) remove commented JS code
Jonathan Druart [Fri, 13 Dec 2013 14:46:15 +0000 (15:46 +0100)]
Bug 8334: (follow-up) remove commented JS code

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4927140966844b88ef54dfc4d8e5f39d164ac8f3)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 8334 - Authority UNIMARC 100 field plugin
Vitor FERNANDES [Wed, 18 Sep 2013 20:58:24 +0000 (17:58 -0300)]
Bug 8334 - Authority UNIMARC 100 field plugin

This patch adds a plugin for field 100 of UNIMARC
authorities.

To test on a UNIMARC site:
1) Apply the patch
2) Edit some authority framework, field 100
3) Link subfield 'a' to unimarc_field_100_authorities.pl
plugin, save
4) Edit or add auth record, click on '...' to bring plugin
5) Modify field 100a
6) Save record

Thanks to Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> for
converting Vitor's original patch to a Git patch and doing
some tidying.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Stephane Delaye <stephane.delaye@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 311c9278765f369f616dadab92a8179761f8ee7a)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11174: fix OPAC search links built from authority 5xx fields
Zeno Tajoli [Wed, 30 Oct 2013 18:36:41 +0000 (19:36 +0100)]
Bug 11174: fix OPAC search links built from authority 5xx fields

In the templates opac-authoritiessearchresultlist of prog and
bootstrap the incorrect parameter 'valuec' is changed to 'value'

To test:

1) Insert an authority record with a 5xx field  (on MARC21 or UNIMARC)
2) Index the record
3) Search for the record in using OPAC authorities search.
4) Click one of the "see also" links built from the 5xx field, the link
   doesn't work
5) Apply the patch
6) Close the browser
7) Open the opac and select the english interface
8) Redo the search
9) Now the link works
10) To use the patch in others languages you need to regenerate the
    templates.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Following commit remove the use to valuec:
 commit 31f41e2c1db9d8dca82e0249050acb8f906c8164
    Bug 8206: Specify index in OPAC authority search

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 09fcd6980301bae3daad68f8cc27a2d5e7d488e4)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10983: Remove unused private subroutines from C4::Budgets
Colin Campbell [Wed, 2 Oct 2013 08:25:16 +0000 (09:25 +0100)]
Bug 10983: Remove unused private subroutines from C4::Budgets

The subroutine _filter_fields is not used by the module
and the sub _columns is only used by it

This patch removes the dead code.

To test:

[1] Verify that the following tests pass

    t/Budgets.t
    t/Budgets/CanUserModifyBudget.t
    t/Budgets/CanUserUseBudget.t
    t/db_dependent/Acquisition.t
    t/db_dependent/Acquisition/GetOrdersByBiblionumber.t
    t/db_dependent/Acquisition/Invoices.t
    t/db_dependent/Acquisition/OrderFromSubscription.t
    t/db_dependent/Acquisition/TransferOrder.t
    t/db_dependent/Acquisition/close_reopen_basket.t
    t/db_dependent/Bookseller.t
    t/db_dependent/Budgets.t
    t/db_dependent/Serials.t
    t/db_dependent/Serials_2.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Looks good to me.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit befc07c754eb4c2199c0063f15f9ffb3f3ea8cca)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11284: Packaging updates for master branch
Robin Sheat [Fri, 22 Nov 2013 00:18:10 +0000 (13:18 +1300)]
Bug 11284: Packaging updates for master branch

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11009: (follow-up) tweak wording and remove potential log noise
Galen Charlton [Tue, 10 Dec 2013 20:20:37 +0000 (20:20 +0000)]
Bug 11009: (follow-up) tweak wording and remove potential log noise

This patch makes the message that is displayed when attempting to
view circ history for the anonymous patron more informative.  It
also removes a potential source of log noise if the AnonymousPatron
system preference happens to be set to a blank value.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d92dbae6814fd2dfc36f7f46194f02a9c27994fa)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11009: Do not display circulation history of anonymous patron
Fridolyn SOMERS [Tue, 8 Oct 2013 07:34:42 +0000 (09:34 +0200)]
Bug 11009: Do not display circulation history of anonymous patron

When using an anonymous patron to anonymise issues history, this patron
may have a huge number of old issues. In this case, trying to display
the reading history of this patron will perform a huge SQL query.
It is not useful to have the reading history of this anonymous patron.

This patch adds an alert instead of old issues when displaying reading
records of anonymous patron.

Test plan :
- Set syspref AnonymousPatron to 0.
- Select a borrower with old issues. For example 123.
- Look at its reading records page : members/readingrec.pl
=> Old issues are displayed in a datatable
- Set syspref AnonymousPatron with this borrower number. For example 123.
- Look at its reading records page
=> Old issues are not displayed and an alert is displayed
- Using SQL query, remove old issues of this borrower :
    DELETE FROM old_issues WHERE borrowernumber=123.
- Look at its reading records page
=> A message is displayed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
This works as advertised and seems like a reasonable thing to do. I
suspect that someone will object... Perhaps that person will implement a
solution which uses an AJAX DataTable.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f2ad1faa63988b9dbf32cf8f8e35d59e7b584f2b)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11112: (follow-up) add FIXME
Galen Charlton [Tue, 10 Dec 2013 18:21:09 +0000 (18:21 +0000)]
Bug 11112: (follow-up) add FIXME

The caching introduced by the main patch is not ideal
as it won't work correctly if a persistance engine is used.

However, I have good reason to expect that bug 8089 will
be worked on (because I'm going to do it) so that Koha::Cache
can be used for this prior to the release of 3.16.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit aca1f5f6a9c5fb58e62ab060c272eadc287bb167)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11112: (follow-up) repair Koha::Calendar->add_holiday()
Galen Charlton [Tue, 10 Dec 2013 18:11:37 +0000 (18:11 +0000)]
Bug 11112: (follow-up) repair Koha::Calendar->add_holiday()

This patch ensures that the package-level cache is updated
when add_holiday() is used.  Note that except for the test
case added by this patch, there doesn't seem to be anything
that actually calls ->add_holiday(); it may be better to remove it.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 08c47cbfe2517ef36b15a16a94227b854be5eeb9)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11112: Koha::Calendar needs some caching
Jonathan Druart [Wed, 16 Oct 2013 13:36:30 +0000 (15:36 +0200)]
Bug 11112: Koha::Calendar needs some caching

Each time a Koha::Calendar object is created, its constructor retrieves
all holidays from the database and create a DateTime::Set object with
all holidays.

[RM note: I've observed that the time it takes DateTime::Set to be
 initialized with a set of dates increases faster than linearly with
 the number of dates.  I think this, more than just retrieving a bunch
 of holidays from the database, is what is most expensive.]

In one of our customer's DB, there are 11085 special_holidays and 598
repeatable_holidays. When a loan is returned, there are 3 calls to
Koha::Calendar->new.

This patch adds caching of the holiday list via package-level variables
as well as lazy fetching of the holidays. (RM note: this means that if
a persistance engine is in use, updates to the holiday list will not
be reflected during checkout.  I'm allowing this breakage for now on
the plan that bug 8089 will be fixed soon and we can switch to using
Koha::Cache).

Nytprof benchmarks (on a 3.8.x branch):
In DateTime::Set->from_datetimes:
3 times (5.49ms+4.90s) by Koha::Calendar::_init at line 80 of Koha/Calendar.pm, avg 1.63s/call
on a total of 7.67s (of 10.2s), executing 6353333 statements and 3031273 subroutine calls in 147 source files and 36 string evals.
for the circulation/return.pl page.

Comparing the access_log:

Without the patch:
checkout: time=2759838
checkin: time=1832751

Without the patch and with overdues:
checkout: time=1086727 + time=1144706
checkin: time=3928854 (x2)

With the patch and overdues:
checkout: time=1077839 + time=1060886
checkin: time=2420898

Test plan:
- checkout an item with a return date < today
- checkin the item and verify the suspension period is well calculated
  (depending on the holidays).
- prove t/db_dependent/Holidays.t
- t/Calendar.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a98b239dbfbf0d0e9c6f6593c3457c18c79584a9)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 11032: Check a valid MARC::Record passed to Biblio
Colin Campbell [Thu, 10 Oct 2013 17:06:14 +0000 (18:06 +0100)]
Bug 11032: Check a valid MARC::Record passed to Biblio

Intermittently problems in the calling environment
cause a C4::Biblio routine to be called with an undefined
MARC::Record object. This results in the process
dying and returning to the end user a low level
message such as 'cannot call method x on an undefined
object'.

For exported subroutines taking a MARC::Record object,
check that object is defined otherwise return a logical
return value and log a stack trace to the error log.
A couple of cases were checking but dying, this may have
unwelcome results in a persistent environment so croak has
been downgraded to carp

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Adds lots of checks for $record in various places, should
not affect behaviour.
Passed all tests and QA script, including new unit tests.
Tested adding and saving a new record.
Also tested detail and result pages without XSLT.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2e0e15485ecae556b77037443af1077291fe3673)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10605: fix encoding issue on basket email (INTRANET)
Jonathan Druart [Thu, 14 Nov 2013 10:31:23 +0000 (11:31 +0100)]
Bug 10605: fix encoding issue on basket email (INTRANET)

Same fix for the staff interface.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Both patches tested with English and German, diacritics
now appear correctly if UTF-8 is selected as encoding.
Passes all tests and QA script.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 62fcbea10a0e7b3fbca74531ec5051704ab63f7c)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10605: fix encoding issue in basket email (OPAC)
Jonathan Druart [Thu, 14 Nov 2013 11:17:38 +0000 (12:17 +0100)]
Bug 10605: fix encoding issue in basket email (OPAC)

There is an encoding issue on the received mail.
Here, we have to keep the encode_qp in order not to break links (= is a
special char for email https://en.wikipedia.org/wiki/MIME#Encoded-Word).

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4290fa60ef0fd93f1c0b51485f3b3ec74f316043)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10808: (follow-up) reformat auth_finder.pl
Fridolyn SOMERS [Fri, 30 Aug 2013 09:41:26 +0000 (11:41 +0200)]
Bug 10808: (follow-up) reformat auth_finder.pl

Perltidy and some format changes.

Most important : call to get_template_and_user must be at begining
of script because it checks authentification.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes:
- Tested various searches, selections now remain after
  submitting the search form.
Regression testing:
- Clearing the authority from the record still works.
- Creating a new authority from the plugin page
  still works.
- Autocomplete of entries still works.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ca29e0658c469abff1e54e8630fb989757d02f71)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10808: make authority search form retain drop-down selections
Fridolyn SOMERS [Fri, 30 Aug 2013 08:54:00 +0000 (10:54 +0200)]
Bug 10808: make authority search form retain drop-down selections

When cataloging a field defined with a thesaurus, an authority search
popup is displayed with a search from. Once operators, values and sort
selected in this form the search can be performed. The bug is that the
values entered are kept but not the selected operators and sort.

The same bug was existing in authorities module, solved by Bug 8692.

This patch corrects the bug.

Also uses in 'sort by' options the same text as search in authorities
module : Heading A-Z (default), Heading Z-A, None.

Also removes duplicated code in auth_finder.pl :
    value_mainstr => $query->param('value_mainstr') || "", ...

Test plan :
- Create a new biblio with a framework containing a field linked to a
  thesaurus. For example : 600
- Click on small icon of main entry. For example : 600$a
=> You get a search form with all operators to "contains" and sort by
   "Heading A-Z"
- Enter a value in each text box and perform search
=> You get a search form with values in text boxes and all operators
   to "contains"
- Select "starts with" in all operator comboboxes and perform search
=> You get a search form with all operators to "starts with"
- Select "is exactly" in all operator comboboxes and perform search
=> You get a search form with all operators to "is exactly"
- Select "Heading Z-A" in sort by and perform search
=> You get a search form with "Heading Z-A" in sort by
- Select "None" in sort by and perform search
=> You get a search form with "None" in sort by

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: With both patches applied no koha-qa errors

Test
1) Original behavior is whatever selection you do before patch,
search form returns to default options
2) After patch, selection remains

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass, further comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 857547c992ea2b548712583d09602eda3787556c)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
10 years agoBug 10661: format mandatory item fields the same on all forms
Owen Leonard [Thu, 15 Aug 2013 14:06:29 +0000 (10:06 -0400)]
Bug 10661: format mandatory item fields the same on all forms

Mandatory item fields are not indicated the same way in all places. This
patch corrects two places where required fields were shown in bold
rather than using the standard "required" class: When adding an order
from a staged file and when adding an item for a new issue of a serial.

This patch also normalizes the text input size on item entry forms: In
some places it was 50, others 67. I have changed the latter to 50.

Unrelated changes: Added $KohaDates formatting of date and time and
corrected capitalization on a heading on the add order from staged file
page.

It would be nice to be able to use the same method for displaying the
item form as we use on neworderentry.tt -- pulling in the form from a
separate include. However that system is designed for handling multiple
items and would need to be adapted for these cases.

To test, you must have a staged file from which to add an order. Open an
existing basket or create a new one and choose to add an order "From a
staged file." Choose a staged file from which to order. The item entry
form under the "Import all" heading should show required fields in red.

To test in serials: Begin the process for receiving an item from an
existing subscription. On the serials-edit page, find the "Click to add
item" links and click to open the item edit forms. There should be one
under the numbered issue and the supplemental issue forms. In both cases
the item edit screen should show the mandatory item fields in red.

Confirm that the cataloging add item form looks correct and works
correctly.

Revision: Left out the "required" note which should appear after each
required field.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dcaa3ff70489adeedb8a7aead364203d633580bc)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>