koha.git
7 years agoBug 15758: [QA Follow-up] Final touch?
Marcel de Rooy [Wed, 31 Aug 2016 12:20:34 +0000 (14:20 +0200)]
Bug 15758: [QA Follow-up] Final touch?

From qa tools:
reports/cat_issues_top.pl: pod: =over on line 39 without closing =back

Note: qa tools does also report "options_for_libraries: not found" on two
template includes. Considering this as a false alarm, since the block is
defined in another include loaded in doc-head-open.
[1] koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc
[2] koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc

Found a template where a USE Branches was missing:
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
Easy to spot since the libraries combo was empty.
Tried to find similar occurrences with few greps, but couldn't find any.

I did find duplicate USE Branches though in:
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt
This patch removes them.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Fix variable name, it's a branchcode
Jonathan Druart [Fri, 26 Aug 2016 13:05:42 +0000 (14:05 +0100)]
Bug 15758: Fix variable name, it's a branchcode

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: [QA Follow-up] Corrections related to GetBranches
Marcel de Rooy [Fri, 26 Aug 2016 11:22:31 +0000 (13:22 +0200)]
Bug 15758: [QA Follow-up] Corrections related to GetBranches

[1] C4/Search
A call to Koha::Libraries is added to routine pazGetRecords, but the
results of that call are not used. So removing it again.

[2] catalogue/itemsearch.pl
Although A=>B=>C=>D works, we'd better use here A=>B, C=>D.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: [QA Follow-up] Some corrections related to GetBranchName
Marcel de Rooy [Fri, 26 Aug 2016 07:02:04 +0000 (09:02 +0200)]
Bug 15758: [QA Follow-up] Some corrections related to GetBranchName

[1] Acquisition.pm
The lines filling $row in GetBasketGroupAsCSV may have side-effects when
the library name is not found. This change restores former behavior. Just
theoretically more safe.
Note that it also contained a typo: $row->{deliveryplace} should have been
$row->{$place}.

[2] Auth.pm
checkauth: $branchname = Koha::Libraries->find($branchcode)->branchname;
Should normally be fine, but I rather have an empty string here than
crashing on "Can't call method branchname on undefined value".
Same for sub check_api_auth.
Note that this holds for a larger number of calls, but I am adding a check
here because it is checkauth.
Also removed a duplicate use Koha::Libraries-statement.

[3] Search.pm
Also removed a duplicate use statement for Libraries.

[4] svc/holds
Added an (explicit) use statement for Koha::Libraries.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: [QA Follow-up] Remove onlymine from Plugin/Branches.pm
Marcel de Rooy [Fri, 26 Aug 2016 06:01:07 +0000 (08:01 +0200)]
Bug 15758: [QA Follow-up] Remove onlymine from Plugin/Branches.pm

Hard to miss that one:
Template process failed: plugin error - Bareword "C4::Branch::onlymine" not allowed while "strict subs" in use at Koha/Template/Plugin/Branches.pm line 59.
Compilation failed in require at /usr/lib/perl5/Template/Plugins.pm line 206.

Removed OnlyMine from Plugin/Branches. Replaced by a template var in
cleanborrowers; it was used only once.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Koha::Libraries - Do not select an option if selected is defined
Jonathan Druart [Mon, 8 Feb 2016 17:17:31 +0000 (17:17 +0000)]
Bug 15758: Koha::Libraries - Do not select an option if selected is defined

This will certainly need a few more tweaks.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Koha::Libraries - Add tests for the Branches TT plugin
Jonathan Druart [Mon, 8 Feb 2016 15:20:18 +0000 (15:20 +0000)]
Bug 15758: Koha::Libraries - Add tests for the Branches TT plugin

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Koha::Libraries - Ultimate duel for C4::Branch
Jonathan Druart [Fri, 5 Feb 2016 12:34:08 +0000 (12:34 +0000)]
Bug 15758: Koha::Libraries - Ultimate duel for C4::Branch

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Koha::Libraries - Move onlymine to C4::Context::only_my_library
Jonathan Druart [Fri, 5 Feb 2016 12:30:29 +0000 (12:30 +0000)]
Bug 15758: Koha::Libraries - Move onlymine to C4::Context::only_my_library

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Koha::Libraries - Remove GetBranches
Jonathan Druart [Thu, 4 Feb 2016 15:24:23 +0000 (15:24 +0000)]
Bug 15758: Koha::Libraries - Remove GetBranches

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Koha::Libraries - Move mybranch to C4::Context
Jonathan Druart [Thu, 4 Feb 2016 15:24:12 +0000 (15:24 +0000)]
Bug 15758: Koha::Libraries - Move mybranch to C4::Context

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Koha::Libraries - Remove GetBranchesLoop
Jonathan Druart [Wed, 3 Feb 2016 15:58:08 +0000 (15:58 +0000)]
Bug 15758: Koha::Libraries - Remove GetBranchesLoop

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15758: Koha::Libraries - Remove GetBranchName
Jonathan Druart [Tue, 2 Feb 2016 17:28:30 +0000 (17:28 +0000)]
Bug 15758: Koha::Libraries - Remove GetBranchName

This is the fourth and last patch set to remove C4::Branch.
The real purpose of this patch is to standardise and refactor some code
which is related to the libraries selection/display.
Its unconfessed purpose is to remove the C4::Branch package.

Before this patch set, only 6 subroutines still existed in the C4::Branch
package:
- GetBranchName
- GetBranchesLoop
- mybranch
- onlymine
- GetBranches
- GetBranch

GetBranchName basically returns the branchname for a given branchcode.
The branchname is only used for a display purpose and we don't need to
retrieve it in package or pl scripts (unless for a few exceptions).
We have a `Branches` template plugin with a `GetName` method which does
exactly this job.
To achieve this removal, we will use this template plugin and delete the
GetBranchName from pl and pm files.
The `Branches.all()` will now select the library of the logged in user
if no `selected` parameter has been passed.
This new behavior could cause regressions, for instance there are some
places where we do not want an option preselected (batch item
modification for instance), keep that in mind when testing.

GetBranchesLoop took 3 parameters: $branch and $onlymine.
The first one was used to set a "selected" flag, for a display purpose:
select an option in the libraries dropdown lists.
The second one was useless: If not passed or set to 0, the
`C4::Branch::onlymine` subroutine was called.
This onlymine flag was use to know if the logged in user was able to see
other libraries infos.
A patron can see the infos from other libraries if IndependentBranches
is not set OR if he has the superlibrarian permission.
Prior to this patch set, the "onlymine test" was done on different
places (neworderempty.pl, additem.pl, holidays.pl, etc.), including the
Branches TT plugin. In this patch set, this test is only done on one
place (C4::Context::only_my_library, code moved from
C4::Branch::onlymine).
To accomplish the same job as this subroutine, we just need to call the
`Branches.all()` method from the `Branches` TT plugin. It already
accepts a `selected` parameter to set a flag on the option to select.
To avoid the repetitive
  [% IF selected %]<option selected="selected">[% ELSE %]<option>[% END %]
pattern, a new `html_helpers` TT include file has been created, it
defines an `options_for_libraries` block, which takes a `selected`
parameter. We could imagine to use this include file for other
selects.

The 'mybranch` and `onlymine` subroutines of the C4::Branch package have
been moved to C4::Context. onlymine has been renamed with
only_my_library. There are only 4 occurrences of it, against 11 before
this patch set.
There 2 subroutines are Context-centric and it makes sense to put them
in `C4::Context` (at least it's the least worst place!)

GetBranches is the tricky part of this patch set: It retrieves all the
libraries, independently of the value of IndependentBranches.
To keep the same way as the existing calls of `Branches.all()`, I have
added a `unfiltered` parameter. If set, the `Branches.all()` will call
a usual Koha::Libraries->search method, otherwise
Koha::Libraries->search_filtered will be called. This new method will
check if the logged in user is allowed to see other libraries or only
its library.
Note that this `GetBranches` subroutine also created a `category` key:
it allowed to get the list of groups (of libraries) where this library
existed. Thanks to a previous patch set (bug 15295), this value was
not used anymore (I may have missed something!).

Note that the only use of `GetBranch` was buggy (see bug 15746).

Test plan (for the whole patch set):
The best way to test this whole patch set is to test with 2 instances: 1
with the patch set applied, 1 using master, to be sure there is no
regression.
It would be good to test the same with `IndependentBranches` and the
without `IndependentBranches`.
No difference should be found.
The tester must focus on the library dropdowns on as many forms as
possible.
You will notice changes in the order of the options: the libraries will
now be ordered by branchname (instead of branchcode in some places).
A special attention will be given to the following page:
- acqui/neworderempty.pl
- catalogue/search.pl
- members/members-home.pl (header?)
- opac/opac-topissues.pl
- tools/holidays.pl
- admin/branch_transfer_limits.pl
- admin/item_circulation_alerts.pl
- rotating_collections/transferCollection.pl
- suggestion/suggestion.pl
- tools/export.pl

Notes for QA:
- There are 2 FIXMEs in the patch set, I have kept the existing behavior,
but I am not sure it's the good one. Feel free to open a bug report and
I will fill a patch if you think it's not correct. Otherwise, remove the
FIXME lines in a follow-up patch.
- The whole patch set is huge and makes a lot of changes.
But it finally will tremendously reduce the number of lines:
716 insertions for 1910 deletions

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: Uniformise calls in patron-attr-types
Jonathan Druart [Fri, 12 Aug 2016 11:56:22 +0000 (12:56 +0100)]
Bug 15407: Uniformise calls in patron-attr-types

Does not make sense to call first in list context and later in scalar
context.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: [QA Follow-up] Confusing cathash removed
Marcel de Rooy [Fri, 12 Aug 2016 11:26:46 +0000 (13:26 +0200)]
Bug 15407: [QA Follow-up] Confusing cathash removed

One of the patches removed %cathash. Some kind of silly remainder
was left in a string. Just used as a text field to explain the
filters used on borrowers_stats.pl. The filter name cathash is not
really easy and also was confusing in relation to the variable.

So just a string patch, replacing it with Patron category.

NOTE: The output of borrowers_stats.pl with the filters listed, is
not one of the most beautiful Koha screens.
Furthermore, translatibility of these filters is still an issue to
be handled on another report.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: (follow-up) Koha::Patron::Categories - replace C4::Category->al
Jonathan Druart [Fri, 12 Aug 2016 10:05:46 +0000 (11:05 +0100)]
Bug 15407: (follow-up) Koha::Patron::Categories - replace C4::Category->al

Categories.GetName should not have been removed in the previous patch
(merge conflict issue).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: [QA Follow-up] Joubu, add your tests
Marcel de Rooy [Fri, 12 Aug 2016 09:20:11 +0000 (11:20 +0200)]
Bug 15407: [QA Follow-up] Joubu, add your tests

Trivial fix (yes again).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: [QA Follow-up] Fix POD in reserves_stats.pl
Marcel de Rooy [Fri, 12 Aug 2016 08:49:32 +0000 (10:49 +0200)]
Bug 15407: [QA Follow-up] Fix POD in reserves_stats.pl

Trivial fix.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: Koha::Patron::Categories - replace GetborCatFromCatType
Jonathan Druart [Tue, 22 Dec 2015 10:12:48 +0000 (10:12 +0000)]
Bug 15407: Koha::Patron::Categories - replace GetborCatFromCatType

This unnecessary complicated subroutine returned an arrayref and an
hashref of the patron categories available for the logged in user, for a given
category_type, ordered by categorycode.
This can now be done with the search_limited method.

Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to other
libraries. They should be ordered as before this patch, by categorycode.
- Add/edit a patron, change his/her patron category value.
- On the 3 following reports:
    reports/bor_issues_top.pl
    reports/borrowers_out.pl
    reports/cat_issues_top.pl
The display for these 3 reports are different than the 2 from the first
patch (borrowers_stats.pl issues_avg_stats.pl): they are ordered by
categorycode and the ones limited to other libraries are not displayed
(should certainly be fixed).

Note that the big part of this patch has already been tested before
(update child related: CATCODE_MULTI).

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: Koha::Patron::Categories - replace GetBorrowercategoryList
Jonathan Druart [Mon, 21 Dec 2015 17:27:08 +0000 (17:27 +0000)]
Bug 15407: Koha::Patron::Categories - replace GetBorrowercategoryList

C4::Members::GetBorrowercategoryList returned all the patron categories,
ordered by description.
This can be done using the search method of the Koha::Patron::Categories
module.

Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to other
libraries. They should be ordered as before this patch, by description.
- On the "patron attribute types" admin page (admin/patron-attr-types.pl).
- On the "Batch patron deletion/anonymization"
  (tools/cleanborrowers.pl), the dropdown list should be filled
  correctly.
- On the import patron tool
- On the following report:
    reports/reserves_stats.pl
Confirm that the patron categories are displayed and that the report
still works as before.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: Koha::Patron::Categories - replace GetBorrowercategory
Jonathan Druart [Mon, 21 Dec 2015 17:13:12 +0000 (17:13 +0000)]
Bug 15407: Koha::Patron::Categories - replace GetBorrowercategory

The purpose of C4::Members::GetBorrowercategory was to return the patron
category for a given categorycode. This can be done easily with the
Koha::Patron::Categories->find method.

Test plan:
- Same prerequisite as before
- Edit a guarantor and confirm the information will be updated for his/her
  guarantee(s).
- Update a child to adult patron (Note: Should not we hide the patron
  categories limited to others libraries? If yes, it must be done on another
  bug report).
  There is a special behavior if there is only 1 adult category, the
  user does not need to select a category. So the same as before with
  only 1 adult patron category.
- Import a patron with a category_code which does not exist. You should
  be warned.
- Modify some patron using the batch patron modification tool. The
  patron category descriptions should correctly be displayed.

Note that the overduerules page has already been tested in a previous
patch.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: Koha::Patron::Categories - replace C4::Category->all
Jonathan Druart [Mon, 21 Dec 2015 17:04:30 +0000 (17:04 +0000)]
Bug 15407: Koha::Patron::Categories - replace C4::Category->all

The C4::Category module contained only 1 method to return the patron
categories available for the logged in user.
The new method Koha::Patron::Categories->search_limited does exactly the
same thing (see tests) and must be used in place of it.

Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to
other libraries.
- On the 'Item circulation alerts' admin page
  (admin/item_circulation_alerts.pl), modify the settings for check-in
  and checkout (NOTE: Should not we display all patron categories on
  this page? If yes, it must be done in another bug report to ease
  backporting it).
- Search for patrons in the admin (budget) and acquisition (order) module.
- On the patron home page (search form in the header)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15407: Koha::Patron::Categories - remove sql queries in some pl and pm
Jonathan Druart [Mon, 21 Dec 2015 15:04:45 +0000 (15:04 +0000)]
Bug 15407: Koha::Patron::Categories - remove sql queries in some pl and pm

This patch replaces sql queries done in some pl script and in
C4::Reports::Guided.
Since we have now a Koha::Patron::Categories module, we should use it
where it is possible.

Test plan:
- Prerequisite: Be sure you have several patron categories created, with
  different option enabled, and limit some to certain libraries.
- On the 'Circulation and fine rules' admin page (admin/smart-rules.pl),
  all the patron categories should be displayed (even the ones limited to
  another library), ordered by description. Try to add/update existing rules.
- On the overdue rules page (tools/overduerules.pl), all the patron
  categories with overduenoticerequired set should be displayed.
  Try to add/update existing rules.
- On the following reports:
    reports/borrowers_stats.pl
    reports/issues_avg_stats.pl
The patron categories should be displayed. Note that there is an
inconsistency with these 2 reports: the patron categories limited to
other libraries are displayed on them, when they are not on the other
reports. This should certainly be fixed (on another bug report).

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14695 - DBRev 16.06.00.018
Kyle M Hall [Thu, 8 Sep 2016 12:47:25 +0000 (12:47 +0000)]
Bug 14695 - DBRev 16.06.00.018

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14695 [QA Followup]
Kyle M Hall [Thu, 8 Sep 2016 09:45:27 +0000 (09:45 +0000)]
Bug 14695 [QA Followup]

* Add tests for CanItemBeReserved returns 'itemAlreadyOnHold' to t/db_dependent/Holds.t
* Don't let GetReserveId explode
* Use search instead of map
* Remove instances of resbarcode
* Fix badly formed li closing tag

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 14695: Fix GetHardDueDate.t tests
Jonathan Druart [Wed, 7 Sep 2016 13:20:00 +0000 (14:20 +0100)]
Bug 14695: Fix GetHardDueDate.t tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17189 [QA Followup] - Missing $ on $key var for unsafe variant
Kyle M Hall [Thu, 8 Sep 2016 12:19:30 +0000 (12:19 +0000)]
Bug 17189 [QA Followup] - Missing $ on $key var for unsafe variant

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16035: MARC default bibliographic framework Export fix
Aleisha Amohia [Wed, 24 Aug 2016 21:24:45 +0000 (21:24 +0000)]
Bug 16035: MARC default bibliographic framework Export fix

This patch makes sure that, if there is no framework code,
     $frameworkcode is set to 'default'. This fixes the format issue.
     Then, if $frameworkcode = default, an empty string (rather than
     null) is passed to the ExportFramework method, as the framework
     code in the DB for default codes is "".

To test:
1) Go to Admin -> MARC Bibliographic framework
2) Try to export default framework in all formats, notice the file is
only exported as .ods and is an empty file. Notice warns in intranet
error log.
3) Apply patch and refresh page
4) Confirm exporting default framework works in all formats and
spreadsheet has data
5) Notice warns in error log are gone
6) Confirm export still works for other frameworks

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17231 - (QA Followup)
Nick Clemens [Wed, 7 Sep 2016 13:03:43 +0000 (13:03 +0000)]
Bug 17231 - (QA Followup)

Nicer grep

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17231 - HTML5MediaYouTube should recognize youtu.be links from youtube as well...
Nick Clemens [Wed, 31 Aug 2016 17:37:56 +0000 (17:37 +0000)]
Bug 17231 - HTML5MediaYouTube should recognize youtu.be links from youtube as well at the full links

To test:
Enable HTML5MediaYouTube and ensure WWW::YouTube::Download is installed
Add an 856$u to a record like: https://www.youtube.com/watch?v=tu0qtEwb9gE
Verify you can see the embedded player
Use the youtube shortened like (from the share button) like:
https://youtu.be/tu0qtEwb9gE
Verify you can see the embedded player

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Improve regex to limit year to 4 integers
Jonathan Druart [Tue, 6 Sep 2016 11:58:31 +0000 (12:58 +0100)]
Bug 14060: Improve regex to limit year to 4 integers

01/01/01984 should not be considered as a valid date.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Consider an empty string as a valid date
Jonathan Druart [Mon, 5 Sep 2016 08:16:02 +0000 (09:16 +0100)]
Bug 14060: Consider an empty string as a valid date

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Add the datepicker class to dateofbirth
Jonathan Druart [Tue, 30 Aug 2016 08:56:46 +0000 (09:56 +0100)]
Bug 14060: Add the datepicker class to dateofbirth

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Force leading zeros on date
Jonathan Druart [Tue, 30 Aug 2016 08:54:55 +0000 (09:54 +0100)]
Bug 14060: Force leading zeros on date

If a date does not contain leading zeros for day and month, the date
will be refused.
parseDate function considers 1/1/1990 as a valid date, but our perl code
does not. We must refuse it.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Display date format pattern instead of date format name
Jonathan Druart [Fri, 26 Aug 2016 07:44:06 +0000 (08:44 +0100)]
Bug 14060: Display date format pattern instead of date format name

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Add support for dmydot
Jonathan Druart [Mon, 4 Jan 2016 11:03:43 +0000 (11:03 +0000)]
Bug 14060: Add support for dmydot

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Force the input to contain a valid date
Jonathan Druart [Tue, 1 Dec 2015 17:33:15 +0000 (17:33 +0000)]
Bug 14060: Force the input to contain a valid date

Before this patch, the user was still allowed to enter a valid date.
Now, if the date is not valid, the input is emptied.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Display the date format on the warning popup
Jonathan Druart [Mon, 27 Apr 2015 08:42:51 +0000 (10:42 +0200)]
Bug 14060: Display the date format on the warning popup

The date format is now displayed on the warning popup.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Add OnClose event on missing datepicker
Jonathan Druart [Mon, 27 Apr 2015 08:39:14 +0000 (10:39 +0200)]
Bug 14060: Add OnClose event on missing datepicker

The "suspend until" inputs (hold list on circ/circulation.pl and
members/moremember.pl) were not set in the same way.
The minDate option should be set for both (bug 10703 removed it for
circ/circulation.pl).
This patch reintroduces the option and add the OnClose event on both.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14060: Remove readonly attributes on date inputs
Jonathan Druart [Fri, 24 Apr 2015 13:36:34 +0000 (15:36 +0200)]
Bug 14060: Remove readonly attributes on date inputs

In order to remove accessibility issues due to the readonly attributes
on date inputs, this patch will remove them and introduce a javascript
validation on them.

This patch is not perfect for some reason:
I didn't manage to force the user to select a valid date. One solution
would be to reopen the datepicker plugin until a valid date is inserted.
But it could be annoying for users (and for me: I did not manage to
implement this solution).
You will note that input is emptied if the date is not valid. This is a
quick and efficient solution to prevent submitting invalid date and make
Koha explodes. A proper solution would be to implement the check server
side send a friendly message to the user.

Test plan:
For all inputs, try an invalid and a valid date.
 1/ Debar a patron
 2/ On the checkout tables (circulation and moremember), add a renewal
due date (at the bottom of the tables)
 3/ On the checkout page, specify a due date
 4/ On the return page, specify a return date
 5/ On the invoice page (acquisition module), enter a shipment and
billing date
 6/ On the invoice search page (invoices.pl) use filters shipment and
billing dates
 7/ On the offline circ page, specify a due date
 8/ On the edit patron page (memberentry), add a debarment
 9/ On the reserve page (reserve/request.pl), use the date inputs to
suspend until a defined date
10/ Edit patrons in a batch (tools/modborrowers.pl) and use the
registration and expiry date inputs

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17152: Do not copy value when duplicating a subfield
Hector Castro [Wed, 31 Aug 2016 19:33:53 +0000 (13:33 -0600)]
Bug 17152: Do not copy value when duplicating a subfield

When cataloguing, if you want to duplicate a subfield that is not
empty, the new subfield is created with a copy of data in it.
This is not the case when you duplicate an whole field. The new one is
created with subfields but without data in it.

Test plan:
Add or edit a bibliographic record
Fill a subfield
Duplicate the subfield
=> Without this patch the value of the input will be copied
=> With this patch the new input will be emptied

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17072: 006 not filling in with existing values
Jacek Ablewicz [Thu, 1 Sep 2016 16:13:50 +0000 (18:13 +0200)]
Bug 17072: 006 not filling in with existing values

When you use the 006 builder to view the existing values in the 006
tag, Koha is not pulling these existing values into the builder
window. Instead, Koha appears to be using defaults.

To reproduce:

1. Open a record in the editor
2. Switch from BKS to another material type.
3. Change as many settings as possible.
4. Close plugin.
5. Reopen plugin - notice your selections are not shown.

Trivial patch, heavilly inspired by Bug 9093.

To test:

1. Apply patch
2. Ensure that issue described above is no longer reproductible

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11592: (QA followup) Add missing framework code to ViewPolicy filter calls
Tomas Cohen Arazi [Tue, 30 Aug 2016 15:44:14 +0000 (12:44 -0300)]
Bug 11592: (QA followup) Add missing framework code to ViewPolicy filter calls

This patch adds the frameworkcode option param, using each record's frameworkcode
as expected by the filter. Otherwise the ViewPolicy filter falls back to the
default framework.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11592: (QA followup) Simplify code
Tomas Cohen Arazi [Mon, 22 Aug 2016 14:00:41 +0000 (11:00 -0300)]
Bug 11592: (QA followup) Simplify code

Koha::RecordProcessor and the defined filters are supposed to bring us
joy and happiness. Let's keep the code compact, simple and clean.

This patch removes record cloning all over the place.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11592: MARCView and ISBD followup
Mark Tompsett [Thu, 21 Apr 2016 01:49:41 +0000 (21:49 -0400)]
Bug 11592: MARCView and ISBD followup

There are still some leaks, but it is not as a result
of the filter, but rather a result of poorly written
template files.

Bug fixing template files is beyond the scope of this
set of patches.

TEST PLAN
---------
 1) Backup your DB
 2) run the following SQL on your DB.
    > UPDATE marc_subfield_structure set hidden=-8;
    -- this should set EVERYTHING to hidden across the board.
 3) In staff client, set OPACXSLTDetailsDisplay to blank
 4) In OPAC, view any detail.
    -- Normal view may mostly leak values still.
    -- MARC view may leak values.
    -- ISBD view may leak values.
 5) In staff client, set OPACXSLTDetailsDisplay to default
 6) In OPAC, view any detail.
    -- same issues as step 4
    -- 'View Plain' may leak too.
 7) 'Save record' -> 'Dublin Core'
 8) Apply this patch
 9) run koha qa test tools
    -- should be fine
10) prove -v t/db_dependent/Filter_MARC_ViewPolicy.t
    -- should pass
    -- this proves Koha/Filter/MARC/ViewPolicy.pm tweaks too
11) In OPAC, view any detail.
    -- Normal view:
       -- Material type comes from the LEADER field.
       -- Lists this is on will still display
       -- 'Tags from this library' will still display
       -- Item information in table will still display
          (THIS IS BEYOND SCOPE)
    -- MARC view:
       -- Record number is leaked
          (THIS IS BEYOND SCOPE)
       -- 'View plain' leaks LEADER field.
    -- ISBD view may leak field headings, but not values.
       (THIS IS BEYOND SCOPE)
12) In staff client, set OPACXSLTDetailsDisplay to blank
13) In OPAC, view any detail.
    -- same kind of output as step 10
14) 'Save record' -> BIBTEXT
    -- Should be next to nothing leaked.
15) 'Save record' -> Dublin Core
    -- Should be the same or less leaked between the two versions.
    -- (XML FILTERING IS BEYOND SCOPE)
16) In the staff client, go view the same record.
    -- it should be mostly hidden in ISBD View.
17) run the following SQL on your DB.
    > UPDATE marc_subfield_structure set hidden=1;
    -- this should set EVERYTHING to hidden in OPAC, but not
       the STAFF across the board.
18) Refresh the staff ISBD page
    -- values should reappear.
19) View the ISBD details in the OPAC
    -- values should still be hidden.
20) Check out the OPAC Cart and List
    -- while the intermediate pages may still leak
       the download links should leak very minimally.
    -- (CARTS AND LISTS ARE BEYOND SCOPE, THOUGH
        THE INTRANET ISBD AND SOME CART/LIST STUFF
        WERE FIXED BECAUSE OF THE GetISBDView REFACTOR)

Expectations:
Before Patch - all the OPAC Detail pages will display things
After Patch - all the OPAC Detail pages will display much less,
              and hopefully nothing (though there are known limits).
              the ISBD detail page in the Staff client will be
              filtered as well based on STAFF settings.
              The saving/exporting should generate nearly empty
              files.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11592: Biblio tweak for MARCSUBJECT
Mark Tompsett [Wed, 9 Mar 2016 19:39:08 +0000 (14:39 -0500)]
Bug 11592: Biblio tweak for MARCSUBJECT

https://bugs.koha-community.org/show_bug.cgi?id=11592

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11592: Applying filtering to opac interface.
Mark Tompsett [Fri, 19 Feb 2016 16:02:59 +0000 (11:02 -0500)]
Bug 11592: Applying filtering to opac interface.

Applying the filtering and then...
Debugging opac/opac-detail.pl filtering
Debugging opac/opac-ISBDdetail.pl more
Debugging opac/opac-export.pl
Tweak opac/opac-export.pl fix variable declarations, conditional assignments
Debugging opac/opac-showmarc.pl

https://bugs.koha-community.org/show_bug.cgi?id=11592

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11592: Add should_hide_marc method to filter
Mark Tompsett [Wed, 16 Mar 2016 21:10:02 +0000 (17:10 -0400)]
Bug 11592: Add should_hide_marc method to filter

Add should_hide_marc to ViewPolicy filter
Add should_hide_marc tests to t/db_dependent/Filter_MARC_ViewPolicy.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11592: Updated License Text and use Modern::Perl
Mark Tompsett [Fri, 24 Jan 2014 03:31:08 +0000 (22:31 -0500)]
Bug 11592: Updated License Text and use Modern::Perl

Why not clean up the License Agreement stuff while the files
are being changed? Used the current one found at:
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence

Changed the strict and warning lines into just a Modern::Perl.

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11921: (QA followup) Remove remaining unused var
Tomas Cohen Arazi [Wed, 7 Sep 2016 14:37:24 +0000 (11:37 -0300)]
Bug 11921: (QA followup) Remove remaining unused var

This patch removes an occurence of an unused var in Context.pm and
also prevents a warning if memcached_servers is not set:

Use of uninitialized value in split at /home/vagrant/kohaclone/Koha/Cache.pm line 91.

t also tidies small things.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11921: Fix logic in C4::Context->new to init the config
Jonathan Druart [Tue, 6 Sep 2016 14:20:28 +0000 (15:20 +0100)]
Bug 11921: Fix logic in C4::Context->new to init the config

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11921: C4::Context->memcached does no longer exist
Jonathan Druart [Tue, 6 Sep 2016 14:20:25 +0000 (15:20 +0100)]
Bug 11921: C4::Context->memcached does no longer exist

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11921: Update remaining occurrences of ->ismemcached
Jonathan Druart [Thu, 23 Jun 2016 05:33:23 +0000 (06:33 +0100)]
Bug 11921: Update remaining occurrences of ->ismemcached

TODO: Would be better to provide a better way to know if memcache is correctly set
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11921: Restore memcached infos to koha-conf - Koha::Config
Jonathan Druart [Thu, 23 Jun 2016 04:12:39 +0000 (05:12 +0100)]
Bug 11921: Restore memcached infos to koha-conf - Koha::Config

Move C4::Context->read_config_file to Koha::Config
That permits to reuse it from Koha::Cache without needing C4::Context
(and introduce a circular deps).

TODO: Add decent POD to Koha::Config
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11921: Restore memcached infos to koha-conf
Jonathan Druart [Wed, 22 Jun 2016 15:53:32 +0000 (16:53 +0100)]
Bug 11921: Restore memcached infos to koha-conf

MEMCACHED_SERVERS and MEMCACHED_NAMESPACE should be moved back to
koha-conf instead of an ENV var to let command line scripts use
the cache mechanism.

TODO:
- Add the entries to koha-conf.xml
- Remove occurrences of MEMCACHED_SERVERS in package, apache and plack files

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17189: Use Koha::Caches instead of Koha::Cache in Koha::MetaSearcher
Jonathan Druart [Wed, 7 Sep 2016 11:03:00 +0000 (12:03 +0100)]
Bug 17189: Use Koha::Caches instead of Koha::Cache in Koha::MetaSearcher

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17189: Replace occurrences of 'use Koha::Cache'
Jonathan Druart [Wed, 7 Sep 2016 10:58:05 +0000 (11:58 +0100)]
Bug 17189: Replace occurrences of 'use Koha::Cache'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17189: Use delete to flush a L1 cache namespace
Jonathan Druart [Wed, 7 Sep 2016 10:43:32 +0000 (11:43 +0100)]
Bug 17189: Use delete to flush a L1 cache namespace

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17189: Add the ability to define several memcached namespaces - replace existing...
Jonathan Druart [Wed, 22 Jun 2016 15:02:08 +0000 (16:02 +0100)]
Bug 17189: Add the ability to define several memcached namespaces - replace existing occurrences

s/Koha::Cache->get_instance/Koha::Caches->get_instance

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17189: Add the ability to define several memcached namespaces - Koha::Caches
Jonathan Druart [Wed, 22 Jun 2016 15:01:46 +0000 (16:01 +0100)]
Bug 17189: Add the ability to define several memcached namespaces - Koha::Caches

We need to define several namespaces for our cache system.
For instance sysprefs, koha conf (koha-conf.xml) and unit tests
should be defined in a separate namespace.
This will permit to
- launch the tests without interfering with other cache values
- and flush the sysprefs cache without flushing all other values

To do so, we need to store different Koha::Cache objects at a package
level. That's why this patch adds a new Koha::Caches module.

FIXME: There is an architecture problem here: the L1 cache should be
defined in Koha::Cache

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17189: Add the ability to define several memcached namespaces - tests
Jonathan Druart [Wed, 22 Jun 2016 15:10:23 +0000 (16:10 +0100)]
Bug 17189: Add the ability to define several memcached namespaces - tests

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16573 - Update Schema
Kyle M Hall [Tue, 6 Sep 2016 09:37:14 +0000 (09:37 +0000)]
Bug 16573 - Update Schema

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14695 [QA Followup] - Fix issues found by QA script
Kyle M Hall [Sat, 3 Sep 2016 00:26:03 +0000 (00:26 +0000)]
Bug 14695 [QA Followup] - Fix issues found by QA script

7 years agoBug 14695 [QA Followup] - Unit Tests
Kyle M Hall [Fri, 2 Sep 2016 10:34:57 +0000 (10:34 +0000)]
Bug 14695 [QA Followup] - Unit Tests

7 years agoBug 14695 [QA Followup] - Tell librarian if item doesn't allow or forces item level...
Kyle M Hall [Thu, 16 Jun 2016 11:53:28 +0000 (11:53 +0000)]
Bug 14695 [QA Followup] - Tell librarian if item doesn't allow or forces item level holds in the OPAC

7 years agoBug 14695 [QA Followup] - Disable "Holds to place (count)" unless "Hold next availabl...
Kyle M Hall [Fri, 29 Apr 2016 17:34:48 +0000 (17:34 +0000)]
Bug 14695 [QA Followup] - Disable "Holds to place (count)" unless "Hold next available item" is checked

Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695: Fix typo in template
Julian Maurice [Tue, 19 Apr 2016 10:06:44 +0000 (12:06 +0200)]
Bug 14695: Fix typo in template

Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 [QA Followup] - Fix method names 'type' to '_type'
Kyle M Hall [Mon, 18 Apr 2016 14:18:07 +0000 (14:18 +0000)]
Bug 14695 [QA Followup] - Fix method names 'type' to '_type'

Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 - Don't use holds_to_place_count when checking an item.
Alex Arnaud [Thu, 28 Jan 2016 09:41:27 +0000 (10:41 +0100)]
Bug 14695 - Don't use holds_to_place_count when checking an item.

This fix the following bug:
If you select 2 in "Holds to place (count)" and finally
check an item, so you get 2 holds for the same item.

Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 - Warn librarian if max_holds_per_record is reached
Alex Arnaud [Wed, 27 Jan 2016 15:48:02 +0000 (16:48 +0100)]
Bug 14695 - Warn librarian if max_holds_per_record is reached

Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 [QA Followup] - Fix clearing of all holds by patron at checkout
Kyle M Hall [Fri, 22 Jan 2016 15:25:20 +0000 (15:25 +0000)]
Bug 14695 [QA Followup] - Fix clearing of all holds by patron at checkout

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 [QA Followup] - Make existing unit tests pass
Kyle M Hall [Tue, 19 Jan 2016 17:49:44 +0000 (17:49 +0000)]
Bug 14695 [QA Followup] - Make existing unit tests pass

* Removes tests no longer needed
* Updates rules to work with existing tests
* Fixes code issues revealed by unit tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 [QA Followup] - Filling one hold fills all of them
Kyle M Hall [Tue, 19 Jan 2016 17:10:29 +0000 (17:10 +0000)]
Bug 14695 [QA Followup] - Filling one hold fills all of them

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 - Add ability to place multiple item holds on a given record per patron
Kyle M Hall [Tue, 29 Dec 2015 19:14:19 +0000 (19:14 +0000)]
Bug 14695 - Add ability to place multiple item holds on a given record per patron

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 - Tidy C4::Reserves::CanItemBeReserved
Kyle M Hall [Mon, 28 Dec 2015 17:11:46 +0000 (17:11 +0000)]
Bug 14695 - Tidy C4::Reserves::CanItemBeReserved

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 - Add new circulation rule
Kyle M Hall [Tue, 29 Dec 2015 19:13:51 +0000 (19:13 +0000)]
Bug 14695 - Add new circulation rule

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 - Update DB Schema file
Kyle M Hall [Tue, 29 Dec 2015 19:13:25 +0000 (19:13 +0000)]
Bug 14695 - Update DB Schema file

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 14695 - Update database
Kyle M Hall [Tue, 29 Dec 2015 19:11:47 +0000 (19:11 +0000)]
Bug 14695 - Update database

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
7 years agoBug 11360 - Fix merge conflict
Kyle M Hall [Sat, 3 Sep 2016 00:17:20 +0000 (00:17 +0000)]
Bug 11360 - Fix merge conflict

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 13501: Fix behavior of 'Delete subfield' button on select2 controls
Julian Maurice [Fri, 19 Aug 2016 13:26:11 +0000 (15:26 +0200)]
Bug 13501: Fix behavior of 'Delete subfield' button on select2 controls

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 13501: Highlight select2 control if field is required and value is missing
Julian Maurice [Fri, 19 Aug 2016 11:48:13 +0000 (13:48 +0200)]
Bug 13501: Highlight select2 control if field is required and value is missing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 13501: Move "Required" and checkbox after input/select
Julian Maurice [Fri, 30 Oct 2015 12:49:56 +0000 (13:49 +0100)]
Bug 13501: Move "Required" and checkbox after input/select

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 13501: Indentation fix (batchMod-edit.tt)
Julian Maurice [Fri, 30 Oct 2015 12:45:13 +0000 (13:45 +0100)]
Bug 13501: Indentation fix (batchMod-edit.tt)

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 13501: Add JS library select2 3.5.4
Julian Maurice [Tue, 30 Dec 2014 13:40:44 +0000 (14:40 +0100)]
Bug 13501: Add JS library select2 3.5.4

use it on cataloguing and batch items edit pages

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10848 - Fix DBRev description
Kyle M Hall [Fri, 2 Sep 2016 16:18:38 +0000 (16:18 +0000)]
Bug 10848 - Fix DBRev description

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11360 [QA Followup] - Fix styles and button order
Kyle M Hall [Wed, 20 Jul 2016 15:58:20 +0000 (15:58 +0000)]
Bug 11360 [QA Followup] - Fix styles and button order

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 11360 - Disable barcode field and submit button when a hold is found
Kyle M Hall [Wed, 18 Nov 2015 18:53:03 +0000 (18:53 +0000)]
Bug 11360 - Disable barcode field and submit button when a hold is found

At the moment when scanning in returns, it can be easy to miss a hold
trap due to the fact that the barcode and submit are still active and
the barcode field is focused on. A librarian who is focused on scanning
can easily scan another item and pass over the form, which is equivalent
to clicking the "ignore" button.

Test Plan:
1) Apply this patch
2) Trap a hold, note the new modal
3) Check the hold in a second time
4) Note the new modal
5) For each modal, test each button

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoBug 7045 - DBRev 16.06.00.017
Kyle M Hall [Fri, 2 Sep 2016 16:09:23 +0000 (16:09 +0000)]
Bug 7045 - DBRev 16.06.00.017

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 7045 - DBRev 16.06.00.016
Kyle M Hall [Fri, 2 Sep 2016 16:04:09 +0000 (16:04 +0000)]
Bug 7045 - DBRev 16.06.00.016

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10848 - [QA Followup] Add missing branch option and fix pattern for copyrightdate
Jacek Ablewicz [Fri, 12 Aug 2016 09:42:48 +0000 (11:42 +0200)]
Bug 10848 - [QA Followup] Add missing branch option and fix pattern for copyrightdate

- HTML5 input pattern for copyrightdate was not taking into an account
the database field type, which is smallint(5)
- added title="..." for the year field so the acceptable date format
should be displayed as a hint/tooltip in the browser
- added an missing option for configuring branch/library as mandatory

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10848 - Allow configuration of mandatory/required fields on the suggestion form...
Jacek Ablewicz [Fri, 5 Aug 2016 09:01:25 +0000 (11:01 +0200)]
Bug 10848 - Allow configuration of mandatory/required fields on the suggestion form in OPAC - part 2

Add 'OPACSuggestionMandatoryFields' syspref definition plus
an atomic DB update for the new preference.

Signed-off-by: barbara johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10848 - Allow configuration of mandatory/required fields on the suggestion form...
Jacek Ablewicz [Fri, 5 Aug 2016 08:47:11 +0000 (10:47 +0200)]
Bug 10848 - Allow configuration of mandatory/required fields on the suggestion form in OPAC

This patch adds a configuration option which allows to define which
fields should be mandatory for a patron purchase suggestion form in OPAC.

Test plan:

1/ Apply patch.
2/ Play with the new OPACSuggestionMandatoryFields system preference
(select some fields as manadatory, select all, deselect all, try to
submit some suggestions with mandatory fields filled and/or not
filled etc.) to ensure that required fields (and only required fields)
are enforced in the browser to be filled.
3/ With all options deselected, 'Title' field should still be
mandatory (by default).

Signed-off-by: barbara johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10407: [QA Follow-up] Hashref process_batch params
Marcel de Rooy [Tue, 12 Jul 2016 12:40:35 +0000 (14:40 +0200)]
Bug 10407: [QA Follow-up] Hashref process_batch params

As requested by Mark Tompsett. Hope this guarantees a signoff now..

Note: For consistency four additional parameters were needed to no longer
use file level vars in this subroutine.

Test plan:
Import a file with stage_file.pl.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Imported a marc file and a marcxml file with stage_file.pl.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10407: Add two subtests to t/ImportBatch.t
Marcel de Rooy [Fri, 8 Jul 2016 11:17:36 +0000 (13:17 +0200)]
Bug 10407: Add two subtests to t/ImportBatch.t

Creates a few simple tests for the two new subroutines in ImportBatch.pm.

Test plan:
Run t/ImportBatch.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10407: Add marcxml import (follow-up)
Marcel de Rooy [Thu, 7 Jul 2016 12:13:16 +0000 (14:13 +0200)]
Bug 10407: Add marcxml import (follow-up)

This patch makes the following changes:

[1] Based on the groundwork of the former patch, add call to
    RecordsFromMARCXMLFile in stage-marc-import. Use format param.
[2] Add format to the template. Use file extension to determine.
    If you use .xml or .marcxml as extension, MARCXML is selected.
[3] In stage-marc-import.tt mark UTF-8 encoding as UTF-8 not as utf8.
[4] BatchStageMarcRecords: do not call plugin if you have no records.
[5] RecordsFromISO2709File: also return errors in an array.
[6] In misc/stage_file.pl also use UTF-8. Handling of errors from [5].

Test plan:
[1] Import an empty file as MARC or MARCXML (with Tools/Stage..import).
[2] Import an non-empty file with invalid contents as MARC or MARCXML.
[3] Export a few records with Tools/Export as MARC and MARCXML.
[4] Import these two files. Check selected format versus file extension.
[5] Import a MARCXML file with misc/stage_file.pl.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10407: Resolve warnings from child process
Marcel de Rooy [Fri, 8 Jul 2016 06:34:00 +0000 (08:34 +0200)]
Bug 10407: Resolve warnings from child process

After the staging job finishes, the child tries to print results to
STDOUT (which is closed). This creates warnings like:

stage-marc-import.pl: binmode() on closed filehandle STDOUT at C4/Templates.pm line 120.
stage-marc-import.pl: Filehandle STDOUT reopened as FH only for input at /usr/lib/perl5/Template/Provider.pm line 964.

Resolving it is simple: the child should exit after marking the job
as finished.

Test plan:
Import a marc file.
Observe that you do no longer have such warnings.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 10407: Allow MARCXML records to be imported via GUI (groundwork)
Olli-Antti Kivilahti [Fri, 17 Apr 2015 17:12:49 +0000 (20:12 +0300)]
Bug 10407: Allow MARCXML records to be imported via GUI (groundwork)

Patch from Olli, manual rebase by Marcel (July 7, 2016).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Needs follow-up. Test plan in the third patch.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 5456 - Create a link to opac-ics.pl
Magnus Enger [Sat, 23 Jul 2016 18:31:11 +0000 (20:31 +0200)]
Bug 5456 - Create a link to opac-ics.pl

opac-ics.pl was added to Koha back in 2007, but there has not been a link to it
from anywhere. This patch adds the link from the main view on
/cgi-bin/koha/opac-user.pl, and makes some changes to opac-ics.pl itself.

Changes to opac-ics.pl:
- Update the code to use date and time for when a loan is due
- Use dt_from_string to turn a MySQL time and date into a DateTime
- Add a timestamp and a UID (these were reported as necessary by a couple of
  iCal validators)
- Remove DTEND from events, since we now have time as well as date for when a
  loan is due
- For loans that are overdue, set the DTSTART to now(), to avoid creating
  calendar events in the past
- Use a template to generate text strings, to make them translatable

To test:
- Apply the patch
- Make sure you have at least a couple of loans, including one overdue
- Go to /cgi-bin/koha/opac-user.pl and click on the link labeled "Download as
  iCal/.ics file"
- Inspect the file in a text editor and/or view the result in a calendar
  appplication. Make sure the data makes sense.
- Sign off and go thee merrily on thine way.

Update 2016-07-25
- Force date_due to UTC to avoid problematic timezone info like this:
  DTSTART:TZID=Europe/Zurich:20160724T235900
- Remove quotes from summary and description

Followed test plan, koha.ics file successfully imported to Thunderbird calendar
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17149 - EDI accounts: Add missing '>' to breadcrumb
Marc Véron [Thu, 18 Aug 2016 18:42:44 +0000 (20:42 +0200)]
Bug 17149 - EDI accounts: Add missing '>' to breadcrumb

To verify:
Breadcrumb on "EDI accounts" pages reads
Home > Administration EDI accounts > Modify account
instead of:
Home > Administration > EDI accounts > Modify account

To test:
- Apply patch
- Add, edit and delete an EDI account
- Verify that breadcrumb displays properly

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17175: Typo in patron card images error message
Aleisha Amohia [Wed, 24 Aug 2016 00:16:43 +0000 (00:16 +0000)]
Bug 17175: Typo in patron card images error message

To test:
1) Go to Tools -> Patron Card Creator -> New Image
2) Click Upload without attaching anything
3) Notice typo
4) Apply patch and refresh page (resend information if prompted)
5) Notice typo fixed

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>