koha.git
8 years agoIncrement version for 3.22.5 release v3.22.05
Julian Maurice [Wed, 23 Mar 2016 16:13:32 +0000 (17:13 +0100)]
Increment version for 3.22.5 release

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoTranslation updates for Koha 3.22.05
Bernardo Gonzalez Kriegel [Tue, 22 Mar 2016 18:06:35 +0000 (15:06 -0300)]
Translation updates for Koha 3.22.05

New languages: Interlingua, Inuktitut and Inuinnaqtun

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoUpdate release notes for 3.22.5 release
Julian Maurice [Wed, 23 Mar 2016 16:01:59 +0000 (17:01 +0100)]
Update release notes for 3.22.5 release

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoChange syspref case to make tests pass
Julian Maurice [Wed, 23 Mar 2016 13:16:18 +0000 (14:16 +0100)]
Change syspref case to make tests pass

Regression due to bug 11998

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16106 Correct loose to lose in comment
Colin Campbell [Fri, 18 Mar 2016 13:49:56 +0000 (13:49 +0000)]
Bug 16106 Correct loose to lose in comment

Comment was using incorrect (but similarly spelled) word, obscuring
the meaning slightly. Also corrected the release note altering the
grammar there additionally as it should have been 3rd person singular
so that it now reads more clearly

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 515e2d7c9d2b5afe3f7c0618596f1d9e5e699315)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15119: Hide search header text boxes on render
Jonathan Druart [Wed, 6 Jan 2016 13:10:00 +0000 (13:10 +0000)]
Bug 15119: Hide search header text boxes on render

When the page rendering is slow or the page is heavy, the tabs in the
header shown be not correctly displayed as tabs.

This patch suggests to hide them, display the first one, and wait for
the JS code to display them nicely.

To easily reproduced the ergonomic issue, go on the circulation home
page (/cgi-bin/koha/circ/circulation.pl) and search for a patron 'a' or
'd', you will get a lot of result and the page will be slow to be fully
displayed.

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 70eedf2217e1bfde1c56bc77c8dd0dc039124f47)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15946 Valid namespace for OAI marcxml schema (3.22/3.20)
Zeno Tajoli [Tue, 1 Mar 2016 10:44:42 +0000 (11:44 +0100)]
Bug 15946 Valid namespace for OAI marcxml schema (3.22/3.20)

As the patch for master, this patch apply on 3.22 (and 3.20 probably).

This path fixes the value of xml schema variable and the link to Library
of Congress.  For Dublin Core format those values are defined in
UNIMARCslim2OAIDC.xsl and MARC21slim2OAIDC.xsl.  For MARCXML those
values are written into the code

To test it:
1) Setup OAI-PMH
2) Test the site inserting the BaseURL into http://validator.oaipmh.com
3) See the problem with ListMetadataFormats [link:
   http://validator.oaipmh.com/#ListMetadataFormats] 4) Insert the patch
5) See the problem is over

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Invalid before patch, valid after.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 16013: Make classification sources deletable
Jonathan Druart [Wed, 9 Mar 2016 11:28:04 +0000 (11:28 +0000)]
Bug 16013: Make classification sources deletable

Because of a wrong variable scope, the classification sources are not
deletable.

Test plan:
Create a classification sources (admin/classsources.pl)
Try to delete it
Without this patch, the classification source won't be deleted
With this patch, it will work!

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit f6463317db08b9a4218ad94a2d191a5f5216c8c5)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15997 - Hold Ratios for ordered items doesn't count orders where AcqCreateItem...
Kyle M Hall [Mon, 7 Mar 2016 14:04:44 +0000 (14:04 +0000)]
Bug 15997 - Hold Ratios for ordered items doesn't count orders where AcqCreateItem is set to 'receiving'

Currently, the hold ratios script only counts on order items where the
record item is created at the time the order is placed, and not if the
item is created when the item is received.

Test Plan:
1) Set AcqCreateItem to recieving
2) Run the hold ratios report with "include ordered" checked
3) From aquisitions, order some additional items for the record
4) Re-run the hold ratios report, not there is no change in the ratio
   for that record
5) Apply this patch
6) Re-run the hold ratios reporat again, the ratio should now have
   changed

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 7e1ccbd6069658540dd352f63ade3ef7b19de282)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16095: Remove target="_blank" when a link refer to an external link
Jonathan Druart [Fri, 18 Mar 2016 08:34:22 +0000 (08:34 +0000)]
Bug 16095: Remove target="_blank" when a link refer to an external link

If you click on a link that opens a new tab/window to another site, that tab
has access to the original window through JavaScript. The browsing context is
related, even if the domains are totally different.

The tab retains access to the original window's object via window.opener, even
if you navigate to another page or domain, in the new or original window.
Access to the Window object means the new window can use Window.location to
open a different URL in the original window, perfect for phishing attacks.

Depending on the site's Same-Origin Policy settings, the new window may have
access to other parts of the original window's DOM as well.

Any  'A HREF' that contains a target of of '_blank' or '_new' or a fixed name
is vulnerable. Previous security best practice often suggested creating a random
fixed name for an unpredictable namespace - that won't help with this problem!
Targets of '_self' and '_parent' are safe.

We do not use _new (at first glance) but several _blank. Some are used
to refer internal url, we do not need to update or remove them. Others
are used to satisfy OPACURLOpenInNewWindow, in these case, we should add
the rel="noreferrer" attribute to the a tags.
In other cases, we can simply remove them and let the users discover
that a mouse has more than one button (we are in 2016, they can do it!)

Signed-off-by: Chris <chrisc@catalyst.net.nz>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 6c1b39b4cbceb1a414a91865e15612385c2eb5b7)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15840: Catch errors if userid already exists when importing patrons
Jonathan Druart [Wed, 17 Feb 2016 16:21:50 +0000 (16:21 +0000)]
Bug 15840: Catch errors if userid already exists when importing patrons

Import borrowers tool explodes if userid already exists. This error
should be caught to avoid the script to explodes.

TEST PLAN
---------
1) back up DB
2) drop DB, create empty DB
3) Apply patch 15842
4) web install all the sample data
5) login as system user and import patron data
   -- sample provided to trigger error.
   -- you will get a DBIx::class exception
      "Duplicate entry ' for key 'userid'"
6) Apply this patch
7) Repeat steps 2-5
   -- patrons won't be inserted but an error
      will be nicely displayed in the error list.
8) run koha qa test tools

Note that it would be easy to insert the patrons anyway and generate a
userid based on the surname and firstname.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit f1e156453a1bc636914bc5c969e1665d7108cb95)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: Clear L1 cache from psgi files
Jonathan Druart [Thu, 10 Mar 2016 09:12:52 +0000 (09:12 +0000)]
Bug 11998: Clear L1 cache from psgi files

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 55b78f1a5dbbff5a790971e2f5a99ebdd6a3f18a)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: Add a L1 cache for sysprefs
Jonathan Druart [Thu, 10 Mar 2016 08:55:27 +0000 (08:55 +0000)]
Bug 11998: Add a L1 cache for sysprefs

Accessing to the cache for each call to C4::Context->preference might
have an impact on performances.
To avoid that this patch introduces a L1 cache (simple hashref). It will
be populated by accessing the L2 cache (Koha::Cache).
If a pref is retrieved 10x, the first one will get the value from the L2
cache, then the L1 cache will be check.
To do so we will need to clear the L1 cache every time a page is loaded.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 47fbbb7cf5e7ef2f9ef422e2fd9232066100a64b)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: follow-up for the debian package psgi file
Jonathan Druart [Thu, 3 Mar 2016 16:52:51 +0000 (16:52 +0000)]
Bug 11998: follow-up for the debian package psgi file

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 2eaf2cd71b9620c0d5782c7c78f86a5e323c89a4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: Revert "Bug 13805: (Plack) Disable syspref cache"
Jonathan Druart [Thu, 3 Mar 2016 16:45:07 +0000 (16:45 +0000)]
Bug 11998: Revert "Bug 13805: (Plack) Disable syspref cache"

This reverts commit ca00f0ddaeb76106b4aa274fd1848844ae042f58.

Bug 13805 fixes an installer bug by disabling the syspref cache.
It was not a good idea, it introduced performance issues (see bug 13805
comment 14).

Test plan:
Test plan:
0/ Create a new database and fill the database entry in the koha conf
with its name
1/ Go on the mainpage, you should be redirected to the installer
2/ Try to log in
You should not get the login form again.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Test plan not followed by me for this patch, due to lack of working
plack setup, but I don't expect it to cause any problems, and performace
gain for plack will be tremendous

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit d4039ce09347c342f8ac048814ee10b47819df48)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: Do not clear syspref cache in psgi file
Jonathan Druart [Thu, 3 Mar 2016 17:17:40 +0000 (17:17 +0000)]
Bug 11998: Do not clear syspref cache in psgi file

This in only in koha.psgi, it has been introduced by bug 13815 but
should not have been added by this patch.

Removing it should not introduce any changes.
Not that it won't impact debian packages.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit f25e3ed90b55b657c71e117a1e9a8bc2c3a1809f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: Make HoldsQueue.t tests pass [TO REVERT]
Jonathan Druart [Mon, 7 Mar 2016 09:24:14 +0000 (09:24 +0000)]
Bug 11998: Make HoldsQueue.t tests pass [TO REVERT]

This patch should not be the way to make these tests pass.
The prefs should not be updated using set_preference, it will modify the
values in the cache.

I have no idea how to make them pass using the correct way, please help
:)

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 3907401a6d293872ca1fb46c90da029b91d37e31)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: Use C4::Context->preference in Koha/Schema/Result/Item.pm
Jonathan Druart [Fri, 4 Mar 2016 13:21:39 +0000 (13:21 +0000)]
Bug 11998: Use C4::Context->preference in Koha/Schema/Result/Item.pm

Otherwise some tests won't pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit a691e88a4ebf57e9ebda8afb5f8e6bac33bc6ad6)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: Use t::lib::Mocks::mock_preference in tests
Jonathan Druart [Fri, 4 Mar 2016 13:14:59 +0000 (13:14 +0000)]
Bug 11998: Use t::lib::Mocks::mock_preference in tests

Unless in t/db_dependent/Context.t where we want to test the cache
behaviors.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 56a782c666d1d05215e49101e33fce0a3cd30377)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 11998: Use Koha::Cache to cache sysprefs
Jonathan Druart [Thu, 3 Mar 2016 16:54:30 +0000 (16:54 +0000)]
Bug 11998: Use Koha::Cache to cache sysprefs

At the moment, the sysprefs are only cache in the thread memory
executing the processus
When using Plack, that means we need to clear the syspref cache on each
page.
To avoid that, we can use Koha::Cache to cache the sysprefs correctly.

A big part of the authorship of this patch goes to Robin Sheat.

Test plan:
1/ Add/Update/Delete local use prefs
2/ Update pref values and confirm that the changes are correctly taken
into account

Signed-off-by: Chris <chrisc@catalyst.net.nz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Tested with plack with syspref cache enabled, there is some time between setting the syspref and applying it, but it takes just one reload of page, it shouldn't be problem, should it?
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Tested with CGI and CGI + memcache; some small issues still remain,
but it would be better to deal with them in separate bug reports
if necessary

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 9820f9dfbd63ecc812b6b2a4ec71af91f303f933)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15163: Do not erase patron attributes if limited to another library
Jonathan Druart [Mon, 22 Feb 2016 10:08:55 +0000 (10:08 +0000)]
Bug 15163: Do not erase patron attributes if limited to another library

The patron attributes displayed on editing a patron are not displayed if
limited to another library.

C4::Members::Attributes::SetBorrowerAttributes will now only delete attributes
the librarian is editing.
SetBorrowerAttributes takes a new $no_branch_limit parameter. If set,
the branch limitations have not effect and all attributes are deleted
(same behavior as before this patch).

Test plan:
1/ Create 2 patron attributes, without branch limitations.
2/ Edit a patron and set a value for these attributes
3/ Limit a patron attributes to a library (one you are not logged in
with).
4/ Edit again the patron.
=> You should not see the limited attributes
5/ Edit the patron attributes and remove the branch limitation
=> Without this patch, it has been removed from the database and is not
displayed anymore.
=> With this patch, you should see it.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 4a3404594ff326e0babb8b7bee8e65f5646ff9f9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16054: Fix variable scope error in paycollect.pl
Jonathan Druart [Fri, 11 Mar 2016 12:47:26 +0000 (12:47 +0000)]
Bug 16054: Fix variable scope error in paycollect.pl

$borrower, $borrowernumber and $template and not visible in the
subroutine.
Using $b_ref and passing $template fixes the issue.

Test plan:
Under plack, use the pay selected button.
On the paycollect page, you should see the image of the patron

It certainly fixes some other bugs.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit da21ad065939d0789bb90d8fd6d088b781688aa3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15446: Update DB rev (3.22.04.003)
Jesse Weaver [Fri, 12 Feb 2016 19:43:32 +0000 (12:43 -0700)]
Bug 15446: Update DB rev (3.22.04.003)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15446: Update systempreferences rows where type=YesNo and value=''
Jonathan Druart [Wed, 30 Dec 2015 17:19:02 +0000 (17:19 +0000)]
Bug 15446: Update systempreferences rows where type=YesNo and value=''

Signed-off-by: Marc Véron <veron@veron.ch>
Amended to fix typo in sql statement.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
(cherry picked from commit 1427cacfe74e4cdc3a4aa4d400e3b02305dfc6ec)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15446: Rename Koha::Object[s]->type with _type
Jonathan Druart [Wed, 30 Dec 2015 17:15:31 +0000 (17:15 +0000)]
Bug 15446: Rename Koha::Object[s]->type with _type

In a few case (at least systempreferences and export_format (csv profiles),
the type method of Koha::Object and Koha::Objects can be in conflict with the
column names.
Indeed systempreferences.type exists and so the method will return
'Systempreference' (the name of the module) instead of the value of the row in
DB.

I have found at least 1 place where it can cause issue:
In C4::Context->set_preference:
 601     my $syspref = Koha::Config::SysPrefs->find( $var );
 602     my $type = $syspref ? $syspref->type() : undef;
 603
 604     $value = 0 if ( $type && $type eq 'YesNo' && $value eq '' );

type will always be 'Systempreference' and the YesNo pref will be set to an
empty string '' instead of 0.

I am not sure about the consequences of this, but it is preferable to
fix it ASAP.

To reproduce:
0/ Do not apply this patch
1/ Edit a YesNo prefs, AutoEmailOpacUser for instance
2/ Set it to "Don't sent"
3/ Check the value in DB, it should be set to an empty string, instead
of 0
4/ Apply this patch and try again. Now the value should be 0

Followed test plan, value is now 0 as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
(cherry picked from commit de3289506dcda91510dc9c7a867558a29ebefd57)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Conflicts:
Koha/Branch.pm
Koha/Branches.pm

8 years agoBug 15446: Add tests
Jonathan Druart [Wed, 30 Dec 2015 17:11:45 +0000 (17:11 +0000)]
Bug 15446: Add tests

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
(cherry picked from commit bd7e79940d548c417580bb79a2f250751fc4575c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16026 - Use Font Awesome icons on cataloging home page
Owen Leonard [Wed, 9 Mar 2016 15:43:52 +0000 (10:43 -0500)]
Bug 16026 - Use Font Awesome icons on cataloging home page

The cataloging home page has one instance of a Glyphicon. This patch
replaces it with a Font Awesome icon.

To test you must have the EnableAdvancedCatalogingEditor preference
enabled.

- Apply the patch and go to the Cataloging home page.
- Confirm that the "Advanced editor" button uses the "pencil" icon and
  that it still works correctly.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit a6917deede700c7a64de58fb5107ce9f1d18a044)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16024 - Use Font Awesome icons on item types administration page
Owen Leonard [Wed, 9 Mar 2016 15:14:58 +0000 (10:14 -0500)]
Bug 16024 - Use Font Awesome icons on item types administration page

When editing an item type, a Glyphicon is used for the "translate" link.
It should use a Font Awesome icon instead. This patch corrects it.

To test, apply the patch and go to Administration -> Item types.

- Edit an existing item type.
- Confirm that the icon associated with the "Translate into other
  languages" link is correct.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit d638520f85e6806cbde83fa47cc7aa3e6fefa3ff)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15445 DateUtils.t fails on Jenkins due to server sluggishness
Frédéric Demians [Wed, 30 Dec 2015 15:29:03 +0000 (16:29 +0100)]
Bug 15445 DateUtils.t fails on Jenkins due to server sluggishness

Jenkins server is abnormally slow to perform a task done in less than
1s elsewhere. The test stay valid by giving just a bit more time to Jenkins
server.

TO TEST:
- Confirm that the two test hasn't changed. They the just get 4s to
  perform
- Push the patch to master and observe that DateUtils.t doesn't fail
  anymore.

NOTE: Also passed koha qa test tools too.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended: Changed to 2s, should be enough

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 357ddab7c6519fdbb57e448c28170c267035a130)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15955: Tuning function 'New child record' for Unimarc 205$a -> 461$e
Zeno Tajoli [Wed, 2 Mar 2016 12:01:22 +0000 (13:01 +0100)]
Bug 15955: Tuning function 'New child record' for Unimarc 205$a -> 461$e

Now the sYstem tries to insert value of 205$a into 461$a when a child is
created from the father record.  In UNIMARC 46x tags there is not
present a subfield for ediction value (205$a in UNIMARC).

To Test:
1) Check to have EasyAnalyticalRecords on 'off'
2) Check to use UNIMARC
3) Create a record with data in 200$a (title), 205$a (ediction), 700
   (author) 215$a(Place), 215$d(date)
4) From those record create a child using 'New'->'New child record'
5) See the values in 461 tag: You can see that in 461$a there is the
   value of 205$a from father This is wrong, you need to have the value
   of 700 $a and $b from father record, and 205$a in 461$e.
6) Appy the patch
7) Redo 4-5
8) Now 461 is good

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I have not checked the doc but trusting author and signoffer.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 69cf2d9451ce3839bbbf16d91da0cc02a479e1f5)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15941 - The template for cloning circulation and fine rules says "issuing rules"
Owen Leonard [Mon, 29 Feb 2016 19:39:30 +0000 (14:39 -0500)]
Bug 15941 - The template for cloning circulation and fine rules says "issuing rules"

The template for cloning circulation and fine rules should use the
phrase "circulation and fine rules" instead of "issuing rules."

Also changed: Added "Cancel" link to return the user to the circulation
and fine rules page.

To test, navigate directly to /cgi-bin/koha/admin/clone-rules.pl.

The page title, breadcrumbs, and heading should all use the phrase
"circulation and fine rules."

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 92544ea10d76c1a9f604c9c60ee33dc50e39d7fc)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15694: Add aliases for date/time last modified
Nicole C Engard [Thu, 28 Jan 2016 17:24:31 +0000 (17:24 +0000)]
Bug 15694: Add aliases for date/time last modified

This patch will add indexes for Date/time-last-modified.

To test:

1. apply patch
2. reindex
3. search for dtlm:DATE and date-time-last-modified:DATE
4. confirm that you get results

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

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  I confirm Hector signing-off. A simple Zebra server restart suffice to get
  working the searches on date-time-last-modified and dtlm.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 39f9b9ddb0359428e4379a90711eb9dc9961be59)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16033 - Quotes upload preview broken for 973 days
Owen Leonard [Wed, 9 Mar 2016 19:49:40 +0000 (14:49 -0500)]
Bug 16033 - Quotes upload preview broken for 973 days

A missing snippet of DataTable configuration means that when you upload
a CSV of quotes to the Quotes of the Day feature the table previewing
your import is not visible. This patch corrects it.

To test, apply the patch and go to Tools -> Quote editor -> Import
quotes.

- Upload a CSV file containing data in two columns, "source","text"
- When your upload completes you should see a DataTable previewing the
  data from your CSV.
- Check that deletion of individual quotes works from the preview.
- Check that quotes are correctly imported.
- Ponder the long 2.66 years during which this page was broken.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Quote of the day: Serenity of mind comes with patience.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 54214c4016d3d20da44047df41034fd752c50591)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16031: (followup) Fix documentation
Tomas Cohen Arazi [Wed, 9 Mar 2016 18:46:46 +0000 (15:46 -0300)]
Bug 16031: (followup) Fix documentation

This followup fixes a tiny mistake in the script POD.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 5439c71689ca49fe1fd02efae725a809f8bd67a8)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16031: sitemap.pl shouldn't append protocol to OPACBaseURL
Tomas Cohen Arazi [Wed, 9 Mar 2016 18:41:02 +0000 (15:41 -0300)]
Bug 16031: sitemap.pl shouldn't append protocol to OPACBaseURL

Since bug 5010 was pushed, OPACBaseURL already contains the protocol. The
sitemap.pl script was written before this was pushed, and thus still concatenates
http:// in front of OPACBaseURL.

This patch removes this behaviour.

To test:
- Have OPACBaseURL set to (say) http://myopac.com
- Run the sitemap.pl script without specifying the --url param
=> FAIL: Notice URLs look like http://http://myopac.com/bib... in the sitemap files.
- Apply the patch
- Run the sitemap.pl script without specifying the --url param
=> SUCCESS: Notice URLs look correctly like http://myopac.com/bib...
- Sign off :-D

Regards

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 41657a87f6981516affff2f482084c7104aa34cb)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16014: Display a warning on deleting OAI sets
Jonathan Druart [Wed, 9 Mar 2016 11:57:47 +0000 (11:57 +0000)]
Bug 16014: Display a warning on deleting OAI sets

A JavaScript alert should ask the user to confirm deletion of a OAI set.

Test plan:
Define a OAI set
Delete it
=> With this patch you should get a warning

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 5dc392f6638b7723a95007afadb23d2872c3f19f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15982 - Serials numbering patterns can be deleted without warning
Owen Leonard [Fri, 4 Mar 2016 17:07:44 +0000 (12:07 -0500)]
Bug 15982 - Serials numbering patterns can be deleted without warning

A JavaScript alert should ask the user to confirm deletion of a serial
numbering pattern. This patch adds this to the template.

To test, apply the patch and go to Serials -> Manage numbering patterns.

- In the list of patterns, click any "Delete" link.
- Verify that a JavaScript alert is triggered.
- Test that cancelling the alert cancels the deletion operation.
- Test that confirming the alert allows the deletion to complete.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 6179f04c8afcbc965756cf7daea039be986727d7)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15981 - Serials frequencies can be deleted without warning
Owen Leonard [Fri, 4 Mar 2016 16:52:25 +0000 (11:52 -0500)]
Bug 15981 - Serials frequencies can be deleted without warning

A JavaScript alert should ask the user to confirm deletion of a serial
frequency. This patch adds this to the template.

To test, apply the patch and go to Serials -> Manage frequencies

- In the list of frequencies, click any "Delete" link.
- Verify that a JavaScript alert is triggered.
- Test that cancelling the alert cancels the deletion operation.
- Test that confirming the alert allows the deletion to complete.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 4e82b8db94ee24ebd49541c25a6dac55cb8d543c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15968: Unnecessary loop in C4::Templates
Jonathan Druart [Thu, 3 Mar 2016 11:35:14 +0000 (11:35 +0000)]
Bug 15968: Unnecessary loop in C4::Templates

From C4::Templates::output

     # add variables set via param to $vars for processing
     for my $k ( keys %{ $self->{VARS} } ) {
         $vars->{$k} = $self->{VARS}->{$k};
     }

This loop is not necessary, we could do the same with

     $vars = { %$vars, %{ $self->{VARS} } };

After a quick benchmark, it gains 100 microseconds when we pass 170 vars
to the template.

Test plan:
Do some clicks on the interface, everything should be ok.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Perl idiosyncratic way of merging hash, clearer, if not quicker (not
  verified)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 9be221b14eee137f4143e4a2243eadfb03fcfbbc)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15735: Audio Alerts editor broken by use of of single quotes in editor
Kyle M Hall [Wed, 3 Feb 2016 19:05:19 +0000 (19:05 +0000)]
Bug 15735: Audio Alerts editor broken by use of of single quotes in editor

Single quotes audio selector break ability to edit an alert

Test Plan:
1) Enable audio alerts
2) Add new a alert with a select containing single quotes such as: input[name*='test']
3) Note you cannot edit the alert
4) Apply this patch
5) Reload the page
6) You should now be able to edit the alert

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Bug 15734 applied on top. Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit f30091414755728317cf34421f7709a939745881)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16009: fix GetMember() search on NULL/undef values
Galen Charlton [Wed, 9 Mar 2016 01:41:33 +0000 (01:41 +0000)]
Bug 16009: fix GetMember() search on NULL/undef values

This patch fixes a bug whereby GetMember(searchfield => undef)
(i.e., searching for patron records where 'searchfield' is NULL)
would crash.

This fixes a regression introduced by bug 15344 that in turn
exposed a long-standing bug in GetMember().

To test:

[1] Import some offline circulation transactions that include at
    least one return.
[2] Attempt to view the list of pending transactions; a crash
    will occur.
[3] Apply the patch and view the list of pending transactions again;
    this time, it should work.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
8 years agoBug 15871: Improve PerlCritic level for t/RecordProcessor.t
Mark Tompsett [Fri, 19 Feb 2016 20:49:02 +0000 (15:49 -0500)]
Bug 15871: Improve PerlCritic level for t/RecordProcessor.t

perlcritic -5 failed.
Attempt to clean up to a higher level:
-- use English to address use of $@ variable
-- perltidy on the code
-- substitute q{} for ''
-- expand out single line hacky goodness (... s/\.pm$//) to more code
-- remove parenthesis on functions that don't need it
-- add x, s, and m as needed to regexps
-- change double quotes to single quotes where no variable involved
-- tweaked eval destroy test to check return value and use $EVAL_ERROR
-- renamed $processor to $record_processor in the subtest to avoid
   lexical warnings

TEST PLAN
---------

$ perlcritic -5 t/RecordProcessor.t
Don't modify $_ in list functions at line 43, column 25.  See page 114 of PBP.  (Severity: 5)

$ perlcritic -2 t/RecordProcessor.t
No package-scoped "$VERSION" variable found at line 1, column 1.  See page 404 of PBP.  (Severity: 2)
Quotes used with a string containing no non-whitespace characters at line 34, column 36.  See page 53 of PBP.  (Severity: 2)
Quotes used with a string containing no non-whitespace characters at line 34, column 39.  See page 53 of PBP.  (Severity: 2)
Quotes used with a string containing no non-whitespace characters at line 36, column 33.  See page 53 of PBP.  (Severity: 2)
Quotes used with a string containing no non-whitespace characters at line 36, column 36.  See page 53 of PBP.  (Severity: 2)
Don't modify $_ in list functions at line 43, column 25.  See page 114 of PBP.  (Severity: 5)
Regular expression without "/s" flag at line 43, column 33.  See pages 240,241 of PBP.  (Severity: 2)
Regular expression without "/x" flag at line 43, column 33.  See page 236 of PBP.  (Severity: 3)
Regular expression without "/m" flag at line 43, column 33.  See page 237 of PBP.  (Severity: 2)
Regular expression without "/s" flag at line 43, column 66.  See pages 240,241 of PBP.  (Severity: 2)
Regular expression without "/x" flag at line 43, column 66.  See page 236 of PBP.  (Severity: 3)
Regular expression without "/m" flag at line 43, column 66.  See page 237 of PBP.  (Severity: 2)
Expression form of "grep" at line 47, column 8.  See page 169 of PBP.  (Severity: 4)
Expression form of "grep" at line 50, column 20.  See page 169 of PBP.  (Severity: 4)
Regular expression without "/s" flag at line 50, column 26.  See pages 240,241 of PBP.  (Severity: 2)
Regular expression without "/m" flag at line 50, column 26.  See page 237 of PBP.  (Severity: 2)
Return value of eval not tested at line 73, column 1.  You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed.  (Severity: 3)
Magic punctuation variable $@ used at line 78, column 5.  See page 79 of PBP.  (Severity: 2)
Reused variable name in lexical scope: $processor at line 84, column 5.  Invent unique variable names.  (Severity: 3)
Subroutine "new" called using indirect syntax at line 87, column 18.  See page 349 of PBP.  (Severity: 4)
Subroutine "new" called using indirect syntax at line 93, column 18.  See page 349 of PBP.  (Severity: 4)
Quotes used with a string containing no non-whitespace characters at line 96, column 40.  See page 53 of PBP.  (Severity: 2)
Subroutine "new" called using indirect syntax at line 99, column 18.  See page 349 of PBP.  (Severity: 4)
Subroutine "new" called using indirect syntax at line 106, column 18.  See page 349 of PBP.  (Severity: 4)
$ prove -v t/RecordProcessor.t
t/RecordProcessor.t .. ok
All tests successful.
Files=1, Tests=13,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.22 cusr  0.02 csys =  0.25 CPU)
Result: PASS

$ prove -v t/RecordProcessor.t
...
$ git bz apply 15871

Repeat perlcritic level 2, and only $VERSION warning should exist.
Retest with the prove.
Run koha qa test tools.

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

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
I don't really care about perlcritic as long as it involves changing '' into qw{} (WTF?)
Anyway, I'd do this kind of things as we go, for example, if we were adding more tests. In that
case it would just be a followup for this, after you provided a patch for an enh/bugfix.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 7721a7b8d2883c2e864eb672ebbef792450e91ff)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15697 - [QA Followup] Apply change to NORMARC
Nick Clemens [Tue, 2 Feb 2016 14:31:34 +0000 (14:31 +0000)]
Bug 15697 - [QA Followup] Apply change to NORMARC

This patch switches from UNLESS MARC21 to IF UNIMARC - this way changes
apply to MARC21 and NORMARC and UNIMARC remains unaffected

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 566daf8c24ad577da1b07c190979ada67877bed7)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15697: Unnecessary comma between title and subtitle on opac-detail.pl
Nick Clemens [Thu, 28 Jan 2016 20:33:58 +0000 (20:33 +0000)]
Bug 15697: Unnecessary comma between title and subtitle on opac-detail.pl

To test:
1 - Go to Administration->Keyword to MARC mapping
2 - Add a mapping (or ensure it exists)
    Field name: subtitle
    MARC field: 245
    MARC subfield: b
3 - View a record with a subtitle in the opac
4 - Note in MARC 21 you have "Title of record:, subtitle of record"
5 - Apply patch
6 - View the record again and note the comma is no longer present.

Note: this patch removes the comma only for MARC21 where subtitle is not
repeatable. UNIMARC seems to be repeatable and does not include
punctuation so I believe this may be needed there.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. Comma removed from title of the window and breadcrumb
section

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e19db8ca32dd776263b73474ece4e17d88ab17b4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15693: Unnecessary punctuation mark when check-in an item in a library other...
Hector Castro [Thu, 28 Jan 2016 16:40:34 +0000 (10:40 -0600)]
Bug 15693: Unnecessary punctuation mark when check-in an item in a library other than the home branch

To test:
1-Checkin an item in a library other than the home branch.
2-A message will display asking to return the item to the home branch
3-You will see the phrase "Print slip )"
4-Apply patch
5-Reproduce or repeat steps 1-2 and verify the punctuation mark is
no longer displayed

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit a9a10c57807a91f550ffc73f6fb32e631d4bdb3f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14097: Fixed missing test cases
Mark Tompsett [Mon, 4 Jan 2016 06:16:59 +0000 (01:16 -0500)]
Bug 14097: Fixed missing test cases

Fixed AllowPkiAuth issue caused by 15101.
Added missing AudioAlerts

TEST PLAN
---------
1) prove -v t/db_dependent/UsageStats.t
   -- should pass after applying patch
2) Run koha qa test tools

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 5f71faf97185efbfad69e4f2237c9e2d38e7a812)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14097 : Changing AddReserve prototype call
Julian FIOL [Mon, 24 Aug 2015 11:51:16 +0000 (13:51 +0200)]
Bug 14097 : Changing AddReserve prototype call

In response of Joubu comment #19

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 9ac68128d99aff4b8d3cabb98c3e84d0f0658b3a)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14097 : Avoid issue if the number of syspref shared is modified
Julian FIOL [Mon, 24 Aug 2015 11:50:16 +0000 (13:50 +0200)]
Bug 14097 : Avoid issue if the number of syspref shared is modified

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit e3e507be9e9f90ff075fafba8013c8e54fa1fa00)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14097 - Correct noise under Debian
Mark Tompsett [Sat, 23 May 2015 04:22:26 +0000 (00:22 -0400)]
Bug 14097 - Correct noise under Debian

The first four patches do not create any noise under Ubuntu 14.04 LTS.

Running on Debian Jessie:
[SNIP]
keys on reference is experimental at t/db_dependent/UsageStats.t line 88.
keys on reference is experimental at t/db_dependent/UsageStats.t line 106.
keys on reference is experimental at t/db_dependent/UsageStats.t line 119.
keys on reference is experimental at t/db_dependent/UsageStats.t line 136.
keys on reference is experimental at t/db_dependent/UsageStats.t line 153.
keys on reference is experimental at t/db_dependent/UsageStats.t line 162.
keys on reference is experimental at t/db_dependent/UsageStats.t line 587.
[SNIP]

Instead of having 'keys $foo->{bar}', 'keys %{$foo->{bar}}' was used.

TEST PLAN
---------
1) On a DEBIAN system (Jessie gives above messages)
   apply the first 4 patches interactively.
2) $ prove t/db_dependent/UsageStats.t
   -- trigger noise like above.
3) apply this patch
4) $ prove t/db_dependent/UsageStats.t
   -- no noise triggered.
5) koha qa test tools

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 3387a6114b70cf8de021c4cdf84a687e629efc82)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14097: Rollback issue and warning corrected
Julian FIOL [Tue, 12 May 2015 12:28:56 +0000 (14:28 +0200)]
Bug 14097: Rollback issue and warning corrected

The rollback issue came from '_count' testing.
It used a 'DROP TABLE' and 'CREATE TABLE' which implicitly do autocommit.
That's why the final rollback could not be.

This patch no longer uses t::lib::TestBuilder either because it was the cause
of the warning on Comment #1 :
"DBIx::Class::Storage::txn_rollback(): A txn_rollback
in nested transaction is ineffective! (depth 1) at
t/lib/TestBuilder.pm line 308"

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Now data is preserved, no errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit afe9d02a819adfeec9468600805ee06df6082b21)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14097: changing verif_systempreferences_values subroutine
Julian FIOL [Mon, 4 May 2015 13:20:01 +0000 (15:20 +0200)]
Bug 14097: changing verif_systempreferences_values subroutine

It's saving a large number of lines

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
All tests run, no koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit acf2e684bd4118d40e3bc89b09c0852bc8732d04)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14097: Delete table issues before testing
Julian FIOL [Mon, 4 May 2015 09:08:14 +0000 (11:08 +0200)]
Bug 14097: Delete table issues before testing

If we delete all biblio DB, we could have some troubles with foreign keys

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit ae5a199a551aa8a08f5d0c5b2338aeb194aba0c7)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14097: Testing C4::UsageStats
Julian FIOL [Fri, 10 Apr 2015 09:07:39 +0000 (11:07 +0200)]
Bug 14097: Testing C4::UsageStats

DESCRIPTION
-----------

Add unit tests to C4::UsageStats
Subroutine :
(V : tested, X : Not tested)

V  NeedUpdate
V  BuiltReport
X  ReportToCommunity
V  _count

TEST PLAN
---------

1. Apply patch
2. prove -v t/db_dependent/UsageStats.t
-- All tests should run successfully

/!\ I have 1 warning but I don't know where it can come /!\
(in cleanup) DBIx::Class::Storage::txn_rollback(): A txn_rollback
in nested transaction is ineffective! (depth 1) at
t/lib/TestBuilder.pm line 308

TEST PLAN OPTIONAL
------------------

Go check bug 13899 to see the coverage of this module.

Coverage BEFORE this patch :
Statement  :  40,5%
Branch     :   0,0%
Condition  :   0,0%
Subroutine :  55,6%

Coverage AFTER this patch :
Statement  :  81,0%
Branch     : 100,0%
Condition  : 100,0%
Subroutine :  88,8%

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit b44b7224e079a983c991aa06eaae11c350871814)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 12920 [QA Followup] - Show override option below checkouts table when allowed
Kyle M Hall [Wed, 3 Feb 2016 15:22:40 +0000 (15:22 +0000)]
Bug 12920 [QA Followup] - Show override option below checkouts table when allowed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 05be0f29cd2d7175acdf2ddf4a8805ec5b3df15e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 12920: Remove AllowRenewalLimitOverride from pl scripts and tt files
Natasha [Tue, 19 Jan 2016 00:56:56 +0000 (00:56 +0000)]
Bug 12920: Remove AllowRenewalLimitOverride from pl scripts and tt files

use Koha.Preference instead

Test Plan:
1) Apply this patch
2) Go to circulation.pl
3) Ensure you can still override renewal limits with pref enabled
4) Ensure you can not override renewal limits with pref disabled
5) Go to moremember.pl
6) Repeat steps 3-4

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 17190de524c58b8abeca5c65506fe44bfdd93adc)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15940 - Remove unused JavaScript from authorities MARC subfield structure
Owen Leonard [Mon, 29 Feb 2016 18:39:16 +0000 (13:39 -0500)]
Bug 15940 - Remove unused JavaScript from authorities MARC subfield structure

The authorities MARC subfield structure template contains some unused
JavaScript, "function displayMoreConstraint()" This patch removes it.

To test, apply the patch and go to Administration -> Authority types ->
MARC structure -> Subfields -> Edit subfields and confirm that there are
no JavaScript errors and tab switching works correctly.

A search of the source code should show no instances of
"displayMoreConstraint."

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  No regression, no JS warning.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 3f70b4660bf57e854e6ef13b04fb29de57c53bec)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15927 - Remove use of <tr class="highlight"> for alternating row colors
Owen Leonard [Fri, 26 Feb 2016 18:27:17 +0000 (13:27 -0500)]
Bug 15927 - Remove use of <tr class="highlight"> for alternating row colors

The "highlight" class on table rows is unnecessary since we have a CSS
rule which defines colors for alternating row colors. This patch removes
use of the "highlight" class from templates and removes the definition
from staff-global.css

To test, view the affected pages and confirm that the change has not
broken anything.

Acquisitions -> Vendor -> View basket
Acquisitions -> Late orders
Acquisitions -> Ordered
Acquisitions -> Vendor -> Receive shipment
Acquisitions -> Spent
Acquisitions -> Vendor details -> Contracts table
Administration -> MARC frameworks (comment removed only)
Administration -> Class sources
Authorities -> Authority search results
Catalog -> Bibliographic detail page -> Items -> View item's checkout
   history
Catalog -> subject.tt (is this template used?)
Cataloging -> Cataloging search results
Patrons -> Patron account
Reports -> Patrons who haven't checked out
Reports -> Statistics wizards -> Patrons
Reports -> Top lists -> Most-circulated items
Reports -> Inactive -> Items with no checkouts
Reports -> Reports dictionary
Reports -> Statistics wizards -> Circulation
Reports -> Statistics wizards -> Holds
Holds -> Place a hold -> Existing holds table
Serials -> New subscription -> Search for a vendor -> Search results
Serials -> Check expiration
Serials -> Subscription -> Serial collection
Serials -> Subscription -> Serial collection -> Edit serials
Suggestions
Tags -> View tags -> View titles with a tag
Tools -> Manage staged MARC records -> Batch (I think the affected
section of this template is obsolete)
Tools -> Log viewer -> Log result
Lists -> View lists (May be broken by Bug 15916)

Note that if you search the templates for instances of a <tr> with a
"highlight" class you'll find two instances in slip templates which
refer to a class defined in printreceiptinvoice.css.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Looks good. Haven't seen any regression.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 255c0af9893b745d2f1a233a9aea8b7f1281546e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15926: Add help for item search fields admin
Nicole C Engard [Fri, 26 Feb 2016 16:03:26 +0000 (16:03 +0000)]
Bug 15926: Add help for item search fields admin

This patch will add the missing help file to the item
search fields admin page.

To test:
* Go to administration > Item search fields
* Click Help
* Confirm help is there and correct.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit ac3e13248abd9687bbce764d1f1b6be39921b552)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15925: Correct some markup issues with patron lists pages
Owen Leonard [Fri, 26 Feb 2016 14:17:52 +0000 (09:17 -0500)]
Bug 15925: Correct some markup issues with patron lists pages

This patch makes some markup changes to the patron lists interface in
order to make them more consistent with other areas of Koha.

Change to look for when testing:

Tools -> Patron lists:

- Wrap "New patron list" button in standard <div id="toolbar">
- Place toolbar above page heading.

Tools -> Patron lists -> New patron list:

- Use built-in form validation for required fields
- Clarify page title and breadcrumbs on list add and edit

Validation errors have been corrected on all three templates, including
removal of an extra </div>.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15920: Clean up and fix errors in batch checkout template
Owen Leonard [Thu, 25 Feb 2016 18:45:54 +0000 (13:45 -0500)]
Bug 15920: Clean up and fix errors in batch checkout template

The batch checkout template has some markup and JavaScript problems
which need to be resolved, including:

- Mismatched <h3></h1>
- JavaScript includes which are not used
- Incorrect DataTables configuration
- Incorrect class on warning dialogs
- Incorrect terminology: Use "checkout" instead of "issue"

This patch also changes the markup and styling of batch checkout errors,
using Font Awesome icons to retain highlighting of warnings and errors
while (I hope) improving readability.

To test, apply the patch and go to batch checkout for a patron for whom
batch checkouts are enabled.

- Check out a batch of barcodes. Include items which will trigger errors
  or warnings. For example: Invalid barcodes, lost items, items which
  are already checked out, items which are on hold for another patron,
  items which are damaged.

- When the table of items is displayed so that you can confirm the
  checkout, make sure the table is sortable.

- Think about whether the style changes on warnings and errors are an
  improvement.

- Try to initiate a batch checkout to a patron who is restricted. You
  should see an "alert" style dialog instead of a "message" style one.

- Validate the HTML and confirm that there are no errors raised by this
  template's markup.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 24e009f72f003a9f4f27f2630c252df0bf2e4f1f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15884 - Vendor contract deletion warning is incorrectly styled
Owen Leonard [Tue, 23 Feb 2016 14:16:13 +0000 (09:16 -0500)]
Bug 15884 - Vendor contract deletion warning is incorrectly styled

When deleting a contract in  Acquisitions -> Vendor -> Contracts, the
deletion confirmation message is not styled with the standard "dialog
alert" <div>. This patch modifies the confirmation markup to match the
standard.

To test, apply the patch and go to Acquisitions -> [ a vendor] ->
Contracts

- Try deleting a contract. The confirmation box should have the standard
  "dialog alert" class.
- Test the 'confirm' and 'cancel' actions and make sure both complete
  correctly.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15872: Rancor: Ctrl-Shift-X has incorrect description in "Keyboard shortcuts"
Jesse Weaver [Fri, 19 Feb 2016 21:51:58 +0000 (14:51 -0700)]
Bug 15872: Rancor: Ctrl-Shift-X has incorrect description in "Keyboard shortcuts"

Should be "Delete current subfield."

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit e651025dd9d78591ad364e9402c6172b3e91008e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15808 - Remove "Return to where you were before" from sysprefs
Marc Véron [Fri, 12 Feb 2016 09:19:00 +0000 (10:19 +0100)]
Bug 15808 - Remove "Return to where you were before" from sysprefs

This patch removes the link 'return to where you were before' from
syspref search result page after failing search.

To test:
- Apply patch
- Go to System preferences in staff client, do a search
  with something that does not exist
- Verify that a message pops up that does not contain the link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 34b79932f79f83fbca528083cacbb61f157c05cb)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15804: Use standard dialog style for confirmation of MARC subfield deletion
Owen Leonard [Thu, 11 Feb 2016 17:23:49 +0000 (12:23 -0500)]
Bug 15804: Use standard dialog style for confirmation of MARC subfield deletion

When deleting a MARC framework subfield, the confirmation message is not
styled. This patch modifies the template to style the confirmation
message like similar ones.

To test, apply the patch and go to Administration -> MARC framworks.

 - Click 'MARC structure' for a framework you can edit.
 - Click 'subfields' for a tag you can edit.
 - Click 'Delete' for a subfield you can delete. You should see a
   confirmation dialog styled like other "alert" type dialogs.
 - Test both canceling and confirming deletion to confirm that both
   function correctly.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15526: Update DB rev (3.22.04.002)
Julian Maurice [Mon, 7 Mar 2016 12:22:02 +0000 (13:22 +0100)]
Bug 15526: Update DB rev (3.22.04.002)

8 years agoBug 15526: drop table nozebra
Jonathan Druart [Mon, 11 Jan 2016 10:26:33 +0000 (10:26 +0000)]
Bug 15526: drop table nozebra

This table is not used anymore and can be removed.

Test plan:
In your sql cli:
  SHOW TABLES;
should return nozebra if your DB has been created before bug 7440.

Apply this patch and execute the update DB entry.
Now the table should have been dropped.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 37b02253899ff294b0b3275c15a488e5ef98807b)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15784: Library deletion warning is incorrectly styled
Owen Leonard [Wed, 3 Feb 2016 13:40:20 +0000 (08:40 -0500)]
Bug 15784: Library deletion warning is incorrectly styled

When deleting a library in Administration ->  Libraries and groups, the
deletion confirmation message is not styled with the standard "dialog
alert" <div>. This patch modifies the confirmation markup to match the
standard.

To test, apply the patch and go to Administration -> Libraries and
groups.

- Try deleting a library. The confirmation box should have the standard
  "dialog alert" class.
- Test the 'confirm' and 'cancel' actions and make sure both complete
  correctly.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15721: (QA followup) pick the most probable first
Tomas Cohen Arazi [Tue, 1 Mar 2016 13:12:29 +0000 (10:12 -0300)]
Bug 15721: (QA followup) pick the most probable first

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 16548d39840c92d43a64ca08f63231156935c41c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15721: (followup) Add apache2ctl to C4::Context::get_versions
Marc Véron [Fri, 19 Feb 2016 15:52:48 +0000 (16:52 +0100)]
Bug 15721: (followup) Add apache2ctl to C4::Context::get_versions

See comment #6

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 019634fc5b010324de8adde38f49239a816a519c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15721: About page does not display Apache version
Marc Véron [Tue, 2 Feb 2016 10:34:16 +0000 (11:34 +0100)]
Bug 15721: About page does not display Apache version

This patch changes about.pl to get version information from
C4::Context where applicable and fixes missing display of
the Apache version e.g. for Apache/2.2.22

To test:
- Without patch, open about page in staff client
- Remember contents of tab 'Server information'
  (e.g. make a screenshot)
- Apply patch
- Verify, that the About page displays the same information
  as before rsp. additionally displays Apache version if
  it was missing without patch.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit c2fe13c13ad286e6fc67240624eee6d95c5e7334)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15719: Silence warning in C4/Language.pm during web install
Mark Tompsett [Mon, 1 Feb 2016 23:12:44 +0000 (18:12 -0500)]
Bug 15719: Silence warning in C4/Language.pm during web install

This problem was discovered the hard way:
- Drop DB
- Create DB
- Webinstaller run until the screen is:
We are ready to do some basic configuration.
Please install basic configuration settings to continue the installation.
-- The error log file will end with an error about splitting
   an uninitialized value.

TEST PLAN
---------
0) First patch already applied
1) prove -v t/Languages.t
   -- success, but warn prints
2) Apply this patch
3) prove -v t/Languages.t
   -- success without warning messages
4) run koha qa test tools

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. QA test tools run OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit a84264c92f4c34607fba09f109610e40611078a9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15719: Silence warning in C4/Language.pm during web install - tests
Mark Tompsett [Mon, 1 Feb 2016 23:26:41 +0000 (18:26 -0500)]
Bug 15719: Silence warning in C4/Language.pm during web install - tests

Test empty database case.

TEST PLAN
---------
1) prove -v t/Languages.t
   -- success (because test case is missing)
2) Apply this patch
3) prove -v t/Languages.t
   -- success, but warning printed.
4) run koha qa test tools

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. QA test tools rus OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 701f427587daa4530041014fae8bf3674351283c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15699 [QA followup] - Only display firstname if present
Nick Clemens [Mon, 1 Feb 2016 15:57:56 +0000 (15:57 +0000)]
Bug 15699 [QA followup] - Only display firstname if present

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit ad63a6b8da1cd91f2e03ec4093d76b00cd3045d2)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15699 - Course reserves instructors should be in form "Surname, Firstname" for...
Nick Clemens [Thu, 28 Jan 2016 21:58:37 +0000 (21:58 +0000)]
Bug 15699 - Course reserves instructors should be in form "Surname, Firstname" for sorting purposes

This patch changes the order of the name fields and adds a span class around
each in case of library wanting to customize further

To test:
1 - Enable course reserves
2 - Add some courses with instrcutors
3 - Note they are of form "Firstname Surname"
4 - Apply patch
5 - Note the change
6 - Note span tags
7 - Note you can hide firstname by adding to intranet user js: $(".instr_firstname, instr_separator").hide();

Sing-off note: This patch displays the names as advertised on cgi-bin/koha/opac-course-reserves.pl Sorting
the names would need some more actions but seems not to be intended by this patch.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 4dba088549d1add43cfd575ebdd3d21689c4a700)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15667: Fix date and branch formatting of messages in patron account display
Marc Véron [Tue, 26 Jan 2016 15:33:49 +0000 (16:33 +0100)]
Bug 15667: Fix date and branch formatting of messages in patron account display

This patch fixes the date and branch formatting of messages in patron
account display.

To verify:
Add a new message to a patron account from the 'checkouts' tab in staff,
the displayed date is not correctly formatted and the branch displays as code
instead as branch name

To test:
Apply patch, verify that the messages and branch names are properly formatted.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. The message dates in checkouts tab follow dateformat sypref

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 015e20138a7a400d0da30b0a771a94eede673c05)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15658: Browse system logs: Add more actions to action filter list
Marc Véron [Mon, 25 Jan 2016 17:58:54 +0000 (18:58 +0100)]
Bug 15658: Browse system logs: Add more actions to action filter list

The following actions were missing in the action filter list on
cgi-bin/koha/tools/viewlog.pl:

'ADDCIRCMESSAGE'
'CHANGE PASS'
'DELCIRCMESSAGE'
'RENEW'
'Run'

To test:
- Apply patch
- Go to Tools > Logs (viewlog.pl)
- Verify that the actions appear in the list 'Actions'
- Verify that the new entries filter the list as appropriate (in
  combination with Modules: All or with a meaningful selection in
  list 'Modules')

Note for testing: You have to set a date in 'Display from' to get results

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Logs work as advertised, translated in bug 13474

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
"Run" could be more explicit.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 7ce721ebefc13d99ff527fad26b39b7064bd2e11)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 13474: Adding untranslatable log actions to viewlog.tt
Aleisha [Tue, 19 Jan 2016 20:29:24 +0000 (20:29 +0000)]
Bug 13474: Adding untranslatable log actions to viewlog.tt

Added 'Run'

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
(Amended to remove tab chars to make qa tools happy)
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 4c87b50ac32a00fd1056ab3923ecb11bde5c2b51)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15947: move SIPILS.t to DB-dependent test directory
Galen Charlton [Tue, 1 Mar 2016 13:51:56 +0000 (13:51 +0000)]
Bug 15947: move SIPILS.t to DB-dependent test directory

SIPILS.t requires an active koha-conf.xml to pass,
and consequently is moved to t/db_dependent so that
'make test' can succeed.

To test
-------
[1] Unset KOHA_CONF and either do a make test or a
    prove -v t/SIPILS.t.  Note that the tests fail.
[2] Apply the patch and run make test again; this time,
    the test suite should pass.
[3] Verify that with KOHA_CONF *set*,
    prove -v t/db_dependent/SIPILS.t passes.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit ffda0166cf184c9b2e38d3652700f00a89484e80)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15939: Action logs - Do not default dates to today
Jonathan Druart [Tue, 1 Mar 2016 10:52:39 +0000 (10:52 +0000)]
Bug 15939: Action logs - Do not default dates to today

When accessing the modification logs from a link that does not
explicitly set the to and from dates (e.g., from patron or bib details),
no results are displayed unless the object had an action occur during
the current day.

This is a side-effect of commit 5dceb851 for bug 13813.

Test plan:
- View the modification logs of a record which has already been modified
(/tools/viewlog.pl?do_it=1&modules=CATALOGUING&action=MODIFY&object=XXX)
=> Without this patch, you won't see any logs (unless you have modified
the record today)
=> With this patch, the behavior is the same as prior bug 13813 (you can
check in 3.20.x), you will see all logs

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit ca36ee3794c7a33976405fe8231df28ecaee3289)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15881 - Serials new numbering pattern link should be a toolbar button
Owen Leonard [Mon, 22 Feb 2016 18:21:28 +0000 (13:21 -0500)]
Bug 15881 - Serials new numbering pattern link should be a toolbar button

This patch converts the "new numbering pattern" link to a
Bootstrap-styled toolbar button for consistency with other pages in
Koha. This patch also includes minor markup corrections:

- Standardizing on the phrase "Numbering patterns" by eliminating the
  occasional use of "number patterns."
- Removing mistaking closing slash on <select>
- Using standard "Cancel" link instead of a button.
- Adding a colon and space after labels.
- Fixing of "no existing patterns" message.

To test, apply the patch and go to Serials -> Numbering patterns

- Confirm that the "New numbering pattern" button looks correct and
  works correctly.
- Confirm that the entry form looks correct and that the cancel link
  works as expected.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 0058a977c6b76e0602708ca48fabdbc679b9e0ab)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15880 - Serials new frequency link should be a toolbar button
Owen Leonard [Mon, 22 Feb 2016 18:09:00 +0000 (13:09 -0500)]
Bug 15880 - Serials new frequency link should be a toolbar button

This patch converts the "new frequency" link to a Bootstrap-style
toolbar button in order to maintain consistency. Also included in this
patch are some other minor markup corrections:

- A colon and space after labels
- A 'Cancel' link instead of a button.
- "Required" classes for a required field.

To test, apply the patch and go to Serials -> Manage frequencies.

- Test the "New frequency" button
- Confirm that the changes to the entry form look correct.

Followed test plan, displays as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 3b838ac251a145be2cfa46a076f1e786a86c2f16)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15833: item.biblioitemnumber returns a biblioitem DBIx::Class object
Jonathan Druart [Tue, 16 Feb 2016 15:58:44 +0000 (15:58 +0000)]
Bug 15833: item.biblioitemnumber returns a biblioitem DBIx::Class object

2 links are wrong on the renew page, because item.biblioitemnumber does
not return the biblioitemnumber as expect the template.

Test plan:
Renew an item and check the item link.
It should contain a valid biblioitemnumber for the 'bi' parameter.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Link repaired. At first glance, I am wondering if biblioitemnumber is
of actual use here; is it only passed back and forth between script and
template?

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 1302f91755012d9d31e87b037cb882bc025b357f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15790 - Don't delete a MARC framework if existing records use that framework
Owen Leonard [Thu, 11 Feb 2016 17:06:39 +0000 (12:06 -0500)]
Bug 15790 - Don't delete a MARC framework if existing records use that framework

If a MARC framework is in use by any records it should not be possible
to delete it. Deleting a framework which is in use will leave the
deleted framework code in those records.

This patch modifies the deletion confirmation dialog so that it will not
let the user confirm the deletion if there are records using it.

To test, apply the patch and go to Administration -> MARC frameworks

1. Try to delete a framework which is in use by 1 or more records. The
   resulting confirmation dialog should prevent you from proceeding.
2. Try to delete a framework which is not in use. Test both canceling
   and confirming that deletion to make both function correctly.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15755: Display default item type as "All" in circ rules
Jonathan Druart [Mon, 8 Feb 2016 13:00:37 +0000 (13:00 +0000)]
Bug 15755: Display default item type as "All" in circ rules

Bug 15354 did not fix correctly the issue with the item type display.
The default item type '*' should be "All", at the moment nothing is
displayed in the column.

Test plan:
1/ Define a rule for default item types (All/*) and for specific item
types.
2/ Translate some item type descriptions used in previous step
3/ Default item type should be "All" and correct translations should be
displayed.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 6d854a167d2843ac2dac690bb69a048006994372)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15706: Changing to circulate_remaining_permissions
Aleisha [Sun, 31 Jan 2016 21:16:18 +0000 (21:16 +0000)]
Bug 15706: Changing to circulate_remaining_permissions

I have only changed this in the includes for the tabs at the top.

To test:
2) Ensure that Check Out/Check In tabs still work as they should
3) Check patch for errors or pages I've missed

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15691: Show card number minimum and maximum in visible hint when adding a patron
Owen Leonard [Thu, 28 Jan 2016 13:54:56 +0000 (08:54 -0500)]
Bug 15691: Show card number minimum and maximum in visible hint when adding a patron

The CardnumberLength system preference defines card number minimum and
maximum allowed values when adding a patron. This information is
currently hidden in a title attribute on the card number input field.

This patch moves the information into a <div class="hint">, matching
other fields in the entry form which offer details about entry
guidelines.

To test, apply the patch and open the new patron entry form. Test for
various values of CardnumberLength, and with 'cardnumber' mandatory or
not mandatory as defined in BorrowerMandatoryField.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 9f172a3c1bc8c7cd1664eabac81c5b66877b3952)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15674: Make "Column visibility" translatable
Jonathan Druart [Mon, 29 Feb 2016 07:32:14 +0000 (07:32 +0000)]
Bug 15674: Make "Column visibility" translatable

The "Column visibility" text button was not translatable, now it is.

Test plan:
1/ Update the template for a given language and translate the "Column
visibility" string
2/ Go on admin/currency.pl
=> The string should be translated.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15670 - Rename "Cancel" to "Cancel hold" when checking in a waiting item
Owen Leonard [Thu, 11 Feb 2016 13:56:42 +0000 (08:56 -0500)]
Bug 15670 - Rename "Cancel" to "Cancel hold" when checking in a waiting item

When checking in an on-hold item which is waiting, the "Cancel" button
cancels the hold, so it should say so. This patch changes the text.

This patch also moves the 'cancel hold' button to the middle, on the
theory that buttons on the left should default to 'confirm' and buttons
on the right should generally imply 'cancel'--as in 'do nothing.' Moving
it to the middle seems like a good place to put it where users will have
to think about clicking it.

To test:

1. Find an hold which has been made 'waiting,' or check in an confirm a
   pending hold at your library.
2. Check in that item again and verify that the 'Hold found' dialog
   contains a 'Cancel hold' button which works to cancel the waiting
   hold.
3. Repeat the process and confirm that the functionality of the other
   buttons is unchanged.

Followed test plan, works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit d9dc8be41780c3a4332f2fd50f80961d1653c49e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15663: Fix 'remove selected items', add a 'delete batch' button
Aleisha [Tue, 26 Jan 2016 02:57:38 +0000 (02:57 +0000)]
Bug 15663: Fix 'remove selected items', add a 'delete batch' button

In this patch I have fixed the 'Remove selected items' button.
I have also added a 'Delete batch' button like there is in the Patron Card Creator.

To test:
1) Go to Tools -> Label creator -> New label batch
2) Add 2 items
3) Select the checkbox next to an item you just added and click 'Remove selected items'
4) A pop-up will say that you are yet to select an item. (Please ignore the mistake in the pop-up message, this is being fixed in Bug 15662)
5) Apply patch and refresh. Confirm there is now a 'Delete batch' button in the toolbar
6) Select one item and click 'Remove selected items'
7) Confirm the item is deleted from the batch
8) Select the final item and click 'Remove selected items'
9) Pop-up message will tell you that deleting this item will delete the batch. Click 'Okay'
10) Click 'Delete batch' then 'Okay'
11) Confirm you are redirected to the Labels page and the batch has been deleted.

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: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 4bf881d32c41b54357949e4d37b1401b1324bc8e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15605: Remove the cursor:pointer style.
Jonathan Druart [Wed, 27 Jan 2016 10:33:24 +0000 (10:33 +0000)]
Bug 15605: Remove the cursor:pointer style.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit effe1e27819a3b7d156e4abf5c96dd34d529246f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15605 - Accessibility: Can't tab to add link in serials routing list add user...
Natasha [Wed, 20 Jan 2016 02:11:37 +0000 (02:11 +0000)]
Bug 15605 - Accessibility: Can't tab to add link in serials routing list add user popup

To Test -
1. Go to Serials and search for a title and then click on it.
2. Click routing list and then Add recipients.
3. Search for a patron.
4. Using the tab key try to navigate onto the Add link.
5. Notice it skips Add.
6. Apply the patch and then repeat steps 1-4, notice the Add link can now be accessed through using the keyboard.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit c76549dd7b4a090844a5a51664409417f9838923)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15306: Do not display the translate link if only 1 language is installed
Jonathan Druart [Thu, 7 Jan 2016 12:34:54 +0000 (12:34 +0000)]
Bug 15306: Do not display the translate link if only 1 language is installed

It doesn't make sense to offer the option to translate an item type
description into another language if there is only one language
installed.

Test plan:
Generates templates for only 1 language
Edit an item type and confirm that the link "translate into..." is not
displayed.
Generates templates for another language
Confirm that the link is now displayed.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit adef1d1020255373ec6f954bcd1a02e382305047)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14244: Does not display patron's info in the checkout history if not authorised
Jonathan Druart [Mon, 25 Jan 2016 10:31:34 +0000 (10:31 +0000)]
Bug 14244: Does not display patron's info in the checkout history if not authorised

The librarian needs CAN_user_circulate_circulate_remaining_permissions
to see the checkouts patron's information.

Test plan:
The "Patron" column of the checkout history page should only be
displayed of you have the circulate > circulate_remaining_permissions
permission.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 818b1871519f0348cc54a60c76e2c8192f36bb3c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 14244: viewing a bib item's circ history requires circulation permissions
Thomas Misilo [Wed, 16 Sep 2015 17:43:28 +0000 (13:43 -0400)]
Bug 14244: viewing a bib item's circ history requires circulation permissions

On issuehistory.pl you have:

 flagsrequired   => { circulate => "circulate_remaining_permissions" },

But that really doesn't make sense. People should be able to view the history of circulation without having permission to circulate items themselves

This patch changes the required permissions from circulate to catalogue.

Test Plan:
1. Login as user without the circulate_remaining_permissions
2. Attempt to view Circulation History of an Item
3. Does not work
4. Apply Patch
5. Attempt to view circulation history with a user that has access to the staff side.
6. Can view circulation history now

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit e8c5fb11fbebc86742325aea745bc7253d9110d8)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15923: Fix --id_list_file option for misc/export_records.pl
Jonathan Druart [Mon, 29 Feb 2016 10:56:33 +0000 (10:56 +0000)]
Bug 15923: Fix --id_list_file option for misc/export_records.pl

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit cd9589681d053f15cb54b58570af908e40abd460)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15923: Take the id list file into account when exporting records
Jonathan Druart [Mon, 29 Feb 2016 08:10:59 +0000 (08:10 +0000)]
Bug 15923: Take the id list file into account when exporting records

When exporting records (tools/export.pl or misc/export_records.pl), a
file of ids (authid or biblionumber) can be passed to filter the
results.
Bug 14722 has broken this behavior.

Test plan:
Export records and specify a list of records to filter the results.
Prior to this patch, the record with the id 1 was exported.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 24e502e4a9151cda71bac2e58ddd0f6a02c4ec2e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15736: Update DB rev (3.22.04.001)
Julian Maurice [Mon, 7 Mar 2016 07:56:39 +0000 (08:56 +0100)]
Bug 15736: Update DB rev (3.22.04.001)

8 years agoBug 15736 [QA Followup] - Make add more details to the syspref description
Kyle M Hall [Sun, 14 Feb 2016 14:12:50 +0000 (14:12 +0000)]
Bug 15736 [QA Followup] - Make add more details to the syspref description

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit f92ef6207bc7346825f097f61e696b4b3685a737)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 15736: Add ShowAllCheckins pref to control the display of checked-in item list...
Jonathan Druart [Fri, 12 Feb 2016 09:07:09 +0000 (09:07 +0000)]
Bug 15736: Add ShowAllCheckins pref to control the display of checked-in item list on checking

Bug 14821 removed the items which were not checked out, but some
libraries considered it as a bug.
So let's add a new pref to control this behavior.

Test plan:
0/ Execute the updatedb entry and set ShowAllCheckins to "Do not show"
(default)
1/ Check an item in.
If the item was not checked out, it won't be listed
2/ Turn the pref to "Show"
3/ Check an item in
If the item was not checked out, it should be listed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit ce6c3bb88b426b0d0b945b9e71c695017dcb0fed)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoAdd missing languages in 3.22.4 release notes
Julian Maurice [Sun, 28 Feb 2016 08:53:32 +0000 (09:53 +0100)]
Add missing languages in 3.22.4 release notes

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>