]> git.koha-community.org Git - koha.git/log
koha.git
11 years agoBug 10727: Replace carriage return with <br /> when printing hold notices
Sophie Meynieux [Wed, 14 Aug 2013 13:51:10 +0000 (15:51 +0200)]
Bug 10727: Replace carriage return with <br /> when printing hold notices

This patch replaces carriage return with <br /> in the content of
hold notices for printing. This is necessary to convert html file
into well formatted pdf file.

Test plan :
  - check in an item reserved by a borrower
    that has not activated email notification
  - verify in message_queue table that you've got a
    new HOLD_PRINT notice with status 'pending'
  - run gather_print_notices.pl <directory>

Without the patch, the script generates a html file without <br /> tags.
If you run printoverdues.sh <directory>, the text in the resulting PDF
file is all on one line

With the patch, the script generates a html file with <br/> tags and
the PDF file created by printoverdues.sh is well formatted.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 30b32d99381a8296e41e6843c440cd9e3594eb8a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10656: (follow-up) handle OPAC sorting of authvals where lib_opac is NULL
Galen Charlton [Tue, 20 Aug 2013 17:18:13 +0000 (17:18 +0000)]
Bug 10656: (follow-up) handle OPAC sorting of authvals where lib_opac is NULL

The OPAC description for an authorized value is not required to be
populated.  In particular, if it is NULL, the staff description is
displayed instead.

This patch makes sure that the sort order (in OPAC mode) uses either
the staff description or the OPAC description as needed for each
value.

To test:

[1] Make sure that AdvancedSearchTypes includes "ccode"
[1] Arrange your CCODE values so the sort order for staff labels
    is different from the sort order for OPAC descriptions.  Also,
    ensure that one of the OPAC descriptions is NULL.  For example,

    authorised_value | lib     | lib_opac
    --------------------------------------
    ZZZ              | A_STAFF | Z_PUBLIC
    DDD              | D_STAFF | NULL
    AAA              | Z_STAFF | A_PUBLIC

[2] Prior to the patch, any CCODE values where the OPAC description
    is NULL will sort first in the OPAC advanced search page, even
    if the displayed label shouldn't come first.
[3] Apply the patch.
[4] Verify that the collection list on the OPAC advanced search page
    is now correct.
[5] Verify that the sort order on the staff advanced search page
    has not changed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, tested in staff and OPAC.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0c67e94c8b8dbe1912fd5ba4b503cf53789b75a5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10656: improve sorting of shelving location and collections on OPAC advanced...
Owen Leonard [Thu, 1 Aug 2013 13:14:08 +0000 (09:14 -0400)]
Bug 10656: improve sorting of shelving location and collections on OPAC advanced search form

Collection codes and shelving locations are displayed in the OPAC and
staff client via GetAuthorisedValues which currently sorts results by
"lib, lib_opac." Consequently if lib (the description for the staff
client) doesn't match lib_opac (the description for the OPAC) sorting
will appear to be nonsensical in the OPAC. GetAuthorisedValues can be
passed an $opac parameter, so this should be used to switch how reuslts
are sorted. This patch implements such a switch.

To test, modify your collection code or shelving location authorized
values so that lib and lib_opac do not match. Set your
AdvancedSearchTypes system preference to display the modified authorized
values and view the advanced search page in the OPAC and staff client.
Sorting should be correct in each case according to the correct value
(lib in the staff client, lib_opac in the OPAC).

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tested in staff and opac and it works perfectly!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dd13998837ebd28b3b97e28da470ec341251b9b2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10656: add regression test
Galen Charlton [Tue, 20 Aug 2013 16:59:06 +0000 (16:59 +0000)]
Bug 10656: add regression test

This patch adds regression tests to verify the sort
order when fetching authorised values in either staff
or OPAC mode.

This patch also wraps the Koha.t tests in a transaction, and
better handles skipping tests if Test::Deep is not installed.

To test:

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests pass with all patches applied.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f8484348d12bac3b1e5f3d2e4fef9d3034d58969)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10678 - Update addbooks help page
Tomas Cohen Arazi [Fri, 2 Aug 2013 21:36:19 +0000 (18:36 -0300)]
Bug 10678 - Update addbooks help page

The button's name changed, and a caret was added.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
If you click the button directly, the default framework is still used.
If you use the split button functionality to select another framework,
this framework will be used for the imported record.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6fcb6712fe5411b182b6f0d23c40d3ce6d44f3eb)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10678 - Allow framework selection when creating from Z39.50
Tomas Cohen Arazi [Fri, 2 Aug 2013 18:22:43 +0000 (15:22 -0300)]
Bug 10678 - Allow framework selection when creating from Z39.50

If we are creating a new record, we are forced to use the default framework
and then change it after we have the cataloguing form filled. This patch
adds the option to choose (from a splitted button dropdown) which framework
to use.

To test:
- Apply the patch.
- Go to More > Cataloguing
- Check there's a nice split button that says "New from Z39.50"
a) Click the button, the usual Z39.50 search popup should appear and work as expected
   (check the URL parameters and see frameworkcode= has no value
b) Click on the dropdown arrow, choose a framework and the usual Z39.50 search popup should
   appear, this time frameworkcode= should have the chosen value.

Edit: fixed a small bug that prevented the default framework to be called. Thanks Owen for testing.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a2e7e6ef1cc4306e5429ca99317b96479cfa26d2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10574 - mute the "upgrading from 3.2" message
Robin Sheat [Thu, 11 Jul 2013 11:58:34 +0000 (23:58 +1200)]
Bug 10574 - mute the "upgrading from 3.2" message

New installs get the message about running a script if upgrading from
3.2. They shouldn't. This silences this message in all cases except when
you actually are upgrading from 3.2.

Test plan:

There are three scenarios to test:
1) A fresh install should not cause the prompt.
2) An upgrade with or without the debconf entry set should not cause the
   prompt.
3) An upgrade from a 3.2 release to this should cause the prompt.

To remove the debconf entry that says the prompt has been seen:

echo 'unregister koha-common/3.2-3.4-upgrade-notice' | sudo debconf-communicate koha-common

This should be run before every test to make debconf forget that it's
shown the prompt. To get its current state:

sudo debconf-show koha-common

To test against the 3.2 version, an empty package that claims to be Koha
3.2.2 is attached to the bug.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 598a830af0f97aef39bae36265c06a6f8ed73f10)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 9603 - Fix layout of Patron Card Creator Layout screen for display in IE
David Cook [Wed, 21 Aug 2013 02:12:36 +0000 (12:12 +1000)]
Bug 9603 - Fix layout of Patron Card Creator Layout screen for display in IE

Currently, the layout for the Edit/Add Layout screen of the Patron
Card Creator is in complete disarray, when viewed in Internet Explorer
(of any version).

The nav bar is pushed to the bottom of the page, every fieldset is
empty (as their contents have been pushed out into different parts
of the page), and the checkboxes don't work.

The cause appears to be some extraneous mark-up (a few extra fieldset
and li elements)and some missing mark-up (ol elements to wrap the list
elements, especially when nesting lists within each other and within
div elements).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I didn't test this in IE, but changes are fixing general
problems with HTML validity.

Checking the page with the W3C validator:
Before: 27 Errors, 7 warning(s)
After:  6 Errors, 7 warning(s)

All tests and QA script pass, page looks alright.
Would be nice to see the remaining problems fixed in
a follow-up.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 76a1a00977657132180f0715d96db5702565f1bf)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10588: improve selection of default branch for OPAC popular items pag
Fridolyn SOMERS [Mon, 15 Jul 2013 10:14:53 +0000 (12:14 +0200)]
Bug 10588: improve selection of default branch for OPAC popular items pag

In OPAC most popular items page:
With user is logged-in his branch should be selected by default.
When a branch is manually selected and form is submitted, this branch
should be selected in results page.
When looking at HTML, you see that all options are selected in combobox.

This patch corrects by using the hidden input 'do_it' to distinguish
form display and no branch filter selected.

Test plan :
- Make sure there are issues on records created in the past 3 month
- Go to OPAC not logged-in
- Click on "Most popular"
=> You get to page with results, "All libraries" is selected
- Select a branch and submit
=> You get to page with results, the branch is selected [testing opac-topissues.inc from]
- Select a branch and perform a search that does not have results (for example an item type never issued)
=> You get to page without results, the branch is selected [testing opac-topissues.tt form]
- Log-in with a user
- Click on "Most popular"
=> You get to page with results, user's branch is selected
- Select "All libraries" and submit
=> You get to page with results, "All libraries" is selected [testing opac-topissues.inc from]
- Select "All libraries" and perform a search that does not have results (for example an item type never issued)
=> You get to page without results, "All libraries" is selected [testing opac-topissues.tt form]

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 600e953dff44c29fe7a2996fbacbd8e57cd7eb35)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10786: fix Javascript error on the parcel page
Jonathan Druart [Tue, 27 Aug 2013 10:04:14 +0000 (12:04 +0200)]
Bug 10786: fix Javascript error on the parcel page

The include of the yui json file generates a js error: YAHOO is not
defined.

This file seems not to be in use (patches for bug 8382 remove the use).

To test:
- go on acqui/parcel.pl?invoiceid=XXX
- verify the error occurs (with firebug)
- apply this patch
- refresh the page
- verify this error does not appear anymore
- Verify there is no regression on this page

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch fixes the javascript error pointed out by Firebug.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d1f8d8811b1d2d96f1b087edf42f395c89c8df0f)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 5904: make patron search autocompletion respect IndependentBranches
Jonathan Druart [Thu, 27 Jun 2013 13:33:46 +0000 (15:33 +0200)]
Bug 5904: make patron search autocompletion respect IndependentBranches

Test plan:
- Add a staff user foo in a library A
- Add a staff user bar in a library B
- log in as foo and try to search 'bar'
- Switch on (Prevent) the syspref IndependentBranches
- the search returns no result
- log in as a superlibrarian
- Check that you are allowed to search all patrons.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
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 6b72f249082fc6be8811c3dacec15648f7c5ccd9)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 7143: history.txt and about page updates
Galen Charlton [Wed, 28 Aug 2013 16:27:43 +0000 (16:27 +0000)]
Bug 7143: history.txt and about page updates

- two new developers
- releases

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Reads all ok.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dd367efddf887e3197492f11996a36c0d6c5e4c4)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10755 - Add "Keyword as Phrase" to staff client advanced search indexes
David Cook [Mon, 19 Aug 2013 01:29:13 +0000 (11:29 +1000)]
Bug 10755 - Add "Keyword as Phrase" to staff client advanced search indexes

This patch adds a "Keyword as Phrase" index to the search options in
the staff client.

Test Plan:

1) Go to the Advanced Search in the staff client and click on the "Keyword"
drop-down list.
2) Note that there is only a "Keyword" not a "Keyword as Phrase" option
3) Apply the patch
4) Reload the Advanced Search
5) Note that there is now a "Keyword as Phrase" option as well

If you want to test the functionality...it will depend on your catalogue
data.

Basically, a phrase search will allow you to find "Keyword Adjacent To
Keyword" rather than a more scattershot search that finds the keywords
regardless of their position to each other.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Template change is correct, and in my tests the searching behavior was
correctly modified: Using "keyword as phrase" returned only results
where the terms were adjacent.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, trivial patch with no possible side effects.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a1a4ff2bef3c94bafbf55b5995bc92bb46cdfa02)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10699: add explicit return value for DeleteBranchTransferLimits()
Kenza Zaki [Thu, 8 Aug 2013 09:40:13 +0000 (11:40 +0200)]
Bug 10699: add explicit return value for DeleteBranchTransferLimits()

This patch adds return values to DeleteBranchTransferLimits:
1 if a Transfer Limit is deleted
undef if no parameters is given
0E0 if a wrong parameter is given

More, it fixes and adds some tests in t/db_dependent/Circulation_transfers.t

To test :
prove t/db_dependent/Circulation_transfers.t
t/db_dependent/Circulation_transfers.t .. ok
All tests successful.
Files=1, Tests=14, 19 wallclock secs ( 0.02 usr  0.01 sys +  0.39 cusr  0.02 csys =  0.44 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with patch for bug 10692 applied.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 88f15db30a9da6a24cf575759a97e8765be61ad4)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10693: (follow-up) fix parameter checking in CreateBranchTransferLimit()
Galen Charlton [Wed, 28 Aug 2013 15:16:28 +0000 (15:16 +0000)]
Bug 10693: (follow-up) fix parameter checking in CreateBranchTransferLimit()

There is nothing prevent '0' from being used as a library code.

To test:

Run prove -v t/db_dependent/Circulation_transfers.t and verify that
the tests pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6751c5dc7c963defd0a31adfd46d0665abf41cd6)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should...
Kenza Zaki [Wed, 7 Aug 2013 14:35:35 +0000 (16:35 +0200)]
Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should be more explicit

This patch test if the parameters $toBranch and $fromBranch are given.
If not, CreateBranchTransferLimit now returns undef.
This patch also fixes and adds some regression tests in
t/db_dependent/Circulation_transfers.t

NOTE:
Currently, we can add a transferlimit to nonexistent branches because
in the database branch_transfer_limits.toBranch
and branch_transfer_limits.fromBranch aren't foreign keys.

To test:
prove t/db_dependent/Circulation_transfers.t
t/db_dependent/Circulation_transfers.t .. ok
All tests successful.
Files=1, Tests=15, 18 wallclock secs ( 0.02 usr  0.01 sys +  0.42 cusr  0.00 csys =  0.45 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
(cherry picked from commit 3c61f95fb41152994ca2807eee87dc8e13ba219d)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10692: add unit tests for C4::Circulation routines about transfers
Kenza Zaki [Wed, 7 Aug 2013 13:54:01 +0000 (15:54 +0200)]
Bug 10692: add unit tests for C4::Circulation routines about transfers

The tests are wrap in a transaction.

NOTE: Currently, some tests should pass but don't because of incoherences in the code.
These tests are in comments and preceded by FIXME.

To test:
prove t/db_dependent/Circulation_transfers.t
t/db_dependent/Circulation_transfers.t .. ok
All tests successful.
Files=1, Tests=12, 18 wallclock secs ( 0.02 usr  0.01 sys +  0.37 cusr  0.06 csys =  0.46 CPU)
Result: PASS

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>
(cherry picked from commit a58c5334c96105315ee3bf1cbb62d8c1aab82f0c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10710: (follow-up) perltidy new code
Galen Charlton [Wed, 14 Aug 2013 16:37:49 +0000 (16:37 +0000)]
Bug 10710: (follow-up) perltidy new code

Also, I prefer the use of parentheses for function
calls, even when no arguments are being passed.
One missed comma turns

is(GetOfflineOperation, ...)

into

is(GetOfflineOperation ...)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 35b83e540ea6d2f9856de827cfcad7c3b2b07f82)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10710: add unit tests for OfflineOperation's routines in C4/Circulation.pm
Kenza Zaki [Mon, 12 Aug 2013 12:16:46 +0000 (14:16 +0200)]
Bug 10710: add unit tests for OfflineOperation's routines in C4/Circulation.pm

This patch test AddOfflineOperation,GetOfflineOperation and
DeleteOfflineOperation in C4/Circulation.pm.

The tests are wrapped in a transaction.

Note: Currently, GetOfflineOperations is not tested because we cannot
mock C4::Context->userenv in unit tests

To test:

prove t/db_dependent/Circulation_OfflineOperation.t
t/db_dependent/Circulation_OfflineOperation.t .. ok
All tests successful.
Files=1, Tests=7, 19 wallclock secs ( 0.01 usr  0.01 sys +  0.33 cusr  0.02 csys =  0.37 CPU

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 87890bc366d566685f1484cb476200f5ca302e91)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10767: (follow-up) remove FIXME comments
Galen Charlton [Wed, 28 Aug 2013 14:44:01 +0000 (14:44 +0000)]
Bug 10767: (follow-up) remove FIXME comments

The FIXME comments in the new test script were based on
an assumption that GetIssuingRules() should return
multiple rules if no or only partial parameters are
passed.  This is not the intent of that routine, whose
purpose is to return the *singular* rule that best
applies to a given loan situation.  In other words,
GetIssuingRule() is not a traditional accessor function.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c191532cc0c908ccbd5019a0d49c721e5702e7a6)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10767: add unit tests for C4::Circulation routines that use issuingrules
Kenza Zaki [Tue, 20 Aug 2013 08:18:04 +0000 (10:18 +0200)]
Bug 10767: add unit tests for C4::Circulation routines that use issuingrules

The test are wrap in a transaction.

To test:
prove t/db_dependent/Circulation_Issuingrule.t
t/db_dependent/Circulation_Issuingrule.t .. ok
All tests successful.
Files=1, Tests=9, 17 wallclock secs ( 0.02 usr  0.00 sys +  0.34 cusr  0.04 csys =  0.40 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: No koha-qa errors
prove t/db_dependent/Circulation_Issuingrule.t run without errors

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 08d45913d68d85eea1a1b2bab604b184d323ded5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10629: remove inappropriate uses of $sth->finish() in C4::Branch
Kenza Zaki [Tue, 23 Jul 2013 13:27:23 +0000 (15:27 +0200)]
Bug 10629: remove inappropriate uses of $sth->finish() in C4::Branch

Test plan :
Check if the regression tests still works
prove t/db_dependent/Branch.t
t/db_dependent/Branch.t .. 1/36 Using a hash as a reference is deprecated at t/db_dependent/Branch.t line 207.
t/db_dependent/Branch.t .. ok
All tests successful.
Files=1, Tests=36,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.12 cusr  0.00 csys =  0.16 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
From the man page

finsh()
Indicate that no more data will be fetched from this statement handle
before it is either executed again or destroyed.
You almost certainly do not need to call this method.

Adding calls to "finish" after loop that fetches all rows is a common
mistake, don't do it, it can mask genuine problems like uncaught fetch errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4287fd9d1c3ae16a0496b6261de44642bc92ab9c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10508: (follow-up) remove Perl 5.14 construct
Galen Charlton [Wed, 28 Aug 2013 14:24:34 +0000 (14:24 +0000)]
Bug 10508: (follow-up) remove Perl 5.14 construct

Also added parentheses to bare function calls.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7fa8e92e8e261f822b610da65b28a094e21e452c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10508: (follow-up) fix a typo
Chris Cormack [Mon, 26 Aug 2013 22:29:42 +0000 (10:29 +1200)]
Bug 10508: (follow-up) fix a typo

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Thx for the follow-up Chris!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7a6bd88e497901bd7dc02e1964717da20313c0d8)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10508: add unit tests for C4::Branch
Kenza Zaki [Tue, 2 Jul 2013 12:24:08 +0000 (14:24 +0200)]
Bug 10508: add unit tests for C4::Branch

Unit tests are wrap in a transaction.

To test:
prove t/db_dependent/Branch.t
t/db_dependent/Branch.t .. 1/36 Using a hash as a reference is deprecated at t/db_dependent/Branch.t line 207.
t/db_dependent/Branch.t .. ok
All tests successful.
Files=1, Tests=36,  1 wallclock secs ( 0.02 usr  0.02 sys +  0.13 cusr  0.01 csys =  0.18 CPU)
Result: PASS

http://bugs.koha-community.org/show_bug.cgi?id=10508
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 68bf770f9238d6b05b9383e521969a6782b068d5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10690 - Warn about trailing slashes in description of OPACBaseURL and staffClient...
Magnus Enger [Tue, 6 Aug 2013 14:00:01 +0000 (16:00 +0200)]
Bug 10690 - Warn about trailing slashes in description of OPACBaseURL and staffClientBaseURL

The descriptions for OPACBaseURL and staffClientBaseURL are not explicit
about including a trailing slash or not. This patch makes it explicit
that the trailing slash should *not* be included.

To test:
- Apply the patch
- Search for "baseurl" in the system preferences
- Check that the description of both sysprefs includes a warning about
  not including a trailing slash.
- Sign off

If you want to check that the trailing slash is in fact superfluous you
can do something like 'grep -r "BaseURL" *' and check that these
sysprefs are usually concatenated with some string that starts with a
slash.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Changes to the description appear correctly on both system
preferences.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit da40fe77fc471cfe8e797a7be5f87a506cf9d921)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10130: widen input fields for library configuration
Owen Leonard [Mon, 19 Aug 2013 18:48:00 +0000 (14:48 -0400)]
Bug 10130: widen input fields for library configuration

Most input fields in the library entry form (admin/branches.pl) have no
explicit width, so they display with a browser-default width. This patch
gives explicit widths to those fields, giving more room for entry.

Other fields have been given an explicit width and/or maxwidth according
to the database table structure.

To test, add or edit a library in Administration -> Libraries and
Groups. Form fields should be more comfortable for entry, and add/edit
actions should complete correctly.

Signed-off-by: Campbell Reid-Tait <campbellreidtait@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template changes only, works nicely.
Tested editing and adding libraries in administration.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 08330ec05b8854df61bb28c2498b6ef0a727589e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10587: fix HTML errors on authority detail page in OPAC
Owen Leonard [Fri, 9 Aug 2013 15:41:41 +0000 (11:41 -0400)]
Bug 10587: fix HTML errors on authority detail page in OPAC

A validator check of the OPAC's authority detail returns a few minor
errors. This patch corrects the errors.

To test, apply the patch and run an OPAC authority detail page through
an HTML validator. There should be no errors which are specific to the
authorities detail template (as opposed to header and footer includes).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Also checked using the W3C validator and testing the
authority detail page in the OPAC is still correctly
displayed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 452a4b7775ce10655543aa81f670e2fb497ccc9b)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10593: make AuthoritiesLog default to yes
Tomas Cohen Arazi [Mon, 15 Jul 2013 14:56:14 +0000 (11:56 -0300)]
Bug 10593: make AuthoritiesLog default to yes

This trivial patch set the default to 'yes' for this system preference.
To test,
On a clean install
- Navigate Home > Administration > Global System preferences > Logs
- AuthoritiesLog is set to "Don't log"
Apply the patch, install koha on a new DB.
- Navigate Home > Administration > Global System preferences > Logs
- AuthoritiesLog should be set to "Log"

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
One line patch, changing the default for new installations only.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0cfe0fa92328e62d1fbca33ea69869ad4f034c1b)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 9247 - Add two more usage examples to the manpage for koha-mysql
Magnus Enger [Tue, 30 Jul 2013 13:32:31 +0000 (15:32 +0200)]
Bug 9247 - Add two more usage examples to the manpage for koha-mysql

It might not be immediately obvious that it is possible to send
SQL queries "directly" to the koha-mysql command, or that files
from mysqldump can be loaded with it. This patch adds these as
"example usage" to the man page for koha-mysql.

To test:

Run these commands and look at the formatted man page:
$ xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
  debian/docs/koha-mysql.xml
$ man -l koha-mysql.8

Make sure this test passes:
$ prove -v xt/verify-debian-docbook.t

This patch also corrects a couple places where "Koha" was written as "koha".

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan, all tests and QA script pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5b121593800088656a0430da641b4c12a4e53980)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10528: add unit tests for C4::Bookseller.pm
Kenza Zaki [Tue, 23 Jul 2013 14:46:38 +0000 (16:46 +0200)]
Bug 10528: add unit tests for C4::Bookseller.pm

The tests are wrapped in a transaction.

NOTE: some tests should pass but doesn't because of incoherences in
the code.  These tests are in comments and preceded by FIXME

Test plan:
prove t/db_dependent/Bookseller.t
t/db_dependent/Bookseller.t .. 15/53
[Some warnings about uninitialised values]
t/db_dependent/Bookseller.t .. ok
All tests successful.
Files=1, Tests=53,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.46 cusr  0.03 csys =  0.51 CPU)
Result: PASS

http://bugs.koha-community.org/show_bug.cgi?id=10528

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
The new tests pass nicely, as do all old tests and the QA script.
All patches marked as dependencies have been pushed to master
already.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dc7b5b10e737cc34452dfc6c061cd7c893f08983)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10557: remove unused branch parameter from GetBooksellersWithLateOrders
Jonathan Druart [Tue, 9 Jul 2013 10:02:00 +0000 (12:02 +0200)]
Bug 10557: remove unused branch parameter from GetBooksellersWithLateOrders

C4::Booksellers::GetBooksellersWithLateOrders has an unused parameter.
The $branch variable is never used in the routine.

Test plan:
Check that no behavior changes on the late orders page.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I couldn't find any use of the branch parameter apart from
the one corrected by this patch. Also tested late orders,
couldn't find any problems.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7f075448b8e00596ece780cca654471eebf949a3)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 9820 follow-up: fix a typo
Jared Camins-Esakov [Tue, 6 Aug 2013 00:33:27 +0000 (20:33 -0400)]
Bug 9820 follow-up: fix a typo

Although the XSLT template was renamed to nameABCQ, one instance of
the old name (nameABCDQ) was not corrected. This patch corrects that.

To test: Follow test plan on previous patch

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1e1ccd68aa0642167c2578d167ff3ec343df3a78)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 9820: display titles in MARC21 name headings better in XSLT mode
Galen Charlton [Fri, 15 Mar 2013 21:17:09 +0000 (14:17 -0700)]
Bug 9820: display titles in MARC21 name headings better in XSLT mode

Prior to this patch, if a 100/700 had a $c, it would be
displayed with no space between the contents of $a and $c in XSLT mode.

For example,

100 1#$aSeuss,$cDr.

would be displayed as

SeussDr

The problem was caused by the original version of the stylesheets
drawing a bit too much from the MARC21 to MODS transformation.

To test:

[1] In a MARC21 database, turn on XSLT display mode for
    staff and OPAC.
[2] Create or identify a bib that has a 100 or 700 field
    with both a $a and a $c.
[3] Before applying the patch, verify that the name is
    displayed in bib details and search results with the
    name and title squashed together.  For example, "SeussDr"
[3] After applying the patch, verify that the name displays
    in bib details and search results with a space and
    intervening punctuation between the name and the title.  For
    example, "Seuss, Dr."

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes test plan, works nicely.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 75959da681ae5f78e70dfd7205a22d16fd28ae38)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10645: adding missing zebra languages to koha-create manpage
Tomas Cohen Arazi [Thu, 25 Jul 2013 19:08:43 +0000 (16:08 -0300)]
Bug 10645: adding missing zebra languages to koha-create manpage

There were some missing zebra language options in the man page for koha-create.

Trivial string change.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested using the following commands:

$ xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
  debian/docs/koha-list.xml
$ man -l koha-list.8

Also:
prove -v xt/verify-debian-docbook.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 90cf2f3a265a741bc4d475077dc3a604a08e6192)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10766: unbreak reservoir search when UseQueryParser is OFF
Galen Charlton [Mon, 19 Aug 2013 18:22:00 +0000 (18:22 +0000)]
Bug 10766: unbreak reservoir search when UseQueryParser is OFF

To test:

[1] Turn UseQueryParser off.
[2] Ensure that your database has records in the reservoir.  Performing
    a Z39.50 search will do this.
[3] Perform a broad cataloging (i.e., cataloguing/addbooks.pl search).
    Note that results are returned from the main catalog but that no
    reservoir results are returned.
[4] Apply the patch.
[5] Perform the search again.  This time, there should be both catalog
    and reservoir results.
[7] Enable QueryParser.  Perform the search again, and verify that the
    catalog and reservoir results are the same.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works nicely, passes all tests, and the QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4309e5e6b4682b95db4ca26f7a49f96c2f6c2875)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10741: (follow-up) add regression test
Galen Charlton [Fri, 23 Aug 2013 15:58:01 +0000 (15:58 +0000)]
Bug 10741: (follow-up) add regression test

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8e7379342d7cd8386baf884a77f54f95188bb85c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10741: reformat test for displaying place hold link in OPAC search results
Fridolyn SOMERS [Fri, 16 Aug 2013 11:53:04 +0000 (13:53 +0200)]
Bug 10741: reformat test for displaying place hold link in OPAC search results

To test:

[1] Turn on the syspref for enabling OPAC holds.
[2] Create an item and bring it up on the OPAC search
    results.  Run through the following possibilities,
    by changing the item, and verify that the place hold
    link in OPAC search results appears only when the item is

    - not lost AND
    - not withdrawn AND
    - not damaged (or is damged and AllowHoldsOnDamagedItems is ON) AND
    - the item is not marked not-for-loan OR
      the item has a negative notforloan value (e.g., it is on order)

    Note that it is necessary to reindex the test bib after making
    each change to the test item.

[3] Also verify that whether or not in the item is in transit does
    NOT affect whether the place hold link appears.
[4] Verify that there is no regression on bug 8975 (i.e., if an
    item is on order, that status should be displayed in staff client
    search results).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 397ba93f97855625865689ef0dd0c69a20c8a915)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10741: restore holdability of in-transit items on OPAC search results
Fridolyn SOMERS [Fri, 16 Aug 2013 11:36:10 +0000 (13:36 +0200)]
Bug 10741: restore holdability of in-transit items on OPAC search results

In search results, one could not place a hold on an item in transit
and for loan (items.notforloan=0).  This appears when AllowOnShelfHolds
is allowed.

This patch repairs a regression introduced by the patch for bug 8975.

Test plan :
- Set AllowOnShelfHolds to on
- Create a record with a normal item : not lost, not withdrawn, not
  damaged, notforloan=0
- Index this record
- Perform a search on OPAC that returns this record (and others)
=> You see in actions "Place hold"
- Add this item in transit : /cgi-bin/koha/circ/branchtransfers.pl
- Re-perform the search on OPAC
=> You see in actions "Place hold" and item "in transit"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 239513dc7a13a1a31356b59ab8e36b120c0fa281)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10743: Add styles to 'my privacy' page in OPAC
Nicole C. Engard [Fri, 16 Aug 2013 02:08:41 +0000 (22:08 -0400)]
Bug 10743: Add styles to 'my privacy' page in OPAC

This patch does a couple things.  Most importantly it adds
a new div around the privacy rules summary so that it can
be easily changed. It also moves the start of the form to
right above the form's select box so that it's not in the
new privacy rules div.

To test:

* Apply patch
* Enable the use of privacy via the sys prefs
* Log in to the OPAC
* Visit the 'my privacy' tab
* Make sure it looks okay
* Submit the form and make sure it works
* Repeat in the other theme

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Edit: Replaced a few tabs with spaces to keep the QA script happy.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, privacy options can still be edited.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 841fe4559f6264295ec4cfde6ddd6e22a151d6bf)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10628: make sure AutomaticItemReturn doesn't prevent holds queue from filling...
Kyle M Hall [Tue, 23 Jul 2013 12:05:22 +0000 (08:05 -0400)]
Bug 10628: make sure AutomaticItemReturn doesn't prevent holds queue from filling local holds with local items

For some reason, C4::HoldsQueue::MapItemsToHoldRequests used the system
preference AutomaticItemReturn to decide if an attempt to fill local
holds with local items. No explanation of this behavior is provided.

This patch removes this behavior, and also adjusts the calculation
of the lead-cost library to always return the pickup library if it
is on the list of libraries that could fill the hold -- on the
basis that if the item is already at the pickup library, its
transport cost is inherently zero.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and adds unit tests.
Tested with some examples and those worked correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d46657f8af980524a4351e40abe0b901d1af3e6a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Small merge problem in the tests.

11 years agoBug 8670 - Update POD of C4::Branch::GetBranches() to use TT syntax
Owen Leonard [Mon, 19 Aug 2013 14:55:52 +0000 (10:55 -0400)]
Bug 8670 - Update POD of C4::Branch::GetBranches() to use TT syntax

This patch updates the example template syntax in the POD for
C4::Branch::GetBranches() to use Template Toolkit syntax.

To test, view the POD for C4::Branch::GetBranches() and confirm that it
looks correct.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Checked the POD with "perldoc C4/Branch.pm" before and after applying
the patch. The example now uses TT syntax, and looks sensible.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7ae3ea68579b3f870d7e42968c3727ecffac7f02)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10763 - [SIGNED-OFF] Update POD of C4::Creators::Lib::html_table() to use TT...
Owen Leonard [Mon, 19 Aug 2013 15:16:51 +0000 (11:16 -0400)]
Bug 10763 - [SIGNED-OFF] Update POD of C4::Creators::Lib::html_table() to use TT syntax

This patch updates the example template syntax in the POD for
C4::Creators::Lib::html_table() to use Template Toolkit syntax.

To test, view the POD for C4::Creators::Lib::html_table() and confirm
that it looks correct.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Checked the POD with "perldoc C4/Creators/Lib.pm" before and after applying
the patch. The example now uses TT syntax, and looks sensible.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 54c6dccca70a142c14fff049cb3212694af86610)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10764 - Update POD of C4::Items::GetItemStatus() to use TT syntax
Owen Leonard [Mon, 19 Aug 2013 15:37:55 +0000 (11:37 -0400)]
Bug 10764 - Update POD of C4::Items::GetItemStatus() to use TT syntax

This patch updates the example template syntax in the POD for
C4::Items::GetItemStatus() to use Template Toolkit syntax.

To test, view the POD for C4::Items::GetItemStatus() and confirm that it
looks correct.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
This patch works as advertised (verified with "perldoc C4::Items"),
for GetItemStatus, but it does not fix a a similar example for
GetItemLocation in the same file, which still has the old template
syntax. So a followup or separate bug for that is called for.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
It seems the default option is not in used in templates.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d515457c719197e66bd0a10c7011b407af2faa23)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10765 - [SIGNED-OFF] Update POD of C4::Koha::GetSupportList() to use TT syntax
Owen Leonard [Mon, 19 Aug 2013 16:06:31 +0000 (12:06 -0400)]
Bug 10765 - [SIGNED-OFF] Update POD of C4::Koha::GetSupportList() to use TT syntax

This patch updates the example template syntax in the POD for
C4::Koha::GetSupportList() to use Template Toolkit syntax.

To test, view the POD for  C4::Koha::GetSupportList() and confirm that
it looks correct.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
This patch works as advertised (verified with "perldoc C4::Koha"),
for GetSupportList, but it does not fix a a similar example for
GetItemTypes, getauthtypes and getframework in the same file,
which still has the old template syntax. So a followup or separate
bug(s) for those are called for.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
It seems the default option is not in used in templates.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3429e5e16da0b23615fac4ca0bb6251fac70301c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10081: add library name to IndependentBranches error message
Owen Leonard [Tue, 13 Aug 2013 16:27:28 +0000 (12:27 -0400)]
Bug 10081: add library name to IndependentBranches error message

With IndependentBranches turned on, if you try to check out an item
which belongs to another library you will get an error message which is
missing the library name. This patch corrects the problem by passing the
necessary variable to the template and outputting the library name using
the KohaBranchName TT plugin.

To test, turn on IndependentBranches and try to check out an item
belonging to another library (note that you must test with a staff user
who is not a superlibrarian). The error message you see should include
the name of the library to which the item belongs:

"This item belongs to Nelsonville and cannot be checked out from this
location."

Checkouts of items belonging to the library should be unaffected.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 50ff4f4a94598ce197c0ca5656d314195cf69d07)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10701: fix display of transit status on the bibliographic detail page
Owen Leonard [Thu, 8 Aug 2013 19:37:35 +0000 (15:37 -0400)]
Bug 10701: fix display of transit status on the bibliographic detail page

The patch for Bug 10083 incorrectly changed some template variable names
so that in-transit details could not be shown on the biblio detail page.
This patch corrects the error.

To test, perform any action that will trigger an transfer between
libraries (for instance, check in an item from Library A at Library B).
View the detail page for that title and look for the transfer details in
the status column of the holdings table. It should show correct
information:

"In transit from Athens to Nelsonville since 08/08/2013"

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work as described, no errors.
Before patch incorrect information: "In transit from to since"
after patch correct information.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works perfectly and passes all tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0a6e9c48c5c63e17318f4c8e5c7f0400bab0c363)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10704: make OPAC highlighting work across previous/next travel
Jonathan Field [Fri, 9 Aug 2013 10:38:31 +0000 (11:38 +0100)]
Bug 10704: make OPAC highlighting work across previous/next travel

To test

Enable 'OpacHighlightedWords'

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7d0aea7c39e22f42760c3ecbba4c0cd0818785a7)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agobug 10728: fix additional log noise generated by subscription-renew.pl
Galen Charlton [Wed, 14 Aug 2013 14:53:25 +0000 (14:53 +0000)]
bug 10728: fix additional log noise generated by subscription-renew.pl

To test:

[1] Use the renew link to bring up the subscription renewal form.
[2] Verify that a warning message containing the text
    'Problem = a value of 1 has been passed to param without key'
    was not added to the Apache error log.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6e864430caaa951b06d5fecff3fe7864317e5e26)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10728: fix log noise generated by subscription-renew.pl
Colin Campbell [Wed, 14 Aug 2013 14:26:34 +0000 (15:26 +0100)]
Bug 10728: fix log noise generated by subscription-renew.pl

Error log is showing warnings because mode is undefined
and we are doing string comparisons on it.

Set it to a default value (we were already assigning it a variable
which we were not using) and use the the result in the comparison

To test, after applying the patch:

[1] Use the renew link from the subscription detail page to renew
    a subscription.
[2] Verifying that doing this did not add a warning containing
    'subscription-renew.pl: Use of uninitialized value $mode in string eq '
    to the Apache error log.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 27edb618dd604e0a718f43e98ed97255f72eb515)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10573: (follow-up) update license and copyright statement
Galen Charlton [Sat, 17 Aug 2013 16:04:34 +0000 (16:04 +0000)]
Bug 10573: (follow-up) update license and copyright statement

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 971449866fc23ff9c0c083754e4dd9c53d8d4cdc)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10573: (followup) French translation for printing a basketgroup
Bernardo Gonzalez Kriegel [Thu, 8 Aug 2013 18:54:22 +0000 (15:54 -0300)]
Bug 10573: (followup) French translation for printing a basketgroup

small followup to fix tabs

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a9cd81e6858dda89d95625520108fa0b269ff770)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10573: French translation for printing a basketgroup
Christophe Croullebois [Wed, 10 Jul 2013 14:57:12 +0000 (16:57 +0200)]
Bug 10573: French translation for printing a basketgroup

If you want to print a basketgroup with pdf format, it will be in
English.  The pdf is done with layout2pages.pm or layout3pages.pm,
which call layout2pages.pdf or layout3pages.pdf.

This patch adds layout3pagesfr.pm in src/acqui/pdfformat/ which
calls layout3pagesfr.pdf.

And adds in basketgroup.pl the check for layout3pagesfr
To use it you have to change the systempreferences to  pdfformat::layout3pagesfr

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work as described, koha-qa reports some tab errors.
Corrected in a followup.

Please, always add a test plan, it's easier to test.

Test:
1) apply the patch
2) change syspref OrderPdfFormat to pdfformat::layout3pagesfr
3) select a vendor
4) create a basket group (empty works)
5) close basket group
6) print basket group
7) PDF is in french

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works nicely, although it would be better if we could
find a more general solution to make the templates editable
and translatable.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a7fe13a52f320e6aded1f3313f721bd7fd73fb52)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
I don't like the approach, but I wouldn't hold this one until a proper solution comes up.

11 years agoBug 10028: fix how ModReceiveOrder() calls NewOrder()
Jonathan Druart [Thu, 11 Apr 2013 10:00:45 +0000 (12:00 +0200)]
Bug 10028: fix how ModReceiveOrder() calls NewOrder()

In C4::Acquisition::ModReceiveOrder, a call to NewOrder is badly used.

NewOrder returns ($basketno, $ordernumber) but in ModReceiveOrder the
ordernumber is got with
  my $ordernumber = NewOrder( $args );

It works because:
sub t{
    return ("a", "b");
}
my $a = t();
say $a;

Will display 'b'.

But it is not really clear.

Test plan:
Check that there is no regression for partial receives.

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>
(cherry picked from commit 29689de399a8927547c36e53461c7766ecc604f0)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10686: Remove fields from searches for highlighting
Jared Camins-Esakov [Tue, 6 Aug 2013 00:56:48 +0000 (20:56 -0400)]
Bug 10686: Remove fields from searches for highlighting

If you do a fielded search like au:smith, "Smith" will not get
highlighted on the results page because the Javascript is looking for
the exact string "au:smith."

To test:
1) Turn on OpacHighlightedWords.
2) Do a simple keyword search.
3) Confirm that the word is highlighted on the results and details page.
4) Do a fielded search by entering au:smith (or whatever).
5) Confirm that the word is highlighted on the results and details page.
6) Sign off.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
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 b0ea3be36c8e7ae6dc6f28820b1c26fc909d9039)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10642: fix inappropriate uses of $sth->finish() in C4::RotatingCollections.pm
root [Thu, 25 Jul 2013 11:47:09 +0000 (13:47 +0200)]
Bug 10642: fix inappropriate uses of $sth->finish() in C4::RotatingCollections.pm

From the man page

finish()
Indicate that no more data will be fetched from this statement handle
before it is either executed again or destroyed.
You almost certainly do not need to call this method.

Adding calls to "finish" after loop that fetches all rows is a common
mistake, don't do it, it can mask genuine problems like uncaught fetch errors.

To test:

Verify that prove -v t/db_dependent/RotatingCollections.t passes

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, passes UT provided by bug 10653

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d1b3e4ab6b432844e076e1eb0662a9c04a5f412e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 8887: only display desired result when doing exact syspref search
Marc Veron [Sun, 7 Oct 2012 17:54:44 +0000 (19:54 +0200)]
Bug 8887: only display desired result when doing exact syspref search

This patch fixes an issue where entering the complete name of a system
preference when doing a syspref search in the staff interface resulted
in the display of *all* preferences belonging to the desired one's
module.

Since providing a more specific search string should result in getting
back more specific results, the previous behavior was not intuitive.

Test scenario:

a) In sysprefs, do a search with partial match (e.g. intranetcolor)
-> Result shows one entry: intranetcolorstylesheet
b) Do an exact search. e.g. intranetcolorstylesheet
-> Result shows all Staff Client preferences

Apply patch, test again. Now b) behaves like a).

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
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 9bc53a0fccc3b673dca43791ebfcb53fd6e0a9ee)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 9238 - make fund pull down say 'select fund', not 'select budget'
Owen Leonard [Tue, 13 Aug 2013 14:05:58 +0000 (10:05 -0400)]
Bug 9238 - make fund pull down say 'select fund', not 'select budget'

When adding a new order to a basket the fund selection field is labeled
"Fund:" but the default option is "Select a budget." This patch changes
this string to "Select a fund" and also corrects the associated
JavaScript error message text displayed when one doesn't choose a fund.

To test, add an order to basket. The "New order" form should show
"Select a fund" as the default option for "Fund" in the "Accounting
details" section. If you submit the form without selecting a fund the
error message should read "You must select a fund."

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
tests pass

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
String updates only, passes koha-qa.pl

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dbe233a0e5d86975c28918d8b7023b70bdd29d38)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10653: (follow-up) minor tweaks to RotatingCollections tests
Galen Charlton [Fri, 16 Aug 2013 16:09:13 +0000 (16:09 +0000)]
Bug 10653: (follow-up) minor tweaks to RotatingCollections tests

- remove unnecessary module import
- use parentheses for all C4 function calls

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 40aa42f31f10acad92da5f2c57319f049fba9289)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10653: add unit tests for C4::RotatingCollections.pm
Kenza Zaki [Tue, 30 Jul 2013 11:43:19 +0000 (13:43 +0200)]
Bug 10653: add unit tests for C4::RotatingCollections.pm

The tests are wrap in a database transaction.

Test plan:
prove t/db_dependent/RotatingCollections.t
t/db_dependent/RotatingCollections.t .. ok
All tests successful.
Files=1, Tests=41, 20 wallclock secs ( 0.02 usr  0.01 sys +  0.41 cusr  0.02 csys =  0.46 CPU)
Result: PASS

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>
(cherry picked from commit 12061f44beb46709e03d09f7ff61551fa9297b2e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10481: (follow-up) fix typo in POD
Galen Charlton [Fri, 16 Aug 2013 15:00:35 +0000 (15:00 +0000)]
Bug 10481: (follow-up) fix typo in POD

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1e84b1217afc74f490423538b7b8808e3d34513a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded
Jonathan Druart [Thu, 11 Jul 2013 09:45:06 +0000 (11:45 +0200)]
Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded

prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t
t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. ok
All tests successful.
Files=1, Tests=3,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.38 cusr
0.01 csys =  0.41 CPU)
Result: PASS

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1c8efaf3f9b14caf5f6512149d5fcd957bd3e487)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10481: FIX No enrollment fee when changing patron category.
Jonathan Druart [Mon, 17 Jun 2013 12:56:22 +0000 (14:56 +0200)]
Bug 10481: FIX No enrollment fee when changing patron category.

When a patron changes to a category with enrollment fee, they
are not generated.

Test plan:
- Choose a category without fee (e.g. Kid)
- Add an enrollment fee for another category (e.g. Young adult)
- Choose a kid and change his category to "Young adult".
- Note the warning message "Fees & Charges: Patron has Outstanding fees
  & charges of XX" on the check out page.

This patch also moves all instances of adding the enrollment fee
to a new routine in C4::Members, AddEnrolmentFeeIfNeeded(), so
additional tests include:

- Register a new patron and give it a category that has
  an enrollment fee.  Verify that the fee is charged.
- Renew the patron.  Verify that the additional fee is charged.
- Register a new patron with a child patron category.
- Use the 'update child to adult' menu option to change the
  patron's category to one that is fee-bearing.  Verify that the
  enrollment fee was charged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f8eb19163bd4e59e99b6dae90a5712b6a7be52f6)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10716: fix JavaScript error on basket groups page
Jonathan Druart [Tue, 13 Aug 2013 10:25:35 +0000 (12:25 +0200)]
Bug 10716: fix JavaScript error on basket groups page

To test:

Go on acqui/basketgroup.tt and verify a js error occurred
(ReferenceError: CONFIG_EXCLUDE_ARTICLES_FROM_SORT is not defined).
Apply the patch and verify the error does not appear anymore.

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 a4d8144efdcbbf30d649264495f151e8b6fd7594)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10703: Document borrower_files table
Nicole C. Engard [Thu, 8 Aug 2013 13:01:23 +0000 (09:01 -0400)]
Bug 10703: Document borrower_files table

Add db documentation to borrower_files table.

To test:

apply
review kohastructure.sql to be sure documentation is there

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: No errors. Tested loading on new database.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 09e802c7933073cd98040155b02898ab79739b3a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10703: Document quotes table
Nicole C. Engard [Thu, 8 Aug 2013 12:53:58 +0000 (08:53 -0400)]
Bug 10703: Document quotes table

Add db documentation for the quotes table

To test:

apply patch
review kohastructure.sql to be sure documentation is there

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6823c745371a115d5bec98beb9d10b59e188c9fe)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10703: Add db documentation for biblioimages table
Nicole C. Engard [Thu, 8 Aug 2013 12:49:25 +0000 (08:49 -0400)]
Bug 10703: Add db documentation for biblioimages table

This patch adds db documentation to the biblioimages table.

To test:

Apply patch
Review kohastructure.sql to be sure that the documentation is there

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 801d8237d80d7079f3355da18ef18c60b7f37325)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10715 - MARC21 007 Plugin Editor doesn't load position 01
David Cook [Tue, 13 Aug 2013 02:16:28 +0000 (12:16 +1000)]
Bug 10715 - MARC21 007 Plugin Editor doesn't load position 01

This patch changes the MARC21 007 plugin editor so that it uses
1 character instead of 4 characters for position 01.

TEST PLAN:

1) Create new record/edit an existing record
2) Using the tag editor for the 007 field, choose "Videorecording"
3) Click OK
4) Change the second character in the 007 from "c" to "d"
5) Open the tag editor again
6) Note that position 01 will still say "c - Videocartridge" rather
than "d - Videodisc".
7) Exit tag editor

8) Apply patch

9) Reload the page (Shift + Refresh is always useful)
10) Open the tag editor again
11) Note that position 01 will now say "d - Videodisc"

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 73ac970f734b0f04fff5561aa35bb9d9d47aa943)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Fix worked as expected.

11 years agoBug 8712: add 'and' label for inputs in OPAC "fewer options" advanced search page
Srikanth Dhondi [Mon, 29 Oct 2012 22:17:52 +0000 (11:17 +1300)]
Bug 8712: add 'and' label for inputs in OPAC "fewer options" advanced search page

The "and" label not only improves the accessibility but also gives the
user an idea that the operation between multiple search fields is a
boolean "AND" by default.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Actually only adds a label and an id to the select.
Note that the boxes do not exactly align anymore now (with fewer options).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 98bd9de54aa7cab6fe3dec8e7cd88378a06e8684)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 8712: change "New list" to "Create new list" in OPAC masthead
Srikanth Dhondi [Mon, 29 Oct 2012 00:57:09 +0000 (13:57 +1300)]
Bug 8712: change "New list" to "Create new list" in OPAC masthead

This makes it clear for screen reader users.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Note that you should delete all your private lists to see this change.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f0280dabe0db3e27e0e56a025a61bd41f206de57)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10483: fix item uniqueness check on order form
Fridolyn SOMERS [Mon, 17 Jun 2013 15:01:33 +0000 (17:01 +0200)]
Bug 10483: fix item uniqueness check on order form

When syspref "UniqueItemFields" is defined, the item uniqueness is
tested in acquisition by an AJAX call to check_uniqueness.pl.  This
patch fixes an issue where check_uniqueness.pl wasn't looking
at the correct CGI parameters.

Test plan :
- Select an existing item with barcode
- Add "barcode" to "UniqueItemFields" syspref (use space as separator
  for multiple values)
- Set "AcqCreateItem" syspref to "Create an item when placing an order"
- Go to an acquisition basket
- Create a new order from empty
- Enter existing barcode in item form and save
=> You get an alert that barcode already exists and order is not saved
- Enter a non-existing barcode in item form and save
=> Order and item are created

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1c9135262b9233f59fd05e34c90980e7dc8be338)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 5262: make authority plugin copy indicators to bib record
Janusz Kaczmarek [Mon, 22 Apr 2013 17:28:08 +0000 (20:28 +0300)]
Bug 5262: make authority plugin copy indicators to bib record

With this patch Koha should correctly copy indicators
(and create $2 subfield in MARC 21 if need) from the chosen authority
record to the edited bibliographic record (according to discussion in
bugzilla). UNIMARC and MARC 21 flavors are covered.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: work as described, testing in comments 9 and 12.
No errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests. Tested functionality repeating
some of the tests noted by Bernardo - checking mostly 1xx, 490,
and 7xx.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 129c974fdde0dc62e568f7aa01c4a0796ae150ae)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10614 - have add order form at top and bottom
Owen Leonard [Mon, 12 Aug 2013 12:36:09 +0000 (08:36 -0400)]
Bug 10614 - have add order form at top and bottom

If a basket has a lot of items it may be inconvenient to scroll to the
bottom of the patch to reach the "add to basket" form. This patch adds
as "Add to basket" button to the toolbar which uses JavaScript to copy
the form into a modal dialog for quick access.

To test, apply the patch and view an open basket. You should be able to
click the "Add to basket" button to trigger a modal dialog with the full
"Add to basket" list of options. All options in the list should function
normally.

If you view a closed basket the new button should not appear.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass and I love it :)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit fe193210815b33efbefbf518ccc13329f20eeefc)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10511: (follow-up) jQuery .removeAttr() has only one parameter
Kyle M Hall [Mon, 22 Jul 2013 12:32:39 +0000 (08:32 -0400)]
Bug 10511: (follow-up) jQuery .removeAttr() has only one parameter

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7d6edc6f182009726e9675ae832385f37e16c4e0)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10511: fix message preference form glitch concerning phone notifications
Kyle M Hall [Wed, 26 Jun 2013 20:40:09 +0000 (16:40 -0400)]
Bug 10511: fix message preference form glitch concerning phone notifications

An error in the onclick for phone notices causes the "Do not notify"
checkbox to be checked when the phone checkbox is checked. Also,
checking "Do not notify" does not uncheck the phone checkbox.

Test plan:
1) Enable TalkingTechItivaPhoneNotification
2) Browse to the new patron screen ( memberentry.pl )
3) In the patron messaging preferences check the Phone checkbox
4) Not the "do not notify" checkbox is then checked
5) Uncheck the "do not notify" checkbox, and check the Email checkbox as well
6) Now check the "do not notify" checkbox, note the Phone checkbox remains checked
7) Apply this patch
8) Repeat steps 3-6, noting the odd behavior is no longer present

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e608f4d48c09e025fc10d47668bb40c0d3d686a7)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected. EnhancedMessagingPreferences needs to be set to reproduce.

11 years agoBug 2394: Use syspref canreservefromotherbranches in CanItemBeReserved
Julian Maurice [Tue, 9 Jul 2013 09:48:23 +0000 (11:48 +0200)]
Bug 2394: Use syspref canreservefromotherbranches in CanItemBeReserved

If IndependentBranches is ON, patrons are not allowed to place
hold requests on items whose owning library is different from
the patron's home library, *unless* the canreservefromotherbranches
system preference is also ON.

The patch implements the intended behavior; without it, IndependentBranches
and canreservefromotherbranches were not consulted during the
item holdability check.

To test:

[1] Have IndependentBranches ON and canreservefromotherbranches
    OFF.  Make sure that the circulation rules are set up to
    permit patrons to place hold requests in general.
[2] In the OPAC, log in as a patron from library A, and try placing
    a hold on an item from library B.  The patron will be able to
    place the request.
[3] Cancel the request.
[4] Apply the patch.
[5] Try placing the same hold request.  This time, the request should
    be forbidden.
[6] Turn on canreservefromotherbranches.
[7] Try placing the hold request.  This time, it should go through.
[8] Cancel the request.
[9] Turn off IndependentBranches.
[10] Try placing the hold request and verify that it is permitted.
[10]

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2cbc47a871efc60ae663ecfedf59ec77dda718f4)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected.
Note: on my tests i first forgot to enable AllowOnShelfHolds to get this working. It is not mentioned on the test description.

11 years agobug 2394: regression test for canreservefromotherbranches
Galen Charlton [Fri, 9 Aug 2013 17:40:54 +0000 (17:40 +0000)]
bug 2394: regression test for canreservefromotherbranches

If IndependentBranches is ON and canreservefromotherbranches is OFF,
a patron is not permittedo to request an item whose homebranch (i.e.,
owner of the item) is different from the patron's own library.
However, if canreservefromotherbranches is turned ON, the patron can
create such hold requests.

Note that canreservefromotherbranches has no effect if
IndependentBranches is OFF.

To test, run prove -v t/db_dependent/Holds.t.  Without the bugfix
patch for bug 2394, the last two tests should fail.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 23e302071efabd824f0a6c69bc68dee4cfc13e5b)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The Holds.t file was introduced by 9394 which refactors several lines of code and thus i'm not cherry-picking in the stable branch.
I'm just cherry-picking Galen's regression tests.

11 years agoBug 7257: Add a link to remove an individual title from a list in the OPAC
Owen Leonard [Fri, 2 Aug 2013 18:25:37 +0000 (14:25 -0400)]
Bug 7257: Add a link to remove an individual title from a list in the OPAC

It should be possible when viewing the contents of a list to click a
link to remove an individual title from the list without having to check
a checkbox and click another button.

This patch adds a link to each list item to "Remove from this list."
The functionality is JavaScript-dependent, automatically checking the
appropriate checkbox and submitting the form to delete.

To test, view a list for which you have delete permission. There should
be a "Remove from this list" link next to each item on the list. Test
delete functionality by:

- Clicking the link and then clicking cancel.
- Clicking the link and confirming.
- Checking more than one checkbox and then clicking a single remove
  link (only the one corresponding record should be removed).
- Checking one or more checkboxes and clicking the "Remove from list"
  link at the top of the page.

If JavaScript is disabled the links should not appear.

There are now two delete confirmation messages: One if you're removing
only one item, another if you're removing more than one. This is true
whether you use the links or the checkboxes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit cf902c704ba9b0560bc8ff2006fe5763ffa2a090)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 5652: (follow-up) include subtitle in hyperlink
Galen Charlton [Tue, 6 Aug 2013 14:46:31 +0000 (14:46 +0000)]
Bug 5652: (follow-up) include subtitle in hyperlink

This follow-up patch makes the subtitle part of the same
hyperlink as the title, maintaining consistency with other
pages in the staff interface such as list contents.

To test:

[1] Make sure that the Keyword to MARC mapping includes
    mappings to 'subtitle'.
[2] Find a biblio that has both title and subtitle.  Check
    it out to one patron and place it on hold for another.
[3] In the checkout and patron details pages, verify that
    the entry for this bib in the list of checked out titles
    or hold requests includes both title and subtitle in
    the same hyperlink.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 05019c13607908689581285abc39735923a564f5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 5652: display subtitles on patron checkout and holds summary
Marc Veron [Sun, 16 Jun 2013 20:02:45 +0000 (22:02 +0200)]
Bug 5652: display subtitles on patron checkout and holds summary

This patch adds subtitles (from Keyword to MARC mapping) to the
following tables on the checkout page:

- Checkouts
- Previous checkouts
- Relative's checkouts
- Relative's previous checkouts
- Holds

Additionally it suppresses the appearence of the superfluous word "by"
in cases where the biblio has no author.

Test scenario:
--------------
1)
Make sure that you have one or more fields mapped to subtitle in:
Home . Administration . Keyword to MARC mapping
(e.g. 245 b)

2)
Test the checkout page with patrons having
- current checkouts (today)
- previous checkouts
- relatives (e.g. kids) with current /previous checkouts
- holds on items
- holds on biblios

...with items having:
- title, subtitle, author
- title,  no subtitle, author
- title,  subtitle, no author
- title, no subtitle, no author

3)
Do the same on patron's detail page

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 976561a384e42570c8960f566bc88606ab6f87b1)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10543 - add mandatory subfield check to addorderiso2709.pl
Fridolyn SOMERS [Thu, 11 Jul 2013 14:33:33 +0000 (16:33 +0200)]
Bug 10543 - add mandatory subfield check to addorderiso2709.pl

When adding orders from staged file, you can create one order per
record using item form in the bottom of addorderiso2709.pl.  The
form was missing checks of mandatory item fields; this patch
adds those checks.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All 3 patches pass tests and QA script.

Some additional notes on the test plan from the first patch:
It took me a while to figure out a combination of subfields
that would trigger the bug. I am not sure about the condition
that transforms the input field into a textbox as it does
not seem to happen for every field.

What worked in the end was (MARC21):
- $g cost, normal purchase price = mandatory
- $h serial enumeration/chronolgy = optional, filled with
  text over 100 characters

Checked for:
- Adding items in cataloguing
  Was able to reproduce the problem, mandatory check works
  as expected.
- Adding items from staged file in acq
  Was not able to trigger the problem, because we don't edit
  the item here, but mandatory check works as expected.
- Addings items for serial subscriptions
  Was not able to trigger the problem, because we don't edit
  the items here, but mandatory check works better as before
  as missing mandatory fields are now highlighted and weren't
  before.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2c7e1390b45e497676ea4f414520708577cf761a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Couldn't reproduce using $i as in the test plan, but $o triggered the problem, which this patch series fix.

11 years agoBug 10543 - Unify item mandatory subfields check
Fridolyn SOMERS [Thu, 11 Jul 2013 14:30:27 +0000 (16:30 +0200)]
Bug 10543 - Unify item mandatory subfields check

Use of CheckMandatorySubfields from cataloging.js
everywhere an item cataloging form is checked for
mandatory fields.

Signed-off-by: Srdjan <srdjan@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 0d4724e81b94b290a5b58970a8f59ebe8340f165)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Couldn't reproduce using $i as in the test plan, but $o triggered the problem, which this patch series fix.

11 years agoBug 10543: fix false warnings from checks of mandatory item fields
Fridolyn SOMERS [Fri, 5 Jul 2013 13:20:59 +0000 (15:20 +0200)]
Bug 10543: fix false warnings from checks of mandatory item fields

Under certain circumstances, when editing an item, you get a popup
warning
  "1 mandatory fields empty (highlighted)".

Even though all mandatory fields are filled in.

This occurs when there is a field with a huge content (more than 100
characters) that gets displayed in a textarea instead of input.

This patch corrects the Javascript form check by using siblings().

Also adds a more precise filter to find mandatory inputs because
looking in full page may bring unwanted results.

Test plan :
- In a framework, make sure you have in item field :
  An optional subfield (without authorised value),
  then a mandatory subfield, then an optional subfield
  next to mandatory subfield
  For example : $i (optional), $r (mandatory) and $s (optional)
- Open a biblio record and create a new item
- Enter more than 100 characters in $i, fill $r and $s
- Click "Add item"
- Edit this item
=> You get a textarea for $i
- Empty $s and Save
=> Without patch, you get a warning and form is not saved and you see that $s is yellow while it should be $r
=> With patch, form is saved
- Re-edit this item
- Empty $r and save
=> You get a warning and form is not saved

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on last patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 651ea298ea90742a2c56bbb693a4fbbb0064d5b2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Couldn't reproduce using $i as in the test plan, but $o triggered the problem, which this patch series fix.

11 years agoIncrement version for 3.12.4 release v3.12.04
Tomas Cohen Arazi [Fri, 23 Aug 2013 23:25:29 +0000 (20:25 -0300)]
Increment version for 3.12.4 release

11 years agoMerge remote-tracking branch 'github-pichu/3.12.04-translate' into 3.12.x_release
Tomas Cohen Arazi [Fri, 23 Aug 2013 23:18:39 +0000 (20:18 -0300)]
Merge remote-tracking branch 'github-pichu/3.12.04-translate' into 3.12.x_release

11 years agoUpdate release notes for 3.12.4 release
Tomas Cohen Arazi [Fri, 23 Aug 2013 23:18:03 +0000 (20:18 -0300)]
Update release notes for 3.12.4 release

11 years agoTranslation updates for 3.12.04
Bernardo Gonzalez Kriegel [Fri, 23 Aug 2013 22:35:28 +0000 (19:35 -0300)]
Translation updates for 3.12.04

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
11 years agoBug 10745: remove more ambiguity for translators for XSLT subfieldSelect parameters
Bernardo Gonzalez Kriegel [Fri, 16 Aug 2013 19:52:26 +0000 (16:52 -0300)]
Bug 10745: remove more ambiguity for translators for XSLT subfieldSelect parameters

As in Bug 6278, this patch replace ">at<" with ">a_t<"
so not to mislead translators. Found more cases that
initial description.

To test:

1) Check that problem exists and only on xslt files,
using your preferred language

egrep -B10 "^msgid \"at\"" misc/translator/po/xx-YY-i-staff-t*

2) Apply the patch

3) Update translation file
(cd misc/translator; perl translate update xx-YY)

4) Verify the problem is gone, repeat 1

5) If you like verify new entries in PO file

egrep -B15 "^msgid \"a_t\"" misc/translator/po/xx-YY-i-staff-t*

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested this with field 780 and running a Dutch translation.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5b9cd85dd0dbd7e3470c783e0e024ad32df2f8b5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10664 [QA Followup] - fix error in overdue_notices.pl if there is no active currency
Kyle M Hall [Fri, 16 Aug 2013 11:21:10 +0000 (07:21 -0400)]
Bug 10664 [QA Followup] - fix error in overdue_notices.pl if there is no active currency

Fixes the following koha-qa.pl error:
 FAIL   misc/cronjobs/overdue_notices.pl
    OK     pod
    OK     forbidden patterns
    OK     valid
    FAIL   critic
               # Variables::ProhibitConditionalDeclarations:

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e476378323eb8dd31e67e4741d271d88de61b59e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10664: fix error in overdue_notices.pl if there is no active currency
Sophie Meynieux [Wed, 31 Jul 2013 06:04:25 +0000 (08:04 +0200)]
Bug 10664: fix error in overdue_notices.pl if there is no active currency

If there is no active currency, when running overdue_notices.pl
you get a sofware error "Can't use an undefined value as a HASH
reference" on GetCurrency() function call.

With this patch, if there is no active currency, fines are formated
by default 0.00 and notices are correctly generated.

Test plan :
- have at least one borrower with overdue that should trigger a notice
- verify that there is no active currency (Adminitration > Currency &
  Exchange rates)
- run misc/cronjobs/overdue_notices.pl -v -n (to get the notice directly
  on output)

=> without the patch you get the software error
=> with the patch, notices are correctly generated

If an active currency is defined, the script overdue_notices.pl runs
the same with or without patch

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a9a3bb7b3d7e8e862cf0f772246667258a20b786)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10362: ensure that all messages and alerts are shown upon checkin
Fridolyn SOMERS [Tue, 28 May 2013 13:43:05 +0000 (15:43 +0200)]
Bug 10362: ensure that all messages and alerts are shown upon checkin

If an item is returned and has mutiple error or warnings (e.g.,
it both needs to be transferred and the patron was debarred
in the course of the return), because of a bug in the template,
not all of the messages would be displayed.

This patch changes the template to show both messages and alerts.

Test plan :
- Perform an checkout that will a checkin :
  * need a transfert (return in a different branch)
  * set user debarred (depends on issuing rules)
- Perform check-in
=> You get tranfert message and debarment alert

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5192fd81adaccf9b0f4a01dcc0ffc689edc9468f)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10663: QA Followup: Typo in comment in renewscript
Marcel de Rooy [Thu, 15 Aug 2013 11:10:41 +0000 (13:10 +0200)]
Bug 10663: QA Followup: Typo in comment in renewscript

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 240520c2f925a4e9235628f06a0bdd15c99dfa80)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10666: (follow-up) really fix the daily quotes test
Galen Charlton [Fri, 16 Aug 2013 00:33:24 +0000 (00:33 +0000)]
Bug 10666: (follow-up) really fix the daily quotes test

Koha::DateUtils::dt_from_string() and DateTime->now() are
not equivalent -- they don't handle timezones in the same
way.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c6f903198cf427b9e4c9f8ad89fef97518998a09)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10663: restore ability of active hold requests to block renewal
Tomas Cohen Arazi [Mon, 5 Aug 2013 18:23:44 +0000 (15:23 -0300)]
Bug 10663: restore ability of active hold requests to block renewal

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This reverts changes made to CanBookBeRenewed by
patches from bug 9367.
GetReserveStatus is not suitable to recognize if an item
can fild a hold on return and CheckReserves is restored.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
This patch includes a squash of a follow-up authored by
Katrin Fischer <Katrin.Fischer.83@web.de>:

  CheckReserves returns '' when no reserve is found,
  so $resfound will always be defined and we need to
  check if it's true.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3e387f72a337b36d96e1b0df56965391ffc95213)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10663: (follow-up) set circ policy for circulation tests
Galen Charlton [Thu, 15 Aug 2013 22:17:37 +0000 (22:17 +0000)]
Bug 10663: (follow-up) set circ policy for circulation tests

This patch ensures that the loan rules are set to a known
value suitable for testing.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 51b8deb4d5eceee84ad95b28cac902330b4b12fe)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10663: Follow-up - Unit tests for CanBookBeRenewed
Katrin Fischer [Wed, 7 Aug 2013 23:38:23 +0000 (01:38 +0200)]
Bug 10663: Follow-up - Unit tests for CanBookBeRenewed

Follow-up fixing some and adding more unit tests.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit b15b3be5ae878d19d4b6ed659b68ce0b9843a35e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10663: tests for CanBookBeRenewed
Tomas Cohen Arazi [Mon, 5 Aug 2013 18:26:56 +0000 (15:26 -0300)]
Bug 10663: tests for CanBookBeRenewed

Initial work on unit tests for CanBookBeRenewed. More scenarios are needed.
Also made Circulation.t use autocommit=0.

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dc469424c8bcf952cb64f5c9dc2cdc53772d8ca5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10712: Save missing config variables to install log
Colin Campbell [Mon, 12 Aug 2013 15:15:37 +0000 (16:15 +0100)]
Bug 10712: Save missing config variables to install log

The variables for AUTH_INDEX_MODE and ZEBRA_TOKENIZER were not
being saved to the koha_install_log file.  As a result when using the
--prev-install-log option in Makefile.PL the user was still prompted
to select them.

This patch adds the appropriate variables to the list saved in
the install log.

To test:

On a (non-package) system installed/upgraded without the patch running
'perl Makefile.PL --prev-install-log /path/to/koha-install-log' will
still prompt you to choose authorities indexing mode and select
between chr and icu, after upgrading with this patch applied the same
command should get the responses from the install log and not require
user intervention.

The values can be seen written into misc/koha-install-log

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 40e6f6a8f22b8af7adef79a0ece80a61a69ccc50)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10644: (follow-up) remove inadvertant dependence on Perl 5.14
Galen Charlton [Fri, 9 Aug 2013 18:53:20 +0000 (18:53 +0000)]
Bug 10644: (follow-up) remove inadvertant dependence on Perl 5.14

Perl 5.14 changed array and hash container functions (e.g., keys())
to accept hashrefs or arrayrefs.  However, this doesn't work in
Perl 5.10, so doing

  scalar(keys( function_returning_hashref() ) );

is a syntax error in that version.  This patch changes the affected
tests to explicitly difference the hashrefs returned by the various
functions.

To test:

Verify that t/db_dependent/ClassSource.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8f933bc040e8e4198f5278253191a7a4233467ce)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
11 years agoBug 10643: fix inappropriate uses of $sth->finish() in C4::ClassSource.pm
root [Thu, 25 Jul 2013 12:03:32 +0000 (14:03 +0200)]
Bug 10643: fix inappropriate uses of $sth->finish() in C4::ClassSource.pm

This patch gets rid of finish() and replace prepare_cached by prepare.

From the man page

finish()
Indicate that no more data will be fetched from this statement handle
before it is either executed again or destroyed.
You almost certainly do not need to call this method.

Adding calls to "finish" after loop that fetches all rows is a common
mistake, don't do it, it can mask genuine problems like uncaught fetch errors.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5cba6457aa00f3f3b2038f70057df300d9c6b9c3)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>