koha.git
10 years agoBug 11499: UT: Make zebra_setup.pl correctly set indexing mode
Tomas Cohen Arazi [Wed, 8 Jan 2014 15:21:42 +0000 (12:21 -0300)]
Bug 11499: UT: Make zebra_setup.pl correctly set indexing mode

By adding the relevant environment variables to the script the generated
koha-conf.xml file for the unit tests is correct now.

Test plan:
- Verify that tests pass now:
  $ prove -v t/db_dependent/Search.t 2> /dev/null | grep 11499

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes unit test, koha-qa.pl

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11499: (regression tests) indexing modes not properly set on generated koha-conf.xml
Tomas Cohen Arazi [Wed, 8 Jan 2014 15:17:26 +0000 (12:17 -0300)]
Bug 11499: (regression tests) indexing modes not properly set on generated koha-conf.xml

t/db_dependent/Search.t creates its own temporary koha-conf.xml and
related files, and it fails to properly set indexing modes for
bibliographic and authority records.

This patch adds regression tests for that.

To test:

 $ prove -v t/db_dependent/Search.t 2> /dev/null | grep 11499

The test should fail unless the main page is applied.

Sponsored-by: Universidad Nacional de Cordoba
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>
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>
10 years agoBug 11480: Fix invalid assumptions in JSONStream test
Colin Campbell [Mon, 6 Jan 2014 16:53:33 +0000 (16:53 +0000)]
Bug 11480: Fix invalid assumptions in JSONStream test

Tests for C4::Output::JSONStream made the invalid assumption
that the hash keys of the modules internal structure
will always be returned in the same sequence.
A hash is an unordered structure. as of perl 5.18
this has beem reinforced by random seeding of the
hashing function. See the info in perldelta and
the doc for JSON.

This patch changes the tests to be sequence-neutral
where the previous test was testing that a new element
was added and an existing one was untouched these have
been separated into individual tests.

Some typos in the messages have been corrected

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

1/ Run t/Output_JSONStream.t , 8 tests should pass (or perhaps fail,
   but inconsistently under perl 5.18 or greater)
2/ Apply patch
3/ Run t/Output_JSONStream.t 10 tests should pass now

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7965: Silence warns in staff log
Chris Cormack [Fri, 27 Dec 2013 06:06:34 +0000 (19:06 +1300)]
Bug 7965: Silence warns in staff log

Silence warns in C4::Bookseller::GetBooksellersWithLateOrders()

to test
1/ run prove t/db_dependent/Bookseller.t
   Notice lots of Use of uninitialized value $delay in numeric lt (<) at /var/lib/jenkins/jobs/Koha_master/workspace/C4/Bookseller.pm line 134 type lines
2/ apply patch
3/ run prove t/db_dependent/Bookseller.t
   Notice warns are gone

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tiny change, positive consequences.
Passes QA script and all tests.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10774: (follow-up) tweak styling of buttons on Bootstrap theme
Galen Charlton [Fri, 10 Jan 2014 15:21:29 +0000 (15:21 +0000)]
Bug 10774: (follow-up) tweak styling of buttons on Bootstrap theme

Following a discussion with Kyle, this patch applies the
btn-mini style to the per-hold cancel and suspend/unsuspend
buttons to make them a bit smaller.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10774: (QA Followup) Add support for bootstrap opac theme
Kyle M Hall [Wed, 8 Jan 2014 16:21:37 +0000 (11:21 -0500)]
Bug 10774: (QA Followup) Add support for bootstrap opac theme

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10774: Allow individual holds to be suspended and resumed from the OPAC
Kyle M Hall [Wed, 21 Aug 2013 11:30:54 +0000 (07:30 -0400)]
Bug 10774: Allow individual holds to be suspended and resumed from the OPAC

Right now, holds can only be suspended and resumed from the OPAC as a
whole. It would be nice to be able to suspend and resume holds on a hold
by hold basis from the OPAC.

Test Plan:
1) Apply this patch
2) Log in to the OPAC
3) Place a number of holds
4) Browse to "my summary" and select the holds tab
5) From here, test the following actions
   a) Suspend a hold indefinitely ( no resume date )
   b) Suspend a hold with a date to automatically resume
   c) Manually resume a suspended hold
6) Disable AutoResumeSuspendedHolds, ensure the suspend until date field
   is no longer visible.
7) Disable SuspendHoldsOpac, ensure all suspension related fields are
   no longer visible.

Signed-off-by: Chris Rohde <crohde@roseville.ca.us>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11457: avoid spurious test failure in t/db_dependent/Bookseller.t
Chris Cormack [Thu, 2 Jan 2014 04:15:56 +0000 (17:15 +1300)]
Bug 11457: avoid spurious test failure in t/db_dependent/Bookseller.t

This patch clears the subscription table so tests pass correctly if
there happens to have been a subscription with an end date before
2013-08-01.

To test
1/ Add a subscription in the serials module, with an end date before
2013-08-01
2/ run prove -v t/db_dependent/Bookseller.t
   Notice tests 22 and 23 fail
3/ Apply patch
4/ run test again
5/ Notice tests succeed

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests now clean the subscription table before running
the tests, so that the will always pass.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11483: (follow-up) fix typos
Galen Charlton [Wed, 8 Jan 2014 15:14:43 +0000 (15:14 +0000)]
Bug 11483: (follow-up) fix typos

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11483: Add missing serial help files
Nicole C. Engard [Mon, 6 Jan 2014 18:15:36 +0000 (12:15 -0600)]
Bug 11483: Add missing serial help files

The help files for the Serial Numbering Patterns and Frequencies pages
were missing.  This patch adds them.

To test:

* Visit the two new serial pages
* Click Help
* Confirm text and links are right

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11260: (follow-up) repair German sample_z3950_servers.sql
Galen Charlton [Wed, 8 Jan 2014 01:10:32 +0000 (01:10 +0000)]
Bug 11260: (follow-up) repair German sample_z3950_servers.sql

Without this patch, the sample Z39.50 servers for de-DE
would fail to load.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11260: (follow-up) remove inadvertant change to English sample_z3950_servers.sql
Galen Charlton [Wed, 8 Jan 2014 01:01:37 +0000 (01:01 +0000)]
Bug 11260: (follow-up) remove inadvertant change to English sample_z3950_servers.sql

Part of the patch for bug 11260 had the effect of undoing
commit 5aae737, thereby adding back two undesirable things:

- use of backticks in the SQL
- setting z3950servers.id explicitly

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11260: Follow up - normalizing frequencies in English sample file a bit
Katrin Fischer [Sun, 17 Nov 2013 21:58:52 +0000 (22:58 +0100)]
Bug 11260: Follow up - normalizing frequencies in English sample file a bit

After some discussion in IRC I am throwing in some changes for the
English sample frequencies:

- Change Vol to Vol.
- Change No to No.

We had both forms in the file, now it should be consistent.

To test:
- Run English web installer installing all sample files, especially
  frequencies
- Check installed frequencies
- Check available options creating a subscription

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11260: Update German web installer - frequencies and numberpatterns
Katrin Fischer [Sun, 17 Nov 2013 21:56:45 +0000 (22:56 +0100)]
Bug 11260: Update German web installer - frequencies and numberpatterns

Translates the new files for frequencies and numberpatterns

To test:
- Run the German web installer with all sample files
- Check all files import without errors, especially frequencies and
  numbering patterns
- Check frequencies in serials
- Check numbering patterns in serials
- Create a subscription, check possible choices

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11260: Update German web installer for 3.14
Katrin Fischer [Sun, 17 Nov 2013 20:05:45 +0000 (21:05 +0100)]
Bug 11260: Update German web installer for 3.14

Mandatory:
- adds auth_values.sql and .txt with YES_NO referenced in patron_attributes.sql
- updates sample notices with redone slip templates (ISSUESLIP, ISSUEQSLIP,
  RESERVSLIP, TRANSFERSLIP)
- adds German translations to subtag_registry.sql and copies updated file
  from en to de-DE
- adds translation for new course_reserves permission to userflags.sql
- adds translations for new permissions in userpermissions.sql
- Fixes typo IndependantBranches in English userpermissions.sql

Optional:
- adds csv_profiles.sql and translation of the serial claims profile
- adds z39.50 servers for authorities to sample_z3950_servers.sql

To test:
- Run web installer in English
  - check all sample files, make sure they all install without SQL errors
  - check language list on advanced search displays correctly still
  - check area/language list on tools > news displays correctly still
  - check permissions for correct spelling of IndependentBranches

- Run web installer in German
  - repeat checks from above
  - also check: authorised values, especially existence of YES_NO
  - all permissions are translated now
  - slip notices are all there and look right
  - new z39.50 servers for authorities are available
  - csv profile for serial claims is available and works as expected

... and anything else you can think of.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10863: (follow-up) give limited circ operator way to proceed
Galen Charlton [Tue, 7 Jan 2014 04:33:05 +0000 (04:33 +0000)]
Bug 10863: (follow-up) give limited circ operator way to proceed

This patch tweaks the checkout form so that if a circ operator
doesn't have the circulate/force_checkout permission, they are
presented with a button to continue on if they ran into a restriction
on the loan.  Otherwise, there was no clear way to carry on, as the
item barcode field was disabled.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10863: (follow-up) set correct description for manage_restrictions permission...
Galen Charlton [Tue, 7 Jan 2014 04:06:17 +0000 (04:06 +0000)]
Bug 10863: (follow-up) set correct description for manage_restrictions permission during upgrade

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10863: DBRev 3.15.00.012
Galen Charlton [Tue, 7 Jan 2014 04:02:42 +0000 (04:02 +0000)]
Bug 10863: DBRev 3.15.00.012

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10863: Add 2 circulation permissions: force_checkout and lift_restriction
Jonathan Druart [Wed, 5 Jun 2013 12:37:38 +0000 (14:37 +0200)]
Bug 10863: Add 2 circulation permissions: force_checkout and lift_restriction

This patch adds 2 circulation permissions: force_checkout and
lift_restriction.

During upgrade, these two permission are added to existing staff
users that already have the base circulate permission.

force_checkout allows a librarian to force a checkout if a limitation
occurred.

lift_restriction allows a librarian to lift a restriction for a patron.

Test plan:
1/ Find a debarred patron and go on the checkout page. The "Lift
restriction" button should be present only if the logged librarian has
the lift_restriction permission.
2/ If the force_checkout permission is set, a librarian should be
allowed to check out in several cases:
- age restriction
- the item is issued to another patron
- the item is not for loan
- the patron has overdue items
- the item is lost
- the item is a high demand item
- the item is reserved
- another case ?

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Bug 10863: The force checkout permission should not affect high holds

- typo checkout => check out.
- the force checkout permission does not affect high holds.

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Bug 10863: Follow-up: Adding missing permissions to translated files

This patch adds the 2 new permissions to all remaining sample files.
If the permissions don't get installed, the problem is bigger than
having an English description.

Also adds back the question "Check out anyway?" for high demand items (HIGHHOLDS).

Test xt/permissions.t passes now.

Bug 10863: Rename lift_restriction with manage_restrictions

The pref manage_restrictions now takes into account "Lost card" and
"Gone no address" restrictions.

Test plan:
- log in with a user with manage_restrictions permission
- verify you can set/unset restrictions when editing a patron
- log in with a user without manage_restrictions permission
- verify you cannot set/unset restrictions when editing a patron

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Note: The AgeRestrictionOverride pref has to be set to "Allow" if you
want to override the age restriction, even if the new permission is set.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6886: (follow-up) remove redundant test for singleBranchMode
Galen Charlton [Mon, 6 Jan 2014 16:27:17 +0000 (16:27 +0000)]
Bug 6886: (follow-up) remove redundant test for singleBranchMode

This patch removes an unnecessary check of the singleBranchMode
preference that occurred in an <xsl:otherwise> clause where
we already know that singleBranchMode != 1.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6886: (follow-up) replace needless <xsl:choose> with <xsl:if>
Kyle M Hall [Wed, 4 Dec 2013 17:24:38 +0000 (12:24 -0500)]
Bug 6886: (follow-up) replace needless <xsl:choose> with <xsl:if>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Switching SingleBranchMode:

Tested with MARC21 and UNIMARC:
- "Don't allow" - branch is not shown in result list
- "Allow" - branch is shown for available items in result list

Changes are consistent over all 3 MARC flavours.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6886: ensure that singleBranchMode does not display library name for reference...
Kyle M Hall [Fri, 4 Jan 2013 18:40:33 +0000 (13:40 -0500)]
Bug 6886: ensure that singleBranchMode does not display library name for reference copies

Test plan: Enable singleBranchMode and  OPACXSLTResultsDisplay. Perform
a search in the OPAC which returns results containing not-for-loan
items. Before the patch these items will show their library in search
results loan items. After the patch there will be not be a library
listed, matching other items in results.

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11336: (follow-up) fix typo in previous follow-up
Galen Charlton [Mon, 6 Jan 2014 16:16:22 +0000 (16:16 +0000)]
Bug 11336: (follow-up) fix typo in previous follow-up

This patch corrects a typo that broken ModReserveFill().  This
patch also adds a unit test that (via two levels of indirection)
exercises ModReserveFill().

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10429: improve display of library and library filter on serials claim page
Fridolyn SOMERS [Fri, 7 Jun 2013 12:55:18 +0000 (14:55 +0200)]
Bug 10429: improve display of library and library filter on serials claim page

In serial claims page, the library code is displayed in table instead
of library name and library filter does not work.

This patch adds the display of library name by using libraries template
plugin.  It changes the Javascript library filter to make it work.

Also sets "all" filter in template (like status filter) to allow
translation and sets "all" as selected by default. The staff user's
library was selected by default, but the table was not filtered
with it.

Test plan :
- Go to serials claim of a vendor with serials of multiple libraries
=> You see branch filter with "(All)" and table shows library's names
- Check that library  filter does its work

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Table now shows the branch name instead of the branchcode.
First option was named (All), matching the status pull down.
When opening the claims page, (All) is preselected and the
result list matches with the selection. Before the patch
the library was preselected, but the result list did show
late issues from all branches.

This patch is an improvement, but there is still more work to do.

- Filters are not cumulative, but when another filter is selected
  the first filter is not reset.
- It's not possible to combine
  2 or more filters.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11342: fix error in OPAC self registration form if BorrowersTitles is empty
Kyle M Hall [Thu, 5 Dec 2013 14:13:35 +0000 (09:13 -0500)]
Bug 11342: fix error in OPAC self registration form if BorrowersTitles is empty

If BorrowersTitles is empty, it causes the library pulldown on the self
registration page to be empty, and to have the "Saluation" field have
the option "branches".

This patch also fixes a minor string capitalization issue.

Test Plan:
1) Enable OPAC self registration
2) Set the system preference BorrowersTitles to be empty
3) View the self registration page
4) Note the lack of branches in the home library pulldown
5) Apply this patch
6) Note the branches now display in the pulldown

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested in bootstrap and prog OPAC, with BorrowersTitle configured
and emptied.
Passes all tests and QA script.

Note: The titles pull down has 2 empty entries in master with
and without the patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11468: Remove given/when from Koha::Dateutils
Colin Campbell [Thu, 2 Jan 2014 14:42:16 +0000 (14:42 +0000)]
Bug 11468: Remove given/when from Koha::Dateutils

given and when give warnings due to their experimental
status as of perl 5.18. Replace the construct with
an if/elsif to avoid the keywords

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, especially t/DateUtils.t.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11474: (follow-up) correct typos in POD
Galen Charlton [Mon, 6 Jan 2014 05:46:32 +0000 (05:46 +0000)]
Bug 11474: (follow-up) correct typos in POD

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11474: Remove errors caused by use of given/when statement
Colin Campbell [Fri, 3 Jan 2014 10:47:23 +0000 (10:47 +0000)]
Bug 11474: Remove errors caused by use of given/when statement

This patch replaces a given/when statement by an if so we
do not get warnings on compilation when using Perl 5.18 or later.

Note the perldoc for the subroutine was not correct;
code was not testing that paramater equalled the values
but that it contained them. Have amended accordingly

Have documented behaviour in case parameter contains
neither value.

Subroutine does not appear to me used elsewhere in
codebase

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, especially t/DateUtils.t.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11316 - plugin icon missing tooltip in addbiblio.pl
Mark Tompsett [Wed, 27 Nov 2013 18:16:56 +0000 (13:16 -0500)]
Bug 11316 - plugin icon missing tooltip in addbiblio.pl

By adding:
    title=\"Tag editor\"
into the HTML generated in addbiblio, a tooltip displaying
'Tag editor' appears when the mouse is hovered over the
plugin icon.

Test Plan:
1) Log into Staff client
2) Click the 'Search the catalog' tab
3) Type something which will generate results
4) Click the title of a result
5) Click the 'Edit' button
6) Scroll down and click the 'Edit Record'
7) Look through the various tabs and notice that all the plugin
   icons have no tooltip.
8) Apply the patch
9) Refresh the page
10) All the plugin icons should have the tooltip text of
    'Tag editor'.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Adds a title attribute. Works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7002: fix some invalid superlibrarian permission checks
Galen Charlton [Mon, 30 Dec 2013 16:05:51 +0000 (16:05 +0000)]
Bug 7002: fix some invalid superlibrarian permission checks

This patch fixes a problem where if a staff user has superlibrarian
permissions, but also has module-specific permissions, they are
prevent from editing item records that they should be allowed to.

To test:

[1] Turn on IndependentBranches.
[2] Register a superlibrarian staff user at branch A.
[3] Give that new account at least one other module-level
    permission.  This cannot be done through the user interface,
    however, but can be done via SQL:

    UPDATE borrowers SET flags = 3 WHERE userid = 'XXX';

[4] Log in as that new superlibrarian.
[5] Bring up the item details (catalogue/moredetail.pl) page for
    an item at branch B.  Note that there is no 'Edit Item' link.
[6] Similarly, try editing that item (cataloging/additem.pl).  Note
    that the edit form forbids you from touching the item.
[7] Finally, try editing that item using the Tools | Batch item
    modification utility.  Note that it doesn't allow you to do so.
[8] Apply the patch.
[9] Repeat steps 5 through 7.  This time, the item actions should
    be allowed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes QA script and test suite.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11470: fix occassional spurious test failure in Circulation_transfers.t
Galen Charlton [Thu, 2 Jan 2014 18:02:17 +0000 (18:02 +0000)]
Bug 11470: fix occassional spurious test failure in Circulation_transfers.t

This patch makes Circulation_transfers.t no longer be sensitive to
the exact time it runs, avoiding spurious test failures due
to datesent being a second off between the creation of the test
transfer and the comparison.

To test:

[1] To simulate the failure, add a "sleep(2);" after the
    "#Test GetTransfers" comment and run
    prove -v t/db_dependent/Circulation_transfers.t
[2] Remove the sleep and apply the patch.
[3] Verify that prove -v t/db_dependent/Circulation_transfers.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11336: (follow-up) improve POD for _FixPriority()
Galen Charlton [Sat, 4 Jan 2014 23:25:25 +0000 (23:25 +0000)]
Bug 11336: (follow-up) improve POD for _FixPriority()

This patch improves the POD for C4::Reserves::_FixPriority()
to (hopefully) describe its function thoroughly.  It also
adjusts the call of _FixPriority() by CancelReserve() to
omit passing reserve_id, since by that point no row in
the reserves table for that request still exists.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11336: (follow-up) correct change to POD for GetReserve()
Galen Charlton [Sat, 4 Jan 2014 22:45:29 +0000 (22:45 +0000)]
Bug 11336: (follow-up) correct change to POD for GetReserve()

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11336: (follow-up) fixing capitalization in templates
Katrin Fischer [Sun, 29 Dec 2013 12:57:33 +0000 (13:57 +0100)]
Bug 11336: (follow-up) fixing capitalization in templates

Fixes capitalization on the holds and check in page.

Changes are easy to spot using:
git diff HEAD^ --color-words=.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11336: update hold queue priorities correctly when deleting holds
Jonathan Druart [Fri, 13 Dec 2013 16:42:55 +0000 (17:42 +0100)]
Bug 11336: update hold queue priorities correctly when deleting holds

In various places, deleting a hold request did not trigger recalculating
the priority of the other holds on the bib:

To reproduce the bug:
- select or create 2 users U1 and U2
- select or create an holdable item
- place on hold for both U1 and U2. U1 has priority 1 and U2 has
  priority 2.
- delete the hold for U1
- go on circ/circulation.pl?borrowernumber=XXXX for U2 (or in the DB
  directly) and verify the priority has not been set to 1

The issue is repeatable (at least) on these 2 pages:
 * circ/circulation.pl?borrowernumber=XXXX (tab 'Holds', select "yes"
  in the dropdown list and submit the form)
 * reserve/request.pl?biblionumber=XXXX (click on the red cross)

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Reran my tests:

Preparations:
- Create holds for different patrons on a record:
  * 1st - title level hold
  * 2nd - item level hold
  * 3rd - title level hold
  * 4th - title level hold
- AllowOnShelfHolds = On/Allow (items were not checked out)

Tests:
Deleted holds from various pages, confirming bugs first,
then testing with applied patches. Reloading database
after each test.

1) Cancel holds from OPAC patron account
  /cgi-bin/koha/opac-user.pl#opac-user-holds
- Cancel 4th - ok, before and after applying the patch
- Cancel 2nd - ok, after applying the patch

2) Cancel hold from holds tab on staff detail page
  /cgi-bin/koha/reserve/request.pl?biblionumber=7

  a) Setting priority to 'del', submitting with 'Update holds'
  - Cancel first (1st) - ok, before and after
  - Cancel hold in the middle (was 3rd) - ok, before and after
  - Cancel last (was 4th) -ok, before and after

  b) Using red X
  - Repeating tests from a) - before the patch is applied holds
    get totally 'out of order' - after applying the patch, it works
    correctly

Additional tests done on this page:
- Change priority using up, down, to top, to bottom icons
- Change priority with 'toggle to lowest'

3) Cancel hold from the patron's account

  a) Check out tab - Delete? Yes, 'Cancel marked holds'
    /cgi-bin/koha/circ/circulation.pl?borrowernumber=X
  - Cancel first (1st) - ok, after applying the patch
  - Cancel hold in the middle (was 3rd) - ok, after applying the patch
  - Cancel last (was 4th) - ok, after applying the patch

  b) Details tab - Delete? yes, 'Cancel marked holds'
    /cgi-bin/koha/members/moremember.pl?borrowernumber=X
  - Cancel first (1st) - ok, after applying the patch
  - Cancel hold in the middle (was 3rd) - ok, after applying the patch
  - Cancel last (was 4th) - ok, after applying the patch

  Without the patch, holds priorities get out of order.

Additional tests done:
- Check in one item to trigger first hold
- Check in one item to trigger second hold
- Check out first item
Priorities are kept while the item is waiting, when it's
checked out, priorities of remaining holds get reset correctly.

Conclusion:
Big improvement, no regressions found.

Passes all tests in t, xt and QA script.
Also: t/db_dependent/Holds.t
      t/db_dependent/HoldsQueue.t
      t/db_dependent/Reserves.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11066: (follow-up) add regression test
Galen Charlton [Fri, 3 Jan 2014 15:54:45 +0000 (15:54 +0000)]
Bug 11066: (follow-up) add regression test

This patch adds a regression test for using the MARC21
264 field in the Bibtex export.

To test:

[1] Verify that prove -v t/db_dependent/Record.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11066: make RIS and Bibtex exports RDA compatible
Joy Nelson [Sat, 26 Oct 2013 04:14:48 +0000 (00:14 -0400)]
Bug 11066: make RIS and Bibtex exports RDA compatible

RIS and Bibtex exports from staff side and OPAC edited to
allow for additional publisher RDA tag (264).  Script will
look first for 264 then fall back to 260 when pulling publisher
data from MARC21 records.

Test Plan:
1. Create RDA and non RDA record
2. In OPAC, export both as RIS and Bibtex - verify publisher information
   is exported
3. On staff side, export records as RIS and Bibtex, verify publisher
   information is exported.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed some tabs pointed out by the QA script.
Works nicely in my tests, no regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11192: (follow-up) fix a little typo
Chris Cormack [Fri, 27 Dec 2013 20:07:13 +0000 (09:07 +1300)]
Bug 11192: (follow-up) fix a little typo

Test plan the same as the original patch

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan. Searches tested were:
fic=e
fiction=e

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11192: Fix lf and ff07-02 definition in ccl.properties
Mathieu Saby [Sun, 3 Nov 2013 18:04:44 +0000 (19:04 +0100)]
Bug 11192: Fix lf and ff07-02 definition in ccl.properties

ff7-02 1=87020 (position 2 of field 007 in MARC21) should be
ff7-02 1=8702

lf 1=8833
lf fiction
fic fiction

should be

lf 1=8833
fiction lf
fic lf

To test :
1. apply the patch
2. copy the modified ccl.properties into your active Zebra config
   directory
3. reindex zebra (rebuild_zebra.pl -b -x -r -v)
4. make some searches using the fixed indexes

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9654: add space between amount and currency symbol in basket group display
Samuel Crosby [Mon, 30 Dec 2013 03:52:49 +0000 (14:52 +1100)]
Bug 9654: add space between amount and currency symbol in basket group display

Changed:
    $total .= $bookseller->{invoiceprice} // 0;
Into:
    $total .= " " . ($bookseller->{invoiceprice} // 0);
in order to add a space between the total and currency in
the basket group.

Revised test plan:
 1) Log into staff client
 2) Acquisitions
 3) Click 'Search' in the 'Manage orders' box.
 4) Click '+ New basket' beside a vendor name.
 5) Type 'Bug 9654 Test 1' into basket name.
 6) Click 'Save'
 7) Click 'Add to basket'
 8) Click 'From an external source'
 9) Type 'Green Eggs and Ham' into the Title text box.
10) Click 'Search'
11) Click 'Order' on any one of the results.
12) Click 'Add Item' in the 'Item' box.
13) Select a Fund from the dropdown in the
     'Accounting details' box.
14) Click 'Save'
15) Click 'Close this basket'
16) Click 'Yes, close (Y)' without checking the attach to a
     basket group.
17) Click the 'Basket groups' tab.
18) Click '+ New basket group'
19) Notice the listing in 'Ungrouped baskets' lacks a space
     between the number and the currency. (e.g. Total: 0USD)
20) Apply patch (git bz apply 9654)
21) Refresh the page
22) Notice there is now a space. (e.g. Total: 0 USD)
23) Run the Koha QA Tool: (~/qa-test-tools/koha-qa.pl -v 2 -c 1)

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11398: A typo occurred with occured
Marcel de Rooy [Mon, 16 Dec 2013 11:01:21 +0000 (12:01 +0100)]
Bug 11398: A typo occurred with occured

This patch cures occured and makes occurred occur.
Note that I found them while testing bug 11170.
In a follow-up of 11170, I corrected this typo in parcels.tt.
This patch touches update22to30.pl and modborrowers.tt

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes a typo in 2 files.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11131: display authority summary correctly when searching by all authority types
Jonathan Druart [Thu, 24 Oct 2013 13:28:42 +0000 (15:28 +0200)]
Bug 11131: display authority summary correctly when searching by all authority types

The summary is built using the authtypecode selected from the interface.
So when a search is launch on all auth types, the summary is not
correctly built by the BuildSummary routine.

It should get the authtypecode from the authority (call to
GetAuthTypeCode).

To test:
1/ go to authorities/authorities-home.pl
2/ search <something> by authtype personal name
3/ results are displayed with summary
4/ now select the default entry and search again the
results display but without the summary
5/ apply the patch
6/ search default again, now summary shows

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with a UNIMARC database, works as described.
All tests and QA script pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10277: (follow-up) if no userenv is set, act like a superlibrarian
Galen Charlton [Mon, 30 Dec 2013 18:50:04 +0000 (18:50 +0000)]
Bug 10277: (follow-up) if no userenv is set, act like a superlibrarian

This patch fixes an error caught by t/db_dependent/Acquisition.t, and
adjusts C4::Context::IsSuperLibrarian() to return true if no
userenv is set. This is done on the basis that if no userenv is set,
calls to C4::Context routines are being made from a command-line script,
and if you have access to the command line of a running Koha instance,
you implicitly already have better than superlibrarian access.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11208: If no smsalertnumber is defined, the message is marked as failed
Jonathan Druart [Wed, 6 Nov 2013 13:54:36 +0000 (14:54 +0100)]
Bug 11208: If no smsalertnumber is defined, the message is marked as failed

For DUE message (and PREDUE, etc.) there are no check before sending the
message to the message_queue table.

This check avoids to try to send again and again the same message. Now
it is marked as "failed".

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Without the patch a sms notice will remain as 'pending' forever.
With the patch applied, the status is set to 'failed'.

Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11208: regression test for failing SMS messages
Galen Charlton [Mon, 30 Dec 2013 16:45:45 +0000 (16:45 +0000)]
Bug 11208: regression test for failing SMS messages

This patch adds a regression test for verifying that queued
SMS messages meant for patrons who have no SMS alert number
set are marked as failed after the first attempt to send them.

To test:

[1] Run prove -v t/db_dependent/Letters.t.  The fourth
    test should.
[2] Apply the main patch and run t/db_dependent/Letters.t
    again.  This time, all tests should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11402: (follow-up) add one more unit test
Galen Charlton [Mon, 30 Dec 2013 16:22:05 +0000 (16:22 +0000)]
Bug 11402: (follow-up) add one more unit test

This test exercise the case where defined parameters
are passed to the _guide_box() routine.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11402: make Labels::_guide_box return undef if undefned data is passed
Tomas Cohen Arazi [Mon, 16 Dec 2013 14:55:56 +0000 (11:55 -0300)]
Bug 11402: make Labels::_guide_box return undef if undefned data is passed

That's it. A guide box cannot be created if invalid data is passed.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, includes new unit tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10277: Add UT for C4::Context::IsSuperLibrarian
Jonathan Druart [Wed, 18 Dec 2013 15:12:00 +0000 (16:12 +0100)]
Bug 10277: Add UT for C4::Context::IsSuperLibrarian

Note that I modify the return value. Before this patch, it returned an
empty string or 1. Now it returns 0 or 1.

Test plan:
- same as the original patch
- verify that unit tests pass:
    prove t/Context.t

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, including new tests.
Checked the code and tested superlibrarian behaviour in some places:

moremember.pl:
With IndyBranches only superlibrarian can delete borrowers from
other branches. Accessing the borrower with a direct link.
OK

C4/Members.pm
With IndyBranches only superlibrarian can search for borrowres
from other branches.
OK

tools/holidays.pl
With IndyBranches only superlibrarian can edit holidays for other
branches.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10277 - Add C4::Context->IsSuperLibrarian()
Kyle M Hall [Wed, 15 May 2013 15:04:07 +0000 (11:04 -0400)]
Bug 10277 - Add C4::Context->IsSuperLibrarian()

The method of checking the logged in user for superlibrarian privileges
is obtuse ( $userenv && $userenv->{flags} % 2 != 1 ) to say the least.
The codebase is littered with these lines, with no explanation given. It
would be much better if we had one subroutine that returned a boolean
value to tell us if the logged in user is a superlibrarian or not.

Test Plan:
1) Apply this patch
2) Verify superlibrarian behavior remains unchanged

Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11075: 'select all' for export no longer clears renew checkboxes
Jonathan Druart [Thu, 21 Nov 2013 16:55:57 +0000 (17:55 +0100)]
Bug 11075: 'select all' for export no longer clears renew checkboxes

If circulation exports are enabled (by turning on ExportWithCsvProfile),
the table on the checkout page includes three columns of checkboxes --
'renew', 'checkin', and 'export'.

For each loan, the renew and checkout links should behave like radio
buttons, but the state of the export checkbox is meant to be independent
of the renew and checkin checkboxes.

However, if the 'select all' link in the export column is clicked,
active renew checkboxes are toggled off.

The desired behavior is that clicking the select all link in the export
column should only affect checkboxes in that column.  This patch
implements this behavior.

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11188 - Make gather_print_notices.pl die on failed open()
Magnus Enger [Sat, 23 Nov 2013 21:57:03 +0000 (22:57 +0100)]
Bug 11188 - Make gather_print_notices.pl die on failed open()

Problem:
If you tell gather_print_notices.pl to write output to a location
you do not have write access to, it will silently fail to write the
data, but still mark unsent messages as sent.

Solution:
This patch adds two lines of defense:
1. Check that the location given for the output is writable
2. use "open() or die" instead of just "open()" when writing the
   output
The first measure should catch most of the potential errors, but
I guess a directory can be writable, but the open() still can fail
because the disk is full or something similar.

To test:
- Make sure you have some unsent messages in the message_queue table,
  that do not have an email adress
- Apply the patch
- Run the script, pointing at a location you do not have access to
  write to. Check that the script exits with an appropriate error
  message, and that the unsent messages are still unsent. Do this
  both with and without the -s option.
- To fake passing the first line of defence, comment out line 62
  and put this in instead:
  if ( !$output_directory || !-d $output_directory ) {
- Run the script again as above, check you get an appropriate
  error and that the message queue is not touched
- Reset line 62 to how it was
- Run the script against a directory you do have access to write to
  and check that output is produced as expected and that messages
  are marked as sent
- Sign off

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11445: avoid sending duplicate hold waiting notifications
Galen Charlton [Wed, 25 Dec 2013 17:44:19 +0000 (17:44 +0000)]
Bug 11445: avoid sending duplicate hold waiting notifications

This patch fixes a problem where a patron could receive duplicate
hold waiting notifications.  For example, this could happen if a
circ operator checked in an item more than once and confirmed the
same hold each time.

To test:

[1] Set up a test patron that received hold waiting notifications.
[2] Put an item on hold for the patron, then check the item in
    and confirm the hold.  Verify that a hold notification is
    sent (or inspect the message_queue table).
[3] Check the item in again and confirm the hold again.  A duplicate
    hold notification will be generated.
[4] Apply the patch.
[5] Repeat steps 2 and 3.  This time, only one notification should be
    generated.
[6] Verify that prove -v t/db_dependent/Reserves.t passes.

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11445: regression test for duplicate hold notifications
Galen Charlton [Wed, 25 Dec 2013 17:38:39 +0000 (17:38 +0000)]
Bug 11445: regression test for duplicate hold notifications

This patch implements a regression test for verifying that
duplicate hold notifications aren't sent if ModReserveAffect() is
called repeatedly (as might happen if a circ operator accidentally
checks in an item and confirms its hold more than once).

Note that the test depends on the fact that _koha_notify_reserve()
defaults to sending a HOLD_PRINT letter if the borrower has not
specified an email or SMS hold notification.

To test:

[1] Run prove -v t/db_dependent/Reserves.t
[2] The 'patron not notified a second time (bug 11445)' test
    should fail.
[3] Apply the main patch and run prove -v t/db_dependent/Reserves.t
    again.  This time all tests should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11403: Add missing help file to new Renew page
Nicole C. Engard [Mon, 16 Dec 2013 15:53:10 +0000 (09:53 -0600)]
Bug 11403: Add missing help file to new Renew page

This patch adds a help file to the Renew page found under
Circulation.

To test:

* Go to Circulation > Renew
* Click the help link
* Confirm text and manual link are correct.

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 8921: make koha-common*.deb depend on cron-daemon
Tomas Cohen Arazi [Wed, 4 Dec 2013 17:34:05 +0000 (14:34 -0300)]
Bug 8921: make koha-common*.deb depend on cron-daemon

Trivial patch to add 'cron-daemon' as dependency for the koha-common
package. 'cron' is usually pulled in any minimal Ubuntu/Debian
install, but in some circumstances (using debootstrap) it might be
absent.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
No entry in debian/control yet, but
according to comments in the file this file is generated
from control.in - so this should be ok.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10138: (follow-up) FIX sql errors
Jonathan Druart [Tue, 24 Dec 2013 08:58:38 +0000 (09:58 +0100)]
Bug 10138: (follow-up) FIX sql errors

There were 2 INSERT in error.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I have gone ahead and fixed the typo pointed out by Mathieu:
Endommadgé-> Endommagé

Sample files install without problems, tests look good.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10138: Add some authorized values in French installer; small fixes in frameworks
Mathieu Saby [Sun, 28 Apr 2013 17:06:11 +0000 (19:06 +0200)]
Bug 10138: Add some authorized values in French installer; small fixes in frameworks

This patch adds some categories of values in French installer :

- SUGGEST
- OPAC_SUG
- REPORT_GROUP
- LOST
- DAMAGED

SUGGEST and OPAC_SUG are used by Suggestions module.
REPORT_GROUP is used by Reports module.

It also adds a new status for "ETAT" (en commande)

It creates a 995$2 subfield in french frameworks when it did not exist.
It links existing 995$2 subfield with LOST category.

It cleans up the list of authorised values installed with "Lecture
publique" framework :

- some codes are moved in general 1-Obligatoire/authorised_values.sql
  (SUGGEST, REPORT_GROUP)
- some are suppressed, because they are also defined in
  1-Obligatoire/authorised_values.sql (langue, COUNTRY, statut)
- the code for inserting the ones left is changed (I suppress the `id`
  column)

To test :
1. Take a fresh new Koha
2. Install Koha choosing French installer and UNIMARC Lecture publique
3. Check the authorised values are imported
4. Check the cataloguing frameworks are usable :
   especially 995 $2 field, which must be mapped with LOST values :
   Perdu, Long retard, Perdu et remboursé, Introuvable
   you can also check 101$a (language codes), 102$a (country codes)
5. In OPAC, make a suggestion. See if you can select a cause for your
   suggestion ("Bestseller" or "'L'exemplaire en rayon est endommagé")
6. In staff interface, manage some suggestions. See if you can select a
   cause for rejection or acceptation ("Bestseller", "Budget
   insuffisant" etc)
7. In reports, see if you can sort reports according to values of
   REPORT_GROUP ("Circulation", "Catalogue", "Adhérents" etc)

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 8018: DBRev 3.15.00.011
Galen Charlton [Fri, 27 Dec 2013 00:37:19 +0000 (00:37 +0000)]
Bug 8018: DBRev 3.15.00.011

Signed-off-by: Galen Charlton <gmc@esilibrary.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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
10 years agoBug 6331: DBRev 3.15.00.010
Galen Charlton [Mon, 23 Dec 2013 16:38:20 +0000 (16:38 +0000)]
Bug 6331: DBRev 3.15.00.010

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
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>
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>
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>
10 years agoBug 11391: DBRev 3.15.00.009
Galen Charlton [Mon, 23 Dec 2013 16:21:44 +0000 (16:21 +0000)]
Bug 11391: DBRev 3.15.00.009

Signed-off-by: Galen Charlton <gmc@esilibrary.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>
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>
10 years agoBug 11384: DBRev 3.15.00.008
Galen Charlton [Mon, 23 Dec 2013 16:17:21 +0000 (16:17 +0000)]
Bug 11384: DBRev 3.15.00.008

Signed-off-by: Galen Charlton <gmc@esilibrary.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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>