Bug 12338: Remove smartmatch operator from C4/Serials.pm

This patch removes the use of the 'when' smartmatch operator from
Serials.pm

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11958: Fix typon in classification source help

The Classification Sources help file said the source was in the 942$2 but it's in the 952$2 and 94$2 so this patch fixes that.

To test:
* Go to Admin > Classification Sources
* Click Help
* Confirm the Help file is right now

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
String change, no errors.

Note: Perhaps change "Authorized Values ..." for "Authorized values ..."

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12380 - can't tab to save buttons on add item

Many form elements on the add item page are giving a tabindex of "1" by
the script. This seems to make it impossible to tab through the add item
form fields onto the save buttons. I don't see a reason to set an
explicit tabindex of "1," so this patch removes it.

To test, apply the patch and open an item for editing. Try tabbing
through the add item form fields. It should be possible to tab through
the fields and onto the submit buttons at the bottom. Test again when
adding a new item.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12293: Correct display for patron messaging preferences on OPAC - bootstrap

This patch is a follow-up for bug 11125, it fixes the bootstrap theme.

Test plan:
1) Remove 'sms' from message_transport_types table.
2) Go on OPAC "My messaging" tab => table columns are out of alignment with table heading.
3) Apply patch => table is correctly displayed.

Signed-off-by: Axelle Clarisse <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
With and without 'sms' existing the display of the table is now correct.
Template only change.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12439 - check that CGI is enabled when doing koha-create

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected.
Bug 12406: adding the column maxsuspensiondays in the tests

The column maxsuspensiondays was added in the datatable but not in the tests, which caused the failure of the tests

test plan: execute prove t/db_dependent/Circulation_Issuingrule.t
The command has to print:
t/db_dependent/Circulation_Issuingrule.t .. ok
All tests successful.
Files=1, Tests=9,  2 wallclock secs ( 0.03 usr  0.01 sys +  1.35 cusr  0.08 csys =  1.47 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Failure on test before patch, success after
No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11801: In transit hold items incorrectly labels as "Waiting to be pulled" on request.pl

If an item needs to be transferred to fill a hold, the hold will be
listed as 'Waiting to be pulled" while it is in transit.

Test Plan:
1) Place a hold for pickup at another library
2) Check in the item, confirm the hold transfer
3) View the holds for that record ( request.pl )
4) Note the priority is "In transit" and the status is 'Waiting to be
   pulled".
5) Apply this patch
6) Reload the holds page
7) Note the status is now "Item being transferred to $branch"

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11891: set up tests to require that Koha::Database uses same DB handle as C4::Context

This patch removes changes in two cases to work around the fact that
Koha::Database and C4::Context were not using the same DBI database
handle.

To test:

[1] Run prove -v t/db_dependent/ILSDI_Services.t and
    prove -v t/db_dependent/Items.t.  Both tests
    should fail.
[2] Apply the main patches and run step 1 again.  This
    time, both tests should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11891 - Make Koha::Schema use C4::Context->dbh

Right now there is no connection between the database handles used by
C4::Context::dbh and Koha::Datbase/Schema. This makes it impossible to
use transactions in unit tests to temporarily modify the database to
test subroutines that take advantage of Koha::Database. This patch fixes
that issue.

Test Plan:
1) Apply this patch
2) prove -v t/db_dependent/ILSDI_Services.t and
   prove -v t/db_dependent/Items.t and
   prove -v t/db_dependent/Circulation_issue.t should
   all start passing

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11891: (follow-up) remove custom storage class

For now, just rely on the normal DBIx::Class cleanup handler;
otherwise, the following warning is displayed in logs:

  (in cleanup) Can't locate object method "_preserve_foreign_dbh" via package "Koha::Storage" at .../Koha/Storage.pm

Using the default DBIC storage class also means that we
don't have to manually do things like set the SQL limit dialect;
meaning that we don't get the following warning message:

  DBIx::Class::ResultSet::find(): Your storage class (Koha::Storage) does
  not set sql_limit_dialect and you have not supplied an explicit
  limit_dialect in your connection_info. DBIC will attempt to use the
  GenericSubQ dialect, which works on most databases but can be (and
  often is) painfully slow. Please file an RT ticket against
  'Koha::Storage' . at /home/gmc/koha/C4/Members.pm line 840

Test plan: same as main patch

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11891: (follow-up) set DBIC storage flags correctly

Since we're passing an existing DBI database handle to
DBIC, and that handle doesn't have RaiseError set to true
by default, don't let DBIC override that -- for now.

Test plan: verify that the DB-dependent test suite passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12041 - improve Koha::Cache

This makes Koha::Cache behave better by default. It will use memcached
if available to do shared caching, if that's not available it will fall
back to in-memory caching. It also allows for a singleton accessor to
allow a single cache to be shared within a process.

* Added tests to confirm UTF8-cleanness.
* Added minor fixups to stop warnings.

Test plan:
* The t/Cache.t file runs successfully with and without the
  MEMCACHED_SERVERS envvar set (and memcached running in the
  environment.)

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12041 - POD fixing followup

This fixes a minor POD error detected, and also adds the Koha/ directory
to the regular test case so that the in-repo tests can find these
things.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12041: UT - Get rid of warnings

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12454: Can't add new patron categories

To test:
- Add a new patron category
- After saving, the new patron category won't show up in the list
- Apply patch
- Try to add a new patron category again
- It should now save correctly and show up in the list of patron
  categories.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12226: (regression tests) Check_Userid should always consider the DB user not unique

Some improvements on t/db_dependent/Members.t and specifically regression
tests for bug 12226

Regards
To+

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12226 - A user with the database username/userid can access staff with full permissions

This patch implements 2 suggestions on comment #3

- Prevents creation of a new user with same userid
of database user

- When checking password, if userid matches database user,
only check against pass on config file

To test:
1. Create a new user with same login as database user
any password different from real db user
2. Check that you can login on staff using this user/pass
and you are superlibrarian

3. Apply the patch

4. Login again using new pass, it must fail
5. Login again using db pass, you are now superuser,
but system does not warn you :( No problem, that's
for having one borrower with that login
6. Delete user with same login as db user
7. Try to create one again as in 1, system must return
an error of duplicate login!

8. Check for no regressions on user/pass authentication

Resubmited, has an error

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
This works nicely and as described.
Also editing the former 'superuser' will force you to
change the userid in order to save any other change.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9093 - 008 forgetting what material type was chosen

This patch adds material type checking to the MARC21 008 tag editor,
based on value from the leader. That is, the 008 tag editor
will choose an initial material type based on the leader 06
(and if necessary the leader 07 position)

_TEST PLAN_
1) Create a new record or open an existing bib record
2) Change position 6 from its current value (probably "a") to
"c" or "e" or "g" or "m" or "p". (See the end of this message
for a comprehensive list of 06 values to try.)
3) Open the 008 tag editor
4) Note that it still says BKS even though it should say "MU"
or "MP" or "VM" or "CF" or "MX".

5) Apply the patch

6) Repeat steps 2 and 3.
7) Note that the 008 tag editor now shows the correct material
type based on the leader.

8) For more comprehensive checking, try switching position 6
back to "a" and changing position 7 to "b" instead of "m".
9) Note that it will switch from "BKS" to "CR".
10) Fin

Comprehensive mapping:

Field 008/18-34 Configuration
If Leader/06 = a and Leader/07 = a, c, d, or m: Books
If Leader/06 = a and Leader/07 = b, i, or s: Continuing Resources
If Leader/06 = t: Books
If Leader/06 = c, d, i, or j: Music
If Leader/06 = e, or f: Maps
If Leader/06 = g, k, o, or r: Visual Materials
If Leader/06 = m: Computer Files
If Leader/06 = p: Mixed Materials
http://www.loc.gov/marc/bibliographic/bdleader.html

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, nice job.
koha-qa complains for a tab char, removed on followup.
Mode change on TT file (+x), removed.
No other errors

NOTE: It would be desirable to update LEADER values
to reflect changes on 008.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Awesome work David.
Bug 12434: Fix Typo in Smart Rules Help

This patch fixes a typos in the help file on the circ and
fine rules.

To test:

Visit admin > circ and fine rules
Click help in the top right
Confirm that period is not spelled peiod

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7143: Release team 3.18

See http://wiki.koha-community.org/wiki/Roles_for_3.18

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

No errors.
Order is alphabetical?

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