koha.git
7 years agoBug 14399: Results form also needs a few interface changes
Marcel de Rooy [Wed, 12 Apr 2017 14:06:29 +0000 (16:06 +0200)]
Bug 14399: Results form also needs a few interface changes

Currently, the value of compareinv2barcd is used to determine if the
Seen column, the Select/Clear all buttons and the Mark seen buttons are
displayed. But if we scanned barcodes, we already marked items as seen.
So we should only display these buttons when we did not upload barcodes.

Test plan:
[1] Upload a barcode file. Check that the result form does not show
    the buttons.
[2] Generate an inventory list, so do not upload a barcode file. Verify
    that you still see the buttons.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit af89df12e72ea51010039a2206bb942bcc4c4b50)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14399: Interface changes
Marcel de Rooy [Wed, 5 Apr 2017 13:12:31 +0000 (15:12 +0200)]
Bug 14399: Interface changes

A part of the confusion around the inventory script may arise from the
fact that the form offers several options that are only used under
certain conditions. This patch hopefully rearranges a few options more
logically and only offers options when appropriate.

The barcode fieldset now also contains Compare barcodes and Do not check in
checkboxes. These are meaningful when a barcode file is uploaded.

The fieldset Item location filters (new name) contains fields that are
always used. Same for tne only control left under Additional options,
Export to CSV.

The fieldset Optional filters depends on the status of the barcode file
and the Compare checkbox. It is now shown or hidden depending on what
you select: if you do not upload a file, it is shown; or if you upload
a file and check Compare, it is shown. Otherwise we hide it, since the
script will not look at these values. Under this fieldset last inventory
date and Skip items on loan are added, since their behavior is the same
as the various item statuses.

Test plan:
In this test plan we test both the script changes from the previous patch
and the interface changes here. We follow the three main scenario's as
mentioned in the previous patch.

[1] First we prepare a few test items.
    Pick two biblios A, B and create five items say A1,A2,B1,B2,B3.
    Pick a not-existing callnumber range you want to test and move these
    five items there. Add barcodes too (say A1..B3).
    Edit one item A1 to a not-existing notforloan status (doing this on
    the mysql command line is fastest).
    Like: update items set notforloan = '9' where barcode='A1';
    Now simulate that we did not add/edit these items today:
    update items set datelastseen='2017-01-01' where barcode in ('A1','A2','B1','B2','B3');
    Note: We need this when comparing with last inventory date in the last
    scenario.

Scenario 1 (no barcodes uploaded)
[2] Enter the callnumber range on inventory form.
    Verify that "Set inventory date", Compare barcodes and "Do not check
    in" are disabled on the form. Check that you see the Optional filters
    box.
    Submit the form. Verify that you see all five items.
    Do the same. Check Export to CSV. Check result file contents.

Scenario 2 (upload barcodes, do not compare)
[3] Create a barcode file with the barcodes of A1, A2 and B1. Add another
    existing barcode outside the test callnumber range.
    After uploading this file, verify that "Set inventory date", Compare and
    "Do not check in" are enabled. The Optional filters should be hidden.
    Leave "Set inventory date" to today. Enter the callnumber range again.
    Submit the form.
    What do we expect? Four items should have been updated (alert). We
    should see barcode A1 with problem Unknown status. We should see
    also the barcode from the other range (Found in wrong place).
    Repeat this step with the same file. But now export to CSV. Verify that
    you see two barcodes with problems again in the csv file.

Scenario 3 (upload barcodes, compare)
[4] Create another barcode file with barcodes of B2 and one existing barcode
    outside the test callnumber range.
    After uploading this file, check the Compare checkbox. Verify now that
    the Optional filters box is displayed again.
    Leave "Set inventory date" to today. Enter the callnumber range again.
    Also set "Last inventory date" to today (important!).
    Submit the form.
    What do we expect now? Two items should be updated (see alert).
    We should see barcode B3 with problem Missing. We should also see the
    barcode from the other range (wrong place).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 35b73aa3c6fb163f1389d30f0c175bec19696698)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14399: Numerous small refinements to the inventory script
Marcel de Rooy [Mon, 3 Apr 2017 13:16:42 +0000 (15:16 +0200)]
Bug 14399: Numerous small refinements to the inventory script

This patch contains the following changes:

[01] Label "Inventory date" reworded to "Last inventory date", adding a
small explanation for its purpose.
[02] Restructured the results: it was an array with items and possible
error messages. Multiple messages duplicated individual items. Now the
results are in a hash, pulling all error messages for one item together.
At the end of the script they are copied to an array. (A helper sub
additemtoresults is added in this regard.) We no longer use array
@items_with_problems.
[03] Both datepickers are no longer connected to the same class. This
prevents changing the set date by filling the last inventory date.
[04] Input markseen in the template and $markseen in the script are
no longer needed.
[05] The paragraph before the detail link in the results table in the
Title column has been removed. Same for problems column. This makes
vertical spacing consistent.
[06] Problem status 'missingitem' is no longer used; the missing items
are marked as 'not_scanned'. Two additional statuses are: no_barcode and
checkedout.
[07] Removed unused $itemtype, $totalrecords and $count. We use variable
$moddatecount to report a count to the template.
[08] The script updated scanned items twice. The first time with ModItem
and the second time with ModDateLastSeen. The second call is removed.
[09] If a book is checked in, we do no longer return an error message when
the checkin is successful (ERR_ONLOAN_RET). The updated datelastseen is
passed to the results.
[10] $wrongplacelist is renamed to $rightplacelist. It is only built when
we need it. (Same for inventorylist now.)
[11] Datelastseen (last inventory date) is always used for building the
inventory list. It allows you to process partial barcode lists or make
a list of items not seen after some date. We do no longer use variable
$paramdatelastseen.
[12] The section where items.datelastseen was compared with the inventory
date has been removed. Scanned items were already updated; to get items
seen before some date, you can now use last inventory date without passing
barcodes.

The form can mainly be used for the following three cases:
[1] Prepare an inventory list or csv file; we do not upload barcodes.
[2] Update items for uploaded barcodes without comparing to inventory.
    Last inventory date is useless in this case.
    Errors wrongplace, checkedout and changestatus are reported.
    Use this scenario for partial scanned barcode lists (all but last).
[3] Update items for uploaded barcodes and compare to inventory, filtered
    by an optional last inventory date.
    Apart from the errors mentioned under [2], this also reports
    not_scanned ("missing") and no_barcode.
    Use this scenario too for the last partial barcode file (together with
    inventory date).

Test plan:
See next patch ("Interface changes").

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6da97c7c8713bb16cbf6cf079df18534c3661414)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14399: Prevent display of double zero notforloan status
Marcel de Rooy [Mon, 3 Apr 2017 11:05:13 +0000 (13:05 +0200)]
Bug 14399: Prevent display of double zero notforloan status

On bug 12913 a zero status is added on the inventory form. This prevents
a lot of false warnings for a wrong notforloan status. The zero status
is not included in the default setup. But if you would add one, the
status will display here twice now.

This patch checks if the status already exists.

Test plan:
[1] Add a zero NOTFORLOAN status if it does not yet exist in Authorized
    values.
[2] Check that you do not see two "For loan" statuses on inventory form.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e162c4d526e042c4b382629a7aec880dcfced346)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit 8ed599113c7592ec2e2227e3a7265a7e9cc9ca0e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit 9026169a235aa8133660ef649d98d8cedc5a4692)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit 01e7523dfb1ec9789f38dd6d7819cb5e3d7d7cc2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit b37df275b85114ccd23986d94af7ed21544269e6)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit 092f02d227417ac9786e23651ab13fbd566589c8)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18611 - Create labels action fails in manage-marc-import.pl if an item has been...
Nick Clemens [Tue, 16 May 2017 09:40:28 +0000 (05:40 -0400)]
Bug 18611 - Create labels action fails in manage-marc-import.pl if an item has been deleted from the import batch.

To test:
1 - Import a batch with some items
2 - Delete one of the imported items
3 - Browse to Tools->Staged MARC record management
4 - Click (Create label batch) for the batch you imported
5 - Recieve an error
6 - Apply patch
7 - Click (Create label batch)
8 - Batch is created with remaning items from the import

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>
(cherry picked from commit 7249351f120f3bd02d7f7829af10bd89cae490dc)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18600 - DBRev 16.11.00.002
Katrin Fischer [Mon, 5 Jun 2017 12:38:20 +0000 (14:38 +0200)]
Bug 18600 - DBRev 16.11.00.002

7 years agoBug 18600: Add pref TalkingTechItivaPhoneNotification if missing
Jonathan Druart [Tue, 23 May 2017 19:16:39 +0000 (16:16 -0300)]
Bug 18600: Add pref TalkingTechItivaPhoneNotification if missing

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ec4b976289d68b4122f081f05ff7a7a023a32580)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18204 - Authority searches are not saved in Search history
LeireDiez [Thu, 11 May 2017 15:09:22 +0000 (17:09 +0200)]
Bug 18204 - Authority searches are not saved in Search history

When you search an authority in Authority search, this search is not saved in Search history.

EnableOpacSearchHistory is enabled

Steps to test:
 1- Login your account (opac)
 2- Search an authority in Authority search
 3- Go to Search history -> Authority
 4- It says "Your authority search history is empty"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d4e3e6af9fd054dc64844be49e8d1a0f28b545bd)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16295: Fix access to MMT admin page
Jonathan Druart [Tue, 23 May 2017 17:10:20 +0000 (14:10 -0300)]
Bug 16295: Fix access to MMT admin page

There was a typo in the permission code

Test plan:
Try to access the marc modification templates admin page with the
marc_modification_templates permission (and not all tools permissions)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d046474805b065f7419fefb06902d6ae18a0cd29)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18663 - DBRev 16.11.00.001
Katrin Fischer [Mon, 5 Jun 2017 12:26:35 +0000 (14:26 +0200)]
Bug 18663 - DBRev 16.11.00.001

7 years agoBug 18663: Add pref ExportRemoveFields if missing
Jonathan Druart [Tue, 23 May 2017 19:16:17 +0000 (16:16 -0300)]
Bug 18663: Add pref ExportRemoveFields if missing

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6f29c775d92d72bd03188efea4a41b3fbb49e928)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 15465: Fix typo in bugs.k-c.org
Jonathan Druart [Fri, 26 May 2017 14:45:31 +0000 (11:45 -0300)]
Bug 15465: Fix typo in bugs.k-c.org

(cherry picked from commit 0b7c517bfe9c76b0e40f25f1fa5b1f3cf7a00dd3)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18548: Print usage when missing instance name in koha-create script
Josef Moravec [Fri, 5 May 2017 10:23:23 +0000 (10:23 +0000)]
Bug 18548: Print usage when missing instance name in koha-create script

Test plan:
1. Run: debian/scripts/koha-create --request-db
-> Without patch you see the getent error message
-> With patch you see usage and "Missing instance name" message

Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d2ed4fadc59260372baedab038d16bd7cb169b1c)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18569 - Quick add patron will not copy over details from cities and towns pull...
Nick Clemens [Fri, 12 May 2017 13:38:37 +0000 (09:38 -0400)]
Bug 18569 - Quick add patron will not copy over details from cities and towns pull down into patron details

Followed test plan and the city value updates in the quick add form correctly.
Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e609679eb278383f573eda78048f8fa107ae159b)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18598 - Quick add form doesn't clear values when switching
Nick Clemens [Fri, 19 May 2017 02:00:44 +0000 (22:00 -0400)]
Bug 18598 - Quick add form doesn't clear values when switching

To test:
1 - Fill out some fields in quick add
2 - Switch to full form and clear fields
3 - Switch back and fields are still populated
4 - Fill a field in long form
5 - Switch to quick add and clear it
6 - Save
7 - Value set in 4 is saved
8 - Apply patch
9 - Repeat 1-6 - values should be cleared and not saved

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c762cd827e0a80960f3b23513981a382025b3bee)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18596 - Quick add form duplicating password confirm
Nick Clemens [Fri, 12 May 2017 13:18:45 +0000 (09:18 -0400)]
Bug 18596 - Quick add form duplicating password confirm

To test:
1 - Add password to BorrowerMandatoryField
2 - View quick add form
3 - See confirm password twice
4 - Apply patch
5 - See confirm password once
6 - Add password to QuickAddFields
7 - Confirm one confirm field
8 - Remove password form BorrowerMandatory field
9 - Confirm there is one confirm field and password fields are not
required

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3e5dbef9ef18e0eaadfff9c7d7b5838aec75fb36)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18647: Resolve internal server error on category_type
Marcel de Rooy [Tue, 23 May 2017 12:31:01 +0000 (14:31 +0200)]
Bug 18647: Resolve internal server error on category_type

See bug 18552. When we resolved the housebound_role bug, the hash got
filled correctly again. And this revealed that the (second) call to
Koha::Patrons->find was not appropriate. It can be removed, as Jonathan
explained on the report.

Note: Commit 95429af6855e8ed37945b681dc466bf360deffb added this call, but
it was hidden until the template variable hash got fixed.

Test plan:
Restart Plack and go to patron details again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 87bb59304e53755d7b4565c517578a838e1f0041)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18552: [16.11.X] [QA Follow-up] Resolve warnings
Marcel de Rooy [Fri, 19 May 2017 10:22:03 +0000 (12:22 +0200)]
Bug 18552: [16.11.X] [QA Follow-up] Resolve warnings

Like:
Problem = a value of AutoResumeSuspendedHolds has been passed to param without key at /usr/share/koha/masterclone/C4/Templates.pm line 137.
Problem = a value of relatives_borrowernumbers has been passed to param without key at /usr/share/koha/masterclone/C4/Templates.pm line 137.

Problem is functions returning undef in list context (in this case
housebound_role).
No need to call Patrons::find a second time.

Note: The call of GetDebarments in the first patch suffered from this too.
It is in a fine place now too. But strictly speaking, should not have been
moved.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18552: [16.11.X] Borrower debarments not showing on member detail page
Aleisha Amohia [Thu, 18 May 2017 23:10:13 +0000 (23:10 +0000)]
Bug 18552: [16.11.X] Borrower debarments not showing on member detail page

To test:
1) Go to a borrowers details page and create a manual restriction
2) Notice the restriction shows at the top of the page but the
restriction tab says the member is currently unrestricted
3) Apply patch and refresh page
4) Restrictions tab should now correctly show debarments and correct
number is shown
5) Confirming deleting and adding restrictions still works as expected

Sponsored-by: Catalyst IT
Followed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17108 - Update debian/control
Mirko Tietgen [Mon, 22 May 2017 07:49:47 +0000 (09:49 +0200)]
Bug 17108 - Update debian/control

Last changes in debian/control as added to 16.11.08

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
https://bugs.koha-community.org/show_bug.cgi?id=17108
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoAdd release notes to 16.11.08 release v16.11.08
Katrin Fischer [Mon, 22 May 2017 05:35:27 +0000 (07:35 +0200)]
Add release notes to 16.11.08 release

7 years agoMerge remote-tracking branch 'transl/16.11.08-translate-20170521' into 16.11.x
Katrin Fischer [Mon, 22 May 2017 05:26:12 +0000 (07:26 +0200)]
Merge remote-tracking branch 'transl/16.11.08-translate-20170521' into 16.11.x

7 years agoTranslation updates for Koha 16.11.08
Bernardo Gonzalez Kriegel [Sun, 21 May 2017 23:29:03 +0000 (20:29 -0300)]
Translation updates for Koha 16.11.08

7 years agoIncrement version for 16.11.08 release
Katrin Fischer [Sun, 21 May 2017 22:54:29 +0000 (00:54 +0200)]
Increment version for 16.11.08 release

7 years agoBug 18551: followup - hide advanced filters in header, move hidding to css file
Josef Moravec [Tue, 9 May 2017 13:33:52 +0000 (13:33 +0000)]
Bug 18551: followup - hide advanced filters in header, move hidding to css file

Test plan:
The same as first patch, but also with advanced search form in header hidden
on page load - see comment 4

Issue with advanced search form is gone.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Philippe <philippe.audet-fortin@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 9719284622e2c3027ef615286ef417f920238c9f)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18551 - Hide with CSS dynamic elements in member search
Fridolin Somers [Fri, 5 May 2017 13:00:05 +0000 (15:00 +0200)]
Bug 18551 - Hide with CSS dynamic elements in member search

In member search page, the result table is in Ajax so fully managed by Javascript. There is also a yellow dialog message prepared in HTML.

Thoses elements are hidden by JS code : ie $("#patron_list_dialog").hide().

The problem is that the static page is first loaded an displayed then the JS code runs an hides the elements.
On a low performance computer, this action is visible and looks like there is a blinking yellow message.

I propose to hide with CSS so that thoses elements are not displayed in static page and are there shown in dynamic JS code.

Test plan :
Check display is unchanged :
- Go to home page /cgi-bin/koha/members/members-home.pl
- Perform patron search from header search box
- Perform patron search by clicking on a letter
- Perform patron search from filters (left of results table)
- Select a patron and add it to a list => you see the yellow message

Yellow message does no longer appear with this patch.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Philippe <philippe.audet-fortin@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5cc536c68b221823f4335b5b5db1108521f88a71)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18578: Use subdirectory in /tmp for session storage during installation
Marcel de Rooy [Thu, 11 May 2017 07:10:50 +0000 (09:10 +0200)]
Bug 18578: Use subdirectory in /tmp for session storage during installation

Apply the change from bug 15553 to InstallAuth.pm too.

Test plan:
[1] Remove all cgisess_* files from your /tmp directory.
[2] Remove directory /tmp/cgisess_koha_[your instance], if there.
[3] Run the webinstaller
    /cgi-bin/koha/installer/install.pl?step=1&op=updatestructure
[4] Check if you have cgisess_ files in /tmp/cgisess_koha_[your instance].

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c9de665c294f0e4416a9f1ea751e2859eb065a9c)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18536: [QA Follow-up] Tiny regex simplification
Marcel de Rooy [Fri, 19 May 2017 09:39:24 +0000 (11:39 +0200)]
Bug 18536: [QA Follow-up] Tiny regex simplification

Simplify regex for removing table name.
No need to escape a dot between the square brackets. No need to specify a
number of 1 between parentheses.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 63c6eaca8d649cb7864b90e5e1ee9ac019daffdf)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18536: Generating CSV using profile in serials late issues doesn't work as described
Josef Moravec [Thu, 4 May 2017 08:54:30 +0000 (08:54 +0000)]
Bug 18536: Generating CSV using profile in serials late issues doesn't work as described

Description on editing csv profiles says:

"You can also use your own headers (instead of the ones from Koha) by
prefixing the field name with an header, followed by the equal sign."

So the header should be optional, but in fact it's mandatory. Also the
regular expression to cut table name from beginning of db column is not
right.

Test plan:

0. Don't apply the patch
1. Make two CSV profiles for exporting late issues
    a) SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUENUMBER=serial.serialseq|LATE SINCE=serial.planneddate
    b) aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate
2. Export late issues, profile a) works as expected, profile b) doesn't
3. Apply the patch
4. Both profiles should work

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6b8f9d7e14a8b93143185e814464393ef275631d)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18597 - Quick add form does not transfer patron attributes values when switching...
Nick Clemens [Fri, 12 May 2017 14:00:29 +0000 (10:00 -0400)]
Bug 18597 - Quick add form does not transfer patron attributes values when switching forms/saving

The function that switches between quick add/fulll form assumes labels
are followed by values - patron_attr don't follow this pattern. This
patch just moves the hidden input field

To test:
1 - Have some patron attributes (with/without auth values set)
2 - Add them to QuickAddFields (patron_attr2 for example)
3 - view quick add form and set some values
4 - Switch to full form, values not transferred
5 - Switch to quick add, view values, save
6 - Values are not saved :-(
7 - Apply patch
8 - Repeat 3 - 5
9 - Values are transferred and saved :-)

Signed-off-by: Peggy Thrasher <p.thrasher@dover.nh.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 48c87a19a68bf1157c471b8355f5eafe9ec305c1)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18534 - When IndependentBranches is enabled the pickup location displayed incorre...
Nick Clemens [Wed, 3 May 2017 19:21:40 +0000 (15:21 -0400)]
Bug 18534 - When IndependentBranches is enabled the pickup location displayed incorrectly on request.pl

To recreate:
1 - Place a hold for pickup at Midway
2 - Enable independentbranches
3 - Login to staff interface as admin without superlibrarian status from
a different branch
4 - View the holds for the title you placed a hold on
5 - The hold placed in step 1 should show a dropdown with current branch
as pickup location, current branch is the only in that dropdown
6 - Verify it displays correctly for superlibrarian
7 - Apply patch
8 - The correct pickup location should show and not be editable
9 - Verify it is a dropdown

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 90575b64d5c4ed63e1eeded043865796bbcde244)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16568 - Talking Tech generates phone notifications for all overdue actions
Kyle M Hall [Mon, 23 May 2016 14:05:58 +0000 (14:05 +0000)]
Bug 16568 - Talking Tech generates phone notifications for all overdue actions

Regardless of whether the phone transport has been selected for a given
overdue action or not, the Talking Tech outbound script generates and
sends a line for that action.

Test Plan:
1) Enable Talking Tech
2) Create one or more overdue actions without a phone transport selected
   and one or more with the phone transport selected
3) Generate the overdues csv file to send to Itive
4) Note the csv file has lines for actions that do not have the phone
   transport selected
5) Apply this patch
6) Repeat step 3
7) Note the csv file now only has lines for actions that have the phone
   transport selected

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 86678bbc26954e5e4eddf8b11b652b4c83e80425)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18438 - Implemented data-dismiss="modal" in returns.tt so that any warning messag...
Alex Buckley [Wed, 19 Apr 2017 02:01:30 +0000 (14:01 +1200)]
Bug 18438 - Implemented data-dismiss="modal" in returns.tt so that any warning messages hidden by a hold modal are displayed after it is dismissed

Test plan:
1. Check out an item to one patron whilst having that item also being on
hold to another patron

2. Check the item back in

3. Notice a modal box appears greying out the background with three
buttons 'Confirm hold', 'Print and confirm' and 'Ignore'. Click confirm
and notice that the page refreshes and no yellow warning messages are
able to be displayed

4. Now that you have checked the item in. Try checking it in a second
time by clicking on the Checkin tab and writing in the barcode.

5. The modal box will appear again, this time with three buttons
'Confirm', 'Print and confirm' and 'Cancel hold'

6. Click the 'Confirm' button and the page refreshes again and the
yellow warning message hidden by the modal box is not properly displayed
to the user. Notice that the focus is on the barcode input box.

7. Apply patch

8. Try checking in the item again, and this time after clicking the
'confirm' button on the modal box notice that the yellow warning message
is displayed telling the user the item was "Not checked out". Also
notice the focus is in the barcode inputbox.

9. Drop the hold on the item and make sure it is not checked out.

10. Repeat steps 1 and 2 and notice after clicking the 'Confirm hold'
button the page refreshes and the item is successfully checked back in.
With the focus on the barcode input.

11. View koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt and
notice that the button on line 345 does not use an onclick parameter

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>
Amended-patch: remove spaces

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit bbef5c4c3afadeebfe645048bb48ec81f21e0b59)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18376: Do not need to prepare a single statement, use do
Jonathan Druart [Thu, 18 May 2017 19:40:42 +0000 (16:40 -0300)]
Bug 18376: Do not need to prepare a single statement, use do

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 285dd883564eaf96737b2be153bbe6d30e1b64f7)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18376 - authority framework creation fails under Plack
Fridolin Somers [Tue, 4 Apr 2017 12:17:15 +0000 (14:17 +0200)]
Bug 18376 - authority framework creation fails under Plack

With plack, when creating a new authority framework from another, you get the error :
Can't call method "prepare" on an undefined value at (...)/src/admin/auth_tag_structure.pl line 267.

Looks like plack does not like when the var $dbh from the script is called inside a sub.

This patch adds a local var $dbh inside sub duplicate_auth_framework(), like in sub StringSearch().

Also correctes a redefine of my $sth.

Test plan:
- Go to Administration > Authority types
- Create a new type
- On this new type click on Actions > MARC Structure
- Select another type and click OK
=> You must get a table filled with the tag structure
Check with and without plack
You may not be able to reproduce the error with plack.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6a82ff4b8907f17fb17af3201ab6e96320a995bf)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14625 - LDAP: skip extended patron attributes in 'borrowers' attribute update
Oliver Bock [Mon, 30 Nov 2015 12:57:58 +0000 (13:57 +0100)]
Bug 14625 - LDAP: skip extended patron attributes in 'borrowers' attribute update

* Any extended patron attributes will cause the update to fail as those attributes don't exist in the 'borrowers' table
* The update of the extended patron attributes is already dealt with in checkpw_ldap()
* Ergo: just skip those attributes here

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I did not test this patch but code looks good

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4c631a0824a38177279475f77e9246087fa97515)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18571: Add default ES configuration to koha-conf-site.xml.in
Tomas Cohen Arazi [Wed, 10 May 2017 19:04:36 +0000 (16:04 -0300)]
Bug 18571: Add default ES configuration to koha-conf-site.xml.in

This patch adds a default configuration entry for elasticsearch. It will
add localhost:9200 to the server subsection, and koha_instance (replacing instance
for the corresponding instance name) for the namespace.

To test:
- Apply the patch
- Copy the file to the /etc/koha dir:
  $ sudo cp kohaclone/debian/templates/koha-conf-site.xml.in /etc/koha
- Create a new instance:
  $ sudo koha-create --create-db test
=> SUCCESS: /etc/koha/sites/test/koha-conf.xml includes the mentioned section:

 <elasticsearch>
     <server>localhost:9200</server>
     <index_name>koha_test</index_name>
 </elasticsearch>

- Sign off :-D

Note: As the use of ES is syspref driven, this default entry doesn't have any use
until ES is installed and SearchEngine set to Elasticsearch. So it doesn't hurt
but will help end users test the ES integration. Advanced users will take care of
this config entry manually (pointing to external servers/clusters, etc).

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2855107383db654e92e219d7d2d88fa88a73d36e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18471 - Receiving order with unitprice greater than 1000 processing incorrectly
Kyle M Hall [Fri, 21 Apr 2017 14:10:37 +0000 (10:10 -0400)]
Bug 18471 - Receiving order with unitprice greater than 1000 processing incorrectly

Receiving orders process the comma as a decimal point
Invoices are displaying incorrectly when formatting total

Test Plan:
1. Open a basket
2. Place an order for an item with price > 1000, $4367.00 for example
3. Close basket
4. Receive order
5. Note on orderreceive.pl the price is populate as "4,367.00"
6. Receive/Save
7. Note the 'Actual Cost' is now $4.00, verify db contains 4 as well
8. Cancel receipt
9. Receive again, this time enter price as "4367"
10. Receive/save
11. Note actual cost is correct
12. Finish receiving
13. Note invoice reads total as $4.00
14. Check db. price in aqorders is correct but displaying incorrectly
15. Apply this patch
16. Repeat step2 1. 14, note errors are fixed

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18502: Make koha-shell set the right PERL5LIB on dev installs
Tomas Cohen Arazi [Thu, 27 Apr 2017 14:37:27 +0000 (11:37 -0300)]
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs

Bug 16749 introduced a nice way to have flexible paths. During the discussion on how to do it, we moved from having it contain the path to the git dir to just a boolean. The 'koha-shell' script didn't get attention it seems, and it is broken on dev installs.

This was hidden by the fact that many of us run dev installs on kohadevbox, which sets a .bashrc file for de instance's user, containing the right path when opening the new shell.

This patch changes the logic so on a dev install, intranetdir is picked as the right path. This is how it is handled in koha-functions.sh

To test:
- On kohadevbox, run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> FAIL: C4/Installer.pm not found on PERL5LIB error.
- Apply this patch
- Replace /usr/bin/koha-shell with debian/scripts/koha-shell
  $ sudo cp kohaclone/debian/scripts/koha-shell /usr/bin/koha-shell
- Run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> SUCCESS: No warning about missing libs is raised.
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16749: Add is_instance check to koha-upgrade-schema
Jonathan Druart [Thu, 16 Feb 2017 14:07:05 +0000 (14:07 +0000)]
Bug 16749: Add is_instance check to koha-upgrade-schema

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16749: Check instancename in adjust_paths_dev_install
Marcel de Rooy [Thu, 16 Feb 2017 13:33:57 +0000 (14:33 +0100)]
Bug 16749: Check instancename in adjust_paths_dev_install

Check if the instance does not exist (or was not even passed).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16749: Use is_instance to make sure the dev instance exist
Jonathan Druart [Thu, 16 Feb 2017 12:57:17 +0000 (12:57 +0000)]
Bug 16749: Use is_instance to make sure the dev instance exist

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16749: Go with a boolean flag, we love booleans
Marcel de Rooy [Mon, 13 Feb 2017 07:56:17 +0000 (08:56 +0100)]
Bug 16749: Go with a boolean flag, we love booleans

As requested by Jonathan on comment 10 on Bugzilla and supported by Tomas,
we should use the dev_install entry in koha-conf as a boolean flag.
Since we already used it as a path, this patch is not too strict about it.
If the entry is not empty and not equal to "0", we will interpret it as
a true value. The path is taken from the intranetdir entry.

Test plan:
[1] Copy debian/scripts/koha-functions.sh to /usr/share/koha/bin
[2] For a dev install:
    Remove the dev install line, or toggle its value between empty string,
    0 or 1 and each time test stop/start koha-indexer.
    Check the path to rebuild_zebra with ps aux|grep indexer.
    If you have no entry, an empty entry or a zero, you should see a regular
    path.
    (Note: You can do something similar with koha-start-sip.)
[3] For a regular install:
    Remove the dev install line.
    Stop/start koha-indexer or koha-plack, and verify that it still works.
    Add a dev_install line with 0, and repeat stop/start.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tested in a package installation of master+16749

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16749: Update debian docs for koha-translate
Marcel de Rooy [Mon, 12 Sep 2016 09:51:22 +0000 (11:51 +0200)]
Bug 16749: Update debian docs for koha-translate

This patch adds the -d option to the documentation (with thanks to
Magnus Enger).

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tested in a package installation of master+16749

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16749: Adjustments for koha-translate
Marcel de Rooy [Thu, 16 Jun 2016 08:38:54 +0000 (10:38 +0200)]
Bug 16749: Adjustments for koha-translate

[AMENDED February 10, 2017]

[1] Added reading /etc/default/koha-common as in the other debian scripts.
    We need it for KOHA_HOME.
[2] Add a -d|--dev parameter for dev installs.
[3] No hardcoded PERL5LIB or KOHA_INSTALL_DIR (KOHA_HOME).
    They are read from default file or set by adjust_paths_dev_install.
[4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL.
[5] Remove references to obsolete themes ccsr and prog.

Test plan:
[1] Regular package install:
    Copy koha-translate to /usr/sbin.
    Run koha-translate -l to show installed languages.
    Run koha-translate -l -a to show available languages.
    Add a language: koha-translate -i nl-NL.
    Check template folders in regular location (/usr/share/koha/...)
    Remove a language: koha-translate -r nl-NL. Check again.
[2] Dev install or kohadevbox:
    Copy koha-translate to /usr/sbin.
    If needed, add the <dev_install> line to koha-conf.xml.
    Run koha-translate -l -d yourinstance to show installed languages.
    (Note: You only see the languages installed in this instance.)
    Add a language: koha-translate -i nl-NL -d yourinstance.
    Check template folders in the clone.
    Remove a language: koha-translate -r nl-NL -d yourinstance.

    Note: Make sure you have sufficient file permissions for the kohaclone
    files and koha-conf.xml. On kohadevbox you might need to run sudo
    koha-translate within the the vagrant user context.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested on Jessie (Debian VM and Kohadevbox)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tested in a package installation of master+16749

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16749: Adjustments for koha-plack
Marcel de Rooy [Fri, 10 Feb 2017 09:33:57 +0000 (10:33 +0100)]
Bug 16749: Adjustments for koha-plack

[1] Use run_safe_xmlstarlet for plack workers and requests
[2] Simplify adjust_paths. The lazy export statement is actually enough to
    replace adjust_paths by one direct call to adjust_paths_dev_install.

Test plan:
[1] Copy koha-functions.sh and koha-plack:
    cp [YOUR_PATH]/debian/scripts/koha-functions.sh /usr/share/koha/bin/
    cp [YOUR_PATH]/debian/scripts/koha-plack /usr/sbin/
    where YOUR_PATH might well be /home/vagrant/kohaclone.
[2] Make sure that you have dev_install in koha-conf.
    Stop and start koha-plack. Verify with ps aux|grep plack.
[3] Rename dev_install to nodev_install (in start and end tag).
    Now stop/start koha-plack. Verify with ps aux|grep plack.
[4] Change plack_requests to 51 in your koha-conf.
    Restart Plack and check that you see 51 in ps aux|grep plack.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested on Jessie (Debian VM and Kohadevbox)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tested in a package installation of master+16749

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16749: Adjust xmlstarlet calls in koha-functions
Marcel de Rooy [Fri, 10 Feb 2017 08:37:13 +0000 (09:37 +0100)]
Bug 16749: Adjust xmlstarlet calls in koha-functions

In various scripts we use xmlstarlet to extract values from koha-conf.
If we call xmlstarlet on non-existing entries in koha-conf, this may
however result in silently failing scripts (when set -e is in effect).

A function run_safe_xmlstarlet is added for situations where the entry
might not exist. It will not halt execution.

This patch only adjusts koha-functions.sh and modifies the xmlstarlet calls
for dev_install and zebra_loglevels.

Note: The function does not need to check file existence. If the file does
not exist, xmlstarlet warns about it; the function returns empty string,
but does not set an error exit status.

Test plan: See second patch ("koha-plack adjustments").

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tested in a package installation of master+16749

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16733: [Follow-up] Add $home to api path too
Marcel de Rooy [Mon, 12 Sep 2016 10:22:05 +0000 (12:22 +0200)]
Bug 16733: [Follow-up] Add $home to api path too

In the meantime api was enabled in plack.psgi and needs a little tweak
too for a dev install.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16733: Adjust other debian scripts using PERL5LIB
Marcel de Rooy [Wed, 15 Jun 2016 12:08:28 +0000 (14:08 +0200)]
Bug 16733: Adjust other debian scripts using PERL5LIB

This patch makes the following changes:

koha-foreach, koha-upgrade-schema (shell scripts):
[1] Read default file
[2] Include helper functions
[3] Add call to adjust_paths_dev_install
[4] Replace hardcoded path by $PERL5LIB

koha-shell (perl script):
[1] Remove hardcoded lib path
[2] Add a sub that reads PERL5LIB from default or koha-conf, just as the
    shell scripts do.

koha-plack (shell script), plack.psgi:
[1] Add call to adjust_paths_dev_install
[2] Remove hardcoded lib path
[3] Add installer path to PERL5LIB, remove it from plack.pgsi

koha-sitemap (shell script):
[1] Add call to adjust_paths_dev_install
[2] Remove hardcoded lib path
[3] Add installer path to PERL5LIB
[4] Adjust path for call to sitemap cron job

koha-start-sip (shell script):
[1] Read default file
[2] Include helper functions
[3] Add call to adjust_paths_dev_install
[4] Adjust path to C4/SIP

koha-stop-sip (shell script):
[1] Remove KOHA_CONF and PERL5LIB (not needed to stop the daemon)
[2] Same for paths in daemon client options

NOTE: Script debian/scripts/koha-upgrade-to-3.4 has been left out
intentionally.

Test plan:
[1] Regular install:
    Run koha-foreach echo Hi
    Run koha-upgrade-schema yourinstance
    Run koha-shell yourinstance
    If you have plack, run koha-plack --start|--stop yourinstance
    Run koha-sitemap --generate yourinstance
    Run koha-start-sip yourinstance
    Run koha-stop-sip yourinstance

[2] Dev install [yourinstance] with <dev_install> in koha-conf.xml:
    Run koha-upgrade-schema yourinstance
    Run koha-shell yourinstance
    If you have plack: koha-plack --start|--stop yourinstance
    Run koha-sitemap --generate yourinstance
    Run koha-start-sip yourinstance
    Run koha-stop-sip yourinstance

[3] Git grep on koha/lib
    You should no longer see occurrences in debian/scripts except:
    koha-translate: see report 16749
    koha-upgrade-to-3.4: left out intentionally

[4] Git grep on koha/bin
    You should only see hits for lines with koha-functions in the
    debian scripts except:
    koha-upgrade-to-3.4: left out intentionally

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Most scripts tested on Wheezy (although it would not matter much).
Plack script tested on Jessie.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16733: Adjust koha-rebuild-zebra
Marcel de Rooy [Wed, 15 Jun 2016 11:57:12 +0000 (13:57 +0200)]
Bug 16733: Adjust koha-rebuild-zebra

[1] Add a call to the new adjust_paths_dev_install
[2] Differentiate location of rebuild_zebra.pl
[3] Replace a hardcoded path by $PERL5LIB

Test plan:
Adjust a biblio record in package or dev install.
Run koha-rebuild-zebra -b -z for same instance.
Verify that the change has been indexed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16733: Adjust koha-indexer
Marcel de Rooy [Wed, 15 Jun 2016 11:43:41 +0000 (13:43 +0200)]
Bug 16733: Adjust koha-indexer

[1] Add a call to the new adjust_paths_dev_install
[2] Differentiate location of rebuild_zebra.pl

NOTE: The scripts assume koha-functions.sh to be in /usr/share/koha/bin.
Finding a better location for this shell library may be hard.

Test plan:
Run koha-indexer for a regular package install or a dev install.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16733: Add adjust_paths_dev_install to koha-functions.sh
Marcel de Rooy [Tue, 14 Jun 2016 14:00:58 +0000 (16:00 +0200)]
Bug 16733: Add adjust_paths_dev_install to koha-functions.sh

This new function checks koha-conf.xml for a given instance and if it
contains a dev_install line, it adjusts PERL5LIB and KOHA_HOME
accordingly. Otherwise it does not touch the values of these
variables as normally read from /etc/default/koha-common.

The function will be used in various debian scripts to allow for more
flexibility with dev installs. And at the same time aiming to make better
use of PERL5LIB and KOHA_HOME.

Test plan:
[1] Add <dev_install>/not/there</dev_install> to your koha-conf.xml.
[2] Run on the command line:
        PERL5LIB=test
        source [path-to-your-instance]/debian/scripts/koha-functions.sh
        echo $PERL5LIB
        adjust_paths_dev_install [name-of-your-instance]
        echo $PERL5LIB
    The last echo should be: /not/there
[3] Remove the <dev_install> line and repeat step 2.
    The last echo should be: test

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoSCHEMA UPDATE for Bug 17260 - updatedatabase.pl fails on invalid entries in ENUM...
Katrin Fischer [Sun, 14 May 2017 12:35:48 +0000 (12:35 +0000)]
SCHEMA UPDATE for Bug 17260 - updatedatabase.pl fails on invalid entries in ENUM and BOOLEAN columns

7 years agoDBREV for Bug 18066 - Hea - Version 2
Katrin Fischer [Sun, 14 May 2017 12:32:50 +0000 (14:32 +0200)]
DBREV for Bug 18066 - Hea - Version 2

7 years agoBug 18066: Remove warnings from translate script
Jonathan Druart [Mon, 24 Apr 2017 19:26:31 +0000 (16:26 -0300)]
Bug 18066: Remove warnings from translate script

This patch removes the following warnings:
Use of uninitialized value $pref_name in concatenation (.) or string at
LangInstaller.pm

(cherry picked from commit bcc04652762ff097623630432946ca9203f7519f)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18066: Add the new geolocation column to kohastructure.sql
Jonathan Druart [Thu, 23 Mar 2017 16:31:24 +0000 (13:31 -0300)]
Bug 18066: Add the new geolocation column to kohastructure.sql

(cherry picked from commit 64812347c9536340484f17758c6881ca882987d6)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18066: Fix map positioning in admin/usage_statistics.pl
Julian Maurice [Tue, 21 Mar 2017 11:01:45 +0000 (12:01 +0100)]
Bug 18066: Fix map positioning in admin/usage_statistics.pl

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit c3db243ad459782362c7051a648730bc51fda83d)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18066: Fix tests
Jonathan Druart [Tue, 21 Mar 2017 10:21:38 +0000 (07:21 -0300)]
Bug 18066: Fix tests

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 7aff8696614604960b7244fac798a28c4438fc36)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18066: Use https for ws
Jonathan Druart [Tue, 28 Feb 2017 17:13:07 +0000 (17:13 +0000)]
Bug 18066: Use https for ws

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit c302fd2bea710c960db7bc14aeac762c865f677a)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18066: Do not use token for OSM tiles
Jonathan Druart [Tue, 28 Feb 2017 11:16:56 +0000 (11:16 +0000)]
Bug 18066: Do not use token for OSM tiles

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 0d479976af81df3a66024e4ffc18ecc2038c0103)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18066: Add the leaflet library
Jonathan Druart [Tue, 7 Feb 2017 08:31:28 +0000 (09:31 +0100)]
Bug 18066: Add the leaflet library

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit f3c4c7016128e6550230cd44f8efedf0374db25e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18066: Hea V2
Jonathan Druart [Thu, 2 Feb 2017 15:53:58 +0000 (16:53 +0100)]
Bug 18066: Hea V2

This patch is the Koha part of the Hea v2 project.
You can find the (testing) code for the server at
  hea-ws  - https://github.com/joubu/hea-ws/commits/v2
  hea-app - https://github.com/joubu/hea-app/commits/v2
They contain the different pull requests made over the last 6 months.

More information on Hea at https://wiki.koha-community.org/wiki/KohaUsageStat_RFC
The goal of this commit message is to provide an overview of what could
be a new version of Hea.

Prior to these changes, the Hea database was filled with 1 line per Koha
installation. System preferences were filled by the libraries and a
cronjob (share_usage_with_koha_community.pl) collected these values to send
them to a webservice (hea-ws/upload.pl).

With the need to collect more data we would want to collect data at the library
level (branch) and not at the installation level.
For instance the geolocation, the url or the country can be different from one
library to another, even if managed from the same Koha installation.
The Hea DB has been upgraded to reflect that change (see hea-app/sql/schema.sql).

The hidden goal of this patch is to make Hea sexier and explain
better to libraries how it can be useful to share their information
with the Koha community. I guess the main problem is the lack of
communication and explanations about what we are doing we these data.
To fill this gap I'd like to (TODO)
  1. Communicate on the ML about this new version of Hea (once it got
pushed and backported)
  2. Link the Privacy_Policy.md from the Hea interface
  3. Get help from a native English speaker to add
popup/help/info/whatever on "Home › Administration › Usage statistics",
to clearly explain what happens (and what will not happen!) when an option or
another is set.

You can find screenshot of this whole enhancement on bug 18066, comment 2.

What this patch does:
- Create a new branches.geolocation DB field
- Add 3 new sysprefs:
  * UsageStatsGeolocation
  * UsageStatsLibrariesInfo
  * UsageStatsPublicID
- Integrate the Leaflet JS library to get a fancy map to pick
geolocations

How does it works:
On the new administration page where statistics to share are configured,
there are several new things. It is now possible to share information either
per Koha installation or libraries. If UsageStatsLibrariesInfo is set,
the info at library level (url, name, country, geolocation) will be
sent to the Hea webservice. If it is not set, you can decide to fill
UsageStatsLibraryUrl, UsageStatsLibraryName, UsageStatsCountry,
UsageStatsGeolocation to share these information. Note that even if the
data are retrieved at installation level, it's better to fill the prefs
as well: On the Hea website the different libraries defined for a given
Koha installation could be displayed on the same page.
This page is a public page which will be attributed to every
installation (with the pref UsageStatsPublicID). On this page all the
info available publicly will be displayed.

TODO later:
- Add a button on the administration page to delete the info shared
publicly. It will be easy to show that the info are no longer displayed
on the public page.
- Add an icon per Koha installation to get a better "public page"
- Any suggestions?

Test plan:
We will need to test hea-ws, hea-app and the Koha-side code to test the
whole enhancement.
1/ To start, clone the hea-ws and hea-app project and checkout the
'master' branch (*not* 'v2')
2/ Create the hea database and user
  CREATE DATABASE hea
  CREATE USER 'hea'@'localhost' IDENTIFIED BY 'hea';
  GRANT ALL PRIVILEGES ON hea.* TO 'hea'@'localhost';
  FLUSH PRIVILEGES;
3/ Fill the DB with some data
  mysql hea < hea-app/sql/schema.sql
  mysql hea < hea-app/sql/sql/mock-data.sql
4/ Checkout the 'v2' branch for both hea-ws and hea-app
5/ Execute the upgrade DB script
  % cd hea-app
  % perl -p -i -e 's/REPLACE_ME/hea/' sql/upgrade.pl # Fill the DB info
  % perl sql/upgrade.pl
Now the DB is using the v2 structure. That means we have 1 installation
row per library previously defined. 1 library row has also been created.
5/ Configure hea-ws
% echo '192.168.50.1 hea.koha-community.org' >> /etc/hosts
<VirtualHost *:80>
  DocumentRoot "/path/to/hea-ws"
  ServerName "hea.koha-community.org"
  <Directory "/">
    Options +ExecCGI
    Require all granted
    AddHandler cgi-script .pl
  </Directory>
</VirtualHost>

And enable it with a2ensite, then restart apache.
The copy the database.yml.sample to database.yml and edit it to fill the
DB info.

6/ Launch the hea-app
  % cd hea-app
  % edit README.md # to install the missing modules
  % cp environments/config.yml environments/development.yml
  % edit environments/development.yml # to fill the DB info
  % perl bin/app.pl
Then hit localhost:3000
You should see a local version of Hea with sample data

7/ Back to Koha side
A. We will test that the webservice still works with previous version of Koha (without v2)
a. Do not configure Hea
  % perl misc/cronjobs/share_usage_with_koha_community.pl -f -v
Then hit localhost:3000
=> Nothing added
b. Configure Hea on admin/usage_statistics.pl
perl misc/cronjobs/share_usage_with_koha_community.pl -f -v
=> New library added
c. Modify the Hea configuration
perl misc/cronjobs/share_usage_with_koha_community.pl -f -v
=> Info are modified

B. Not we will test that it works with the new version (much more fun ;))
% git checkout hea-v2 # koha
a. Configure Hea using /admin/usage_statistics.pl
perl misc/cronjobs/share_usage_with_koha_community.pl -f -v
=> Check the result on localhost:3000
b. Share libraries's info
perl misc/cronjobs/share_usage_with_koha_community.pl -f -v
c. Continue to play a bit and share the info.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 63a1adff9097493be0329aebab5fb3bf8a627b80)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14608: Move country list to an include file
Jonathan Druart [Sun, 12 Mar 2017 22:54:58 +0000 (19:54 -0300)]
Bug 14608: Move country list to an include file

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 6b626b64944dff0ba0adff99da26e3bbe8eb7544)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14608: Follow up on labels and search box
Mark Tompsett [Fri, 13 Jan 2017 18:33:05 +0000 (13:33 -0500)]
Bug 14608: Follow up on labels and search box

This addresses concerns raised in comment #26 and comment #27.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit ffbeae312bb472a58adf33e13b8c3d5f9124f0af)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14608: Add a reference to Hea at the end of the installer process
Jonathan Druart [Tue, 20 Dec 2016 22:31:41 +0000 (22:31 +0000)]
Bug 14608: Add a reference to Hea at the end of the installer process

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 384b69462e6005e316680b88de304095a39a318b)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14608: Add a link from the admin home page
Jonathan Druart [Tue, 20 Dec 2016 22:31:25 +0000 (22:31 +0000)]
Bug 14608: Add a link from the admin home page

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 601312c6c80e82837869b4eb2c91686c6a1361b3)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 14608: Add a page to configure shared statistics
Jonathan Druart [Tue, 20 Dec 2016 22:29:53 +0000 (22:29 +0000)]
Bug 14608: Add a page to configure shared statistics

This patch set adds:
- a reference to Hea at the end of the installation process
- a link to the new page from the admin home page
- a new page to easily configure shared statistics

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 3d46c0c7bb8ce487f85cd0d0233cb7ceffcbbde3)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17618: perl-modules Debian package name change
Mirko Tietgen [Sat, 12 Nov 2016 07:50:04 +0000 (08:50 +0100)]
Bug 17618: perl-modules Debian package name change

Newer versios of perl-modules have a version number in the package name.
This patch makes Koha aware of perl-modules-5.22 and perl-modules-5.24

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0c5905843dfc55e422c667f9d0aa6f243f56f1a8)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17936 [Generated CSS] Search bar not aligned on right in small screen sizes
Kyle M Hall [Fri, 12 May 2017 13:18:04 +0000 (09:18 -0400)]
Bug 17936 [Generated CSS] Search bar not aligned on right in small screen sizes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ca50a65cb8ca6dcc61fcdd46428e45e967d4ea87)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17936 - Search bar not aligned on right in small screen sizes
Owen Leonard [Sat, 29 Apr 2017 17:45:48 +0000 (17:45 +0000)]
Bug 17936 - Search bar not aligned on right in small screen sizes

This patch tweaks the OPAC's CSS so that the main search form's fields
have consistent width at small screen sizes.

To test, apply the patch and process the LESS files. View the OPAC main
page at a very narrow browser width and confirm that the text field
width matches that of the dropdown and button.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e94709cd7efaf3151ef1bde9278bc063a6ddcac1)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17925: Disable debugging in reports/bor_issues_top.pl
Marcel de Rooy [Tue, 17 Jan 2017 15:49:40 +0000 (16:49 +0100)]
Bug 17925: Disable debugging in reports/bor_issues_top.pl

Remove setting $debug to 1. This prevents creation of file
tmp/bor_issues_top.debug.log.
Enable warnings pragma.
Resolve a uninitialized warning on $sep like:
Use of uninitialized value $CGI::Compile::ROOT::usr_share_koha_masterclone_reports_bor_issues_top_2epl::sep in string eq at /usr/share/koha/masterclone/reports/bor_issues_top.pl line 66.

Test plan:
Restart Plack (as you always do when testing).
Remove file /tmp/bor_issues_top.debug.log.
Open Reports/Patrons with the most checkouts.
Check if the file in /tmp has not been created again.
Check the log for warnings after you restarted Plack.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e739fecbc83ff0ee32f155ae7e74c4780a5201c2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18504 - Amount owed on fines tab should be formatted as price if <10 or credit
Nick Clemens [Thu, 27 Apr 2017 19:39:35 +0000 (15:39 -0400)]
Bug 18504 - Amount owed on fines tab should be formatted as price if <10 or credit

To test:
1 - Give a patron a fine of 1
2 - View opac fines tab, it shows as '1'
3 - Give patron a credit of '1'
4 - View opac fines tab, it shows as '1'
5 - Apply patch
6 - Both now show as '1.00'

Signed-off-by: Lisa Gugliotti <lisa@hchlibrary.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6da7ed1d8c17960e1e90b8f197fe948d4ed25bad)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16515 [Generated CSS] Did you mean? links don't wrap on smaller screens
Owen Leonard [Sat, 29 Apr 2017 18:48:05 +0000 (18:48 +0000)]
Bug 16515 [Generated CSS] Did you mean? links don't wrap on smaller screens

Processed and minified CSS.

Works as expected and looks much tidier now.
Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e3141c6fff2b80f10b536411cefa64152cfb99da)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16515 - Did you mean? links don't wrap on smaller screens
Owen Leonard [Sat, 29 Apr 2017 18:45:30 +0000 (18:45 +0000)]
Bug 16515 - Did you mean? links don't wrap on smaller screens

This patch tweaks some CSS in the OPAC to give the "Did you mean" block
better layout on smaller screens.

To test, apply the patch and process LESS files. Enable "Did you mean"
plugins for the OPAC in Administration.

Perform a search in the OPAC and confirm that the "Did you mean" block
looks correct. Resize your browser to various widths and confirm that
the block handles all sizes well.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 893ead43f751df78bfdcb23ebb137b7975885ec9)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18383 - Correct items.onloan schema comment
pongtawat [Tue, 4 Apr 2017 16:06:45 +0000 (23:06 +0700)]
Bug 18383 - Correct items.onloan schema comment

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended to include items and deleteditems.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 69a24812eda9c10841d8f20ce4c689305703b6f0)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17257: Fix add/edit patrons under MySQL 5.7
Jonathan Druart [Tue, 6 Sep 2016 09:12:20 +0000 (10:12 +0100)]
Bug 17257: Fix add/edit patrons under MySQL 5.7

If no guarantor is defined the patron won't be added/modified and an
error will be raised:

DBD::mysql::st execute failed: Incorrect integer value: '' for column
'guarantorid'

Test plan:
Using MySQL 5.7 (and/or sql_mode=STRICT_TRANS_TABLES)
Create a patron without guarantor

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Tested with MariaDB 10.0.30 (sql_mode='STRICT_TRANS_TABLES')
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 720071004516ec4e119dc5ec7f9538b56313b186)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18444: Add TalkingTechItivaPhoneNotification to sysprefs.sql
Lari Taskula [Tue, 18 Apr 2017 12:24:26 +0000 (12:24 +0000)]
Bug 18444: Add TalkingTechItivaPhoneNotification to sysprefs.sql

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3e1f21ae0ddcef1c351639e228410f8523f5efe4)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18370: Use splice instead of splice
Jonathan Druart [Thu, 11 May 2017 15:37:24 +0000 (12:37 -0300)]
Bug 18370: Use splice instead of splice

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ec822b855244cacf36757e9028779ad9d270c370)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18370: Columns visibility on patron search - Hide the correct column
Jonathan Druart [Mon, 3 Apr 2017 14:50:07 +0000 (11:50 -0300)]
Bug 18370: Columns visibility on patron search - Hide the correct column

When a column is hidden by default on the patron search result table,
if the logged in user does not have the "tools > manage_patron_lists"
permission, the wrong column will be hidden.

Test plan:
Edit the column visibility detail for "Patrons > id=memberresultst"
Set "Fines" hidden by default
Search for patrons
=> Without this patch, if the logged in user does not have the
manage_patron_lists permission, the wrong column will be
hidden/displayed.

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0a2b14dd16292572e5163e5dfa491432be1660d2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18340: Fix progress bar length
Jonathan Druart [Mon, 27 Mar 2017 20:18:22 +0000 (17:18 -0300)]
Bug 18340: Fix progress bar length

The progress bar (for background jobs) should be fully filled when 100%
is hit, right? :)
It has been introduced quite long time ago when the size of the progress
bar has been changed from 150 to 200px, and the code has been
refactored.

Test plan:
Launch a big modification/deletion of records/items in a batch.
You should see the progress bar progressing to 100 and reach 100!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e424bd0d84d4aa30ceae5e6cea0ee453413f0ef9)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18535 - Clicking 'edit printer profile' in label creator causes software error
Nick Clemens [Wed, 3 May 2017 20:43:22 +0000 (16:43 -0400)]
Bug 18535 - Clicking 'edit printer profile' in label creator causes software error

1) Go to Tools > Label creator
2) If you don't have a printer profile defined, create one.
3) Go to manage > Printer profiles
4) Click the 'edit' button on any of the profiles.
5) INTERNAL SERVER ERROR! "Can't use string ("fields") as a HASH ref
while "strict refs" in use at /usr/share/koha/lib/C4/Creators/Lib.pm
line 147"
6) Apply patch
7) Click the 'edit' button on any of the profiles.
8) Things work as expected

Bug reproduced, is fixed by this patch
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit af845c143a4f5a8fb1ea88cac3478ef91a1bdb9c)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 4460: Amazon's AssociateID tag not used in links so referred revenue lost
Mark Tompsett [Tue, 21 Jun 2016 18:49:32 +0000 (14:49 -0400)]
Bug 4460: Amazon's AssociateID tag not used in links so referred revenue lost

Reworking based on output of:
git grep "gp\/reader"
Additionally, some changes might be in order though gp/reader works.
https://affiliate-program.amazon.com/help/topic/t64/a1
suggests using dp
A dp was discovered, so that part of the URL was left unchanged.
The "/ref..." part was changed to just an Amazon tag ("?tag={AAT}")
if defined.

TEST PLAN
---------
 1) Added:
     "100 years of Canadian foreign policy /
      edited by Robert Bothwell and Jean Daudelin."
 2) Added a second book with the word foreign in the title.
 3) Waited for reindex
 4) Checked out the Canadian foreign policy book.
 5) Applied patch
 6) Made sure that:
    - AmazonAssocTag was set to TEST (easy to notice)
    - AmazonCoverImages was set to 'Show'
    - OPACAmazonCoverImages was set to 'Show'
 7) Searched intranet for 'foreign' to find the detail page
    -- hovering over picture shows URL with ?tag=TEST in it.
 8) Went to the OPAC Detail page
 9) Toggling OPACURLOpenInNewWindow, confirmed that URL for
    the picture contained ?tag=TEST in it.
10) Logged into the OPAC
11) Confirmed the URL in the checked out list on your summary
    page contained ?tag=TEST in it.
12) Confirmed the URL in the checked out list on your reading
    history page contained ?tag=TEST in it.
13) Confirmed links worked (went to expected page)
14) run koha qa test tools

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 463c5a0f25a1e2dfc3331319bd86f17b4114821e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18525: (bug 14828 follow-up) FIX ordering from suggestion when item-level_itypes...
Jonathan Druart [Tue, 2 May 2017 22:12:49 +0000 (19:12 -0300)]
Bug 18525: (bug 14828 follow-up) FIX ordering from suggestion when item-level_itypes = biblio

When ordering from a suggestion with item-level_itypes = biblio the app
crashes with
Template process failed: undef error - The method selected is not
covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121.

C4::ItemTypes->all did not set a selected flag. The item type is only
display when ordering (and not modifying an order).
The flag is never set, the test can be removed.

Test plan: Confirm that the error is gone

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 9a3ad32e468f2a006a43577031f3aa50b83fb3d8)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16758: Use the default cache instance
Jonathan Druart [Mon, 8 May 2017 15:43:43 +0000 (12:43 -0300)]
Bug 16758: Use the default cache instance

I do not see a valid reason not to use the default one instead of the
syspref one.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit caa4cccfa09cdf5c9816634194000307ac508578)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 16758 - Caching issues in scripts running in daemon mode
Jacek Ablewicz [Wed, 14 Sep 2016 13:33:07 +0000 (15:33 +0200)]
Bug 16758 - Caching issues in scripts running in daemon mode

As L1 cache does not have expiration mechanism, scripts running
in daemon mode (rebuild_zebra.pl -daemon, sip server ?, ...) would
not be aware of any possible changes in the data being cached
in upstream L2 cache.

This patch adds ->flush_L1_caches() call in rebuild_zebra.pl
inside daemon mode loop.

To test:

1) apply patch
2) ensure that rebuild_zebra.pl -daemon is still working properly,
without any noticeable performance degradation
3) stop memcached daemon and try to run rebuild_zebra.pl -daemon
again: there should be a warning emitted stating that the script
is running in daemon mode but without recommended caching system

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 84dbc80074b5b1ada05b815cba810e4c5fb10dd2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18560: RSS link in opac shelves is broken
Mark Tompsett [Tue, 9 May 2017 04:15:23 +0000 (00:15 -0400)]
Bug 18560: RSS link in opac shelves is broken

TEST PLAN
---------
1) have books entered
2) log in create a list
3) add books to list
4) display list
5) click the RSS link button.
   -- bad HASH error.
6) apply patch
7) repeat steps 4&5
   -- readble junk without error messages.
8) run koha qa test tools

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f3167a5259a5adb5cc00455bb81a269e29081742)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18574 - Clean Patron Records tool doesn't limit to the selected library
Kyle M Hall [Wed, 10 May 2017 15:46:36 +0000 (11:46 -0400)]
Bug 18574 - Clean Patron Records tool doesn't limit to the selected library

The library selector simply does nothing because at some point the
javascript that powers it was removed. This is very bad because
the librarian may batch delete patrons assuming it is limiting by
branch correctly and instead delete patrons for all the libraries!

Test Plan:
1) Note that the library pulldown on tools/cleanborrowers.pl does nothing
2) Apply this patch
3) Note that chaning the value in the pulldown now refreshed the page and sets the library correctly!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7a4f3c17a8fe518534658009d075dcdc1d537b62)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBUG 18505: opac-search-history does not respect opacPublic
Martin Renvoize [Fri, 28 Apr 2017 07:48:50 +0000 (08:48 +0100)]
BUG 18505: opac-search-history does not respect opacPublic

The opac-search-history page was available regardless of the opacPublic setting, this
patch corrects that.

Test plan, set opacPublic to 'No', test whether opac-search-history page is available
when not logged in, note that it is.
Apply patch, test whether opac-search-history is still available when not logged in,
note that you should be redirected to the login page.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 94e09b6a186a4a8f1a2a470c41493ad228d0be20)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18494: Pass a code, not hash & Fix double commas
Mark Tompsett [Mon, 1 May 2017 16:46:20 +0000 (12:46 -0400)]
Bug 18494: Pass a code, not hash & Fix double commas

TEST PLAN
---------
1) prove -v t/db_dependent/Letters.t
   -- fails at test 5 or so.
2) apply patch
3) run step 1
   -- success
4) run koha qa test tools

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5da5910cf1fb69810b11de1fd4362fc2128d1e46)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18233 - t/db_dependent/00-strict.t has non-existant resetversion.pl
Olli-Antti Kivilahti [Wed, 8 Mar 2017 16:12:59 +0000 (18:12 +0200)]
Bug 18233 - t/db_dependent/00-strict.t has non-existant resetversion.pl

Removes a warning.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit fac7ba914d7f3071102563109ce843f1e97bc46f)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17812 - Return focus to barcode field after toggling on-site checkouts
Owen Leonard [Tue, 3 Jan 2017 15:08:32 +0000 (15:08 +0000)]
Bug 17812 - Return focus to barcode field after toggling on-site checkouts

This patch changes the behavior of the checkout form so that after
checking boxes in the "checkout settings" panel the cursor focus is
automatically moved to the barcode field.

To test, apply the patch and enable OnSiteCheckouts and
decreaseLoanHighHolds system preferences.

- Open any patron account in circulation.
- Expand the "Checkout settings" panel.
- Click the label or checkbox for "Automatic renewal", "Don't
  decrease checkout length based on holds" and "On-site checkout"
- Confirm that the focus has moved to the barcode field.

Works as advertised.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@ccsr.qc.ca>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d16bcb70e7066b6e4c908f560affb281018e788e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17190 - Marked REST API as mandatory (require = 1) in PerlDependencies.pm
Alex Buckley [Sun, 19 Mar 2017 12:00:48 +0000 (12:00 +0000)]
Bug 17190 - Marked REST API as mandatory (require = 1) in PerlDependencies.pm

For testing I went in Staff client to Home > About Koha > tab  Perl modules
and verified that both Mojolicious (6.0) and Swagger2 (0.59) are marked
as mandatory.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a900a434d50ae232af81c74c98020af3f13bf0e5)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 18415 - Advanced Editor - Rancor - return focus to editor after successful macro
Nick Clemens [Tue, 11 Apr 2017 15:22:13 +0000 (11:22 -0400)]
Bug 18415 - Advanced Editor - Rancor - return focus to editor after successful macro

After running a macro we should return focus to the editor screen so
editing can continue from keyboard

To test:
1 - Create a macro
   007=vd cvaizq
2 - Run it and note focus is not on editor
3 - Apply patch
4 - Reload page
5 - Run macro
6 - Note focus is returned to editor

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4259ae2836822cfa656500be75c3fec770ef9788)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17993 - Do not use modal authentication with CAS - tags bis
Fridolin Somers [Mon, 27 Mar 2017 13:19:24 +0000 (15:19 +0200)]
Bug 17993 - Do not use modal authentication with CAS - tags bis

Bug 12046 corrected the fact that modal dialog does not allow to use the
CAS authentication in main authentication link. This must also be
corrected in link for tags in detail tags page: "Log in to see your own
saved tags."

Test plan :
- Enable syspref casAuthentication
- Go to OPAC, not authenticated
- Click on "Tag cloud"
- Click on "Log in to see your own saved tags"
=> Without patch you get the modal login popup
=> With patch you go to the login page opac-user.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f71e3a78b9ad35e7839271de80d89c9044c268c6)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
7 years agoBug 17993 - Do not use modal authentication with CAS - tags
Fridolin Somers [Wed, 25 Jan 2017 13:47:02 +0000 (14:47 +0100)]
Bug 17993 - Do not use modal authentication with CAS - tags

Bug 12046 corrected the fact that modal dialog does not allow to use the CAS authentication in main authentication link.
This must also be corrected in link for tags in detail page : "Log in to add tags"

Test plan :
- Enable syspref casAuthentication
- Go to OPAC
- Go to a record detail page opac-detail.pl
- Click on "Log in to add tags"
=> Without patch you get the modal login popup
=> With patch you go to the login page opac-user.pl

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 34e813c8d053382313a804c8b2682f138f166926)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>