Commit Graph

30816 Commits

Author SHA1 Message Date
Jonathan Druart f0db075dde Bug 21011: Search for items with not defined homebranch and/or holdingbranch
From bug 5789: scripts can fail if items.homebranch and/or
items.holdingbranch is not defined

This script will help people catching these migration issues.

Test plan:
Update your items table to set some homebranch or holdingbranch to NULL
Run this script
It will display the different items with not defined values in these
fields.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7d47bb3118)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b5b74454cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:46:48 +02:00
Katrin Fischer 2a7f362d20 Bug 20631: Remove unused RemoveLostItem from C4::Accounts
RemoveLostItem was 'used' in C4::Accounts, but is not
actually used there.

Call has been removed by
  commit ed9cf81c3a
  Bug 15896 - Use Koha::Account::pay internally for makepayment

To test:
- Verify that the routine was actually not used!

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9ccfa48f6e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8b1944bbd8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:44:06 +02:00
Katrin Fischer a457318423 Bug 20504: Fix lang attribute in html tag on systempreferences page
On the system preferences page the lang attribute of the
html tag is always empty.

To test:
- Go to systempreferences
- Check the html source and look at the html tag,
  it should read: <html lang="">
- Apply patch
- Check the html source again: <html lang="en">
  Verify the language code shown matches the currently
  selected language in the staff interface
- Verify the language system preferences work correctly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The problem was actually that
  $lang = $template->param( 'lang' );
should certainly be $lang = $input->param( 'lang' );
and, as it, it overrides the value of 'lang' passed from C4::Auth

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 56c50a6616)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 32b01b2642)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:36:01 +02:00
Katrin Fischer 85b488a9ea Bug 7996: (QA follow-up) Remove unnecessary permission check view logs template
Permission is checked in the perl file, no need to check again
in the template.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3484db7187)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b1aa841e1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:32:14 +02:00
Nick Clemens 3c78199927 Bug 7996: Correct wrong permissions for modification log
To test:
 1 - Create a staff patron with catalogue,borrowers,and view_system_logs
     permissions
 2 - Log in using that patron
 3 - Go to tools
 4 - Click 'Log viewer'
 5 - You get a blank page
 6 - View borrower circ screen, note you do not see 'Modification log'
 7 - Edit a borrower, note you do not see 'Modification log'
 8 - Apply patch
 9 - 'Log Viewer' should now load correctly
10 - You should see 'Modification log' tab during circ
11 - You should see 'Modification log' tab when editing patron

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a750ebdbd9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d8b3095f7d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:31:56 +02:00
Owen Leonard 2fdf6e2322 Bug 19511: Local cover images not centered in table column in staff client search results
This patch modifies the JavaScript which embeds local cover images in
staff client catalog search results. It now adds the "thumbail" class to
the image, matching Amazon cover images.

To test you should have one or more titles with local cover images
attached. Apply the patch and clear your browser cache if necessary.

Enable both the AmazonCoverImages and LocalCoverImages system
preferences and perform a search which will return titles with local
cover images. Confirm that local covers are styled like Amazon covers.

Tested and confirmed local cover images are appearing quite nicely now.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit afa51869c3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 683589ec95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:25:49 +02:00
Nick Clemens 463e7de027 Bug 21144: DBRev 17.11.09.002
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit df06587b76)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4ee626a6f3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:22:19 +02:00
Katrin Fischer 9fee5ac6fd Bug 21144: Add ROADTYPE to default authorised values categories
The ROADTYPE category was missing from the default list of
authorised value categories available.

To test:
- Verify ROADTYPE is not listed as authorised value category
- Apply patch and run database update
- Verify ROADTYPE is now listed
- Add an entry, for example: AV = Avenue
- Add or edit a patron, verify a pull down with your entry
  shows on the form.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 266d7b5fa8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6c099d4360)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:18:51 +02:00
Jonathan Druart 859eb738f4 Bug 21142: Open uploaded files in utf-8 - batch mod/del
Batch item/record modification/deletion tools does not open uploaded
files in utf-8

Test plan:
Edit and delete records and items using a file which will contain:
valid and invalid barcodes with and without utf-8 chars (💕)

You should see the warning message:
 "The *** 39999000💕001679 does not exist in the database."

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f5f31679bf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0d7ba4634a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:15:24 +02:00
Jonathan Druart 659d4cc0d4 Bug 21238: Prevent TemplateToolkit.t to fail on slow servers
It failed 3x in the last 6 runs (on node 1), we should mock
DateTime->now to prevent it to fail again.

The error is:
koha_1       |         #   Failed test at
t/db_dependent/Letters/TemplateToolkit.t line 724.

When comparing <<today>> replacement:
koha_1       |         # 08/16/2018 14:25<br />
[...]
koha_1       |         # 08/16/2018 14:24<br />

Let's mock DateTime->now to prevent it to fail again.

Test plan:
0. Do not apply this patch
1. Add "sleep(60);" at line ~715, before "# Add a second checkout"
2. Run the tests
=> Fail!
3. Apply this patch
4. Run the tests again
=> Pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d24d77d495)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fba97f0772)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:13:05 +02:00
Jonathan Druart 2aeacaa96e Bug 21230: Prevent Reserves.t to fail randomly
The following test can fail if the hold has been generated with found => 'W':
 #   Failed test 'No tests run for subtest "_koha_notify_reserve() tests"'
 #   at t/db_dependent/Reserves.t line 675.
Can't call method "to_address" on an undefined value at
t/db_dependent/Reserves.t line 661.
 # Looks like your test exited with 255 just after 56.

We should call AddReserve instead.

Test plan:
0. Do not apply this patch
1. Do the following change:
    my $hold = $builder->build({
            source => 'Reserve',
            value => {
               borrowernumber=>$hold_borrower,
               found => 'W', # This line is added, do not forget the comma above
            }
        });
2. Prove it makes the test fail
3. stash the changes and apply this patch
4. Make sure the tests pass

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c957b52ef8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c359d56f25)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 15:03:37 +02:00
Jonathan Druart 70284a33e4 Bug 20795: Inform the user about this change, add to pod
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e97f6ab9be)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40bfb7913d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:43:48 +02:00
Nick Clemens f45a8fa715 Bug 20795: Pass incrreased verbosity to zebra rebuild script
To test:
1 - Run koha-rebuild-zebra with multiple '-v'
2 - Note no increased verbosity
3 - Apply patch
4 - Run the updated koha-rebuild-zebra script with multiple '-v'
5 - Note increased verbosity

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1dfb177d3f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dbdd2b5630)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:43:41 +02:00
Owen Leonard 055127e9e8 Bug 21164: Fix alignment on new basket form in acquisitions
This patch removes some unnecessary "&nbsp;"'s from the template for
creating a new basket in acquisitions. This fixes the alignment on the
form fields.

To test, apply the patch and go to Acquisitions -> Vendor -> New basket.
All the form fields should be correctly left-aligned with each other.

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2280877fdd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5fe28bf398)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:41:17 +02:00
Owen Leonard a28cc6108b Bug 21185: Incorrect title tag on tags review page
This patch corrects the title tag on the tags review page.

To test, apply the patch and go to Tools -> Tags. The page title
(probably shown in the browser tab) should start with "Koha ->" instead
of "Home ->".

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ad0f90b797)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 718af573c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:40:18 +02:00
Katrin Fischer 5c34ec5664 Bug 19390: Make jQuery selector more specific, so OPAC view link can open in new tab
The OPAC view link in the staff result list already had a target="_blank",
but it didn't work, because of the JavaScript for the result list browser
in staff.

The JavaSript code was looking for the links to the detail page in staff
and this also selected the link to the detail page in OPAC. By changing
detail.pl to \detail.pl opac-detail.pl will no longer be selected.

To test:
- Search in the staff interface
- Click "OPAC view" links in staff result lists
- Click "OPAC view' links in detai page
- Verify both now open in a new tab
- Click other links and test that navigation (previous, next,
  return to results) works as expected
- Inside the staff client, you should see something like
  searchid=scs_1533922927978 added to the URLs

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 880afc9035)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit bed533eb34)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:37:43 +02:00
Nick Clemens 784b7d7af2 Bug 18635: Koha::Patron->guarantees() should return results alphabetically
To test:
1 - Add the same guarantor to a number of patrons, ensuring random order
alphabetically
2 - View the guarantors record, note unordered list of guarantees
3 - Apply patch
4 - Guarantees are alphabetical

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>
(cherry picked from commit fe6cb85c55)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 74a2565c99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:32:12 +02:00
Marcel de Rooy 3f24a07a7e Bug 21033: Remove few warns in acqui/basket.pl
Resolve (line numbers based on 16.11.x):
Use of uninitialized value in hash element at acqui/basket.pl line 337.
Use of uninitialized value in hash element at acqui/basket.pl line 338.
Use of uninitialized value in hash element at acqui/basket.pl line 340.
Use of uninitialized value in hash element at acqui/basket.pl line 342.
Use of uninitialized value in hash element at acqui/basket.pl line 344.

Argument "" isn't numeric in multiplication (*) at koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt line 486.
Argument "" isn't numeric in multiplication (*) at koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt line 591.

Test plan:
If you have older acq data, you may have records in aqorders with field
tax_rate_on_ordering is NULL. These orders will trigger the above warns.
If you do not have, you could simulate by setting this field to NULL.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit af82a1d597)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9a6ed1c852)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:18:02 +02:00
Jonathan Druart fc0841f554 Bug 21035: Handle new lines when running reports
See https://metacpan.org/pod/Text::CSV_XS#Embedded-newlines

Test plan:

1) Choose two items, say barcode '123' and '456'
2) Change the public note on 123 to read

Line1
Line2

(I.e. type 'Line1', then press Enter, type 'Line2' and click update).
3) Change the public note on 456 to read

Public note has one and only one line.

Click update.
4) Create a report with the followng query:

select barcode, itemnotes from items where barcode in ( '123', '456' )

Let's say that this is report number 10.

5) run ./misc/cronjobs/runreport.pl --format=csv REPORT_ID:

=> You should see both lines

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f16fb888f1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4fd18a7df7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:10:59 +02:00
David Cook 68828e1a53 Bug 21131: Remove the TinyMCE.isDirty() check that caused unexpected behaviour
When using the WYSIWYG editor for system preferences, the editor only
updates the textarea element if the content is different from the
original content. This means if you change a system preference and
then change it back to the original content, the textarea will have
the 2nd last change you made.

This patch removes the TinyMCE.isDirty() check, which was responsible
for comparing the original and changed content. Every input/keydown/dragend
or TinyMCE command will cause the textarea element to be updated and
trigger the input event which causes the "modified" class to be added
to the element, so that the system preference can be saved.

__TEST PLAN__

_Before applying_
0. Change "UseWYSIWYGinSystemPreferences" to "Show"
1. Change "opaccredits" to "123a"
2. Click "Save all OPAC preferences"
3. Reload the page
4. Change "opaccredits" to "123"
5. Change "opaccredits" to "123a"
6. Click "Save all OPAC preferences"
7. Reload the page
8. Note that "opaccredits" says "123"

_Apply the patch_

_After applying_
1. Change "opaccredits" to "123a"
2. Change "opaccredits" to "123"
3. Click "Save all OPAC preferences"
4. Reload the page
5. Note that "opaccredits" says "123" (and not "123a")
6. Change "opaccredits" to "1234"
7. Click "Save all OPAC preferences"
8. Reload the page
9. Note that "opaccredits" says "1234"

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f4cf075fbe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1dfa431826)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:05:17 +02:00
Owen Leonard 0afb31f619 Bug 19291: Make breadcrumbs for OPAC search history consistent with other patron account pages
This patch adds the logged-in patron's name to the search history page's
breadcrumb navigation.

To test, apply the patch and view the OPAC search history page with no
user logged in. The breadcrumbs should read:

- Home ->  Search history

Log in and return to the search history page. The breadcrumbs should
read:

- Home -> Owen Leonard -> Your search history

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ff3987c023)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fe9888e1ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 14:02:09 +02:00
Jonathan Druart a981f630dd Bug 21056: Add another flush later
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5abcd3312a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 88a2c8886c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:35:48 +02:00
Kyle M Hall b7ca04b769 Bug 21056: Changing the logged in library can fail sporadically
We are getting reports that sometimes changing the logged in library via selectbranchprinter.pl sometimes appears to fail. Flushing the session after updating the branch appears to fix this.

Test Plan:
1) Change your logged in library repeatedly. Hopefully ( sort of ) it will fail to change.
   You may want to try various browsers.
2) Apply this patch
3) Note the change no longer fails

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 76a06a7050)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0a5dabc271)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:35:34 +02:00
Owen Leonard 4a0708dd37 Bug 21148: Dropdowns styled by the Select2 plugin do not highlight missing required fields
This patch adds some CSS to target mandatory fields on the add item
screen which are styled by the Select2 plugin.

To test you must have at least one item field marked mandatory and
linked to an authorized value.

Open the add item form for an existing record. Try to submit the form
without making a selection in the mandatory dropdown. You should get an
alert warning you that you have empty mandatory fields, and the field
should be highlighted in yellow.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 62aacb5865)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9bb74effa3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:32:18 +02:00
Nick Clemens fe4d3d5006 Bug 21075: Unit tests
prove -v t/db_dependent/Reserves/AutoUnsuspendReserves.t

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6e5865ee4f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 77f2da8fb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:25:00 +02:00
Nick Clemens 3908248f58 Bug 21075: AutoUnsuspendHolds should unsuspend holds <= today
To recreate:
 1 - Place a hold in your system
 2 - Set that hold (or all holds) to expire today
    update reserves set suspend_until=CONCAT( CURDATE()," 00:00:00");
 3 - Run misc/cronjobs/holds/auto_unsuspend_holds.p
 4 - Note the hold is sitll suspended
 5 - Visit /cgi-bin/koha/reserve/request.pl for the book with the hold
 6 - Note the suspend date is tomorrow (and cannot be set to today]
 7 - Click update holds - the date in db is now set to tomorrow
 8 - Reset to today
 9 - Apply patch
10 - Run the cron again
11 - Visit the page and note hold is unsuspended

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c0f7aed84d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9e67cff276)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:24:45 +02:00
Jonathan Druart ac56eda00a Bug 21139: (follow-up) Floating toolbars - Remove unecessary height
Found where QAing bug 20935, we actually want the hidden toolbar to be
the exact same height as the visible one.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 592905a4d2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 514939a804)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:22:39 +02:00
Jonathan Druart 06a44d405d Bug 21139: No table in toolbar
We do not need this selector, we will not have a table in the toolbar

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 40577065b6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 71adb4380c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:22:33 +02:00
Jonathan Druart 80a38c96ea Bug 21139: Floating toolbar - Resize toolbar on window resize
Prior to this patch the toolbar was not resized when the window was
resized

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5ecf4da7d4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5eecc789af)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:22:28 +02:00
Jonathan Druart 08213ef3e3 Bug 21139: Floating toolbar - Remove horizontal scrollbar on resize
To test:
- add/edit a patron
- resize the window
=> Without this patch a horizontal scrollbar appears when resized
shorter

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b5520f3e01)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 106ad2d6f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:22:24 +02:00
Jonathan Druart 60355e2253 Bug 21139: Floating toolbars - Remove unecessary height
This patch remove some pixels under the toolbar, they were used by the
hidden element.

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2588811ef2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3d0d2a3558)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:22:20 +02:00
Jonathan Druart 6842bc0c47 Bug 21139: Floating toolbar - Remove dup id
We should not have twice the same id, we always use fixFloat() on an
element with an id and then duplicate this element.
The id must be changed (just in case)

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 77196e9140)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit af2ccb13e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:22:15 +02:00
Jonathan Druart bc0cfb7d58 Bug 21099: Reposition floating toolbars earlier
To recreate:
- Go to the advanced search form
- scrolldown to position the toolbar on top of the window
- scrollup

https://screenshots.firefox.com/NnkFg3iOXqLPxfkd/pro.kohadev.org

The toolbar should have been repositioned earlier

Test plan:
Edit a patron
- scrolldown
- scrollup
- unfold the form in the header (tab "Search patrons", link "[+]")
- scrolldown
- scrollup
Advanced search
scrolldown
scrollup

You should notice the difference with and without this patch

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 68e735b101)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0d349fba89)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:20:38 +02:00
Marcel de Rooy 6af5e209a0 Bug 21048: (QA follow-up) Fix authorized value statuses in filter
If you select an authorized value status in the filter, you want to keep
it too just like normal statuses as CHECKED.
The variable selected_status was not filled. The minimal fix is adding that
template variable in the script. Note that suggestion.STATUS is out of scope
within a loop using suggestion as loop var.

Note: Adding a regular status like CHECKED as an authorized value with
same code but another description works, but is kind of confusing ;) Not
in the scope of this report though.

Test plan:
Select an authval status in the filter. Apply the filter and verify again
that it is still selected under Suggestion information.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b1e8193a84)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f5121183d9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:14:19 +02:00
Jonathan Druart 45cca9d1f2 Bug 21048: Fix display of suggestion's status (SUGGEST_STATUS)
When a suggestion's status is set to a customized value (AV
SUGGEST_STATUS), the description is not always displayed correctly.

Test plan:
- Create different values for the AV SUGGEST_STATUS
- Create several suggestions
- Change the status using the SUGGEST_STATUS values
- Edit the suggestion and change again the status
- View the suggestions for a given patron
(members/purchase-suggestions.pl?borrowernumber=XX), the statuses must
displayed correctly

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b25c063f95)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e81fdb07c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 12:13:47 +02:00
David Cook 0df11d446c Bug 21031: Apache Rewrite rules don't work for API when using anything but Debian package Plack configuration
The Rewrite rules for Apache don't work unless you're using
debian/templates/apache-shared-opac-plack.conf or
debian/templates/apache-shared-intranet-plack.conf.

This patch fixes the Rewrite rules for the non-Plack Debian
Apache configuration templates as well as the standard
Apache configuration file that comes with Koha.

__BEFORE APPLYING__
1. Visit /api/v1/app.pl/api/v1/spec on your git dev install
2. This should display a large page of JSON
3. Visit /api/v1/spec on your git dev install
4. This should generate a 404 error

__APPLY PATCH__

__AFTER APPLYING__
5. Visit /api/v1/app.pl/api/v1/spec on your git dev install
6. This should display a large page of JSON
7. Visit /api/v1/spec on your git dev install
8. This should display a large page of JSON (identical to
the one from earlier steps)

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Passed QA with few notes posted separately to Bugzilla.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c6b50f0bac)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 11b6ad197a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:57:55 +02:00
Owen Leonard d38fbd4c87 Bug 21094: Syndetics: always use https instead of http
This patch removes the 'using_https' check in OPAC templates in calls to
Syndetics resources. Instead, https is always used.

To test, apply the patch and enable Syndetics-related preferences. View
the following pages in the OPAC:

- Bibliographic detail page
  - Browse shelf section of the bibliographic detail page
- Search results
- List contents
- Recent comments
  - Recent comments RSS
- User summary page
  - Circulation history

NOTE: I tested with made-up Syndetics credentials. This means my changes
didn't make the template explode, but it doesn't confirm conclusively
that the resources work.

Signed-off-by: John Doe <you@example.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6e0548cc1a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40cf253a0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:55:14 +02:00
Katrin Fischer 34f6507185 Bug 21077: Fix database documentation for statistics.type
There's a typo for 'locause', this should be 'localuse'.
Also, 'Credit*' is never used.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0b89cbf6a4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dc490f7d86)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:54:30 +02:00
Jonathan Druart c110912af3 Bug 21134: Correctly throw the exception in Koha::Patron::Modification->approve
koha_1       |     # Looks like you planned 20 tests but ran 9.
koha_1       |
koha_1       | #   Failed test 'approve tests'
koha_1       | #   at t/db_dependent/Koha/Patron/Modifications.t line
259.
koha_1       | [Something went wrong]# Looks like your test exited with
255 just after 5.
koha_1       | [21:13:47] t/db_dependent/Koha/Patron/Modifications.t
.....................

"Something went wrong" should never been thrown,
Koha::Patron::Modification->approve raises $@, but it's not defined, it
should raise $_ instead

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6e99cfbca7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c6133753ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:46:26 +02:00
David Cook d802bf6722 Bug 21097: Missing optgroup closing tag in orderreceive.tt
There is a missing optgroup closing tag in orderreceive.tt. It doesn't
actually cause any display issues (at least in modern browsers), but
it's invalid markup, so this patch fixes it.

_TEST PLAN_
0. Add a budget and add a fund
1. Add a vendor
2. Add a basket
3. Add an order to a basket
4. Close the basket
5. Receive the order
6. Make sure the budget and fund both display when selecting the fund

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 12e18f91be)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 881781240c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:35:59 +02:00
Owen Leonard 711f65a689 Bug 20974: Remove files left behind after removing Solr
Some files were left behind when Bug 12538 removed support for Solr.
This patch removes them.

To test, apply the patch and fail to observe the existence of these
files:

koha-tmpl/opac-tmpl/bootstrap/en/includes/search/facets.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/search/page-numbers.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/search/resort_form.inc

Perform a search in the OPAC to confirm that nothing broke.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ad34ef74cd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 517827fb9c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:34:38 +02:00
Nick Clemens 3725ca1be9 Bug 21064: Use undefined instead of undef
To test:
1 - Load the advanced cataloging editor
2 - Refresh the page several times
3 - Check the JS console, you shoudl see an error:
    'undef is not defined'
4 - Apply patch
5 - Try again, should be no error

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 367f47c416)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f60c611972)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:32:20 +02:00
Jonathan Druart 7a75e0b963 Bug 21053: Encode URI characters in plugin 008
A # (or &) at any position in 008 field of a bib record causes
all subsequent data in field to be overwritten with default values when
record is saved.

These characters need to be correctly encoded before being passed as
parameters of the url

To reproduce:
1. Find and edit a bib record which has an 008 which differs from the
default values for the MARC framework
2. Choose 008 helper
3. Add # in any position before the end of the field noting the current
values of the data
4. Save record
5. Edit record and select 008 helper
6. Review characters after #

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bfdf896111)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 512ee5d576)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:30:18 +02:00
Nick Clemens 990b133fa7 Bug 21076: Don't call autocomplete code after patron found
To test:
1 - Enable article requests
2 - Search on staff client
3 - Click 'Request article'
4 - Find a patron
5 - View error in console
6 - Apply patch
7 - Reload
8 - Not error is gone

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5a9bad7874)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 50f4e86350)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-21 11:09:02 +02:00
Nick Clemens 1293b0a05b Bug 20564: Don't use system to unzip files
To test:
1 - Setup a zip file for patron images and cover images
2 - Test each tool
3 - Get a '500 error' after upload (note images do upload and attach)
4 - Apply patch
5 - Restart all the things
6 - Test agtain, uploads should complete and results display

Signed-off-by: George Williams <george@nekls.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8b806227c1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0f45f3afdf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-20 16:10:18 +02:00
Tomas Cohen Arazi 452d61c3e1 Bug 21285: Add missing select2x2.png file
This file is part of the Select2 jquery plugin, but wasn't added when
the use of the plugin was introduced in Koha.

To test:
- On a high DPI screen (retina mac?) on Chrome or Safari
- Edit an item
=> FAIL: dropdowns using Select2 (like 'Shelving location') don't display the icons (down arrow and cross) and a default value is wrongly selected
=> FAIL: the inspector says the requested select2x2.png file returned a 400 error.
- Apply this patch
- Reload the edit page
=> SUCCESS: Things display correctly! Dropdowns without selected values
by default!
=> SUCCESS: No errors fetching select2x2.png
- Sign off :-D

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 235654a3cf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 637469974c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-20 16:05:19 +02:00
Mirko Tietgen 2d3aca1b6d Bug 20800: Keep Koha on Stretch from using broken libhttp-oai-perl
libhttp-oai-perl in Stretch is 4.03 and broken. Koha depends on
libhttp-oai-perl << 4 for that reason. To make the installation of Koha
on Stretch as easy as possible, this patch adds the alternative
libhttp-oai-3.27-perl which we provide in the Koha repository.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 56813f5c90)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-11 16:23:45 +02:00
Mirko Tietgen 492af5173b Bug 20437: Update debian/control
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9b31bc2d27)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-11 16:23:11 +02:00
Tomas Cohen Arazi 82c5cef3ce Bug 20437: Force the dependency on HTTP::OAI < 4.0
Until HTTP::OAI is patched so it actually works, and bug 17704 fixes the API change Koha-side, we need to explicitly pull the right version. Otherwise people using Debian 9+ derived distros (Ubuntu 16.04+) are seeing production issues.

This implies packaging our custom libhttp-oai-perl distribution in the meantime.

This patch makes Koha require a version lower than 4.0.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 05ebfaf0c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-09-11 16:23:02 +02:00
Andrew Isherwood cdcfce4c6c Bug 20770: ILL loans OPAC form notes field allow arbitrary input
This patch addresses the lack of sanitization of the "notes" field on
the OPAC "View Interlibrary loan request" page.

To test:

- Apply the patch
- As an OPAC user, create an ILL request
- Navigate to the request's "View Interlibrary loan request" page
- Add the following note:

  Hello
  <h1>TESTING</h1>
  <script>alert('pwned');</script>

- Click "Submit modifications"
- TEST: Observe, when the page reloads, only the following is preserved in the
"Notes" textarea:

    Hello
    TESTING

- As a staff user, naviate to the ILL requests table
- Select "Manage request" for the request you created
- TEST: Observe that the Notes field only contains:

    Hello
    TESTING

- TEST: Observe that no Javascript alert is displayed

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 552873f7d4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cc81442349)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-08-30 09:18:10 +02:00