koha.git
10 years agoBug 7785: (follow-up) standardize POD
Galen Charlton [Tue, 13 Aug 2013 16:15:30 +0000 (16:15 +0000)]
Bug 7785: (follow-up) standardize POD

This makes the POD for the columns() function consistent
with the rest of C4/Members.pm.  It also removes a note
that can be relegated to the bug report and the Git
history.

Also, since C4::Members::columns() is not actually a
class method, this patch changes the invocation to
not call it that way.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7785: remove MySQL-specific syntax from C4::Members::columns()
Mark Tompsett [Sun, 30 Jun 2013 00:46:51 +0000 (20:46 -0400)]
Bug 7785: remove MySQL-specific syntax from C4::Members::columns()

The initial thought was to remove this function. However,
tools/import_borrowers.pl uses it. So rather than remove
it to solve the problem, it was reworked to a more generic
solution which runs faster.

By accessing $sth->{NAME} directly, the driver becomes
responsible for filling it correctly. This happens when a SELECT
is done on the borrowers table. It does not even have to have
data in the result set!

The columns method could be more generic and used elsewhere too.
Comparison between the old method and the STH method showed a
significant time difference. The old method took 35 seconds
for 40k iterations versus 19 seconds for the same amount of
iterations with the STH method regardless of the size of the
borrowers table.

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>
10 years agoBug 8507: (follow-up) fix one reference to __ZEBRA_BIBLIOS_CFG__
Mirko Tietgen [Fri, 9 Aug 2013 22:59:27 +0000 (00:59 +0200)]
Bug 8507: (follow-up) fix one reference to __ZEBRA_BIBLIOS_CFG__

Fixed the path to __ZEBRA_BIBLIOS_CFG__ for <server id="mergeserver">

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

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 8507: koha-create now supports using DOM indexing for bibs
Tomas Cohen Arazi [Thu, 8 Aug 2013 18:15:53 +0000 (15:15 -0300)]
Bug 8507: koha-create now supports using DOM indexing for bibs

This patch makes the koha-create script install the file zebra-biblios-dom.cfg
with the proper string substitutions inside on the new instance koha-conf.xml file.

It also adds two option switches that control the indexing mode for the instance:

 --biblio-idx {dom|grs1}
 --auth-idx {dom|grs1}

DOM indexing is set as the default for both authorities and bibliographic records.

Following drojf (thanks!) advice I arranged stuff like explained here:

  http://wiki.koha-community.org/wiki/Switching_to_dom_indexing

To test:
- Apply the patch
- Build your own packages and install them on a test server
a) Create a new instance without using the new switches like:
 $ koha-create --create-db domtest
 - Check there's a file /etc/koha/sites/domtest/zebra-biblios-dom.cfg
 - Check that /etc/koha/sites/domtest/koha-conf.xml points to:
   * zebra-biblios-dom.cfg (biblioserver section)
   * zebra-biblios-dom.cfg (publicserver section)
   * zebra-authorities-dom.cfg (authorityserver section)
 - Success means the new default is DOM
b) Play with the 4 possible combination of option switches
 $ koha-create --create-db --auth-idx grs1 --biblio-idx grs1 domtest
 $ koha-create --create-db --auth-idx grs1 --biblio-idx dom domtest
 $ koha-create --create-db --auth-idx dom --biblio-idx grs1 domtest
 $ koha-create --create-db --auth-idx dom --biblio-idx dom domtest
 - Check the koha-conf.xml file reflects the chosen options.
c) Run
 $ koha-create --help
 - It should advertise this addition accordingly.
d) Run
 $ man koha-create
 - Man page for koha-create should provide good information on the new switches behaviour

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 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>
10 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>
10 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>
10 years agoBug 10247: show warning if hold blocked due to maxreserves syspre
Fridolyn SOMERS [Wed, 15 May 2013 09:52:57 +0000 (11:52 +0200)]
Bug 10247: show warning if hold blocked due to maxreserves syspre

On intranet, when placing a hold requst:
If borrower has reached the request limit, a warning should appear :
  Cannot place hold
  * Too Many Holds: TEST has too many holds.

This works when quota defined in circulation rules is reached but not
when limit specified in syspref maxreserves is reached, in case this
limit is lower than the one defined is circulation rules.

This is because template param maxreserves is set twice, this patch
corrects this bug.

Also moves warnings and messages conditional variable from Perl to
template because it cause the same bug as for maxreserves.

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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agoBug 10298: Adapt existing code
Jonathan Druart [Tue, 21 May 2013 15:14:24 +0000 (17:14 +0200)]
Bug 10298: Adapt existing code

set_solr and set_zebra is not really useful. It is preferable to use
mock_preference directly.

To test:
1/ Launch Solr
2/ prove -r t/searchengine/
It should produce:
% prove -r t/searchengine/
t/searchengine/000_conn/conn.t ........... ok
t/searchengine/001_search/search_base.t .. ok
t/searchengine/002_index/index_base.t .... IndexRecord called with biblio 2
Indexing biblio 2
t/searchengine/002_index/index_base.t .... ok
t/searchengine/003_query/buildquery.t .... ok
t/searchengine/004_config/load_config.t .. ok
All tests successful.
Files=5, Tests=21,  4 wallclock secs ( 0.03 usr  0.01 sys +  2.74 cusr
0.20 csys =  2.98 CPU)
Result: PASS

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Had to get Solr going again to test this, man .. they could make that
easier

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10298: Followup: Adapt existing code
Jonathan Druart [Fri, 24 May 2013 11:32:24 +0000 (13:32 +0200)]
Bug 10298: Followup: Adapt existing code

This unit tests file does not need the t::lib::Mocks::Context module.

To test:

prove t/db_dependent/Circulation_issuingrules.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, test checks out.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10298: Mock C4::Context->preference
Jonathan Druart [Tue, 21 May 2013 15:13:35 +0000 (17:13 +0200)]
Bug 10298: Mock C4::Context->preference

t::lib::Mocks::Context tried to deal with preferences but did not manage
to.

This patch removes this module and add 2 routines in t::lib::Mocks in
order to mock C4::context->preference and C4::Context->config.

To test:

===START t/test.pl===

use Modern::Perl;
use t::lib::Mocks;
use C4::Context;

say "initial value for version: " . C4::Context->preference('Version');
say "initial value for language: " . C4::Context->preference('language');
t::lib::Mocks::mock_preference('Version', "new version for testing");
say "version is mocked with: " . C4::Context->preference('Version');
say "language is not yet mocked: " . C4::Context->preference('language');
t::lib::Mocks::mock_preference('language', 'new langage for testing');
t::lib::Mocks::mock_preference('Version', 'another version for testing');
say "version is mocked with another value: " . C4::Context->preference('Version');
say "language is finally mocked: " . C4::Context->preference('language');
===END===

Try to execute this file and check that the output is consistent.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 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>
10 years agoBug 10404: tweak style of staff client previous/next links
Owen Leonard [Mon, 5 Aug 2013 13:42:36 +0000 (09:42 -0400)]
Bug 10404: tweak style of staff client previous/next links

This patch slightly modifies the styles of the previous/next links in a
way that I think is simpler and clearer.

To test, apply the patch and clear your browser cache if necessary.
Perform a search in the staff client, click any result, and look at the
prevous/next links.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10404: add previous/next browsing to staff client
Jared Camins-Esakov [Wed, 10 Jul 2013 22:02:27 +0000 (18:02 -0400)]
Bug 10404: add previous/next browsing to staff client

Although previous/next browsing was added for searches in the OPAC
in 2011, the staff client has been without any sort of search browsing.
Until now. This patch is an all-singing, all-dancing, all-compatible
implementation of search browsing that will work across multiple
browser tabs and on any browser since IE7 (though the staff client
layout is broken on IE7).

To test:
1) Perform a search that will bring up multiple results.
2) View one of the results.
3) Use the Previous and Next links to browse along the search results.
4) Use the "Return to results" button to check that you end up at the
   correct page of results, even if you page through more than 20
   records.

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>
10 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>
10 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>
10 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>
10 years agoBug 10671: correct minor issues in course reserves help
Galen Charlton [Fri, 2 Aug 2013 20:56:14 +0000 (20:56 +0000)]
Bug 10671: correct minor issues in course reserves help

- fix a typo
- rename the help file for the course reserves home
  page so that it gets picked up when the user clicks
  the help link there.

To test:

[1] Go to the course reserves home page, then click on the
    "Help" link.  Verify that a help page with contents is
    displayed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10671: Help files for course reserves
Nicole C. Engard [Thu, 1 Aug 2013 00:35:14 +0000 (20:35 -0400)]
Bug 10671: Help files for course reserves

This patch adds the missing help files for course reserves.

To test:

* visit every page related to course reserves in the staff client
* click help in the top right
* review the help file for typos/content/links

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10666: avoid random failures of Daily quotes tests
Fridolyn SOMERS [Wed, 31 Jul 2013 09:39:45 +0000 (11:39 +0200)]
Bug 10666: avoid random failures of Daily quotes tests

In t/db_dependent/Koha.t, the test "Got a quote based on today's
date" is failing :

$prove t/db_dependent/Koha.t :
t/db_dependent/Koha.t .. 1/6
    #   Failed test 'Got a quote based on today's date.'
    #   at t/db_dependent/Koha.t line 126.
    # Compared $data->{"source"}
    #    got : 'Herbert Hoover'
    # expect : 'Abraham Lincoln'
    # Be sure to run this test on a clean install of sample data.
    # Looks like you failed 1 test of 4.

Looks like the wrong quote is returned by GetDailyQuote().
I'm using a databased created with the English sample SQL datas.

I think I found the cause :
The test "Got a random quote." calls GetDailyQuote('random'=>1) which
changes the quote timestamp to now. When then testing GetDailyQuote(),
this quote (which may not be the one created by test) is the most
recent quote.

This patch moves the "Got a random quote." test after "Got a quote
based on today's date" to solve the problem.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10609: Use library name rather than code in serials-collection.pl
Owen Leonard [Fri, 19 Jul 2013 16:39:18 +0000 (12:39 -0400)]
Bug 10609: Use library name rather than code in serials-collection.pl

The serials collection page displays branchcode instead of library name.
This patch uses the Branches template plugin to display the library name
instead.

Also corrected: Added missing datatables config include to prevent a
JavaScript error.

To test, view the serials collection page for a subsciption with
existing issues. Library names should be displayed instead of
branchcodes. There should be no JavaScript errors reported by the
browser.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works well and uses the new TT plugin for displaying the branch name.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10644: fix typos in test descriptions
Galen Charlton [Thu, 1 Aug 2013 15:09:39 +0000 (15:09 +0000)]
Bug 10644: fix typos in test descriptions

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10644: add unit tests for ClassSource.pm
Kenza Zaki [Fri, 26 Jul 2013 07:55:43 +0000 (09:55 +0200)]
Bug 10644: add unit tests for ClassSource.pm

The tests are wrapped in a database transaction.

To test:
prove t/db_dependent/ClassSource.t
t/db_dependent/ClassSource.t .. 1/24 prepare_cached(SELECT * FROM `class_sort_rules` WHERE `class_sort_rule` = ?) statement handle DBI::st=HASH(0x92dbedc) still Active at C4/ClassSource.pm line 249
prepare_cached(SELECT * FROM `class_sources` WHERE cn_source = ?) statement handle DBI::st=HASH(0x926876c) still Active at C4/ClassSource.pm line 137
attempting to use non-existent class sorting routine routine1
prepare_cached(SELECT * FROM `class_sort_rules` WHERE `class_sort_rule` = ?) statement handle DBI::st=HASH(0x92dbedc) still Active at C4/ClassSource.pm line 249
prepare_cached(SELECT * FROM `class_sources` WHERE cn_source = ?) statement handle DBI::st=HASH(0x926876c) still Active at C4/ClassSource.pm line 137
t/db_dependent/ClassSource.t .. ok
All tests successful.
Files=1, Tests=24,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.12 cusr  0.01 csys =  0.15 CPU)
Result: PASS

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>
10 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>
10 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>
10 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>
10 years agomove Auth_ParseSearchHistoryCookie.t to db_dependent directory
Galen Charlton [Sun, 28 Jul 2013 19:42:51 +0000 (19:42 +0000)]
move Auth_ParseSearchHistoryCookie.t to db_dependent directory

The actual tests in this script are not dependent on the database,
but simply loading C4::Auth requires a valid(ish) koha-conf.xml
and database.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agodo some validation of the KohaOpacRecentSearches cookie
Galen Charlton [Sun, 28 Jul 2013 02:48:44 +0000 (02:48 +0000)]
do some validation of the KohaOpacRecentSearches cookie

Add validation of the value of the KohaOpacRecentSearches.  In
particular, this patch avoids the generation of an internal server
error when the OPAC is presented with an old cookie that uses the
old Storable-based serialization.

This patch also moves parsing of the cookie value into a
new routine in C4::Auth, ParseSearchHistoryCookie, and adds
a test case.

To test (in conjunction with the previous patch):

Exercise the OPAC search history functionality, after
turning on the EnableOpacSearchHistory syspref:

- As an anonymous user, conduct a variety of searches,
  including ones that include non-ASCII characters
- Check the search history and verify that all searches
  are listed
- Apply this patch and the previous one.
- Do *not* clear the KohaOpacRecentSearches cookie
- Check the search history and verify that no searches
  are listed any more
- As an anonymous user, conduct a variety of searches,
  including ones that include non-ASCII characters
- Check the search history and verify that all searches
  are listed
- Log into the OPAC
- Verify that current and past searches are listed in
  search history.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agouse JSON rather than Storable for the OPAC search history cookie
Galen Charlton [Thu, 25 Jul 2013 16:50:30 +0000 (16:50 +0000)]
use JSON rather than Storable for the OPAC search history cookie

To test:

Exercise the OPAC search history functionality, after
turning on the EnableOpacSearchHistory syspref:

- Clear the KohaOpacRecentSearches cookie
- As an anonymous user, conduct a variety of searches,
  including ones that include non-ASCII characters
- Check the search history and verified that all searches
  are listed
- Log into the OPAC
- Verify that current and past searches are listed in
  search history.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10070: fix saving searches with non-ASCII characters to anonymous search history
Jonathan Druart [Fri, 26 Apr 2013 13:43:58 +0000 (15:43 +0200)]
Bug 10070: fix saving searches with non-ASCII characters to anonymous search history

To test
1/ logout
2/ search "bar" (added to the history)
3/ search "féé" => history is empty

Apply patch
1/ logout
2/ search "bar" (added to the history)
3/ search "féé" => added to the history

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10463: ensure that Quote of the Day feature selects random quotes
Kyle M Hall [Thu, 13 Jun 2013 13:46:43 +0000 (09:46 -0400)]
Bug 10463: ensure that Quote of the Day feature selects random quotes

When the Quote of the Day tool selects a new new quote, it updates the
timestamp and does not take the timezone into account.  Thus the time is
set to +4 hours (e.g. 2013-06-11 13:33:48 when the time is 2013-06-11
        09:33:48).  It then repeats the same quote every day.

To replicate:

Set Administration >> System preferences >> OPAC preferences >> Features
>> QuoteOfTheDay to Enable

In Home >> Tools >> Quote Editor, add several quotes.

In the opac, refresh the home page. You should get a quote of the day at
the top.

mysql> select * from quotes;

Note the timestamp of the quote selected by the tool. It will not match
the date on the machine (unless your server's timezone is set to UTC).

If you change the date to the previous date and refresh the opac, the
tool wlill select another quote, which will not change unless forced.

Test Plan:
1) Remove all your quotes and import a fresh set
2) Enable the quote of the day and view the opac
3) Look at your quotes table and note the timestamp is incorrect
4) Repeat steps 1 and 2
5) Look at your quotes table and note the timestamp is now correct

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10621: use correct from-address for subscription alert emails
Mirko Tietgen [Tue, 23 Jul 2013 21:24:11 +0000 (23:24 +0200)]
Bug 10621: use correct from-address for subscription alert emails

From-address and to-address were the same (patron's email) for
subscription alerts. This patch changes 'from' the branch or
kohaadminemailaddress

To test
- add a subscription in staff/serials in case you don't have any
- enable patron notifications or the subscription
- in the OPAC, subscribe to the serial
- in staff/serial, receive an issue of the serial

Before applying the patch, the email that is supposed to be sent
has the patron's email as 'from' and 'to' (and is likely to fail).

If you follow the steps after applying the patch, the email alert
should have the 'from' address of the patron's branch or
kohaadminemiladdress -- which should also work fine with the MTA/SMTP
you have set up for messaging.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10462: (follow-up) remove some undefined variable warning noise
Galen Charlton [Wed, 24 Jul 2013 16:55:52 +0000 (16:55 +0000)]
Bug 10462: (follow-up) remove some undefined variable warning noise

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10462: QA Followup to resolve LCCN mixup and remove hardcoded marc tags
Marcel de Rooy [Wed, 24 Jul 2013 14:14:46 +0000 (16:14 +0200)]
Bug 10462: QA Followup to resolve LCCN mixup and remove hardcoded marc tags

This patch corrects the mixup for LC call number and control number.

Further, as suggested by Galen, it would be better to not introduce hardcoded
tags in the Z3950Search subs in Breeding.pm.
This patch resolves that by calling TransformMarcToKohaOneField.
Note that this only involves changes to _addrowdata and _isbn_show. These
subs are only used in building the displayed results table.

Additionally, for French UNIMARC installs publicationyear is used to fill
the Date column (copyrightdate is not used in those installs). The edition
statement is only used in unimarc_lecture_pub not in unimarc_complet.

Test plan:
Do some Z3950 searches and look for values in all result columns.
For MARC21 on LOC (and/or others):
  Look for isbn 9780415964845 (check LCCN).
  Look for author Rowling.
For UNIMARC on BNF2 (and/or others):
  On BNF2 look for isbn 2070518426: result contains date and multiple isbn's.
  Look for title: Guide des candidats aux emplois de commissaire de police.
  Third result show edition statement (if you use 205$a with pub install).
  Note that there are no results with LCCN here (just as before).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested for MARC21 and UNIMARC (French lecture_pub install).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10462: Followup for showing multiple ISBNs in Z3950 response
Marcel de Rooy [Wed, 3 Jul 2013 12:26:56 +0000 (14:26 +0200)]
Bug 10462: Followup for showing multiple ISBNs in Z3950 response

As Jonathan correctly noted, the new Z3950 response only showed one isbn
although more isbn numbers could be in the record and would be imported.
To resolve this display problem, I traverse them all now in the updated
routine _isbn_show. There is no change in the imported records.
Note that before this patch TransformMarcToKoha did put all isbn numbers in
one field, separated by pipes (for display only). This behavior is restored
now. The three regexes on the individual isbn numbers now seem to be
overkill, but I left them there for completeness.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested this on a fresh French install under UNIMARC with BNF server.
Tested it too for MARC21.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10462: Some optimizations in Z3950 search paving the way for enhancements
Marcel de Rooy [Thu, 13 Jun 2013 11:52:58 +0000 (13:52 +0200)]
Bug 10462: Some optimizations in Z3950 search paving the way for enhancements

Refactors Z3950Search.
Disable batch record counts for z3950 records.

Test plan:
Do various Z3950 searches on multiple targets from Cataloging and Acquisition.
Behavior should not have changed.

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>
10 years agobug 7494: DBRev 3.13.00.015'
Galen Charlton [Wed, 24 Jul 2013 15:08:50 +0000 (15:08 +0000)]
bug 7494: DBRev 3.13.00.015'

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agobug 7494: (follow-up) tweak description of itemBarcodeFallbackSearch syspref
Galen Charlton [Wed, 24 Jul 2013 15:06:39 +0000 (15:06 +0000)]
bug 7494: (follow-up) tweak description of itemBarcodeFallbackSearch syspref

Thanks to MJ Ray for helping with the wordsmithing on #koha.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agobug 7494: optional checkout-time fallback search for a book
MJ Ray [Thu, 28 Jun 2012 19:35:49 +0000 (20:35 +0100)]
bug 7494: optional checkout-time fallback search for a book

When issuing a book, some libraries want to issue by title or other details.
This patch adds a systempreference and code that allows it.

To test:
1) scan a patron card or enter a surname to start checking out;
2) enter title or other keywords;
3) the circulation screen should display a warning allowing to choose between copies.

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
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>
10 years agoBug 9394: (follow-up) stylistic tidying
Galen Charlton [Tue, 9 Jul 2013 14:58:21 +0000 (14:58 +0000)]
Bug 9394: (follow-up) stylistic tidying

- fix identation in one line
- remove a commented-out warn

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>
10 years agoBug 9394: (follow-up) fix query column alias
Galen Charlton [Tue, 23 Jul 2013 21:06:30 +0000 (21:06 +0000)]
Bug 9394: (follow-up) fix query column alias

A change-and-replace went a tick too far.  This patch
adjusts the column alias in the query run in MergeHolds()
to reflect that the value being returned is the number of
hold requests, not an ID.

To test:

[1] This patch should have no visible changes to behavior.  To
    verify, pick to bib records that have hold requests on them,
    then merge them together.  Verify that the merged bib
    contains sll of the hold requests on it.

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>
10 years agoBug 9394: (follow-up) restore ability to cancel holds from the patron summary
Galen Charlton [Tue, 9 Jul 2013 15:07:08 +0000 (15:07 +0000)]
Bug 9394: (follow-up) restore ability to cancel holds from the patron summary

To test:

- Place a hold request for a patron
- From the patron details page, navigate to the holds table,
  then cancel (delete) it.
- Verify that the hold request is gone.

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>
10 years agoBug 9394: (follow-up) silence spurious warns
Galen Charlton [Tue, 9 Jul 2013 14:30:14 +0000 (14:30 +0000)]
Bug 9394: (follow-up) silence spurious warns

One just needed parentheses, but the one on line 219 reflects
a slightly deeper problem -- it's running patron checks when
a patron hasn't actually been supplied.

To test:

[1] From the staff interface, bring up a biblio that has no
    holds on it, then go to the holds tab.
[2] Verify that the Apache log has no new warnings containing:

request.pl: Use of uninitialized value in string eq at /home/gmc/koha/reserve/request.pl line 219

or

request.pl: Use of uninitialized value in string eq at /home/gmc/koha/reserve/request.pl line 488

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>
10 years agoBug 9394: (follow-up) modernize test cases
Galen Charlton [Tue, 9 Jul 2013 14:13:38 +0000 (14:13 +0000)]
Bug 9394: (follow-up) modernize test cases

- wrap in a transaction
- create the patron records needed for the test

To test:

[1] Run prove -v t/db_dependent/Holds.t
[2] Verify that all tests have passed.
[3] Verify that the additional patron records created
    by the test no longer exist in the database.

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>
10 years agoBug 9394: QA Followup
Jonathan Druart [Wed, 29 May 2013 12:38:40 +0000 (14:38 +0200)]
Bug 9394: QA Followup

* C4::Reserves::_FixPriority
  - The previous code checked the cancellationdate. If think you never pass
in it with bad parameters, but in order to be sure I added the check on
this value.
  - The reservedates array was never used.

* circ/circulation.tt
There was a bug: it was not possible to remove an hold from the
circulation page. Passing reserve_id fixes the issue.

* C4::Reserves::GetReserveId
This subroutine did not have a unit test.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9394: Use reserve_id where possible
Kyle M Hall [Tue, 15 Jan 2013 15:13:52 +0000 (10:13 -0500)]
Bug 9394: Use reserve_id where possible

This patch switches from using a combination of
biblionumber/borrowernumber to using reserve_id where possible.

Test Plan:
1) Apply patch
2) Run t/db_dependent/Holds.t

Signed-off-by: Maxime Pelletier <maxime.pelletier@libeo.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
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>
10 years agoBug 9755: (follow-up) tweak test for tag visibility in merge hash
Galen Charlton [Tue, 23 Jul 2013 23:03:31 +0000 (23:03 +0000)]
Bug 9755: (follow-up) tweak test for tag visibility in merge hash

Koha's MARC framework structure doesn't assign tags to tabs in
the cataloging editor; only subfields are assigned to tabs, and
the field as a whole follows the subfields.

Consequently, for the purpoase of calculating a merge hash, a field
should be added either if no MARC framework information is passed
(which signals that the caller wants to deal with the entire MARC
record) or if any of its subfields are assigned to visible tabs.

This patch has the effect of getting rid of the following spurious
warnings from the Apache log:

merge.pl: Argument "" isn't numeric in numeric ge (>=) at /home/gmc/koha/Koha/Util/MARC.pm line 78

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9755 QA follow-up: fix template compliance
Jared Camins-Esakov [Sun, 16 Jun 2013 11:54:04 +0000 (07:54 -0400)]
Bug 9755 QA follow-up: fix template compliance

Fix the following test failure:
* koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc                FAIL
    forbidden patterns          OK
    tt_valid                    FAIL
            lines 10, 24
    valid_template              OK

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Found a pre-existing problem with non-repeating subfields
that I noted on the bug report.
All other tests were ok and merging records worked nicely.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9755 QA follow-up: move MARC-specific functionality to utility class
Jared Camins-Esakov [Thu, 30 May 2013 10:23:43 +0000 (06:23 -0400)]
Bug 9755 QA follow-up: move MARC-specific functionality to utility class

This follow-up moves all the MARC-specific functionality of Koha::Record
(now renamed to Koha::MetadataRecord) to a Koha::Util::MARC utility class.

To test, run relevant unit tests:
> prove t/Koha_MetadataRecord.t t/Koha_Util_MARC.t t/db_dependent/Koha_Authority.t
and optionally try to merge a record.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9755: Refactor record merge functionality
Jared Camins-Esakov [Wed, 6 Mar 2013 16:30:40 +0000 (11:30 -0500)]
Bug 9755: Refactor record merge functionality

This patch refactors the merge record interface and code a little bit
in preparation for making it possible to merge authority records.

To test:
1) Apply patch.
2) Try merging two records:
    a) Create a list.
    b) Add two records you would like to (or be willing to) merge
       to said list.
    c) View said list.
    d) Check the checkboxes next to the two records you added.
    e) Click "Merge selected records."
    f) Choose a merge reference.
    g) Choose fields from each record that you want to keep.
    h) Click "Merge."
3) Confirm that your merged record has the fields and subfields you
   wanted.
4) Run the unit tests for the two files that were changed:
    prove t/Koha_Record.t t/db_dependent/Koha_Authority.t
5) Sign off.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 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>
10 years agoBug 10516 - Follow up - Fixing capitalization
Katrin Fischer [Sun, 21 Jul 2013 09:50:09 +0000 (11:50 +0200)]
Bug 10516 - Follow up - Fixing capitalization

Fix capitalization on submit buttons when deleting
a Z39.50 server.

- Delete this Server
- Do Not Delete

I think the "Do not delete" should maybe even be a cancel
link to be more consistent with how Koha displays this
kind of dialog in other places.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
fixes capitalisation, tool stil works

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10516 - Improve titles, breadcrumbs, and confirmation messages for Z39.50 server...
Owen Leonard [Fri, 28 Jun 2013 19:10:14 +0000 (15:10 -0400)]
Bug 10516 - Improve titles, breadcrumbs, and confirmation messages for Z39.50 server adds and updates

The template for adding/editing Z39.50 servers shows the same title,
breadcrumbs, etc. for add and edit operations. This patch creates
separate text for each case.

To test, try both adding and editing a Z39.50 server. The page title,
breadcrumb, and heading should correctly reflect the operation you
perform.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely and all strings are translatable.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10586: fix CSS styling when printing cart from Firefox
Owen Leonard [Fri, 19 Jul 2013 16:21:42 +0000 (12:21 -0400)]
Bug 10586: fix CSS styling when printing cart from Firefox

When printing the Cart from Firefox the styling is off even though it
looks correct in preview. I think this may be because the preview is
including stylesheets designated for screen.

This patch removes special handling of JS and CSS assets for the Cart's
print view, letting the page handle print styling like other pages in
the OPAC.

To test, put items in your Cart in the OPAC. Open your Cart and click
the "print" link. Your printout should be correctly styled and match the
preview.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Tested both fail condition and condition with patch - display is much improved. Thanks, Owen!

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10578: fix results sorting in staff interface
Janusz Kaczmarek [Thu, 11 Jul 2013 17:07:09 +0000 (19:07 +0200)]
Bug 10578: fix results sorting in staff interface

To test  (in librarian's interface):

1. Have some biblio records to get a list when searching.
2. Make an advanced search with 'as phrase' modifier (title -- ti,phr:
or author -- au,phr: , etc.)
3. Having the result list try to change the sort order.
4. You should get no results with a message like: "No results match your
search for 'au%2Cphr: " etc.
5. Apply the patch
6. Repeat steps 2. & 3.
7. You should get the list sorted according to your choice.

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10576: make strings in additem.js accessible to translation
Owen Leonard [Thu, 11 Jul 2013 14:53:06 +0000 (10:53 -0400)]
Bug 10576: make strings in additem.js accessible to translation

There are a couple of untranslatable strings in additem.js. This patch
moves the strings out of the script and into the include file which has
been created for this purpose.

To test, apply the patch and test the process for adding an item to an
existing or new basket (with AcqCreateItem set to "when placing an
order."

The add item form should be correctly labeled "Add item." After adding
an item, click to edit it again. The form should now be labeled "Update
item."

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely and passes all tests.
Made sure strings can be translated testing with German templates.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10552: make several sysprefs available to the OPAC login page
Owen Leonard [Mon, 8 Jul 2013 15:22:38 +0000 (11:22 -0400)]
Bug 10552: make several sysprefs available to the OPAC login page

Several system preference variables are unavailable to the OPAC login
template because they are not explicitly enabled for that page. Instead
of adding them to Auth.pm using the old method this patch uses the new
system preference check syntax using the Koha TT plugin.

The following preferences are now checked using this syntax in
masthead.inc:

OpacAddMastheadLibraryPulldown
UseCourseReserves
reviewson
OpacShowRecentComments

In order for the call in masthead.inc to the new plugin to work on all
OPAC pages "[% USE Koha %]" must be added to any template which
includes it (most of them).

Also in this patch: A change to Auth.pm to enable correct display of the
LibraryName in the title of the OPAC login page.

To test, turn on the above system preferences and confirm that the
relevant links appear under the OPAC's main search bar on all pages
including the login page.

Confirm that the text specified in the LibraryName system preference is
shown as the title of the login page.

Confirm that course reserves and comments are displayed correctly on the
biblio detail page.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
I checked both prog and ccsr - all seems well and the links are appearing and disappearing in accordance with the appropriate sysprefs.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10197: Add classes to patron info list
Nicole C. Engard [Fri, 10 May 2013 13:54:53 +0000 (09:54 -0400)]
Bug 10197: Add classes to patron info list

This patch adds classes to the patron info found on the
top left of the circulation and patron related pages to
allow for easy styling of the information displayed.

To test:

* Apply patch
* View a patron detail page and view the source on the list to the
  left to see the styles
* View a checkout screen and view the source on the list to the
  left with patron info to see the styles
* You could also try to style things by customizing your CSS

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template only changes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10604: DBRev 3.13.00.014
Galen Charlton [Mon, 22 Jul 2013 14:46:29 +0000 (14:46 +0000)]
Bug 10604: DBRev 3.13.00.014

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10604: increase width of two columns in the courses table
Galen Charlton [Wed, 17 Jul 2013 14:35:16 +0000 (14:35 +0000)]
Bug 10604: increase width of two columns in the courses table

The department and term columns in the courses table started
as varchar(20), but since they refer to authorized values, need
to be varchar(80) to match authorised_values.authorised_value.  This
patch increases the width of those columns.

To test:

[1] Create two DEPARTMENT authorised values, one whose code
    is shorter than 20 characters and one whose code is longer
    than 20 characters.
[2] Create two courses; give one course the short department and
    the other the long department.
[3] Go to the courses list.  Observe that the department column is
    displays the department name only for the short course.
[4] Apply the patch.
[5] Edit the course with the long department and assign that long
    department to it again.
[6] Go back to the courses list.  Observe that both of the courses
    now display their assigned department.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified changes are consistent for new installations
and updated installations.
Passes all tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agobug 7143: add latest batch of committers
Galen Charlton [Mon, 22 Jul 2013 14:40:58 +0000 (14:40 +0000)]
bug 7143: add latest batch of committers

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7143 - Updating history and about page
Tomas Cohen Arazi [Mon, 8 Jul 2013 16:15:01 +0000 (13:15 -0300)]
Bug 7143 - Updating history and about page

First commit from Silvia Simonetti, went into the 3.12.x branch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 8911: make sure history.txt gets installed where history.txt can see it
Tomas Cohen Arazi [Tue, 2 Jul 2013 21:35:58 +0000 (18:35 -0300)]
Bug 8911: make sure history.txt gets installed where history.txt can see it

This patch makes Makefile.PL put the history.txt file in the right places
depending on the chosen setup layout, adds a reference to that place in
koha-conf.xml (and debian template version), and finally tweaks about.pl to
use it.

To test, apply the patch and verify that perl Makefile.PL runs fine, and
installing in
 - dev
 - single
 - standard
layouts works as expected. Then go to the about.pl page and see if Koha's
history shows there.

Then, build your packages and test on your newly created instances.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10592: fix display of favicon
Galen Charlton [Mon, 15 Jul 2013 15:44:12 +0000 (15:44 +0000)]
Bug 10592: fix display of favicon

Move the favicon files for OPAC and staff so that they are not
blocked by the Apache configuration change introduced by the
patch for bug 9812.

Note that this patch makes the favicon customizable by theme,
not both theme and language.

To test, after applying the patch.

[1] Open pages in the OPAC and staff client.  Verify that the favicon
    is displayed in the usual place in your web browser.  Specific pages
    to test include

    - circulation receipts and slips
    - help
    - lists view
    - web-based self-checkout

[2] Verify that the Apache logs do not contain entries like this:

client denied by server configuration: {...}/prog/en/includes/favicon.ico

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified that the favicon displays correctly. Also
tried changing favicons for staff and OPAC using the
system preferences for those. This still works, where
the system preferences are correctly supported in the
templates.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10592: fix MARC21 006/008 cataloging plugins
Galen Charlton [Mon, 15 Jul 2013 15:00:57 +0000 (15:00 +0000)]
Bug 10592: fix MARC21 006/008 cataloging plugins

Move the XML and XSD data files so that access to them
(particularly the XML files) is not blocked by the Apache
configuration change introduced by the patch for bug 9812.

To test, after applying the patch.

[1] Open a MARC21 bibliographic record in the cataloging editor.
[2] Click on the plugin link for the 008 field.  Verify that
    that the form for all of the fixed field positions is displayed,
    and verify that you can change the type of material.
[3] Repeat step 2 for the 006 field.
[4] Verify that there are no entries in the Apache error log that contain

client denied by server configuration: {...}/cataloguing/value_builder/marc21_field_008.xml

or

client denied by server configuration: {...}/cataloguing/value_builder/marc21_field_006.xml

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Also verified translation of those plugins still works correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7598: [Follow-up] make strings in acquisitions JavaScript translatable
Owen Leonard [Thu, 18 Jul 2013 15:30:35 +0000 (11:30 -0400)]
Bug 7598: [Follow-up] make strings in acquisitions JavaScript translatable

This follow-up addresses QA comments and moves punctuation and line
breaks out of the string to be translated.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7598: make strings in acquisitions JavaScript translatable
Owen Leonard [Mon, 10 Sep 2012 12:34:33 +0000 (08:34 -0400)]
Bug 7598: make strings in acquisitions JavaScript translatable

English strings in acq.js cannot be processed by the translation script.
This patch moves the strings to the templates to be set as JS variables
for use by the script.

To test:

- On the uncertain prices page, enter an invalid price and click save.
  You should see a JavaScript alert pointing this out.

- When adding a fund to an existing budget, enter an amount which
  exceeds the amount in the parent budget. You should see a JavaScript
  alert pointing this out. There is a similar function which has been
  corrected, checkBudgetParent(), but I don't know how to trigger it for
  testing.

The closebasketgroup function has been updated but as far as I can tell
it's not actually in use.

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>
10 years agoBug 9801: display facet labels in search results only when there are facet values
David Cook [Thu, 27 Jun 2013 06:02:08 +0000 (16:02 +1000)]
Bug 9801: display facet labels in search results only when there are facet values

Currently, the headings for facets (such as location) are showing even
if there are no actual values/links for that facet type.

This patch simply checks if the facet array contains any facets before
printing the heading and HTML for each facet value/link.

Test Plan:

Before applying:

0) If you want to check the location facet (which is easiest),
enable singlebranch  mode in the globals system preferences.

1) Do a search for records/items that you have no shelving location
specified (or simply remove the shelving location for a small range
of records that you can find in a search query).

2) Note that "Location" appears amongst the facets even though there
are no values/links present. (If you look at the HTML source, you'll
see some empty HTML tags have been printed out.)

Apply patch.

3) Flush your cache and refresh your page.
4) You should no longer see a "Location" facet (or those empty HTML
tags) on the facet sidebar.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template changes only.
Checked according to test plan, made sure location facet
still shows up when values exist, otherwise it's hidden.

It might make sense to add ids to the facets so libraries
can decide to hide some of them easily. Or alternatively
add a system preference to make that possible.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 2774 - Path to theme is hard-coded in many places
Owen Leonard [Mon, 10 Jun 2013 16:14:15 +0000 (12:14 -0400)]
Bug 2774 - Path to theme is hard-coded in many places

This patch corrects more places in Koha where the path to the "prog"
theme is hard-coded in templates, CSS, and scripts.

Staff client home page:

Paths to the Koha logo background image and the module image sprite have
been corrected. Inactive and hover states of the module links
(circulation, patrons, etc) should look correct.

addbiblio.pl:

An <img> tag is replaced with a text link and an
additional CSS class. CSS uses an image-replacement technique to display
the image as before.

To test, open a blank or existing bibliographic record for editing.
Confirm that the "tag editor" icon displays correctly in two cases: 1)
tags linked to plugin editors and 2) tags linked to authorities. Both
should look correct and work correctly.

System preferences:

The system preferences editor appends a "loading" image to system
preference submit buttons when they are clicked. This patch changes
ajax.js to insert a <span> styled with a background-image instead.

To test, open system preferences and modify any preference. Submit the
change and confirm that the "loading" image appears correctly.

Background jobs:

Any place in Koha where a background job is used displays a progress
bar. This patch corrects the path in CSS to the progress bar image. To
test, perform an action which triggers the display of a progress bar.
For instance, batch modification of items. Confirm that the progress bar
image displays correctly.

blue.css:

I don't know if this is still used by anyone, but a couple of image
paths in this CSS file have been corrected.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests, QA script and test plan.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10457: fix SQL error when using 'export select items data' in serials claims...
David Cook [Thu, 13 Jun 2013 06:46:46 +0000 (16:46 +1000)]
Bug 10457: fix SQL error when using 'export select items data' in serials claims page

Currently, if you use the "check all" checkbox next to the "Vendor"
table header, and try to "Export selected items data", you'll
see the following SQL error in the Apache error log:

DBD::mysql::st execute failed: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for
the right syntax to use near 'on ORDER BY title' at line 12 at
/.../lib/C4/Serials.pm line 1828.

This is because the Javascript that produces the re-direct URL is
including the value of the checkall checkbox, which is "on",
as a "serialid".

We need to only take checkboxes with a name of "serialid" when
crafting the re-direct link.

This patch adds the [name=serialid] attribute selector to the Jquery
that creates the URL to lateissues-excel.pl from claims.pl.

Test Plan:

Before applying the patch:

1) Go to Serials > Claims (found on the left navigation bar of Serials)
2) Choose a vendor that has serials to claim (or create some late
serials for a vendor so that they will show up)
3) Click on the checkbox to the left of the "Vendor" table heading.
4) Click "Export selected items data" at the bottom of the page
5) Check the Apache error log.  Notice that you'll get a SQL error
   like the one in the message above.

Apply the patch.

Repeat Steps 1-4.

Note that you should now have a CSV file downloading rather than
getting a SQL error.

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>
10 years agoBug 10553: make public lists available on OPAC login page
Owen Leonard [Mon, 8 Jul 2013 18:37:03 +0000 (14:37 -0400)]
Bug 10553: make public lists available on OPAC login page

If you are not logged in to the OPAC, looking at the login page, and you
click the Lists button to see public lists it says there are none. This
patch corrects Auth.pm so that it loads the list of public lists in this
situation.

To test you must have at least one public list. Make sure you are logged
out of the OPAC and visit the login page (/cgi-bin/koha/opac-user.pl).
Clicking the "Lists" button should show you a list of public shelves.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
works as described, and list button is not shown when opacpublic is disabled.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agobug 10559: remove spurious "statement handle still active" warnings
Galen Charlton [Tue, 9 Jul 2013 17:53:16 +0000 (17:53 +0000)]
bug 10559: remove spurious "statement handle still active" warnings

Generating (e.g.) overdue notices can result in spurious warnings in
the cronjob logs:

$ ./misc/cronjobs/overdue_notices.pl -t -library CPL
prepare_cached(SELECT * FROM issues WHERE     itemnumber = ?) statement handle DBI::st=HASH(0x54a7828) still Active at C4/Letters.pm line 589

This patch removes the warning by making sure that the relevant statement
handle is finished after fetching its first row of results.

To test:

[1] Set up an overdue loan such that running overdue_notices.pl will
    trigger the generation of a notice.
[2] Run overdue_notices.pl -t and note the warning message.
[3] Apply the patch.
[4] Run overdue_notices.pl -t again and note that the warning message
    is no longer displayed.
[5] Check the message_queue table and verify that the overdue
    notices generated in steps 2 and 4 have the same text.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
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>
10 years agoBug 10597: fix Search to hold button on record details page
Kyle M Hall [Tue, 16 Jul 2013 16:50:25 +0000 (12:50 -0400)]
Bug 10597: fix Search to hold button on record details page

The holds button in cat-toolbar is broken for "search to hold". It is a
split button rather than a dropdown button. Clicking the caret works
fine, but clicked the button sends you to the marc editor!

Test Plan:
1) View a patron's details page
2) Click 'search to hold'
3) Search for something
4) On the results page, click a result line's title link (
    catalogue/detail.pl )
5) Note the "Place hold" button is a split button, click the left half
    of the button, note it redirects you to the editor.
6) Apply this patch
7) Repeat steps 1-5

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>
10 years agoBug 10595: don't display OpacTopissue page when system preference is turned off
Mirko Tietgen [Tue, 16 Jul 2013 19:51:01 +0000 (21:51 +0200)]
Bug 10595: don't display OpacTopissue page when system preference is turned off

When the syspref is turned off, the link is hidden but the page is still
accessible. This patch checks the syspref and redirects to 404 if it is disabled.

Test plan:

Before applying the patch

Enable OpacTopissue
  Observe there is a link to opac-topissues.pl next to Advanced search etc.
  Follow that link, observe that opac-topissues.pl is loading
Disable OpacTopissue
  Observe the link is gone
  Manually open /koha/opac-topissues.pl and check that it is loading even though the feature is disabled

Apply patch

(OpacTopissue still diabled)
Manually open /koha/opac-topissues.pl and observe that you are being redirected to the 404 page.
Enable OpacTopissue
  Follow the link or manuall open opac-topissues.pl and check that it is working

Signoff the patch.

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>
10 years agoBug 10411: add cache control headers for static resources (Debian package)
Robin Sheat [Wed, 5 Jun 2013 05:50:29 +0000 (17:50 +1200)]
Bug 10411: add cache control headers for static resources (Debian package)

This adds caching directives to the static resources so that the browser
doesn't ask about them all the time.

By default, Debian apache doesn't have the required module (mod_expires)
enabled, and so this patch will have no effect. In order to enable this
function, run:

a2enmod expires

and restart apache.

Test Plan:
* Using firebug or equivalent, load a page.
* Note that none of the images, css, or js files have a Cache-Control or
  Expires header set.
* Add this patch, redeploy the package with it (or overwrite the
  apache-share.conf file) enable the 'expires' module, restart apache.
* Force-reload the page
* Note that the images, css, js now have Cache-Control and Expires set
  for 12 hours into the future.

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>
10 years agoBug 10549: (follow-up) make sure ILS-DI GetAvailability response is emitted as UTF-8
Galen Charlton [Wed, 17 Jul 2013 19:12:34 +0000 (19:12 +0000)]
Bug 10549: (follow-up) make sure ILS-DI GetAvailability response is emitted as UTF-8

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agobug 10549: make the ILS-DI services advertise that they return UTF-8
Mirko Tietgen [Sat, 6 Jul 2013 21:48:54 +0000 (23:48 +0200)]
bug 10549: make the ILS-DI services advertise that they return UTF-8

This patch changes a few occurences of ISO-8859-1 to UTF-8
within the XML generation of the ILS-DI module.

To test:
- Activate ILS-DI system preference
- Go to [youropac]/cgi-bin/koha/ilsdi.pl
- Check all examples in the documentation for the correct
  encoding
- Check GetAvailability gives you the correct encoding and
  check the source for the correct encoding

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>
10 years agoBug 10515: (follow-up) fix use of GetBranchCategories
Galen Charlton [Wed, 17 Jul 2013 18:02:13 +0000 (18:02 +0000)]
Bug 10515: (follow-up) fix use of GetBranchCategories

Adjusting to reflect the removal of the branchcode parameter
to GetBranchCategories; also filter on the 'searchdomain'
library group type, as appears to have been intended.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10515: add regression tests
Galen Charlton [Wed, 17 Jul 2013 17:27:36 +0000 (17:27 +0000)]
Bug 10515: add regression tests

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10515: make behavior of library category fetchers consistent with other fetchers
Jonathan Druart [Fri, 28 Jun 2013 14:07:13 +0000 (16:07 +0200)]
Bug 10515: make behavior of library category fetchers consistent with other fetchers

The prototype is not consistent, GetBranchCategory should return only 1 result
and GetBranchCategories should not have a categorycode argument.
This patch fixes that.

Test plan:
1/ Try to add/remove/modify a library.
2/ Add some groups
3/ Add these groups to a library

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>
10 years agoBug 10541: enable cross-browser AJAX in additem.js
David Cook [Fri, 5 Jul 2013 02:00:36 +0000 (12:00 +1000)]
Bug 10541: enable cross-browser AJAX in additem.js

Currently, the additem.js is using "indexOf" to search
for a value in an array. While this works in Chrome, Firefox,
and IE > 9, it fails miserably in IE 8 and 7 (which don't have
the indexOf method). This means that users aren't able to add
items using the acquisitions module!

Instead of using "indexOf", we should be using the jQuery function
$.inArray. It was added in jQuery v1.2 (3.8.0 uses v1.3.2 so even
our oldest supported release can use this method). It's perfectly
cross-browser compatible...works in Chrome, Firefox, and every
version of IE that I've tried (i.e. 7, 8, 9).

Test Plan:

Before applying patch:

0) Switch to Internet Explorer 7, or 8, or 9, or 10.

If you're using IE 9 or 10, you'll need to change the Document Mode to
IE7 standards or IE8 standards.

You can do this by opening Internet Explorer 9 or 10, pressing F12 (or
clicking on the gear in the top right corner and choosing
F12 Developer Tools), and then clicking on "Document Mode" on the
top toolbar. There, you can change to IE7 or IE8 standards.

N.B. This is not always a perfect emulation in every case, but this
time it does show you the bug.

1) Set the system preference AcqCreateItem to "receiving an order"
2) Go to Acquisitions
3) Either:
    a) Receive a shipment for a basket with items
    b) Create a new basket, create an order, close the basket, and
       then do 3a)
4) In the "Item" fieldset, fill out some fields such as barcode,
   Date acquiried, Public note, etc.
5) Click "Add" at the bottom of the fieldset
6) Note that while the item may have been added, the "Item" fieldset
is not being shown again. You may also notice a Javascript error
appearing in a pop-up window or you might see a yellow warning flag
on the bottom status bar.

APPLY THE PATCH

7) Do a full refresh of the page (hold down shift and press the refresh
button on the browser next to the address bar), and try adding items
again.
8) Note that you receive no warnings and that items are added correctly
as they would be in Firefox or Chrome.

OPTIONALLY

9) To be sure that I haven't broken anything, go through the same steps
in IE9 (with IE9 standards) or Chrome or Firefox. Everything should be
working.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Tested in IE10 in IE7 mode and IE9 mode. Also tested in Firefox.

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9362: fix query that finds upcoming due loans
Fridolyn SOMERS [Tue, 9 Jul 2013 15:38:04 +0000 (17:38 +0200)]
Bug 9362: fix query that finds upcoming due loans

C4:Circulation:GetUpcomingDueIssues is used in the advance_notices.pl
script.  This patch corrects an error in its handling of the maxdays
parameter that resulted in it picking up *all* upcoming due loans and
recently overdue loans.

Test plan :
- Create an issue with a date due in the paste
- Create an issue with a date due in two days
- Launch advance notices with due date in max 2 days : perl misc/cronjobs/advance_notices.pl -c -n -v -m=2
=> You get a warn "found 0 issues"
- Launch advance notices with due date in max 3 days : perl misc/cronjobs/advance_notices.pl -c -n -v -m=3
=> You get a warn "found 1 issues"

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
I did the following test :

- 1 book to check in 2 days
- 2 books to check in in the past

before applying the patch :

$perl ../misc/cronjobs/advance_notices.pl -c -n -v -m=2
getting upcoming due issues at ../misc/cronjobs/advance_notices.pl line 203.
found 1 issues at ../misc/cronjobs/advance_notices.pl line 205.

I changed the value of "-m" : 0, 1, 2, 3, 4
=> always 1 issue found (the book to check in in 2 days)

after applying the patch :

$perl ../misc/cronjobs/advance_notices.pl -c -n -v -m=2
found 0 issues
for m = 0, 1, 2 => 0 issues

$perl ../misc/cronjobs/advance_notices.pl -c -n -v -m=3
found 1 issues
for m = 3,4,5 => 1 issues (the book to check in in 2 days)

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9576: DBRev 3.13.00.013
Galen Charlton [Wed, 17 Jul 2013 15:27:50 +0000 (15:27 +0000)]
Bug 9576: DBRev 3.13.00.013

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9576: can now control whether max loans limit can be overriden
Kyle M Hall [Mon, 11 Feb 2013 13:27:05 +0000 (08:27 -0500)]
Bug 9576: can now control whether max loans limit can be overriden

Adds a new system preference AllowTooManyOverride to control whether
a librarian can override the 'Too many checked out' message which is
currently always overridable.

Test Plan:
1) Apply patch
2) Run updatedatabase.pl
3) Attempt to check out 1 more item to a patron than the max issues
4) You should be allowed to override by default ( current behavior )
5) Set AllowTooManyOverride to "Don't allow"
6) Repeat step 3
7) You should be blocked from being able to issue the item

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
The new system preference is activated by default, which mean there
will be no change in behaviour on update.

The system preference is correctly added to the database and .pref
files.

Test plan and QA script passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10563: Fix broken 'Edit' link on check expiration page
Katrin Fischer [Wed, 10 Jul 2013 20:43:41 +0000 (22:43 +0200)]
Bug 10563: Fix broken 'Edit' link on check expiration page

This fixes the broken 'Edit' (subscription) link on the
check expiration page in serials.

To test:
- Add a subscription
- Go to the check expiration page
- Search for your subscription, use an expiration date in the
  far future
- Verify the edit link on the result list doesn't work right
  before applying the patch, but works after

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7019: fix sorting by return date in Circulation History
Fridolyn SOMERS [Thu, 11 Jul 2013 08:24:07 +0000 (10:24 +0200)]
Bug 7019: fix sorting by return date in Circulation History

The "return date" column sort is not using the date sort algorithm because it is
confused by the combination of date data and text data ("Checked out").

This patch adds the use of datatable "title-string" sort type.
With that, the date in ISO format are used for sorting and because
letters are before numbers, "Checked out" rows are more recent than any date.

Test plan :
- set dateformat syspref to "dd/mm/yyyy"
- Go to members/readingrec.pl for a borrower having a old issues and
checked out issues
=> Check that sort of "Return date" is correct.
For example :
With patch :
  20/01/2011
  06/03/2011
  20/03/2011
  Checked Out
Without patch :
  06/03/2011
  20/01/2011
  20/03/2011
  Checked Out
- Test also with dateformat syspref "mm/dd/yyyy"

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>
10 years agoBug 10409: Follow up - improving strings for easier translation
Katrin Fischer [Sun, 30 Jun 2013 14:55:55 +0000 (16:55 +0200)]
Bug 10409: Follow up - improving strings for easier translation

Fixing this line:
<legend>[% IF course_id %] Edit [% ELSE %] Create [% END %] course</legend>

As grammar works different in different languages, having single
strings like that in a predefined order makes having a nice translation
unnecessarily hard.

This will make it a little easier:
<legend>[% IF course_id %]Edit course[% ELSE %]Create course[% END %]</legend>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10409 - Do not show course entry form if no departments are found
Owen Leonard [Wed, 5 Jun 2013 12:36:51 +0000 (08:36 -0400)]
Bug 10409 - Do not show course entry form if no departments are found

The course reserves entry form should not be shown if there are no
DEPARTMENT authorized values, since this prevents the form from being
submitted. This patch replaces the form with an error message when no
DEPARTMENT authorized values are found.

Also corrected:

- Corrected grid structure for more standard display
- Converted labels with no corresponding inputs to <span class="label">
- Closed unclosed tags
- Corrected incorrect capitalization

This patch contains whitespace changes, so please ignore whitespace when
examining changes.

To test, delete any DEPARTMENT authorized values, if present. Create a
new course in Course Reserves. You should see a warning that no
DEPARTMENT values were found.

If you are logged in with the correct permission, the warning should
contain a link to the correct authorized value page. If you do no, the
warning should refer the problem to an administrator.

After creating one or more DEPARTMENT values, the form should display
and submit correctly.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
After this patch has been applied, I get an error message and no form
if I don't have any DEPARTMENTs defined, which makes sense given that
the form can't be submitted without a DEPARTMENT.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
You now see a useful error message, when no departments have been
defined. Else you are taken to the correct form.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10127 : Printoverdues.sh should tar only pdf files
Sophie Meynieux [Fri, 26 Apr 2013 13:06:40 +0000 (15:06 +0200)]
Bug 10127 : Printoverdues.sh should tar only pdf files

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
From the bug report:
At the end of printoverdues.sh, an archive is generated
containing all files present in  directory given as parameter.
As archives are generated in this given directory, they
contain previously generated tar files, creating oversized files.
Only .pdf files should be archived

All tests and QA script pass.
Worked ok in my tests, only packign PDF in the given directory.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10170: expose more managed staged MARC strings to translation
Galen Charlton [Mon, 20 May 2013 15:38:46 +0000 (08:38 -0700)]
Bug 10170: expose more managed staged MARC strings to translation

This commit makes it possible to translated the 'staged'
and 'error' record statuses as well as the 'auto_match'
overlay status.

Also takes out a bit of HTML cruft in one string that is
not needed for translation.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass. New strings are parsed into the po files:
"%s Always add items %s Add items only if matching bib was found %s Add items only if no matching bib was found %s Ignore items %s %s %s %s "
"%s No match %s Match applied %s Match found %s %s %s "
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10170: strings in MARC import made translatable
Adrien Saurat [Thu, 2 May 2013 14:56:54 +0000 (16:56 +0200)]
Bug 10170: strings in MARC import made translatable

Following bug 9215: non translatable strings are now
present in the template and translatable

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Not only does this make the strings translatable it makes the template
a lot easier to read
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10556: The delivery time is not inserted on adding a supplier.
Jonathan Druart [Tue, 9 Jul 2013 09:52:31 +0000 (11:52 +0200)]
Bug 10556: The delivery time is not inserted on adding a supplier.

Test plan:
Add/edit a supplier and check that the delivery time is set in DB.

Note: This patch cleans the code (sql query) in order to see easily if a
problem occurred.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agobug 10556: regression test for setting deliverytime when adding vendor
Galen Charlton [Tue, 16 Jul 2013 14:55:09 +0000 (14:55 +0000)]
bug 10556: regression test for setting deliverytime when adding vendor

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10274: Execute sql queries into a transaction
Jonathan Druart [Fri, 5 Jul 2013 12:50:03 +0000 (14:50 +0200)]
Bug 10274: Execute sql queries into a transaction

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10274: UT: Acquisition.t needs to create its own data
Jonathan Druart [Fri, 17 May 2013 13:11:35 +0000 (15:11 +0200)]
Bug 10274: UT: Acquisition.t needs to create its own data

Try before the patch:
prove t/db_dependent/Acquisition.t

And after, it should produce:
  t/db_dependent/Acquisition.t .. ok
  All tests successful.
  Files=1, Tests=41,  2 wallclock secs ( 0.03 usr  0.00 sys +  0.42 cusr
  0.02 csys =  0.47 CPU)
  Result: PASS

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tests pass and the bookseller is deleted.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>