]> git.koha-community.org Git - koha.git/log
koha.git
7 years agoBug 18703 - Followup, fix typo "statment"
Josef Moravec [Tue, 6 Jun 2017 08:09:19 +0000 (08:09 +0000)]
Bug 18703 - Followup, fix typo "statment"

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 4dd9236c6ebdfff33abcf97b6ea254ed1e63ffbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18703 - Translatability: Resolve some remaining %%] problems for staff client...
Marc Véron [Tue, 30 May 2017 18:44:30 +0000 (20:44 +0200)]
Bug 18703 - Translatability: Resolve some remaining %%] problems for staff client in 6 Files

There are some more files that expose parts of tt diretives to translations, mostly due to
line breaks inside directives.

Files covered with this Bug:

koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc
 koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt
koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt

To test:
- Review code, verify that line breaks are removed
- Run QA tools
- Bonus test: Create a "language" aa-AA and verify that no fragments
  containign %%] are picked for the 6 files

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 9fb5f8519f2937aa7db6b53d6501f09ada11db4f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18699: Get rid of %%] in translation for edi_accounts.tt
Marc Véron [Tue, 30 May 2017 14:08:32 +0000 (16:08 +0200)]
Bug 18699: Get rid of %%] in translation for edi_accounts.tt

Translation for edi_accounts.tt exposes:
[%% transport_types = [ 'FTP', 'SFTP', 'FILE' ] %%]

Translators should not be confronted with such code internals.

To test:
- Review code change (it removes line breaks)
- Bonus test: Create a new translatin for "language" aa-AA and
  verify that the line no longer appears in aa-AA-staff-prog.po

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 3b64ebe2346de50d2fa3745d0febb935b5cc8b75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18804: Add additional information to execute successfuly selenium tests
Jonathan Druart [Fri, 16 Jun 2017 20:00:23 +0000 (17:00 -0300)]
Bug 18804: Add additional information to execute successfuly selenium tests

(cherry picked from commit 0f105285910d6a14b44d7cd789475a144552a627)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18804: (bug 13501 follow-up) Fix add item form (select2)
Jonathan Druart [Wed, 14 Jun 2017 16:08:43 +0000 (13:08 -0300)]
Bug 18804: (bug 13501 follow-up) Fix add item form (select2)

Hard to say here, select2 adds so many elements that we need to ignore.
Here we just assume that input text with an id starting with
tag_952_subfield must be filled

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 8035a467f0b5d8441d4164bc183286d4f2593438)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18804: (bugs 16400,11088 follow-up) Update the "save category" elt selector
Jonathan Druart [Wed, 14 Jun 2017 16:08:20 +0000 (13:08 -0300)]
Bug 18804: (bugs 16400,11088 follow-up) Update the "save category" elt selector

With bug 11088 and bug 16400 the submit node switched from:
  <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
to:
  <button type="submit" name="save" onclick="return check_form_borrowers">
then finally to:
  <button class="btn btn-small" id="saverecord" type="submit" name="save" onclick="return check_form_borrowers();">

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 08ab41aa9825e48f6321a90bf0bef09b572d4000)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18804: (bug 16286 follow-up) Update the "save category" elt selector
Jonathan Druart [Wed, 14 Jun 2017 16:07:41 +0000 (13:07 -0300)]
Bug 18804: (bug 16286 follow-up) Update the "save category" elt selector

Bug 16286 replaced the submit node:
  <input type="button" value="Save" onclick="Check(this.form);" />
with
  <input type="submit" value="Save" />

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit a88f540ec1a0f7e1f876f3811d0e44cb3ff3a612)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18804: Skip selenium tests if Selenium::Remote::Driver is not installed
Jonathan Druart [Tue, 13 Jun 2017 20:43:39 +0000 (17:43 -0300)]
Bug 18804: Skip selenium tests if Selenium::Remote::Driver is not installed

We do not want these tests to fail if the module is not installed.
This module is not in the dependencies of Koha and it is good as it.
A developper who wants to use it will know what to do.
It is part of RM duties to make sure these tests pass

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 943a3a5c3ab4df6337607e1e237ff4f059d23da4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18630: Translatability (Clubs): 'Cancel' is ambiguous and leads to mistakes
Marc Véron [Thu, 18 May 2017 18:02:33 +0000 (20:02 +0200)]
Bug 18630: Translatability (Clubs): 'Cancel' is ambiguous and leads to mistakes

The button to cancel a club enrollement is labelled with 'Cancel'. That is ambiguous and translates e.g. in German to 'Abbrechen' which can lead to
mistakes.

To test:
- Apply patch
- Enroll a patron to a club
- Enable public enrollment in OPAC
- Verify that the button to cancel enrollment in both OPAC and staff client
  reads 'Cancel enrollement' (instead of 'Cancel' without patch)
  (The button appears on the patron's detail pages in OPAC and staff client)

Amended for comment #4 / mv

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 628d8391d29a59f7d6a0ecfb52081684cee81403)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 11235: Names for reports and dictionary are cut off when quotes are used
Marc Véron [Sun, 4 Jun 2017 17:55:08 +0000 (19:55 +0200)]
Bug 11235: Names for reports and dictionary are cut off when quotes are used

To reproduce for saved reports:

- Go to Home > Reports > Guided reports wizard
- Create a report with double quotes in it's name, e.g. 'My "double quoted" report'
- Go to "Saved reports", locate in the list the new report (name is correct here,
  is correct in database as well)
- From the selection button at the right choose "Edit"
- Result: Content of edit field for the report name is truncated (displays only: 'My')

To reproduce for Reports dictionary:

- Go to Home > Reports > Guided reports wizard
- Create a new definition, give it the name 'The "double quoted" definition' and enter
  a text with double quotes for "Description"
- Save
- Verify that in the list of definitions both name and descriptions are truncated
  (in database as well)

To test:
- Apply patch
- Verify that issues described above can no longer be reproduced

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f4c965781d82e9537015b695cc15677cd06d72cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 13452: Fix for plack
Julian Maurice [Wed, 12 Oct 2016 10:38:16 +0000 (12:38 +0200)]
Bug 13452: Fix for plack

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a44f202fdb9c933e0b5ac88656e2c8f74e498023)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 13452: Fix obvious issues in issues_avg_stats.pl
Julian Maurice [Fri, 2 Oct 2015 09:31:10 +0000 (11:31 +0200)]
Bug 13452: Fix obvious issues in issues_avg_stats.pl

- Remove joins with issuingrules which are not needed
- Fix the SQL query so that $weight is now the value of COUNT(*) instead
  of a timestamp
- QA fix: '$column eq $itype' instead of '$column =~ $itype' (same for
  $line)

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 25d28e7c8100c1993f8794e39ed135781de04a47)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 13452: 'Average loan time' report to obey item-level_itypes preference
Katrin Fischer [Mon, 8 Jun 2015 23:04:07 +0000 (01:04 +0200)]
Bug 13452: 'Average loan time' report to obey item-level_itypes preference

Fixes the 'Average loan time' report so that the system
preference setting item-level_itypes is taken into account.

Before the patch, the report was always using the biblio
level itemtype. With the patch, it will depend on the pref
setting.

To test:
- Run various reports, compare results with both
  possible pref settings
- Try limiting your search in various ways, especially
  on a specific itemtype
- Make sure you switch checkboxes in testing,
  using itemtype as the row or as the column

Notes:
- Filtering on a specific itemtype on master was not working
  if the itemtype was chosen as column. The patch should fix that.
- Fixes headings and breadcrumbs so that the name of the report
  is the same as on the reports start page

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d0bf036c1828bbbd37a022f8449e217e8e269475)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoIncrement version for 17.05.01 release v17.05.01
Fridolin Somers [Fri, 23 Jun 2017 07:53:03 +0000 (09:53 +0200)]
Increment version for 17.05.01 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoMerge remote-tracking branch 'translate/17.05.01-translate-20170623' into 17.05.x
Fridolin Somers [Fri, 23 Jun 2017 08:04:55 +0000 (10:04 +0200)]
Merge remote-tracking branch 'translate/17.05.01-translate-20170623' into 17.05.x

7 years agoTranslation updates for Koha 17.05.01
root [Fri, 23 Jun 2017 07:58:21 +0000 (04:58 -0300)]
Translation updates for Koha 17.05.01

7 years agoUpdate release notes for 17.05.01 release
Fridolin Somers [Fri, 23 Jun 2017 07:47:17 +0000 (09:47 +0200)]
Update release notes for 17.05.01 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: Do no LOCK/UNLOCK the table
Jonathan Druart [Wed, 21 Jun 2017 17:14:09 +0000 (14:14 -0300)]
Bug 18651: Do no LOCK/UNLOCK the table

We cannot LOCK the old_issues table here, other tables are accessed and DBIx::Class rename it with "me":
DBD::mysql::st execute failed: Table 'me' was not locked with LOCK
TABLES [for Statement "SELECT `me`.`issue_id`, `me`.`borrowernumber`,
`me`.`itemnumber`, `me`.`date_due`, `me`.`branchcode`,
`me`.`returndate`, `me`.`lastreneweddate`, `me`.`renewals`,
`me`.`auto_renew`, `me`.`auto_renew_error`, `me`.`timestamp`,
`me`.`issuedate`, `me`.`onsite_checkout`, `me`.`note`, `me`.`notedate`
FROM `old_issues` `me` WHERE ( `me`.`issue_id` = ? )" with ParamValues:
0='2'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.

Consequence: We could have a checkin refused if there is a race, but
this is the simplest and safest way to fix it.

(cherry picked from commit 905572910b3af03d86fdbd3e52c72614f41c978b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: Fix tests if no circ rule exist
Jonathan Druart [Wed, 21 Jun 2017 14:05:59 +0000 (11:05 -0300)]
Bug 18651: Fix tests if no circ rule exist

The following test is failing on Jenkins:
 # Subtest: Handle ids duplication
    1..4
    ok 1 - No account lines should exist on old issue_id
    not ok 2 - Two account lines should exist on new issue_id
    ok 3 - AddReturn should return the issue with the new issue_id
    ok 4 - If an item is checked-in, it should be moved to old_issues even if the issue_id already existed in the table
not ok 4 - Handle ids duplication

When no circ rule exist

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 66f435149a8f2e116070ed28c34bdd5cd627a30f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: [QA Follow-up] Fix the MAX(issue_id) calculation
Marcel de Rooy [Tue, 20 Jun 2017 13:03:35 +0000 (15:03 +0200)]
Bug 18651: [QA Follow-up] Fix the MAX(issue_id) calculation

Found this by inserting the same issue_id in old_issues before checkin:
The call to ->search( )->get_column is in scalar context and will
return the number of results, i.e. always 1.
If you have an issue_id 2 in old_issues, it will crash:
    DBIx::Class::Storage::DBI::_dbh_execute(): Duplicate entry '2' for key 'PRIMARY'

The fix is fairly simple: Put get_column in list context and pick the first
array entry.
NOTE: Using DBIx's get_column()->max here might look simpler here.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit ee7969d3461e6ce08b4fbfd982c90f263f19f693)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: [QA Follow-up] Remove unused variable
Marcel de Rooy [Tue, 20 Jun 2017 12:19:12 +0000 (14:19 +0200)]
Bug 18651: [QA Follow-up] Remove unused variable

Variable $original_issue_id is not used. The id is retrieved later from
$issue when updating accountlines.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 4906d58f7c507613c9ad20c4524afd278fca467c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: Limit the life span of the LOCK
Jonathan Druart [Thu, 15 Jun 2017 23:25:18 +0000 (20:25 -0300)]
Bug 18651: Limit the life span of the LOCK

We only need the table to be locked for the fetch, increment, store sequence

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 26957fea0d438046aa5d08c117099f5d2d57406d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: Use a READ and WRITE LOCK
Jonathan Druart [Wed, 24 May 2017 15:24:53 +0000 (12:24 -0300)]
Bug 18651: Use a READ and WRITE LOCK

For more info, see:
  commit be156d9ad9e5bcfadab34d44f90e04fd61e256ad
    Bug 15854: Use a READ and WRITE LOCK on message_queue
and
  commit b40456f7dd4b8a988f9c6a5718452936101cb8ff
    Bug 18364: Do not LOCK/UNLOCK tables from tests

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 59fcad685e8143bfaeb7a148f248cc7b7f80b742)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: Copy the row before modify the id
Jonathan Druart [Tue, 23 May 2017 13:27:31 +0000 (10:27 -0300)]
Bug 18651: Copy the row before modify the id

If the "max(issue_id) from old_issue + 1" already exists in issues, the
move fails.

For instance we have
1, 2, 3, 4 in issues

checkin 4
1, 2, 3 in issues (AI=5)
4 in old_issues

Restart mysql => AI is reset to MAX(issue_id) => 4

checkout a new one
1, 2, 3, 4 in issues (AI=5)
4 in old_issues

checkin 4 (will get id 5 in old_issues)
1, 2, 3 in issues (AI=5)
4, 5 in old_issues

=> This works with and without this patch

Now we have
1, 2, 3 in issues (AI=5)
4, 5 in old_issues

Restart mysql => AI is reset to MAX(issue_id) => 4

checkout 2 new ones
1, 2, 3, 4, 5 in issues (AI=7)
4, 5 in old_issues

checkin 4 (4 becomes 6 in old_issues)
1, 2, 3, 5 in issues (AI=6)
4, 5, 6 in old_issues

=> This did not work without with patch
The update of the issue_id was made before the move (so in the issues
table), the PK did not allow it

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 79cb157b3b4bee9f1c079937bd13019c7b7f650f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: Update accountlines.issue_id is the issue_id has been changed during the...
Jonathan Druart [Mon, 22 May 2017 17:30:48 +0000 (14:30 -0300)]
Bug 18651: Update accountlines.issue_id is the issue_id has been changed during the move

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit be3d39c8b1e2671790ee5cb5cc7295eec3774a35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: Do not charge if the checkin failed
Jonathan Druart [Mon, 22 May 2017 17:26:25 +0000 (14:26 -0300)]
Bug 18651: Do not charge if the checkin failed

2. If the move fails for whatever reason (see
https://lists.katipo.co.nz/pipermail/koha/2017-May/048045.html for an
example), fines can be charged. It should not

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit acb7a717482c2a47f7da6a0d883784415bf3b8d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18651: Update issue_id in AddReturn
Jonathan Druart [Mon, 22 May 2017 15:02:20 +0000 (12:02 -0300)]
Bug 18651: Update issue_id in AddReturn

1. AddReturn returns a $issue hashref with the old issue_id value
=> At first glance it does not affect anything, but would be good to fix
it for future uses.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit c3c9d61570b61ec49d508261f0500463a73925d6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18835: Fix SQL syntax error in overdue_notices.pl
Jonathan Druart [Wed, 21 Jun 2017 13:59:57 +0000 (10:59 -0300)]
Bug 18835: Fix SQL syntax error in overdue_notices.pl

Caused by bug 17952, an extra / is in the middle of the query.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 939eadc5d987429db04887623c3f260ee02b86d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 17710 - C4::Matcher::get_matches and C4::ImportBatch::GetBestRecordMatch should...
David Cook [Wed, 11 Jan 2017 04:36:05 +0000 (15:36 +1100)]
Bug 17710 - C4::Matcher::get_matches and C4::ImportBatch::GetBestRecordMatch should use same logic

C4::ImportBatch::GetBestRecordMatch uses SQL to sort by score descending
then candidate_match_id descending. With C4::Matcher::get_matches, I
implement the same sort but use Perl code to do it, since we're sorting
search results.

It's a simple change, but it's in a big block of code, so I don't have
unit tests.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6906b848a78ad4c7d52c1e7c7ce195f08cc6d2a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18732: Noisy t/SMS.t triggered by koha_conf.xml without sms_send_config
Mark Tompsett [Mon, 5 Jun 2017 22:18:07 +0000 (18:18 -0400)]
Bug 18732: Noisy t/SMS.t triggered by koha_conf.xml without sms_send_config

Upgraded systems may be lacking sms_send_config which makes t/SMS.t noisy.
This silently bypasses the problem.

Remove sms_send_config from your koha-conf.xml file
prove t/SMS.t
-- it will be noisy, but pass.
apply patch
prove t/SMS.t
-- noise gone.
run koha qa test tools.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works correctly as indicated by the testing plan.
No "uninitialized" noise after patch is applied.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Slightly amended: turned the iif around.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f97addef42826c0007f91cace1f365de358a8b60)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18763: Fix swagger/definitions.t
Jonathan Druart [Thu, 8 Jun 2017 19:28:41 +0000 (16:28 -0300)]
Bug 18763: Fix swagger/definitions.t

Test plan:
  prove api/v1/swagger/definitions/patron.json
must return green

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
swagger/definitions.t test returns green

(cherry picked from commit 75a62e93922834dd511ee7eb1fbdd31f2006fe1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18685: (bug 18551 follow-up) Fix patron toolbar
Jonathan Druart [Mon, 12 Jun 2017 14:38:59 +0000 (11:38 -0300)]
Bug 18685: (bug 18551 follow-up) Fix patron toolbar

Bug 18551 moves the way the filters are displayed and so the position of
the patron toolbar must be recalculated.

Test plan:
Edit patron's detail
open the filters, scrolldown
close the filters, scrolldown
=> The toolbar must be correctly placed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
(cherry picked from commit 6ae6d4bcb5238b1ffc0a22cc1d83ac05ba982b92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18762: Remove some warnings from Search.t
Jonathan Druart [Thu, 8 Jun 2017 19:11:45 +0000 (16:11 -0300)]
Bug 18762: Remove some warnings from Search.t

Note that some are caused by CGI, see bug 18632

Test plan:
Confirm there are less warnings with this patch applied

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
(cherry picked from commit 6d78d7a6108afc75546f933d601b04fde8b76c9b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18762: Remove a warning from History.t
Jonathan Druart [Thu, 8 Jun 2017 18:36:40 +0000 (15:36 -0300)]
Bug 18762: Remove a warning from History.t

Test plan:
  prove t/db_dependent/Search/History.t
should not display any warnings

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
(cherry picked from commit 15f9e830ece26b5eead340e67b8d05b4bd07e930)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18762: Remove warnings from xt/author/valid-templates.t
Jonathan Druart [Thu, 8 Jun 2017 18:35:02 +0000 (15:35 -0300)]
Bug 18762: Remove warnings from xt/author/valid-templates.t

Test plan:
Read the changes and make sure they make sense

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
(cherry picked from commit ab29b5efdc763269399c06aa62ac0a36a93152f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18761: Fix tests for AutomaticItemModificationByAge.t - clear cache
Jonathan Druart [Thu, 8 Jun 2017 17:17:53 +0000 (14:17 -0300)]
Bug 18761: Fix tests for AutomaticItemModificationByAge.t - clear cache

The mapping structure is cached and may be wrong if already populated.
We need to clear the cache when a framework is modified

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works as described in test plan and passes QA tools.

(cherry picked from commit c3a115916146e7c1e98c58c0b0a429e9841af461)

7 years agoBug 18752 - Automatic item modifications by age should allow 'blank' values
Owen Leonard [Thu, 8 Jun 2017 15:19:22 +0000 (15:19 +0000)]
Bug 18752 - Automatic item modifications by age should allow 'blank' values

This patch modifies the automatic item modification by age template to
correct errors in form validation:

- Age in days should not be required
- A value should not be required in substitutions.

To test, apply the patch and clear your browser cache if necessary.

- Go to Tools -> Automatic item modification by age.
- Confirm that when editing or creating a rule the only required field
  is the substitutions field name.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1bc45a470e55bcbb5e4031c001749a1ec9b35160)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18601: OAI/Sets.t mangles data due to truncate in ModOAISetsBiblios
Marcel de Rooy [Mon, 15 May 2017 07:58:04 +0000 (09:58 +0200)]
Bug 18601: OAI/Sets.t mangles data due to truncate in ModOAISetsBiblios

This patch replaces the TRUNCATE statement in ModOAISetsBiblios by a
DELETE statement. A truncate will cause an implicit commit and will
therefore commit the transaction started in the test script.

Also simplifying the module load in the test script.

Test plan:
Do not apply this patch and observe that biblio records are added to your
database by running t/db_dependent/OAI/Sets.t.
Apply this patch, run the test again and verify that it does no longer
add records to your biblio table.

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>
(cherry picked from commit e0444e8600efbe06016ff857f23ea85893a93041)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18749 - xt/sample_notices.t fails
Lee Jamison [Wed, 7 Jun 2017 11:34:29 +0000 (11:34 +0000)]
Bug 18749 - xt/sample_notices.t fails

Bug Description:
When performing a unit test on xt/sample_notices.t with the command
'prove xt/sample_notices.t' 11 tests fail with the error message
"No sample notice to delete".

Cause of bug:
The failures are caused by an incorrect file path on Line 25 of
xt/sample_notices.t.

Patch Description:
This patch corrects the failures by changing $base_notices_file from
"en/default/sample_notices.sql" to "en/mandatory/sample_notices.sql"

Test Plan:
1) Drop into koha-shell and run the command 'prove xt/sample_notices.'
2) 11 unit tests fail.
3) Apply the patch.
4) Re-run 'prove xt/sample_notices.t'
5) All of the tests pass now.
6) Quit out of koha-shell

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 323cc1501fc91d67e8ecaa0a2cdf272f642d8e46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18794: Fix test ListMetadataFormats in OAI/Server.t
Jonathan Druart [Mon, 12 Jun 2017 21:56:45 +0000 (18:56 -0300)]
Bug 18794: Fix test ListMetadataFormats in OAI/Server.t

This test may fail on slow servers, it compares the response date with
'now', but both can differ a bit.

https://jenkins.koha-community.org/job/Koha_Master_D8/198/consoleFull

   Failed test 'ListMetadataFormats'
   at t/db_dependent/OAI/Server.t line 150.
     Structures begin differing at:
          $got->{responseDate} = '2017-06-12T14:31:51Z'
     $expected->{responseDate} = '2017-06-12T14:31:50Z'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1b3f0c798b7770ecd7211be5998790e4a9f3999a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18584: Fix trailing spaces in C4/Accounts.pm
Lee Jamison [Sat, 10 Jun 2017 09:26:51 +0000 (09:26 +0000)]
Bug 18584: Fix trailing spaces in C4/Accounts.pm

Removed trailing spaces at line 182 of C4::Accounts.

Test plan:
1. Edit C4/Accounts.pm and verify trailing spaces
2. Apply patch
3. Verify that trailing spaces in C4/Accounts have been removed

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a80ed84d070f81065b1fb2fa14f5ced3c25d6431)

7 years agoBug 18694: Translatability: Get rid of exposing [%% FOREACH in csv/cash_register_stats.tt
Marc Véron [Tue, 30 May 2017 06:41:53 +0000 (08:41 +0200)]
Bug 18694: Translatability: Get rid of exposing [%% FOREACH in csv/cash_register_stats.tt

Code exposed is:
%s %s %s [%%- FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END %%] %s TOTAL [%%- FOREACH field IN total; field; sep IF !loop.last; END %%]

Similar for: csv/orders_by_budget.tt

To test:
- Apply patch
- In staff client, verify that Cash register statistics work as before
  (Home > Reports > Cash register statistics)
- Verify the same for Home > Reports > Orders by fund (triggers orders_by_budget.tt)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines mentioned above do
  no longer appear in aa-AA-staff-prog.po )
- Run QA tools (newest version with test for newlines in tt directives)

Rebased on top of Bug 18734 2017-12-06 / mv

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ec478e18f352d340c7a1ec4416121928229c2907)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18734 - Internal server error in cash_register_stats.pl when exporting to file
Nick Clemens [Fri, 9 Jun 2017 14:17:25 +0000 (10:17 -0400)]
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file

To test:
Output cash reigster stats report to file
Internal server error
Apply patch
Export to file
File is generated and correctly formed

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 855ff0fb9a1cf7755a0805910c367150b37b5f2a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18656 - Require confirmation of deletion of files from patron record
Owen Leonard [Wed, 24 May 2017 13:46:50 +0000 (13:46 +0000)]
Bug 18656 - Require confirmation of deletion of files from patron record

This patch adds a JavaScript confirm to the deletion of files. It also
styles the file deletion link as a Bootstrap button.

To test, apply the patch and open the "Files" page for a patron who has
files attached.

- Verify that clicking any "delete" link prompts for a confirmation.
- Verify that confirming the dialog triggers the deletion of the correct
  file.
- Verify that canceling the confirmation dialog aborts the deletion.
- Confirm that the "Delete" button looks correct.

Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Revision for QA: Replaced '.click(function' with '.on("click",function'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a38ffe2d48c35029ef80ea0a4294e36b408cd1a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18773: Fix failing history.t test
Mark Tompsett [Fri, 9 Jun 2017 22:52:17 +0000 (18:52 -0400)]
Bug 18773: Fix failing history.t test

changed get() to get_ok() and increased test count to match.
Now the master build will only fail on search_utf8.t

TEST PLAN
---------
assuming KOHA_CONF is set.
$ export KOHA_INTRANET_URL=...
$ export KOHA_OPAC_URL=...
$ prove -v t/db_dependent/www/history.t

run koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works correctly using text plan provided and passes QA tools.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 25bbc181c9ceacd84582368f0006d4025250ea1f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18411: Fix failing search_utf8.t tests
Mark Tompsett [Fri, 9 Jun 2017 23:23:49 +0000 (19:23 -0400)]
Bug 18411: Fix failing search_utf8.t tests

TEST PLAN
---------
export KOHA_INTRANET_URL=...
prove -v t/db_dependent/www/search_utf8.t

something like seen before failure:
t/db_dependent/www/search_utf8.t .. 9/66 Error GETing http://koha_16_11:8080/cgi-bin/koha/tools/background-job-progress.pl?jobID=741d649f9d4472fe75f30761ba2488c0: Bad Request at t/db_dependent/www/search_utf8.t line 170.

apply this patch
prove -v t/db_dependent/www/search_utf8.t

Now it is the marc staging that is failing.
And that is failing in master for me.
So, I don't think it is the test that is a problem at this point,
but the actual staged marc records process.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
I'm not sure why you had problems. All 66 tests passed
after patch application and the patch also passes QA Tools.
I tested this patch on a brand new kohadevbox without issue.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bd14d2db9c6f6ac34a1dc0ea4ab741c05c22e5d3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18741: Fix loading of SQL files in web installer
Julian Maurice [Wed, 7 Jun 2017 09:29:46 +0000 (11:29 +0200)]
Bug 18741: Fix loading of SQL files in web installer

Test plan:
1. Start a normal install using the web installer
2. When asked to select data to load, verify that
   'message_transport_types' is checked, and check some optional data
   files
3. Continue the install to the end
4. Verify that message_transport_types is not empty, and that the
   optional data you checked is there

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8d2270254187b7d876d466860a76fd231b9549c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18706 - Remove useless Javascript
Fridolin Somers [Wed, 31 May 2017 14:10:41 +0000 (16:10 +0200)]
Bug 18706 - Remove useless Javascript

Whe checking a subfield to be deleted, the code
  $(this).val($(this).siblings("[name='subfield']").val());
is useless, the checkbox already contains the subfield code :
  <input type="checkbox" ... name="disable_input" value="[% ite.subfield %]" />

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6bb4a0405abe0d03be3915644c6a05e2e3ee1e9f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18706 - subfields to delete not disabled anymore in batch item modification
Fridolin Somers [Wed, 31 May 2017 14:02:44 +0000 (16:02 +0200)]
Bug 18706 - subfields to delete not disabled anymore in batch item modification

In Tools > Batch item modification, one can click a checkbox to delete a subfield.
This click use to disable the input to change the field value.

This comes from the patch : Bug 13501: Move "Required" and checkbox after input/select
Because input is found using JQuery next().

This patch replaces with $(this).parent().find("[name='field_value']").

Test plan :
- Go to Tools > Batch item modification
- Enter a barcode and submit
- Click on a checkbox on a non-mandatory subfield
=> Without patch the input or select is not disabled
=> With patch the input or select is disabled
- Submit
=> Check that subfield is deleted

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c9273be169ca4da47059aa152f8c6ea11137a52)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18716: Remove CGI::param warns from updatesupplier.pl
Tomas Cohen Arazi [Fri, 2 Jun 2017 02:52:07 +0000 (23:52 -0300)]
Bug 18716: Remove CGI::param warns from updatesupplier.pl

This script floods the logs with this kind of warnings.

To test:
- Run:
  $ koha-plack-err
- Edit a vendor in the acquisitions module
- Save
=> FAIL: Logs show lots of warnings that look like:
 CGI::param called in list context from package CGI::Compile::ROOT::home_vagrant_kohaclone_acqui_updatesupplier_2epl
- Apply this patch
- Run:
  $ restart_all
  $ koha-plack-err
- Edit a vendor, add/delete vendor contacts
=> SUCESS: No more warnings
- Verify editing and storing vendor contacts works as expected.
- Sign off :-D

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c35932923407e9ec088957f877e8607289b6b914)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18767: Remove useless diags from GetDailyQuote.t
Tomas Cohen Arazi [Fri, 9 Jun 2017 14:16:08 +0000 (11:16 -0300)]
Bug 18767: Remove useless diags from GetDailyQuote.t

This tests print useless debugging info.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/Koha/GetDailyQuote.t
=> FAIL: Some output telling what is doing on each step is printed.
- Apply the patch
- Run
 k$ prove t/db_dependent/Koha/GetDailyQuote.t
=> SUCCESS: No output, YAY!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 78a9f39f9a97179af3e3a38cf8cb17b3f043d88a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18727: System preferences loose part of values because of double quotes
Marc Véron [Mon, 5 Jun 2017 04:52:58 +0000 (06:52 +0200)]
Bug 18727: System preferences loose part of values because of double quotes

System preferences do not display values of text fields properly if they
contain doulbe quotes.

To recreate:
- Go to Home > Administration > System preferences , then tab Acquisitions
- Enter values to both system preferences like proposed in the example (o=5|a="bar foo" and  o=5|a="foo bar")
- Save
- Click on tab Acquisitions to reload
- Wrong result: Both preferences show a value of: o=5|a=
  (parts with double quotes are truncated)

- Edit any of the email addresses (Bug 9814):
  KohaAdminEmailAddress, NoticeBcc, ReplytoDefault, PayPalUser
- Set value to: "The Library" <thelibrary@example.com>
- Search for this email address syspref to re-display it
- Wrong result:
  Use [     ] " autocomplete="off" /> as the email address for the
  administrator of Koha.

To test:
- Apply patch
- Try to recreate issues above
- Additionally, edit other system preferences that could contain double
  quotes, e.g. LibraryName or UsageStatsLibraryName
- Set value to: Bibliothek "Zur Leseratte"

(Note: patch contains a tiny fix for a typo in acquisitions.pref)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6e7c125a56be8971ec9c9bb52373bff5004a936a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18689: calendar error with double quotes in title or description of holiday
Marc Véron [Sun, 4 Jun 2017 16:04:00 +0000 (18:04 +0200)]
Bug 18689: calendar error with double quotes in title or description of holiday

This patch fixes the calendar display with holidays having double qoutes in
title or description.

To test:
- Apply patch
- Go to Home > Tools > Calendar
- Create new holidays of each type (Day only, repeated wekly/yearly,
  range, yearly repeated range and enter double qoutes in their titles and
  descriptions
- Verify that calendar displays and works as expected
- Verify that you can edit the holidays

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f1d90f205e3dc8177c0d524b208d9d4a367cf56e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18722: Fund name is not shown in received orders fund subtotals
Josef Moravec [Mon, 5 Jun 2017 11:20:18 +0000 (11:20 +0000)]
Bug 18722: Fund name is not shown in received orders fund subtotals

Test plan:
1) Go to acquisition and receive some orders
2) Show the receive summary for invoice
--> without patch, the fund name in subtotal is not shown
--> with patch the name is shown as expected

Signed-off-by: Michael Cabus <michael@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6a2ef935ac63c67a4b31d8c3eb9bcb8d974d844e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18730: Batch Mod Edit <label> HTML validation fails
Mark Tompsett [Mon, 5 Jun 2017 16:24:07 +0000 (12:24 -0400)]
Bug 18730: Batch Mod Edit <label> HTML validation fails

[tag] [reply] [−] Description M. Tompsett 2017-06-05 16:30:21 UTC
Know the barcode of an existing item.
Home -> Tools -> Batch Item Modification
Enter the barcode
Click
View Page source
select and copy it into validator.w3.org direct input.
There will be complaints about <labels>.

Apply this patch

refresh the page.
select and copy it into validator.w3.org direct input.
There will be no complaints about <labels>.

This is intended to be a highly focused HTML bug, as the
missing form tag which will fix the <div> issues at the bottom
is corrected on bug 18710.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
(cherry picked from commit eb0a67ea10c9210dbfb42f810c280b7515b04a16)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18766: Remove itemtype-related warnings from ArticleRequests.t
Tomas Cohen Arazi [Fri, 9 Jun 2017 13:46:49 +0000 (10:46 -0300)]
Bug 18766: Remove itemtype-related warnings from ArticleRequests.t

This patch fixes a small mistake on that test file (itype vs. itemtype
in itemtypes table)

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/ArticleRequests.t
=> FAIL: itemtype-related warning displayed
- Apply the patch
- Run
 k$ prove t/db_dependent/ArticleRequests.t
=> SUCCESS: No warnings, YAY!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e426da4e009ce63c10923eaddd1ca271dca8005e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18746: Add license and remove diag
Jonathan Druart [Fri, 9 Jun 2017 13:21:33 +0000 (10:21 -0300)]
Bug 18746: Add license and remove diag

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fcec2c71b4e362ffa7e1a443cdff9ace91761b9d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18746: Text_CSV_Various parse failures
Mark Tompsett [Wed, 7 Jun 2017 22:07:13 +0000 (18:07 -0400)]
Bug 18746: Text_CSV_Various parse failures

While it might be an idea to just delete it,
this patch attempts to catch everything and make it
clear that Text::CSV::Unicode (binary) is the parser
that should be used.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Running 'prove xt/author/Text_CSV_Various.t' passes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 89d36585bb3483ac46c87224391b6867ae8468bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18641 - Translatability: Get rid of template directives in translations for ...
Marc Véron [Sat, 20 May 2017 07:18:10 +0000 (09:18 +0200)]
Bug 18641 - Translatability: Get rid of template directives in translations for *reserves.tt files

Template directives should not be exposed in translation, but lines like the following pop up in the translation tool:
Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %] All

This patch fixes it.

To test:
- Apply patch
- Verify that code changes make sense
- Verify that submit buttons of pendingreserves.tt and waitingreserves.tt
  still work and display the same string as before

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 18641: (RM-followup) for waitingreserves.tt

Code changed for waitingreserves.tt as asked for in comment #7

Bug 18641: Followup for pendingreserves.tt (less %s)

Change as of comment #13 to reduce %s

After creating a new translation for a "language" aa-AA, we have
the following in the file aa-AA-staff-prog.po

msgid ""
"(Inclusive, default is %s days ago to %s days ahead. Set other date ranges "
"as needed.)"
msgstr ""

msgid ""
"(Inclusive, default is %s days ago to today. Set other date ranges as "
"needed.)"
msgstr ""

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 78b30baf3fa975ab9eabc58733a2252b08d22f25)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18759: (follow-up) Try to fix random failure from Circulation.t
Jonathan Druart [Fri, 9 Jun 2017 13:08:37 +0000 (10:08 -0300)]
Bug 18759: (follow-up) Try to fix random failure from Circulation.t

If IndependentBranches, CanBookBeRenewed will set ITEMNOTSAMEBRANCH
or BORRNOTSAMEBRANCH flags, if the branches do not match.

(cherry picked from commit 1577460c713e3ac7e602dce81738f974e86ddf9d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18759: Try to fix random failure from Circulation.t
Jonathan Druart [Thu, 8 Jun 2017 14:54:18 +0000 (11:54 -0300)]
Bug 18759: Try to fix random failure from Circulation.t

Circulation.t is failing randomly on our CI
https://jenkins.koha-community.org/job/Koha_Master_D8/192/console

    #   Failed test at t/db_dependent/Circulation.t line 1147.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1152.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1156.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1170.
    #          got: '1'
    #     expected: '0'

    #   Failed test at t/db_dependent/Circulation.t line 1184.
    #          got: '1'
    #     expected: '0'
    # Looks like you failed 5 tests of 23.

Sometimes one of the alert or impossible flags is set.
This patch guesses that it's because of the 'restricted' value of the item that is evaluated to 1.
If it is not fixed by this patch, we will have more info next time (at least know
if alert or impossible is set).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The fix is trivial. Using random data will lead to this situations. The good thing is that
it lets us spot places in which tests need more fine-grained data.

(cherry picked from commit 9a55f5783c91b92cb8518f423ab23bd9727051ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18675: Translatability: Get rid of [%% in translation for csv-profiles.tt
Marc Véron [Fri, 26 May 2017 09:06:56 +0000 (11:06 +0200)]
Bug 18675: Translatability: Get rid of [%% in translation for csv-profiles.tt

Translation tool for file csv-profiles.tt picks following line:
%s [%% IF csv_profile.encoding == encoding OR NOT csv_profile AND encoding == 'utf8' %%]
It is is due to a line break inside a template directive. This patch removes it.

To test:
- Verify that code change makes sense
- Apply patch
- Verify that csv exports behave as before

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dd9da3e8f64ac4eb8fde5a1a58e0d692542ce2e6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18690 - Typos in Koha database description (Table "borrowers")
Marc Véron [Mon, 29 May 2017 18:13:03 +0000 (20:13 +0200)]
Bug 18690 - Typos in Koha database description (Table "borrowers")

This string patch fixes typos in kohastructure.sql as described in initial
comment.

To test:
- Carefully verify that string changes make sense

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 279126d710233f7925432ab1f8fa6ae9f947889e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18681 - (followup) Remove on more [%% in translation for about.tt
Marc Véron [Tue, 30 May 2017 07:37:02 +0000 (09:37 +0200)]
Bug 18681 - (followup) Remove on more [%% in translation for about.tt

Test plan same as in previous patch
Run QA tools in newest version (test for line breaks in tt directives)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 880c2e19c3c5f10f110fd80a44f0d111b9d05472)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18681: Translatability: Get rid of [%% in translation for about.tt
Marc Véron [Fri, 26 May 2017 17:11:59 +0000 (19:11 +0200)]
Bug 18681: Translatability: Get rid of [%% in translation for about.tt

Translation tool picks a line
%s [%% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords ||
...due to a line break inside a template directive.
This patch fixes it.

To test:
- Update QA tools
  (see https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18675#c2)
- Verify that code change makes sense
- Apply patch
- Run QA tools

Followed test plan and everything was as intended
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1c8c84f4be8665d95ededf5174c406e1a63d6529)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18695: Translatability: Get rid of [%% INCLUDE in translation for circulation.tt
Marc Véron [Tue, 30 May 2017 08:47:48 +0000 (10:47 +0200)]
Bug 18695: Translatability: Get rid of [%% INCLUDE in translation for circulation.tt

The file circ/circulation.tt exposes the following line to translation:
%s %s [%% INCLUDE 'blocked-fines.inc' fines = chargesamount %%] %s %s
Translators should not be confronted with code internals.

This patch fixes it by removing a line break.

To test:
- Verify that code change makes sense
- Run QA tools in newest version (check for line breaks in tt directives)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that line mentioned above do
  no longer appear in aa-AA-staff-prog.po )

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c5726913774ed25c4125e65a12054a00c2f7dd76)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18693: Translatability: Get rid of exposing a [%% FOREACH loop in translation...
Marc Véron [Tue, 30 May 2017 05:13:31 +0000 (07:13 +0200)]
Bug 18693: Translatability: Get rid of exposing a [%% FOREACH loop in translation for branch-selector.inc

The file branch-selector.inc exposes the following line to translation
(due to newlines insied a tt directive):
%s %s [%% FOREACH branch IN branches; IF branch.selected; selectall = 0; END; END %%]

Additionally, export.tt exposes the following line to translation:
[%% INCLUDE 'branch-selector.inc' branches = libraries %%]

To test:
- Apply patch
- In Staff client, go to Home > Tools > Export data
- Verify that library selection behaves as before
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines mentioned above do
  no longer appear in aa-AA-staff-prog.po
- Run QA tools (newest version with test for newlines in tt directives)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0ee3249438b85cb47aa9ff623bac4f405df7161f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18644: Translatability: Get rid of pure template directives in translation for...
Marc Véron [Tue, 30 May 2017 09:23:20 +0000 (11:23 +0200)]
Bug 18644: Translatability: Get rid of pure template directives in translation for memberentrygen.tt

Translation for memberentrygen.tt exposes a lot of template directives
like the following:
[% UNLESS opduplicate %][% othernames | html %][% END %]
Translators should not be confronted with such code internals.

To test:
- Review code changes
- Verify that creating / editing patrons works as before
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines like mentioned above
  do no longer appear in aa-AA-staff-prog.po

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5a30dea05b158fd6a77b0495ee047310865072eb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18682 - Translatability: Get rid of [%% in translation for 2 files av-build-dropb...
Marc Véron [Tue, 30 May 2017 12:27:56 +0000 (14:27 +0200)]
Bug 18682 - Translatability: Get rid of [%% in translation for 2 files av-build-dropbox.inc

Two files av-build-dropbox.inc has linebreaks inside template directives,
 exposing internals (comments and tt code) to translations as mentioned
in initial comment.
Translators should not be confronted with such interal code.

This patch fixes it.

To test
- Verify, that code changes make sense and have no more line breaks insied
  tt directives.
- Run QA tools in newest version (checking for line breaks inside tt
  directives)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
  from folder misc/translator, verify that lines mentioned above do
  no longer appear in aa-AA-staff-prog.po and in aa-AA-opac-bootstrap.po

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 953504a0769a38a60f379a2e9c72bf7b71814fd0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18701: Translatability: Get rid of exposed tt directives in matching-rules.tt
Marc Véron [Tue, 30 May 2017 15:50:57 +0000 (17:50 +0200)]
Bug 18701: Translatability: Get rid of exposed tt directives in matching-rules.tt

Translation for file matching-rules.tt exposes a lot of template directives.

Translators should not be confronted with internal code like the following:

[%% PROCESS norms_select selected_norm=\"none\" id=\"mc_1_src_c_1_n_1_norm\" "name=\"mc_1_src_c_1_n_1_norm\" %%]

To test:
- Apply patch
- Verify that code changes make sense (removes line breaks in directives)
- Run QA tools in newset version (tests for line breaks in tt)
- Bonus test: create a new translation e.g. fpr language 'aa-AA', verify
  that such lines no longer appear in po/aa-AA-staff-prog.po
  (for matching-rules.tt)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1a023a670c1bf0faffe51faefc42fdd6407c2320)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18702: Translatability: Get rid of exposed if statement in tt for translated...
Marc Véron [Tue, 30 May 2017 16:50:16 +0000 (18:50 +0200)]
Bug 18702: Translatability: Get rid of exposed if statement in tt for translated onboardingstep2.tt

The file onboardingstep2.tt exposes the following to translations:

"[%% IF (categories && categories.count > 1 ) # This if statement checks if "
"the categories variable handed to this template # by onboarding.pl has data "
"in it. If the categories variable does have data # in it this means that the "
"user has previously imported sample patron category # data and so we do not "
"need to show them the create patron category screen 1, #instead we can "
"display a screen with ubtton redirecting the user to step 3 %%] "

Translators should not be confronted with such internals. This patch removes it

To test:
- Verify that code change makes sense
- Run QA tools
- Bonus test: Create a new "language" aa-AA and verify that the lines above
  are no longer exposed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 17fd5a4ffb6fa92e1ce522ac8f8cf5fdeb343868)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18648: Restore hyphen
Jonathan Druart [Fri, 9 Jun 2017 16:24:07 +0000 (13:24 -0300)]
Bug 18648: Restore hyphen

(cherry picked from commit 6999dbafbd2d6708d4c3a8fae7e83855902ebdbb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18648: Fix syntax 'unexpected end of input'
Jonathan Druart [Tue, 6 Jun 2017 14:06:29 +0000 (11:06 -0300)]
Bug 18648: Fix syntax 'unexpected end of input'

(cherry picked from commit 023b0890a25d1420a0f4ecb28d54c08a06e6479e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18648: Translatability: Get rid of tt directives in translation for macles.tt
Marc Véron [Tue, 30 May 2017 19:10:32 +0000 (21:10 +0200)]
Bug 18648: Translatability: Get rid of tt directives in translation for macles.tt

koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/macles.tt contains
template directives inside a div tag:
<span title="[% FOREACH lib IN cell.libs %][% lib.lib |html %] - [% END %]">
This is exposed in translation tool.

To test:
- Carefully examine code changes
- Apply patch, verify that the directive is no longer exposed (picked for
  po files), e.g. by creating a new "language" aa-AA and examing aa-AA-staff-prog.po
- If you know where / how this macles is used, verify that it behaves as before

(Note: New patch, needs new sign off)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 00d3a883b5e4d2ff1f5badef3c5dc33d7913bebe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoRevert "Bug 18295: C4::Items - Remove get_itemnumbers_of"
Fridolin Somers [Mon, 12 Jun 2017 07:17:26 +0000 (09:17 +0200)]
Revert "Bug 18295: C4::Items - Remove get_itemnumbers_of"

This reverts commit 42a73053001dc033ea50bd386496b28021906148.

7 years agoBug 13747: Fix problems with frequency descriptions containing quotes
Marc Véron [Sun, 4 Jun 2017 20:09:14 +0000 (22:09 +0200)]
Bug 13747: Fix problems with frequency descriptions containing quotes

If a serial frequency description contains quotes or is surrounded by
quotes, the description is empty ("TEST" > empty) or shown without the
quotes part (TEST "sth" > TEST) on editing the frequency.

To verify:
- Create a new frequency with description: "Test"
- Modify frequency
- Verify the description field is empty

To test:
- Apply patch
- Try to recreate, verify that the description field is
  correctly filled when editing
- Test also with a name like: 'A "souble quoted" name'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 16307c40343cdb0ed4ff69c9c001fc4d9e1a459f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18653: Possible privacy breach with OPAC password recovery
Marc Véron [Tue, 23 May 2017 05:08:41 +0000 (07:08 +0200)]
Bug 18653: Possible privacy breach with OPAC password recovery

OPAC password recovery allows to find out which email address belongs to an account. An attacker could systematically guess login names. If they hit an existing one, OPAC displays a message like:
An email has been sent to "xxx@yyy.zz".

Having a combination of login name and email, attackers could use the information e.g. for phishing or other personalized actions.

To reproduce:
- Enable OPAC password recovery (syspref OpacResetPassword)
- 'Guess' a login name e.g. by using a common pattern like ptester for Peter Tester
- If such account exists, you get to know the related email address

This patch removes the email address from the success message. Additionaly, it changes
wording to address Bug 18570 ('will be sent' instead of 'has been sent')

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Simplified the wording. "Will be sent shortly" is used elsewhere too.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit eddf975cf0244c731f987c64af5126090f73f9f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 17944: QA follow-up
Jonathan Druart [Tue, 9 May 2017 18:56:32 +0000 (15:56 -0300)]
Bug 17944: QA follow-up

- Remove an unused use statement
- Fix pod
- Use snake_case
- Fix test "An itemtype cannot be deleted if and only if there is
biblioitem linked with it"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6d76f61a6b0b6b429246c5a9398ec55f97d98027)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 17944 - Add Koha::ItemType->can_be_deleted and use it from admin/itemtypes.pl
Alex Buckley [Sun, 22 Jan 2017 01:52:50 +0000 (01:52 +0000)]
Bug 17944 - Add Koha::ItemType->can_be_deleted and use it from admin/itemtypes.pl

Removed the sql code from Itemtypes.pm and replaced  it with DBIx
database query in the itemtypes.pl administrative script

Test plan:
1. In the staff interface, stage and manage MARC records for import

2. Try to delete an itemtype. If there are items of that itemtype in the
   database then a message telling you the number of items of that
   itemtype there are will be displayed.

3. Record that number

4. View the admin/itemtpes.pl script and confirm that there is sql code
   written in this file.

5. Apply this patch

6. View the admin/itemtypes.pl script and observe that there is no sql
   in this file. There is however DBIx code, for example
   $schema->resultset('Item')->search({ 'itype' => $itemtype_code} );
   which is searching for items with the itype value matching
   $itemtype_code value.

7. In the staff interface try to delete the same itemtype

8. Record the number of items there are with that itemtype in the
   resulting message

9. The numbers recorded in steps 3 and 8 should match showing that the
   DBIx code is working as intended

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit db3ebe47e859e85659b1a2565a03bcb6b59df0ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 13913 - Renewal error message in OPAC is confusing
Owen Leonard [Sat, 29 Apr 2017 17:14:10 +0000 (17:14 +0000)]
Bug 13913 - Renewal error message in OPAC is confusing

This patch adds some formatting to the error message a patron receives
when there are renewal failures in the OPAC.

This is pretty much the least which could be done to address this
problem. However, I don't think the issue can be fixed without
re-thinking how renewals are processed. Sending error messages back to
opac-user.pl via URL parameter isn't flexible enough.

To test, apply the patch and attempt to renew multiple items in the OPAC
which cannot be renewed for some reason, for instance because they have
been renewed too many times. The error messages should appear in a list
rather than strung together in one long block of text.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 281e1253777d2bd635610075fe610bedb2d47360)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 11122: Follow up - Fix some display issues and typos
Katrin Fischer [Mon, 1 May 2017 23:08:02 +0000 (01:08 +0200)]
Bug 11122: Follow up - Fix some display issues and typos

This patch fixes the display of copyrightdate for MARC21 installations.
As MARC21 already requires you to add punctuation in cataloguing, there
is usually no need for punctutation in the templates.

Also fixes a template variable name typo and the basket summary page.

To test (all 3 patches):
- Add several order lines to an order, one should be uncertain
- Verify that the publisher and publication year are displayed
- Check the uncertain price page
- Verify that the publisher code and publication year are displayed
- Fix uncertain price and close your order
- Basket summary: Verify... (you know what)
- Cancel one of your orders
- Verify... for cancelled orders
- Receive shipment
- Verify... for unreceived orders
- Receive order
- Verify ... for received orders
- Finish receiving
- Verify ... on the invoice summary page

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cbb5096934907ec56df27d6ee3e77d752cd5e401)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 11122: Address MARC21 vs. UNIMARC issue
Mark Tompsett [Mon, 20 Apr 2015 00:28:21 +0000 (20:28 -0400)]
Bug 11122: Address MARC21 vs. UNIMARC issue

In comment #6 and comment #17, Katrin pointed out the discrepancy
between UNIMARC (using publisheryear) vs. Other MARC installations
(using copyrightdate). This was dealt with in invoice.tt already.
This patch does similar logic for the other 3 template files.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c470b3e38486e3c6040a10f6b0bf90af069f4566)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 11122 - publisher code and publication year not fetched in acq orders
Fridolyn SOMERS [Wed, 23 Oct 2013 10:05:23 +0000 (12:05 +0200)]
Bug 11122 - publisher code and publication year not fetched in acq orders

In acquisition, several templates try to display publisher code and publication year : invoice.tt, parcel.tt, transferorder.tt.
Thoses pages use C4::Acquisition methods GetPendingOrders or GetInvoiceDetails.
The bug is that in the SQL query of those methods, biblioitems.publishercode and biblioitems.publicationyear.
In uncertainprice.pl those datas are fetch using GetBiblioData.
It whould be better to fetch them in GetPendingOrders and GetInvoiceDetails.

This patch changes SQL queries to fetch wanted datas : aqorders.*,biblio.title,biblio.author,biblioitems.isbn,biblioitems.publishercode,biblioitems.publicationyear. GetInvoiceDetails also needs : biblio.seriestitle,biblioitems.volume.
This patch also unifies the way biblio datas are displayed :
  <a href="link to catalog using biblionumber">[title]</a> <em>by</em> [author] &ndash; [isbn]
  <em>Publisher:</em> [publishercode], [publicationyear]

Test plan :
- Choose a biblio record containing a data in :
    biblio.title,
    biblio.author,
    biblioitems.isbn,
    biblioitems.publishercode,
    biblioitems.publicationyear,
    biblio.seriestitle,
    biblioitems.volume.
- Create an order using this biblio.
- Look at this order in pages : parcel.pl, transferorder.pl, uncertainprice.pl
=> You see publisher code and publication year
- Look at this order in page : invoice.pl
=> You see publisher code, publication year, series title and volume

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c59e395b749132080fefb81e5b12f8c0b6654665)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18700 Fix grammar (data cannot be pluralized)
Colin Campbell [Tue, 30 May 2017 14:17:58 +0000 (15:17 +0100)]
Bug 18700 Fix grammar (data cannot be pluralized)

data is a mass noun or plural of datum - datas is ungrammatical
and jarring for a native speaker.
Split the awkward sounding sentence into two for more clarity,
thanks to Marc Véron for the suggestion.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 60b31a7a2219dea16f124684bd21e6d12a35c05a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18673: News author does not display on staff client home page
Marc Véron [Thu, 25 May 2017 21:04:14 +0000 (23:04 +0200)]
Bug 18673: News author does not display on staff client home page

News authors do not display on staff client homepage, independently of
syspref 'NewsAuthorDisplay'. This patch fixes the issue.

To verify:
- Create news with display location 'All'
- Set syspref NewsAuthorDisplay to 'Staff client only' or 'Both OPAC and staff client'
- Go to staff client
- Verify that news author does not appear (but it should)

To test:
- Applly patch
- Verify that news author is displayed as expected

Followed test plan works as intended
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 151cdcd133d8618a3faf9b47723d66ac3dc71b4e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18295: C4::Items - Remove get_itemnumbers_of
Jonathan Druart [Wed, 15 Mar 2017 22:02:21 +0000 (19:02 -0300)]
Bug 18295: C4::Items - Remove get_itemnumbers_of

The code from scripts and subroutines using this subroutine was not very
elegant. Most of the time the code was unnecessarily complex.
This patch removes this subroutine and adapt the code to use
Koha::Items instead.

1. C4::Items::get_hostitemnumbers_of
I did not understand why the code was so complicated, it seems that we
only want to know if a given item has a given biblionumber
2. cataloguing/merge.pl
We want to retrieve the itemnumber for a given biblio.
We could also have done that with:
  Koha::Biblios->find( $biblionumber )->items;
3. labels/label-item-search.pl
We want to loop over the items for a given biblio, no need to use
get_itemnumbers_of and GetItemInfosOf.
We just need to use:
  Koha::Items->search({ biblionumber => $biblionumber })
4. reserve/request.pl
We want to retrieve the itemnumbers of the biblio's items
We could also have done that with:
  Koha::Biblios->find( $biblionumber )->items->get_column('itemnumber');

Test plan:
1.You need to create analytical record relationships (
EasyAnalyticalRecords needs to be set). Link an item to a biblio using
the 'Edit > Link to host item' menu from the biblio detail page.
From the staff interface place a hold on the biblio. You should see the
items from the biblio and the one you just linked
2. Merge two bibliographic records (with items), the resulting record
should contain items from both original records
3. Create a new label batch, edit it.
Add items to this batch ('Add items' button).
Fill the input with a barcode.
You should see all the items of a biblio.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f466a856a99f3109985e3867296d9b7467f32e58)

7 years agoBug 18278: C4::Items - Remove GetItemLocation
Jonathan Druart [Wed, 15 Mar 2017 20:14:56 +0000 (17:14 -0300)]
Bug 18278: C4::Items - Remove GetItemLocation

This subroutine is no longer in used.
It was previously call from serials/serials-recieve.pl, which was not used and has been removed by
    commit 65b7ad030cd5cd0e3148fbbd1496d31b5cf149f7
    Bug 13423: Remove unused serials-recieve

Test plan:
  git grep GetItemLocation

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e0acd9bdf8500aa3cc2e5aeccbd1631f0b841040)

7 years agoBug 18704 - File types limit in tools/export.pl is causing issues with csv files...
Nick Clemens [Tue, 30 May 2017 20:55:19 +0000 (16:55 -0400)]
Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel

To test:
1 - Save a csv of biblionumber from MS/Excel
2 - Attempt to export records using this file
3 - It fails (mimetype is appliction/vnd.ms-excel)
4 - Apply patch
5 - Try again
6 - It succeeds!

Signed-off-by: Jason Palmer <jpalmer@switchinc.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ef6211b319b58b4c35e8cb8555e1caa4da9b2a8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18179: Update 1 occurrence in booksellers.pl
Nick Clemens [Fri, 28 Apr 2017 16:11:28 +0000 (12:11 -0400)]
Bug 18179: Update 1 occurrence in booksellers.pl

To test:
1 - Load http://localhost:8081/cgi-bin/koha/acqui/booksellers.pl?booksellerid=1
2 - Should get internal server erro
3 - Apply patch
4 - Reload
5 - Should not get error

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cc54b596c3bb225f45ca0443728452444b807d4e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18179: Update existing calls
Jonathan Druart [Tue, 18 Apr 2017 16:50:36 +0000 (13:50 -0300)]
Bug 18179: Update existing calls

This patch updates the existing occurrences of ->find called in a list
context.
There are certainly others that are not easy to catch with git grep.
Test plan:
Confirm that the 4 modified scripts still works as expected.

We need this one ASAP in master to make sure we will not get other
side-effects of this kind and to catch possible uncaught occurrences
before the release.

Tested scripts changed by this patch, they work as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bb22703dcaa53400c17674b8bb7ba1cf76dffac8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoDBRev 17.05.00.000 v17.05.00
Kyle M Hall [Tue, 30 May 2017 03:09:24 +0000 (03:09 +0000)]
DBRev 17.05.00.000

7 years agoAdd release notes for Koha 17.05
Kyle M Hall [Tue, 30 May 2017 03:08:18 +0000 (03:08 +0000)]
Add release notes for Koha 17.05

7 years agoTranslation updates for Koha 17.05
Bernardo Gonzalez Kriegel [Fri, 19 May 2017 17:26:48 +0000 (14:26 -0300)]
Translation updates for Koha 17.05

7 years agoBug 5395: Update C4::Acquisition::SearchOrders POD
Mark Tompsett [Wed, 24 May 2017 05:54:02 +0000 (01:54 -0400)]
Bug 5395: Update C4::Acquisition::SearchOrders POD

Comparing the perldoc to the function:
- basketname
- basketgroupname
- budget_id
Were missing. This adds them.

Also, a description of ordernumber and search were
added, as they are not self-evident by their name
alone.

There are no code changes, so all tests should pass
or fail identically before and after patch.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Fixed typo basetgroupname

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18669 - RewriteCond affecting wrong rule in koha-httpd.conf
David Cook [Thu, 25 May 2017 04:37:21 +0000 (14:37 +1000)]
Bug 18669 - RewriteCond affecting wrong rule in koha-httpd.conf

One of the RewriteCond directives in koha-httpd.conf was affecting
the wrong RewriteRule after its original RewriteRule was commented out
years ago.

_TEST PLAN_
0) Before applying patch, build Koha from source
    *) make
    *) make install (or make upgrade)
    *) Copy or symlink etc/koha-httpd.conf to your Apache vhost directory
        (and enable if you're on a Debian based system)
    *) Restart Apache
1) Make sure that you have at least 1 bibliographic record in Koha
(URL like this http://server:port/cgi-bin/koha/opac-detail.pl?biblionumber=1)
2) Go to http://server:port/bib/1
3) Note that you get a 404 error
4) Apply the patch
5) Rebuild Koha from source as per step 0
6) Go to http://server:port/bib/1
7) Note that you now see the same page as you would if you went to
http://server:port/cgi-bin/koha/opac-detail.pl?biblionumber=1

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18664: Make IssueSlip returns if params are not valid
Jonathan Druart [Tue, 23 May 2017 19:33:17 +0000 (16:33 -0300)]
Bug 18664: Make IssueSlip returns if params are not valid

Problem raised by bug 17762: IssueSlip should return if the params are
not valid.
The tests contain 2 FIXME to highlight this problem already, it's time
to fix them.

Note that, theoretically, this change may produce software error. Indeed
the caller expecting a hashref (letter) will access the "content" key.
But that should not happen.

Test plan:
Tests must return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18632: Remove 'CGI::param called in list context' warnings
Jonathan Druart [Thu, 18 May 2017 20:42:02 +0000 (17:42 -0300)]
Bug 18632: Remove 'CGI::param called in list context' warnings

Once again, after bug 16154 and bug 16259 we need to remove more
occurrence of CGi->param called in list context.
Refer to bug 15809 for more information.

Test plan:
Make sure you do not see the error on the modified scripts.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18611: [QA Follow-up] Add unit test for GetItemNumbersFromImportBatch
Marcel de Rooy [Fri, 26 May 2017 08:25:10 +0000 (10:25 +0200)]
Bug 18611: [QA Follow-up] Add unit test for GetItemNumbersFromImportBatch

Test plan:
Run t/db_dependent/ImportBatch.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18611: [QA Follow-up] Make SQL query more readable
Marcel de Rooy [Fri, 26 May 2017 08:20:00 +0000 (10:20 +0200)]
Bug 18611: [QA Follow-up] Make SQL query more readable

Make it more explicit by adding join statements.

Test plan:
See next patch for adding a unit test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18611 - Followup, remove tabs to make qa tools happy
Josef Moravec [Tue, 23 May 2017 11:03:04 +0000 (11:03 +0000)]
Bug 18611 - Followup, remove tabs to make qa tools happy

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>