Bug 12686: Make more selected option XHTML compliant

This patch fixes several occurrences of selected
options that do not follow XHTML style rule for
markup.

To test:
1. Apply the patch
2. There are no functional changes at all,
only a more strict markup

Changed all cases I can found.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12635 - Course reserves item list should use "Checked out" instead of "On Loan"

When viewing the list of items on a course reserve list, if the item is
checked out it is indicated by the phrase "On Loan." The default
templates should always use "checked out" instead of "on loan." Also
corrected: the capitalization of "Item Lost."

To test, Course Reserves must be enabled and you must have an existing
course reserves with items on it, one of which should be checked out.
View the list of items on that Course Reserve and confirm that the table
says "Checked out."

Table in staff client displays "Checked out" / "Item lost"
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
String change, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12699 - Capitalization: All Libraries in pull down on news tool page

To test, got to tools > news
- In pulldown and in table, "All Libraries" should now read "All libraries"
- Create additonal news for "All libraries". Pull down in form should read "All libraries" as well
- Make sure that news for "All libraries" diesplay correctly where they should (in OPAC and Staff client)

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 4045 - No check for maximum number of allowed holds.

Re-add the system preference maxreserves.

All the code using maxreserves is still in place. Though it
is not used in the Reserves module, it is used in all the
scripts where holds are placed.

Also adds a check so that a borrower cannot exceed the maximum
number of allowed holds by using the multi-hold feature via
the opac.

Test Plan:
1) Apply this patch
2) Run updatedatabase
3) Set maxreserves to 3, set opactheme to bootstrap
4) Log into the opac as a patron
5) Place 3 holds
6) Attempt to place a 4th hold
7) Note you get an error message and cannot place a forth hold
8) Delete two of those holds
9) Attempt to place 3 or more holds as a multi-hold
10) You should see a warning that you cannot place this many holds
11) Try to anyway
12) You should see an alert to tell you to reduce the number of holds
    you are placing.
13) Reduce the number for holds you are placing to 2
14) Your holds should now be placed

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 4045: DBRev 3.17.00.013

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11673: columns.def has swapped last and first name of alt contact

To test:
- Create a new guided circulation report
- On the field list scroll to "Alternate contact: Last name"
=> FAIL:
   "Alternate contact: Last name" relates to borrowers.altcontactfirstname
   "Alternate contact: First name" relates to borrowers.altcontactsurname
- Apply the patch, restart the creation of the report
=> SUCCESS:
   "Alternate contact: First name" relates to borrowers.altcontactfirstname
   "Alternate contact: Surname" relates to borrowers.altcontactsurname
- Sign off :-D

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba

Patch behaves as expected
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12523 - Add patron email in Holds awaiting pickup circulation rapport

Modified:

circ/waitingreservers.pl    - added GetFirstValidEmailAddress

Testing:

I Apply the patch

0) Put an item in hold for pickup;
1) In Circulation -> Holds awaiting pickup, validate email (column Patron);

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and will use the first valid email address.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8148: Prevent local authentification fallback if an invalid LDAP password was entered.

http://bugs.koha-community.org/show_bug.cgi?id=8148
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8148: Only update the password if the LDAP password field was mapped

http://bugs.koha-community.org/show_bug.cgi?id=8148
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8148 - LDAP auth_by_bind doesn't fallback to local auth

This patch covers LDAP auth_by_bind configuration so that wrong
LDAP password will return -1 to C4::Auth so we can abort local auth
and prevent users logging in with stale database passwords.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8148: (regression tests) C4::Auth_with_ldap needs unit tests

This followup provides some unit tests for C4::Auth_with_ldap. It implements
regression tests for this bug's changes too.

The aim was to cover all use cases for checkpw_ldap from the first line up to
those touched by this bug's patches. It should serve as a start for having
unit tests for the LDAP thing.

Having said that: no excuses for not providing regression tests for LDAP from now on :-/

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8148: add squeeze's Test::MockObject dependency

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 5502 - Patron card category search field should be menu

When searching for patrons to add to a patron card creator batch there
is a text input field for submitting a patron category. This should be a
dropdown menu. This patch corrects it.

To test, go to Tools -> Patron card creator and click "New batch."
 - Click the "Add item(s)" button.
 - Confirm that in the Patron search pop-up window there is a dropdown
   menu populated with existing patron categories.
 - Confirm that searches limited by patron category return correct
   results.
 - Confirm that the correct patron category is automatically preselected
   after performing a search limited by category.
 - Confirm that reordering the table of search results works correctly.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12600: remove duplicate use statement from code

A use C4::Charset was added deep in the body of the code
we have already imported it at the top of the file
(the by convention normal place) As use is executed at compile time
specifying it in the code body does not serve a
useful purpose and detracts from the readability of an already
overly complex subroutine.
Remove the superfluous statement
also removed the tabs introduced to the surrounding lines
by the same commit

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Search still works, no errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 5672: Gives RSS icons to catalog search history

This patch adds an extra column to the table for the search history (this session and previous searches) with RSS icons for each search.

Test plan:
* Verify that there is no RSS icons for saved searches in opac
* Install the patch
* Verify that there is no RSS icons for saved searches and searches for the current session in Opac.
* Test that the RSS links produce the expected result.

Note: I left out authority searches since I have very little experience with authority searches and didn't feel I could test it properly.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 5672: Gives RSS icons to catalog search history placed to the left of saved searches

Test plan:
* Verify that there is no RSS icons for saved searches in opac
* Install the patch
* Verify that there is no RSS icons for saved searches and searches for the current session in Opac.
* Test that the RSS links produce the expected result.

Note: I left out authority searches since I have very little experience with authority searches and didn't feel I could test it properly.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12738: (regression tests) C4::Context should set keyword search as default for QueryParser

This patch introduces tests for the QueryParser PQF driver usage in Koha. Specifically its
initialization on C4::Context, and initial setup.

It also introduces a .pl script that is used to load C4::Context with different hash randomization
seeds on purpose, to verify the initialization result is deterministic and consistent between
runs.

To test:
  $ prove -v t/db_dependent/QueryParser.t

It should fail because different default_search_class is set on each run, and it is not often the
one we expect.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12738: C4::Context should set 'keyword' as the default search class

On a Perl 5.18 environment (e.g. Ubuntu 14.04 LTS):

To reproduce:
- Have UseQueryParser == "Don't try"
- Perform a search typing just a word that would have many matches on your Zebra db.
- Take note of the search results count.
- Make sure you have the queryparser.yaml file in your config dir.
- Set UseQueryParser == "Try"
- Perform the same search a couple of times
=> FAIL: Notice that the search results count differs from one run to the other.
- Run the regression tests
  $ prove -v t/db_dependent/QueryParser.t
=> FAIL: tests fail

To test:
- Apply the patch
- Run tests
  $ prove -v t/db_dependent/QueryParser.t
=> SUCCESS: tests pass
- Repeat the steps 'To reproduce'
=> SUCCESS: Search results count is deterministic :-D
- Sign off :-D

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Now search with QueryParser always returns the correct number of
results on a system with the newer Perl version.
Passes all tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12647: PQF QueryParser driver and unit tests fixes

Due to Perl 5.18, QueryParser the default search class is no longer
'keyword' (see bug 12738), and needs to be set manually. This patch
adds a line that does that. The problem that gets fixed is with test
'super simple keyword query'.

The rest of the non-deterministically failing tests are due to the same
problem, keys returning differently sorted keys from hashes.

So this patch sorts keys in the step that concatenates attributes when building
the PQF queries (and tests get adjusted to match the now deterministic result).

I did that (sorting there) under Jared's recommendation. Hopefuly he will step
in and comment/fix any mistake I made. My main concern was a possible loss
in performance. That we agreed it is almost void, because of the tiny size
of the hash.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests are passing now again :)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10542: Fix QueryParser with OpacSupression

OpacSupressions manipulates the query string after the buildQuery
call and so breaks with queryParser enabled.  This patch adds
checks for queryParser and manipulates the query before passing it
to buildQuery if it is enabled, but leaves the post buildQuery
manipultation when queryParser is disabled

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Adding a sing after test

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