]> git.koha-community.org Git - koha.git/log
koha.git
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>
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>
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>
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>
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>
7 years agoBug 18529 - Template cleanup of patron clubs pages
Owen Leonard [Sat, 29 Apr 2017 08:40:26 +0000 (08:40 +0000)]
Bug 18529 - Template cleanup of patron clubs pages

This patch addresses template issues with the newly-added patron clubs
pages.

- Move Clubs tab out of second position in Circulation page tabs.
- Link patron name in enrollments list to the patron record
- Make page titles on some pages more specific
- Correct label "for" attributes so that it matches input id
- Correst style of buttons: Buttons in tables must be "btn-xs," all
  Bootstrap buttons must have "btn-default."
- Correct "Edit" icons: Should be "fa-pencil"

This patch also revises the club template editing form to make it more
consistent with similar interfaces in Koha and (hopefully) make it more
clear.

To test, apply the patch and test adding clubs and club templates and
enrolling patrons in clubs via the staff client and OPAC. Confirm that
everything looks and work okay.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 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>
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>
7 years agoBug 18400: [QA Follow-up] Move sort outside the loop
Marcel de Rooy [Fri, 12 May 2017 08:59:11 +0000 (10:59 +0200)]
Bug 18400: [QA Follow-up] Move sort outside the loop

GetItemTypesCategorized can return descriptions that are still undef since
Authorized values does not enforce a description in lib and lib_opac.
When I add one ITEMTYPECAT auth value without descriptions, I can still
generate the string comparison warnings on the itemtypes sort.
In order to prevent the warning, we should add an empty string in the
assignment on line 229.

We do not need to copy the itemtypes hash if we move the sort outside the
@advanced_search_types foreach. There is no need to sort it more than once.
Note that I did not see any reasons btw for corruption of the structure
inside this loop.

Note: If we use ITEMTYPECAT without descriptions, we should probably leave
them out. No need to show a checkbox without description on Advanced Search,
but I would recommend to solve that on its own report. The whole ITEMTYPECAT
functionality has imo not been designed properly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18400 - Noisy warns in opac-search.pl during itemtype sorting
Nick Clemens [Fri, 7 Apr 2017 16:51:49 +0000 (12:51 -0400)]
Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting

To fix the warns we use a copy of itemtypes which is not touched by
other code

To test:
Apply patches
Ensure search still works

Followed test plan, search 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: Kyle M Hall <kyle@bywatersolutions.com>
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>
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>
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>
7 years agoBug 18557 [QA Followup] - Use dt_from_string
Kyle M Hall [Mon, 8 May 2017 21:23:22 +0000 (21:23 +0000)]
Bug 18557 [QA Followup] - Use dt_from_string

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18557 - Mysqlim CURRENT_DATE in Koha::Clubs::get_enrollable
Kyle M Hall [Tue, 9 May 2017 11:56:53 +0000 (07:56 -0400)]
Bug 18557 - Mysqlim CURRENT_DATE in Koha::Clubs::get_enrollable

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Clubs.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 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>
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>
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>
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>
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>
7 years agoBug 18573: (bug 17847 follow-up) Update av-build-dropbox.inc for OPAC
Jonathan Druart [Wed, 10 May 2017 16:13:09 +0000 (13:13 -0300)]
Bug 18573: (bug 17847 follow-up) Update av-build-dropbox.inc for OPAC

On bug 17847, av-build-dropbox.inc has been updated for the intranet,
not OPAC

There is only one call to av-build-dropbox.inc at the OPAC, from
opac-suggestion.tt

Test plan:
Create a new suggestion, anonymous or with a logged in user
=> Without this patch you got
  Template process failed: undef error - The method default is not
  covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121.
=> With this patch applied you should see the item type dropdown list
correctly filled

Reproduced without patch, OK with patch
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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>
7 years agoBug 18579: Fix call to append_fields, fix tests
Julian Maurice [Fri, 12 May 2017 07:25:23 +0000 (09:25 +0200)]
Bug 18579: Fix call to append_fields, fix tests

MARC::Record::append_fields takes a list of MARC::Field (not an arrayref)

Use $record->subfield() instead of $record->field()->subfield() to avoid errors
when field doesn't exist

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18579: Make EmbedItemsAvailability handle control fields correctly
Tomas Cohen Arazi [Thu, 11 May 2017 16:07:37 +0000 (13:07 -0300)]
Bug 18579: Make EmbedItemsAvailability handle control fields correctly

This patch makes the EmbedItemsAvailability filter handle the biblio.biblionumber > control field mapping gracefully.
Right now, it was assuming a regular data field was used, and such is not the case for UNIMARC (001).

To test:
- Apply the tests patch
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t
=> FAIL: Tests fail to run
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t
=> SUCCESS: Tests pass!
- Sign off :-D

Sponsored-by: ByWater Solutions
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>
7 years agoBug 18579: Regression tests
Tomas Cohen Arazi [Thu, 11 May 2017 16:04:18 +0000 (13:04 -0300)]
Bug 18579: Regression tests

This patch makes sure the tests have the biblio.biblionumber mapping mocked
so we test the case where the mapping is to a control field instead of just
regular data fields (in the case of UNIMARC).

To test:
- Apply the patch
- Run:
  $ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t
=> FAIL: Tests fail due to an attemp to access a subfield on a control field.

Sponsored-by: ByWater Solutions
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>
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>
7 years agoBug 12063 - DBRev 16.12.00.032
Kyle M Hall [Tue, 9 May 2017 13:16:49 +0000 (09:16 -0400)]
Bug 12063 - DBRev 16.12.00.032

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063: [QA Follow-up] Small change of two test scripts
Marcel de Rooy [Thu, 4 May 2017 12:15:51 +0000 (14:15 +0200)]
Bug 12063: [QA Follow-up] Small change of two test scripts

Removing dbh from one script, changing rollback in the other.
Schema is leading now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063: [QA Follow-up] Adjustments to db revision
Marcel de Rooy [Thu, 4 May 2017 10:53:03 +0000 (12:53 +0200)]
Bug 12063: [QA Follow-up] Adjustments to db revision

Replace use by require.
Add require Koha::Calendar (seriously needed to prevent crashing).
Base expirationdate on today not on waitingdate (just as in Reserves).
Remove if ( waitingdate ) construction. Not needed anymore.
Remove $cancel_on_holidays. Not used. Note that the if construction around
the new pref is not strictly needed at upgrade time (pref still zero).
Fill the dbrev description.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063 - Remove checking of ExpireReservesMaxPickUpDelay in CancelExpiredReserves...
Alex Arnaud [Thu, 4 May 2017 08:54:16 +0000 (08:54 +0000)]
Bug 12063 - Remove checking of ExpireReservesMaxPickUpDelay in CancelExpiredReserves(). Koha::Hold::set_waiting calculate expiration date from today instead of hold's waiting date.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063 - make perl atomic update follow skeleton.perl
Alex Arnaud [Thu, 20 Apr 2017 14:22:25 +0000 (14:22 +0000)]
Bug 12063 - make perl atomic update follow skeleton.perl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063 - Fix QA failures
Alex Arnaud [Thu, 30 Mar 2017 09:53:10 +0000 (09:53 +0000)]
Bug 12063 - Fix QA failures

  - Remove expiration date calculation in C4::Letter since it's done
    when setting the reserve waiting,
  - remove expiration date calculation in circ/waitingreserves.pl. Use
    the one in DB,
  - add a new atomic update that calculate expiration date for
    waiting reserves,
  - add tests for days_foward function and fix the infinite loop.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063 - Fix unit tests
Alex Arnaud [Wed, 22 Mar 2017 12:55:49 +0000 (12:55 +0000)]
Bug 12063 - Fix unit tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063 - Keep patron's requested expiration date if it is prior to the calculated one
Alex Arnaud [Wed, 18 Jan 2017 14:13:33 +0000 (14:13 +0000)]
Bug 12063 - Keep patron's requested expiration date if it is prior to the calculated one

Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063 - Remove Koha::Hold::waiting_expires_on since dateexpiration is set on...
Alex Arnaud [Thu, 30 Jun 2016 08:00:26 +0000 (10:00 +0200)]
Bug 12063 - Remove Koha::Hold::waiting_expires_on since dateexpiration is set on database

Signed-off-by: sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12063: Change date calculation for reserve expiration to skip all holiday
Alex Arnaud [Mon, 20 Jun 2016 09:52:37 +0000 (11:52 +0200)]
Bug 12063: Change date calculation for reserve expiration to skip all holiday

This patch makes koha automatically set expiration date when reserves become
waitting. Also it adds a new syspref "ExcludeHolidaysFromMaxPickUpDelay" that allows to
take holidays into account while calculating expiration date.

Test plan:

  - Install this patch and run updatedatabase.pl script,
  - allow ExpireReservesMaxPickUpDelay in system preferences,
  - set ReservesMaxPickUpDelay to 5.

  - Place an hold on a checked out item and check in this item:
    The hold's expiration date should be today + 5.

  - Allow ExcludeHolidaysFromMaxPickUpDelay in system preferences,
  - add holiday during this pickup delay period,
  - Create a new hold and make it comes waitting:
    The hold's expiration date should be today + 5 + number of closed
    day(s).

Also:
  - Check that ExpireReservesOnHolidays syspref works again
    without ExcludeHolidaysFromMaxPickUpDelay.
  - Check that cancel fees apply again if wanted.

Signed-off-by: sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18553 - Incorrect Loading... tag on circulation.tt when no clubs defined
Jonathan Druart [Mon, 8 May 2017 15:54:51 +0000 (12:54 -0300)]
Bug 18553 - Incorrect Loading... tag on circulation.tt when no clubs defined

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18553 - Incorrect "Loading..." tag on moremember.tt when no clubs defined
Nick Clemens [Fri, 5 May 2017 21:20:09 +0000 (17:20 -0400)]
Bug 18553 - Incorrect "Loading..." tag on moremember.tt when no clubs defined

To test:
1 - Have no clubs
2 - View Details tab for a patron
3 - Note the 'Loading' tag near the tabs
4 - Apply patch
5 - Load patron details and notice 'Loading' is gone
6 - Add a club and verify tab shows as expected

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBUG 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>
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>
7 years agoBug 15108 - DBRev 16.12.00.031
Kyle M Hall [Mon, 8 May 2017 13:29:38 +0000 (09:29 -0400)]
Bug 15108 - DBRev 16.12.00.031

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15108: (QA followup) Fix atomic update file
Tomas Cohen Arazi [Fri, 5 May 2017 14:38:31 +0000 (11:38 -0300)]
Bug 15108: (QA followup) Fix atomic update file

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15108: (followup) OAI-PMH provider improvements
Ere Maijala [Thu, 23 Feb 2017 12:44:09 +0000 (14:44 +0200)]
Bug 15108: (followup) OAI-PMH provider improvements

Fixed OAI-PMH Server tests to delete any existing issues before deleting biblios,
to delete oai_sets to avoid sets in the responses and to work with UNIMARC and
NORMARC as well as MARC21.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15108: OAI-PMH provider improvements
Ere Maijala [Wed, 15 Feb 2017 13:20:27 +0000 (15:20 +0200)]
Bug 15108: OAI-PMH provider improvements

- Fixed date handling to use UTC as specs require.

- Added support for second precision in time stamps.

- Added support for marc21 metadata prefix as recommended in the
  guidelines (synonym for marcxml).

- Improved performance of database queries especially for large
  collections.

- Unified functionality of ListRecords and ListIdentifiers to a common
  base class.

- If items are included in the records, their timestamps are taken into
  account everywhere so that whichever is the most recent (timestamp of
  biblioitem or any of its items) is considered the record's timestamp.

- Fixed OAI.xslt to show correct record range.

- Incorporated extended tests from Bug 17493 and their tweaks from Bug 15108.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18299 - Removed unused env_tz_test.pl based on user testing feedback
Alex Buckley [Tue, 2 May 2017 13:52:25 +0000 (13:52 +0000)]
Bug 18299 - Removed unused env_tz_test.pl based on user testing feedback

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>
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>
7 years agoBug 18098: Add an index with the count of not onloan items
Tomas Cohen Arazi [Fri, 3 Mar 2017 21:32:06 +0000 (18:32 -0300)]
Bug 18098: Add an index with the count of not onloan items

This patch adds a numeric index 'not-onloan-count' containing the value
of 999$x. This subfield is filled by 'rebuild_zebra.pl' by making use of
(bug's 18208) 'EmbedItemsAvailability' filter.

bib1.att and indexes definitions are updated accordingly.

To test:
- Apply the patch
- Pick the right biblio-zebra-indexdefs.xsl file for your setup and
  replace the one your Zebra uses [1]
- Replace your bib1.att
- Replace your ccl.properties
- Have at least one record with more than one item, checkout some
  item(s) from that record(s).
- Rebuild zebra's indexes:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ misc/migration_tools/rebuild_zebra.pl -r -b -v -k
 (notice the dump directory is kept, you can try the XSLT yourself
  running:
    $ xsltproc \
       etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \
       /tmp/the_dump_dir/biblios/exported_records | less
=> SUCCESS: There are records with the not-onloan-count index, and the
            value is correct!
- Check Zebra yourself:
  $ yaz-client unix:/var/run/koha/kohadev/bibliosocket
 Z> base biblios
 Z> find @attr 1=9013 @attr 2=5 @attr 4=109 0
=> SUCCESS: The search matches the amount of records with not-onloan
            items.
 Z> s 1+1
=> SUCCESS: Records with 999$x having a value higher than 0 are rendered
- Sign off :-D

Note: While this work is complete on its purpose, it is part of an
attempt to create a better way of filtering by availability.

Sponsored-by: ByWater Solutions
 [1] In kohadevbox this would be
/etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl

Edit: Added the missing XSLT changes for UNIMARC and NORMARC

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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>
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>
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>
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>
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>
7 years agoBug 17993 - Do not use modal authentication with CAS - lists
Fridolin Somers [Wed, 25 Jan 2017 13:19:16 +0000 (14:19 +0100)]
Bug 17993 - Do not use modal authentication with CAS - lists

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 of lists popup : "Log in to create your own lists"

Test plan :
- Enable syspref casAuthentication
- Go to OPAC
- Click on Lists > Log in to create your own lists
=> 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>
7 years agoBug 18405: Self checkout: Fix broken silent printing
Marc Véron [Sun, 9 Apr 2017 14:58:21 +0000 (16:58 +0200)]
Bug 18405: Self checkout: Fix broken silent printing

Fix broken 'silent printing' (without printer dialog) in self checkout.

To reproduce:
Set up silent printing to slip printers as described in:
https://wiki.koha-community.org/wiki/Setting_up_slip_printer_to_print_silently

Verify that it works for check-outs in staff client.
Verify that it does not work in Self checkout.

To test:
Apply patch
Verify that silent printing works on SCO

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 7550: [QA Follow-up] Resolve param warning from sco-patron-image
Marcel de Rooy [Mon, 1 May 2017 12:15:58 +0000 (14:15 +0200)]
Bug 7550: [QA Follow-up] Resolve param warning from sco-patron-image

Resolve this warning:
  CGI::param called in list context from package C4::Service line 212, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.

It comes from the require_params call in sco-patron-image.pl.

Git grepping on require_params tells me this:
  members/default_messageprefs.pl:my ($categorycode) = C4::Service->require_params('categorycode');
  opac/sco/sco-patron-image.pl:my ($borrowernumber) = C4::Service->require_params('borrowernumber');
  opac/sco/sco-patron-image.pl:my ($csrf_token) = C4::Service->require_params('csrf_token');
  svc/cataloguing/metasearch:my ( $query_string, $servers ) = C4::Service->require_params( 'q', 'servers' );

The only candidate for multi_param seems to be 'servers', but as we can see
this variable is a scalar. Additional servers returned by require_params are
lost. This should be solved on its own report.
So, we can safely add scalar to the params call, resolve the warning and
keep the same behavior.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 7550: SCO - Restrict access of patron's image
Jonathan Druart [Wed, 19 Apr 2017 17:09:12 +0000 (14:09 -0300)]
Bug 7550: SCO - Restrict access of patron's image

With this patch if SelfCheckoutByLogin is set to 'username and
password', only the logged in user will be able to see the image linked
to his/her logged in account.
If set to "barcode" we generate a token but it can be easily generated.
You should add a warning in the about page if
SelfCheckoutByLogin="barcode" and ShowPatronImageInWebBasedSelfCheck="Show".

How I tested:
- Go to SCO
- Log - Enable self checkout, go to [Your
  Server]//cgi-bin/koha/sco/sco-main.pl
- Log in with a user 'A' who has a patron image
- Copy the address of the patron image into an other browser window
- Change the borrowernumber to on of an other user 'B' having a patron
  image
- Verify that the patron image is NOT displayed

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>
7 years agoBug 17952 - Lost items not skipped by overdue_notices.pl
Kyle M Hall [Fri, 20 Jan 2017 14:43:24 +0000 (14:43 +0000)]
Bug 17952 - Lost items not skipped by overdue_notices.pl

If a library does not use --mark-returned when running longoverdue.pl,
all those lost item checkouts are selected by overdue_notices.pl.
This causes much unnecessary overhead. In addition Koha::Calendar is
instantiated many times for each branchcode which is not necessary.

Test Plan:
1) Run overdue_notices.pl, note output
2) Apply this patch
3) Run overdue_notices.pl again, note output is the same

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jane Leven <jleven@camdencountylibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18512: Add tests
Jonathan Druart [Tue, 2 May 2017 20:27:48 +0000 (17:27 -0300)]
Bug 18512: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not...
Nick Clemens [Fri, 28 Apr 2017 18:11:00 +0000 (14:11 -0400)]
Bug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not empty string) if value not found

To test:
1 - Create or edit a borrower with info in Sort1 and Sort2 field, not
mapped to authorized values
2 - Note this info does not display on moremember.tt
3 - Apply patch
4 - Note value is passed through

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18152: Add tests
Jonathan Druart [Wed, 3 May 2017 18:30:14 +0000 (15:30 -0300)]
Bug 18152: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18152 : fix unimarc label in SetMarcUnicodeFlag
Stephane Delaune [Wed, 22 Feb 2017 11:25:33 +0000 (12:25 +0100)]
Bug 18152 : fix unimarc label in SetMarcUnicodeFlag

The standard UNIMARC requires than the 9th character (starting from 0) in
labels must be blank (while it may be 'a' in marc21)

the problem is that C4::Charset::SetMarcUnicodeFlag (called in particular when
we import a record) always add 'a' char in the 9th label'pos whereas it should
do it just for MARC21 and NORMARC (not for UNIMARC) :

C4::Charset::SetMarcUnicodeFlag add 'a' char in the 9th label character for
MARC21 and NORMARC (it's normal), but just before doing this it call
"$marc_record->encoding('UTF-8')" which is a MARC::Record function which, when
called with 'UTF-8' parameter, do only one thing : add 'a' char in the 9th
label character

This patch only removes this incorrect function call, so, when we import a bib
record in UNIMARC : it no longer adds erroneous character (this does not change
anything for MARC21 and NORMARC because SetMarcUnicodeFlag explicitly adds 'a'
char in the 9th label for them)

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18442: Add a test
Jonathan Druart [Fri, 21 Apr 2017 21:44:05 +0000 (18:44 -0300)]
Bug 18442: Add a test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18442: Fix DB user loggin
Alex Buckley [Wed, 19 Apr 2017 23:29:28 +0000 (11:29 +1200)]
Bug 18442: Fix DB user loggin

Test plan:
1. Drop and recreate your db

2. Clear memcached

3. Go through the installer (to speed up this test plan install all
sample data so you dont have to create libraries, patron categories etc. later)

4. On the installer page login as the database user and notice that it
does not work on the first attempt ( you get 'Error: You do not have
permission to access this page')

5. Try logging in as database user for a second time and notice you are
logged in successfully this time

4. In staff interface create a patron account with superlibrarian permissions

5. Logout of the staff interface

6. Login as database user

7. Notice you cant log in. You get the 'Error:: You do not have permission to access this
page' error

8. Try a second attempt and notice you get the same error

9. Open the URL in a new tab and notice the staff interface appears
showing that you are logged in

10. log out and log back in as the superlibrarian user you created and
notice it works on first login attempt

11. Apply patch

12. Log out and try logging back in as database user and notice that you
can login successfully on first attempt

13. Repeat steps 1,2,3 and login as database user and notice the login
works on first attempt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 years agoRevert "Bug 18179: Forbid list context calls for Koha::Objects->find"
Kyle M Hall [Fri, 28 Apr 2017 16:49:05 +0000 (12:49 -0400)]
Revert "Bug 18179: Forbid list context calls for Koha::Objects->find"

This reverts commit a1fcf1818c8d9f23d9c870e93c41c67a27faf603.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoRevert "Bug 18179: Update existing calls"
Kyle M Hall [Fri, 28 Apr 2017 16:48:56 +0000 (12:48 -0400)]
Revert "Bug 18179: Update existing calls"

This reverts commit 2a2b9739117e74232c9a7abde516b1c436d4bad3.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16344 - DBRev 16.12.00.030
Kyle M Hall [Fri, 28 Apr 2017 13:28:33 +0000 (09:28 -0400)]
Bug 16344 - DBRev 16.12.00.030

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16344 - Update Schema
Kyle M Hall [Thu, 27 Apr 2017 19:21:11 +0000 (19:21 +0000)]
Bug 16344 - Update Schema

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16344: Fix alignment between top and bottom columns
Jonathan Druart [Tue, 26 Apr 2016 15:58:49 +0000 (16:58 +0100)]
Bug 16344: Fix alignment between top and bottom columns

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16344: Add a circ rule to limit the auto renewals given a specific
Jonathan Druart [Mon, 25 Apr 2016 20:52:27 +0000 (21:52 +0100)]
Bug 16344: Add a circ rule to limit the auto renewals given a specific

This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow
auto renewals after a given date.
The idea is to stop renewals at a given date. That way the library will have
time to send overdues and get the books back before the students do on holiday.

Test plan:
0/ Execute the update DB entry
1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow
2/ Modify the issues.issuedate, to simulate a checkout in the past:
    UPDATE issues
    SET issuedate = "yyyy-mm-dd hh:mm:ss"
    WHERE itemnumber = YOUR_ITEMNUMBER;
with issuedate = 2 days before for instance
3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has been renewed
4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday
5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has not been renewed

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224 - DBRev 16.12.00.029
Kyle M Hall [Thu, 27 Apr 2017 19:10:47 +0000 (19:10 +0000)]
Bug 14224 - DBRev 16.12.00.029

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14424: DBIC Schema changes
Jonathan Druart [Thu, 20 Apr 2017 16:46:35 +0000 (13:46 -0300)]
Bug 14424: DBIC Schema changes

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Use encode_json instead of to_json
Jonathan Druart [Thu, 20 Apr 2017 16:42:02 +0000 (13:42 -0300)]
Bug 14224: Use encode_json instead of to_json

To handle unicode characters properly

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Check if the columns do not exist before creating them
Jonathan Druart [Wed, 1 Feb 2017 14:53:06 +0000 (15:53 +0100)]
Bug 14224: Check if the columns do not exist before creating them

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Improve escaped characters
Jonathan Druart [Wed, 1 Feb 2017 16:01:00 +0000 (17:01 +0100)]
Bug 14224: Improve escaped characters

To recreate the problem, submit a note like
  doh"doh

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Update Copyright
Jonathan Druart [Wed, 1 Feb 2017 15:56:46 +0000 (16:56 +0100)]
Bug 14224: Update Copyright

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Replace AllowIssueNotes with AllowCheckoutNotes
Jonathan Druart [Thu, 2 Feb 2017 10:37:54 +0000 (11:37 +0100)]
Bug 14224: Replace AllowIssueNotes with AllowCheckoutNotes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Make strings translatable
Jonathan Druart [Wed, 1 Feb 2017 15:38:37 +0000 (16:38 +0100)]
Bug 14224: Make strings translatable

The strings should be translatable.
This patch also removes the error as it appears that we only have 1
error.
To improve we could surround the store with an eval.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Fix prevent submit
Jonathan Druart [Thu, 2 Feb 2017 10:10:30 +0000 (11:10 +0100)]
Bug 14224: Fix prevent submit

That did not work, the form was submitted anyway

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Remove SQL query in svc script
Jonathan Druart [Thu, 2 Feb 2017 10:10:28 +0000 (11:10 +0100)]
Bug 14224: Remove SQL query in svc script

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Reintroduce previous copyright
Jonathan Druart [Thu, 2 Feb 2017 09:49:18 +0000 (10:49 +0100)]
Bug 14224: Reintroduce previous copyright

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Do not reintroduce GetItemIssue, it's dying
Jonathan Druart [Wed, 1 Feb 2017 14:56:34 +0000 (15:56 +0100)]
Bug 14224: Do not reintroduce GetItemIssue, it's dying

Bug 17680 is removing it.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14224: Allow patron notes about item shown at check in
Aleisha Amohia [Sun, 23 Aug 2015 16:22:50 +0000 (18:22 +0200)]
Bug 14224: Allow patron notes about item shown at check in

This patch adds a "Note" input field to checked out items in the "your summary"
section. The field allows patrons to write notes about the item checked out,
such as "this DVD is scratched", "the binding was torn", etc. The note will be
emailed to the library and displayed on item check in.

Patch adds two fields to the "issues" table - "note" and "notedate".
Patch adds syspref "AllowIssueNotes" - default off.

Test Plan:
1) Apply this patch
2) Update database
3) Rebuild schema
4) Turn on 'AllowIssueNote' syspref
5) Check out three different items to a borrower (may be easiest to check
    out to yourself)
6) Log in as that borrower (or yourself) on the OPAC side and go to your
summary
7) Confirm text field shows under Note column for all checkouts. Set a
note for each issue, confirm all save.
8) Check the message_queue in mysql for the entries for ALL THREE issue
notes.
9) Disable javascript in your browser
10) Refresh your summary page. Confirm that you can no longer edit the
notes in the text field. Click the 'Create/edit note' button and confirm
you are redirected to a new page.
11) Confirm that the correct title and author show for the note button
you clicked.
12) Set the note and click Submit -> confirm you are redirected
back to summary page and note is saved
13) Confirm there is a new entry in message_queue
14) Enable javascript and go back to the your checkouts page in the
staff client for the borrower you issued the items to
15) Check in TWO items
16) Confirm that the issue notes show under the "Date due" column for
the two items you checked in, and are accurate to the item (i.e. the
right issue note under the right item)
17) Go to circ/returns.pl and check in the final item using the barcode.
Confirm the issue note shows and the date is formatted correctly.

Sponsored-by: Region Halland
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marc Véron <veron@veron.ch>
7 years agoBug 18484 - opac-advsearch.tt missing closing div tag for .container-fluid
Owen Leonard [Mon, 24 Apr 2017 14:21:00 +0000 (14:21 +0000)]
Bug 18484 - opac-advsearch.tt missing closing div tag for .container-fluid

This patch corrects HTML validation errors by adding back a missing
</div> which was removed accidentally by Bug 9043 (2014!).

This patch also removes "border" attributes from <img> tags because the
attribute is obsolete.

To test, apply the patch and test the validity of the OPAC's advanced
search page. The only error should be one about 'Bad value
"api-server,"' which isn't really resolvable.

Signed-off-by: Barton Chittenden <barton@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18402: Add the Koha::Item->checkout method
Jonathan Druart [Wed, 5 Apr 2017 19:42:35 +0000 (16:42 -0300)]
Bug 18402: Add the Koha::Item->checkout method

Return the current checkout for a given item.
Note it may not exist.

Test plan:
  prove t/db_dependent/Koha/Items.t
should return green

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>
7 years agoBug 18401: Add new method Koha::Checkout->patron
Jonathan Druart [Wed, 5 Apr 2017 19:42:26 +0000 (16:42 -0300)]
Bug 18401: Add new method Koha::Checkout->patron

Return the patron related to a given checkout

Test plan:
  prove t/db_dependent/Koha/Checkouts.t
should return green

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>
7 years agoBug 18110 - DBRev 16.12.00.028
Kyle M Hall [Fri, 28 Apr 2017 12:53:00 +0000 (08:53 -0400)]
Bug 18110 - DBRev 16.12.00.028

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18110: Do not update value for existing installs
Jonathan Druart [Wed, 26 Apr 2017 18:41:35 +0000 (15:41 -0300)]
Bug 18110: Do not update value for existing installs

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18110: Update addressFormat in atomicupdate
Baptiste Wojtkowski [Mon, 3 Apr 2017 13:40:44 +0000 (13:40 +0000)]
Bug 18110: Update addressFormat in atomicupdate

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>
7 years agoBug 18110: Folllowup to fix alternative address and add missing class
Marc Véron [Tue, 28 Mar 2017 07:20:47 +0000 (09:20 +0200)]
Bug 18110: Folllowup to fix alternative address and add missing class

This patch fixes the display of alternative address (streetnumber, streettype
and address on same line, see comment #22, and it adds missing class
patronaddress1 to main address display.

To test:
- Create / edit a customer to have streetnumber, streettype and address in
  both main address and alternate address
- Switch syspref addressformat ot French style
- Verify that both main address and alternate address display as expected
  on patron's detail page (street number, street type and address on same
  line)

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18110: Removed unwanted spaces
Baptiste Wojtkowski [Mon, 27 Mar 2017 07:32:06 +0000 (07:32 +0000)]
Bug 18110: Removed unwanted spaces

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18110: Corrected display address format
Baptiste Wojtkowski [Fri, 24 Mar 2017 12:47:42 +0000 (12:47 +0000)]
Bug 18110: Corrected display address format

- minor changes on address format
- corrected member-password so that steetnumber is given to the template

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 18110: Add a field FR to the syspref AddressFormat
Baptiste Wojtkowski [Mon, 27 Feb 2017 09:32:24 +0000 (09:32 +0000)]
Bug 18110: Add a field FR to the syspref AddressFormat

Add a field FR to the syspref AddressFormat

Testplan
1 - Apply patch
2 - Check if there is a field FR in the syspref AddressFormat, enable it
3 - Create a new borrower and check the order of the fields for the address
4 - Check if it's address appears in a propper manner

27/02/17 : Fixed the display

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12461 - DBRev 16.12.00.027
Kyle M Hall [Fri, 28 Apr 2017 12:46:59 +0000 (08:46 -0400)]
Bug 12461 - DBRev 16.12.00.027

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 14143 - Patron cards: Crash (confusion between table names creator_templates...
Marc Véron [Mon, 4 May 2015 21:29:29 +0000 (23:29 +0200)]
Bug 14143 - Patron cards: Crash (confusion between table names creator_templates and club_template_enrollment_fields)

To reproduce:
Go to Home > Tools > Patron card creator
Click on 'Manage profiles'
Result:
Can't use string ("1") as an ARRAY ref while "strict refs" in use at /usr/share/kohaclone/C4/Creators/Lib.pm line 564.

Reason:
Select statment to get field 'template code' from table 'club_template_enrollment_fields' (!) instead of 'table creator_templates'.

To test:
Apply patch
Try to reproduce issue.

Amended because of typo (_ instead of -)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12461 - (QA Followup)
Nick Clemens [Fri, 28 Apr 2017 10:43:44 +0000 (06:43 -0400)]
Bug 12461 - (QA Followup)

    Club enrollments should only list active enrollments
    Confirms should warn of cascading delete
    Branch limited clubs should only be available to members of that
    branch
    Fix breadcrumbs

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12461 [QA Followup]
Kyle M Hall [Thu, 27 Apr 2017 12:24:29 +0000 (08:24 -0400)]
Bug 12461 [QA Followup]

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12461 - Add patron clubs feature
Kyle M Hall [Fri, 23 May 2014 15:54:26 +0000 (11:54 -0400)]
Bug 12461 - Add patron clubs feature

This features would add the ability to create clubs which patrons may be
enrolled in. It would be particularly useful for tracking summer reading
programs, book clubs and other such clubs.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Ensure your staff user has the new 'Patron clubs' permissions
4) Under the tools menu, click the "Patron clubs" link
5) Create a new club template
   * Here you can add fields that can be filled out at the time
     a new club is created based on the template, or a new enrollment
     is created for a given club based on the template.
6) Create a new club based on that template
7) Attempt to enroll a patron in that club
8) Create a club with email required set
9) Attempt to enroll a patron without an email address in that club
10) Create a club that is enrollable from the OPAC
11) Attempt to enroll a patron in that club
12) Attempt to cancel a club enrollment from the OPAC
13) Attempt to cancel a club enrollment from the staff interface

Followed test plan, works as expected.
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>
7 years agoBug 17855: Simplify the onboarding tool
Jonathan Druart [Mon, 17 Apr 2017 18:42:35 +0000 (15:42 -0300)]
Bug 17855: Simplify the onboarding tool

This patch should not modify a lot the behaviours of the onboarding
tool.
Its goal is mainly to remove duplicated as well as useless (because
copy/pasted from existing script files) code.

It assumes that the onboarding tool will be done on an empty database
and will skip steps that are not needed. For instance if a library
already exists, the first step will be skipped.

One of the main problem was the lack of feedback messages sent to the
user when something wrong/ok happened.

Explanation on main changes:
1. Use checkauth first, then get_template_and_user
=> As we do not know the template to use, it's better to use checkauth
first to know if the user is logged in, then retrieve the template we
need, depending on the success or the failure of the action
2. Create a @messages variables
Pushing messages to this variable and handling the messages via an
include files (onboarding_messages.inc) simplify error handling. Note
that we could remove this include file if we merge all the
onboardingstepX.tt files altogether
3. Simplify creation of the admnistrator user
This patch removes some unecessary checks done on the user's info
(passwd to short, mandatory fields

Todo (minor): Add style to feedback messages

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17855: No need to resend the library list to the template
Jonathan Druart [Mon, 17 Apr 2017 15:18:31 +0000 (12:18 -0300)]
Bug 17855: No need to resend the library list to the template

This has been done at the beginning of the script

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>