]> git.koha-community.org Git - koha.git/log
koha.git
6 years agoBug 21213: Add diagnostics to Circulation.t
Jonathan Druart [Mon, 13 Aug 2018 14:54:36 +0000 (11:54 -0300)]
Bug 21213: Add diagnostics to Circulation.t

Jenkins reported failures on a D9 run. No idea why it is failing so
adding diag and wait for the next failure.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21195: Ignore files used for SCSS build process
Nick Clemens [Thu, 9 Aug 2018 16:08:31 +0000 (16:08 +0000)]
Bug 21195: Ignore files used for SCSS build process

koha_1       | #   Failed test 'All directories should be mapped:
.sass-lint.yml,.scss-lint.yml,gulpfile.js,package.json,yarn.lock'
koha_1       | #   at t/Makefile.t line 47.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: DBRev 18.06.00.013
Nick Clemens [Fri, 10 Aug 2018 12:38:34 +0000 (12:38 +0000)]
Bug 20997: DBRev 18.06.00.013

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: Replace missing credit_applied with 'Credit Applied'
Jonathan Druart [Tue, 31 Jul 2018 19:46:23 +0000 (16:46 -0300)]
Bug 20997: Replace missing credit_applied with 'Credit Applied'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: (QA follow-up) POD fixes and offset type consistency
Tomas Cohen Arazi [Fri, 27 Jul 2018 17:55:14 +0000 (14:55 -0300)]
Bug 20997: (QA follow-up) POD fixes and offset type consistency

This patch addresses minor issues highlighted by QA.
- The POD is enhanced based on the proposal in bug 11983.
- The introduced offset type value is made consistent with the rest of
them.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: (follow-up) Minor POD fixes
Tomas Cohen Arazi [Thu, 28 Jun 2018 18:54:53 +0000 (15:54 -0300)]
Bug 20997: (follow-up) Minor POD fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: ->apply should be applied to Koha::Account::Lines
Tomas Cohen Arazi [Thu, 28 Jun 2018 18:52:01 +0000 (15:52 -0300)]
Bug 20997: ->apply should be applied to Koha::Account::Lines

This patch makes ->apply get passed an object set class instead of
single account lines.

The change is fully covered by tests.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: Add new offset type
Tomas Cohen Arazi [Thu, 28 Jun 2018 18:51:06 +0000 (15:51 -0300)]
Bug 20997: Add new offset type

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: (follow-up) Add Koha::Account::Line->is_debit method
Josef Moravec [Tue, 26 Jun 2018 00:22:16 +0000 (00:22 +0000)]
Bug 20997: (follow-up) Add Koha::Account::Line->is_debit method

Test plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Account/Lines.t
=> Test should pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: Add Koha::Account::Line::apply method
Tomas Cohen Arazi [Tue, 26 Jun 2018 14:52:44 +0000 (11:52 -0300)]
Bug 20997: Add Koha::Account::Line::apply method

This patch implements the ->apply() method for account lines.
It will only work on credit lines, and raise an exception otherwise.

It implements ->is_credit() as well.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Account/Lines.t
=> SUCCESS: Tests pass!
- Check all use cases are covered by the tests
- Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20997: Add unit tests for Koha::Account::Line::apply
Tomas Cohen Arazi [Tue, 26 Jun 2018 14:51:41 +0000 (11:51 -0300)]
Bug 20997: Add unit tests for Koha::Account::Line::apply

This patch adds unit tests for the mentioned method.

To test:
- Apply this patch
- Run:
  $ khell
 k$ prove t/db_dependent/Koha/Account/Lines.t
=> FAIL: The method is not already implemented!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21125: Shortcut moredetail.pl on nonexistent biblionumber
Jonathan Druart [Wed, 11 Jul 2018 16:35:28 +0000 (13:35 -0300)]
Bug 21125: Shortcut moredetail.pl on nonexistent biblionumber

This replaces the solution for 17.11 on bug 20927.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20661: (QA follow-up) Add POD for output_and_exit
Marcel de Rooy [Fri, 27 Jul 2018 06:29:03 +0000 (08:29 +0200)]
Bug 20661: (QA follow-up) Add POD for output_and_exit

Resolve:
 FAIL   C4/Output.pm
   FAIL   pod
                *** ERROR: Apparent command =cut not preceded by blank line  in file C4/Output.pm
   FAIL   pod coverage
                POD is missing for output_and_exit

Test plan:
Run QA tools again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20661: Shortcut circ scripts if a blocking error appeared
Jonathan Druart [Wed, 25 Apr 2018 20:08:42 +0000 (17:08 -0300)]
Bug 20661: Shortcut circ scripts if a blocking error appeared

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
No test plan found ;)
But tested bookcount and request-article.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20647: (alternate) When ILL is enabled the hover effect on the ILL requests butto...
Owen Leonard [Mon, 4 Jun 2018 18:16:54 +0000 (18:16 +0000)]
Bug 20647: (alternate) When ILL is enabled the hover effect on the ILL requests button is wrong

This alternate patch adds a new icon to the sprite image which gives
icons to the link on the staff client home page. It modifies the CSS
positioning for all the links as the new image sprite is somewhat
different.

The SVG file from which the sprite image was generated is also updated,
and the about page has been updated to give credit to the creator of the
icon.

Unrelated change: The cataloging link is moved to the second column.
Although it's probably rare for all modules to be enabled and available,
this puts the same number of links in each column.

To test, apply the patch and clear your browser cache if necessary. With
interlibrary loan enabled, view the staff client home page and confirm
that all the module links look correct, including when you hover your
mouse over them.

Confirm that the about page lists the new icon under the "licenses" tab.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20683: Update German web installer for 18.05
Katrin Fischer [Fri, 11 May 2018 06:24:06 +0000 (08:24 +0200)]
Bug 20683: Update German web installer for 18.05

Adds translations for 2 new notices CANCEL_HOLD_ON_LOST and
CHECKOUT_NOTE.
Some small changes to older notices to match them with the
English templates.

To test:
- Install German
- Run the web installer on an empty database
- Make sure all files install correctly and there are no SQL
  errors
- Check notices were loaded correctly

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 7143: Update about page for new dev - Vassilis Kanellopoulos
Nick Clemens [Fri, 10 Aug 2018 10:21:00 +0000 (10:21 +0000)]
Bug 7143: Update about page for new dev - Vassilis Kanellopoulos

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 15136: Add homebranch of borrowed items to patron accounts tab
Vassilis Kanellopoulos [Mon, 9 Nov 2015 09:20:21 +0000 (11:20 +0200)]
Bug 15136: Add homebranch of borrowed items to patron accounts tab

Test plan:
1 - View the accounts tab for a patron with fines
2 - Note there is no homebranch displayed to see where charges came from
3 - Apply patch
4 - Reload the page and note that you see the 'Home library' column

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: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19633: Use alphanumeric error codes in upload
Marcel de Rooy [Thu, 22 Feb 2018 10:52:14 +0000 (11:52 +0100)]
Bug 19633: Use alphanumeric error codes in upload

The error codes 1 to 7 are used in Uploader.pm or tools/upload.pl.
It would be nice to use alphanumeric codes instead.
No behavior change expected.

Test plan:
[1] Run t/db_dependent/Upload.t
[2] Verify that a regular upload with tools/upload.pl still works.
[3] Rename upload_path in your koha-conf.xml. Restart Plack, flush the cache
    and try to upload to a category. Correct error message?
[4] Upload the same file twice to the same category.
    Correct error message the second time?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19633: (QA follow-up) Really remove these ugly numbers

See BZ comment5. We now remove the numbers also from the constant names.

Test plan:
Read the changes.
Git grep "ERRCODE_"
Run t/db_dependent/Upload.t (Note: You may see one failure here; it is fixed
on bug 20727. So depends on who reaches master first.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20468: (QA follow-up) Deactivate select/clear all for empty tab
Marcel de Rooy [Mon, 2 Jul 2018 12:08:59 +0000 (14:08 +0200)]
Bug 20468: (QA follow-up) Deactivate select/clear all for empty tab

This only pertains to the second (Processing) tab.

Test plan:
[1] Have one entry in Pending and zero in Processing.
[2] Click on Processing tab.
[3] Without this patch, you would see Select all/Clear all.
    With this patch, you won't.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20468: (follow-up) Cancel multiple items for same reason
Marcel de Rooy [Wed, 6 Jun 2018 11:38:36 +0000 (13:38 +0200)]
Bug 20468: (follow-up) Cancel multiple items for same reason

The repeated prompts for cancelling multiple selected items are
confusing.
The wording is slightly adjusted. The reason is asked only once per
group of selected items.

Test plan:
Create three requests.
Select two requests and cancel (from top menu) for reason A.
Cancel third request (from item menu) for reason B.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20468: (follow-up) Changes to checkbox/menu interactions
Owen Leonard [Fri, 1 Jun 2018 16:28:29 +0000 (16:28 +0000)]
Bug 20468: (follow-up) Changes to checkbox/menu interactions

This patch makes a couple of minor interface changes and updates the way
checkbox change events are handled:

 - jQueryUI tabs initialization sets a variable for "active table" which
   can be re-used by functions which affect only the visible table.
 - The batch "Actions" menu is shown or hidden based on whether there
   are checked items.
 - The item selection tools are shown or hidden based on whether there
   are rows in the table.

To test, apply the patch and test various article request actions:

 - Single "process," "complete," and "cancel" operations.
 - Select all/ clear all operations on both tabs.
 - Batch operations with checked requests.
 - Process all pending requests to confirm the selection controls for
   that table are hidden.
 - Complete all processing requests to confirm the selection controls
   for that table are hidden.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20468: Add multi-select to staff article request form
Marcel de Rooy [Thu, 22 Mar 2018 14:47:45 +0000 (15:47 +0100)]
Bug 20468: Add multi-select to staff article request form

Adds a column with a checkbox. Adds buttons under the table for Select,
Clear and Actions menu.
An additional javascript function HandleMulti is placed between the form
and the functions handling individual requests.

Note: The Actions menu below does not contain Print slip. This does not
work in its current form. This could be handled on a separate report.

Test plan:
[1] Enable Article Requests. Add a few requests.
[2] Test the Select all / Clear all functionality on the form.
[3] Verify that the menu options Process, Complete and Cancel work as
    expected both from the individual Actions menu as from the shared
    Actions menu for selected requests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Patch applies and functions as described.
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>
6 years agoBug 21188: Convert return_date to a DateTime object
Nick Clemens [Thu, 9 Aug 2018 13:28:27 +0000 (13:28 +0000)]
Bug 21188: Convert return_date to a DateTime object

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20427: (RM follow-up) Add compiled CSS
Nick Clemens [Thu, 9 Aug 2018 15:21:07 +0000 (15:21 +0000)]
Bug 20427: (RM follow-up) Add compiled CSS

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20427: (follow-up) Bring SCSS up to date with latest LESS changes
Owen Leonard [Thu, 9 Aug 2018 14:04:51 +0000 (14:04 +0000)]
Bug 20427: (follow-up) Bring SCSS up to date with latest LESS changes

This patch catches the SCSS up to the latest changes in master:

Changes to opac.less:

Bug 20756
Bug 20559
Bug 7547

Changes to print.less:

Bug 16575

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20427: Convert OPAC LESS to SCSS
Owen Leonard [Thu, 15 Mar 2018 16:14:09 +0000 (16:14 +0000)]
Bug 20427: Convert OPAC LESS to SCSS

This patch converts the OPAC LESS files to SCSS. In the process of
converting opac.less (and other .less files) to .scss, I have improved
the completeness of the nesting, reordered properties, and in general
done cleanup based on rules in .scss-lint.yml. All of these changes
should have no impact on the style of the OPAC.

This patch modifies the commands used to compile CSS so that OPAC and
staff assets can be processed separately:

'yarn build' <-- Builds the staff client assets by default
'yarn build --view opac' <-- Builds OPAC assets

To test, apply the patch and compile the CSS by running the command
above (or apply the follow-up patch with compiled CSS).

Do a thorough review of the OPAC, taking care to cover as many pages as
possible and checking responsive behavior at the same time. There should
be no visual differences in the OPAC before and after applying the
patch.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19474: (RM follow-up) Compiled css
Nick Clemens [Thu, 9 Aug 2018 15:16:42 +0000 (15:16 +0000)]
Bug 19474: (RM follow-up) Compiled css

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19474: (follow-up) Bring scss up to date with latest CSS changes
Owen Leonard [Mon, 23 Jul 2018 16:24:00 +0000 (16:24 +0000)]
Bug 19474: (follow-up) Bring scss up to date with latest CSS changes

This patch catches the scss up to the latest changes in master:

Bug 19946
Bug 20045
Bug 20343
Bug 18327
Bug 20322
Bug 18799
Bug 20622
Bug 20329
Bug 20744
Bug 20931
Bug 20793
Bug 20651
Bug 20668
Bug 16575
Bug 19166
Bug 20770
Bug 21163
Bug 20779

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19474: (QA follow-up) Fix sass lint yaml configuration
Josef Moravec [Fri, 26 Jan 2018 09:56:26 +0000 (09:56 +0000)]
Bug 19474: (QA follow-up) Fix sass lint yaml configuration

Test plan:
QA tools should report green on the .sass-lint.yml file now

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19474: Convert staff client CSS to SCSS
Owen Leonard [Tue, 13 Mar 2018 13:57:36 +0000 (13:57 +0000)]
Bug 19474: Convert staff client CSS to SCSS

This patch converts staff-global.css to Sass, using SCSS syntax. This
changes the build process for Koha to include installation and execution
of yarn to install npm dependencies and run SCSS -> CSS conversion.

To test, apply the patch and run the following:

$ sudo apt-get install nodejs npm [not necessary in kohadevbox]
$ sudo npm install -g yarn
$ yarn install
$ yarn build

Clear your browser cache if necessary and confirm that CSS styling
throughout the staff client looks correct.

The "yarn build" command triggers a gulp process which compiles SCSS to
CSS, adds automatic vendor-prefixing, and minifies the resulting CSS
file.

There is also a "yarn css" command available which might be used by
developers who are making changes to SCSS. This command does two things
differently:

1. Adds .css.map files which aid CSS debugging using in-browser
   inspector tools.
2. Compiles staff-global.css without minification. It can be useful to
   see unminified CSS during development, especially to see how SCSS
   compiles.

This patch adds a configuration file for sass-lint, .sass-lint.yml.
Currently this configuration is not used during the build process but
can be used in a code editor which supports linting.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18586: Create module to mint RDF subject URIs
David Cook [Tue, 23 May 2017 02:06:59 +0000 (12:06 +1000)]
Bug 18586: Create module to mint RDF subject URIs

Created the Koha::RDF module to mint URIs for RDF documents that
represent Koha bibliographic records.

_TEST PLAN_
To test the module, just run 'prove t/Koha/RDF.t'.

You'll get
some warnings about not being able to find koha-conf.xml, but
you can safely ignore them or you can point to any koha-conf.xml
file since it's not used by the test in actuality.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as expected. No warnings when run like:
sudo koha-shell -c "prove t/Koha/RDF.t" kohadev

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20779: Style refresh for patron detail page
Owen Leonard [Thu, 5 Apr 2018 11:53:07 +0000 (11:53 +0000)]
Bug 20779: Style refresh for patron detail page

This patch makes style and markup changes to the patron detail page
template in order to make the display of information somewhat more
compact and to increase the visibility of the edit controls.

To test you should enable the patronimages system preference. Apply the
patch and view the detail page for a patron.

- Check that the page looks correct and that sections like "Alternate
  address" and "Alternative contact" are empty when there is no data.
- Check that the "Manage patron image" tool works correctly.

Signed-off-by: Cab Vinton <director@plaistowlibrary.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21132: Highlight active filters on saved report page
Owen Leonard [Mon, 30 Jul 2018 17:33:29 +0000 (17:33 +0000)]
Bug 21132: Highlight active filters on saved report page

This patch adds a more obvious way of see which search terms have been
submitted to filter the table of saved reports.

The patch also moves embedded CSS into a separate file.

To test you should have multiple saved reports.

- Apply the patch and go to Reports -> Use saved.
- Filter the table of reports by submitting one or more terms in the
  sidebar "Filter" form.
- Confirm that the terms you submit are shown at the top of the table of
  results.
- Confirm that clicking the "Clear" link clears the search filter.

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: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 18635: Unit tests
Nick Clemens [Fri, 19 May 2017 01:07:11 +0000 (21:07 -0400)]
Bug 18635: Unit tests

I also adjust a few tests that assume value of $nb_of_patrons to not
rely on existing datas

To test:
1 - Apply this patch only
2 - Prove t/db_dependent/Koha/Patrons.t
3 - Tests fail
4 - Apply other patch
5 - Tests pass

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>
6 years agoBug 18635: Koha::Patron->guarantees() should return results alphabetically
Nick Clemens [Fri, 19 May 2017 01:08:22 +0000 (21:08 -0400)]
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>
6 years agoBug 21033: Remove few warns in acqui/basket.pl
Marcel de Rooy [Tue, 3 Jul 2018 13:52:05 +0000 (15:52 +0200)]
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>
6 years agoBug 20828: Step 4 of moremember is used for Housebound and additional attributes
Owen Leonard [Thu, 19 Jul 2018 15:13:55 +0000 (15:13 +0000)]
Bug 20828: Step 4 of moremember is used for Housebound and additional attributes

This patch modifies the patron edit process so that "Housebound roles"
can be edited as a separate step.

To test, apply the patch and open an existing patron's detail page
(moremember.tt). Test the "edit" links for 'Housebound roles' and
'Additional attributes and identifiers' and confirm that each opens its
own edit page, and saving changes works correctly.

Signed-off-by: Cab Vinton <bibliwho@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 20660: Return date override affects debarments in AddReturn
David Bourgault [Tue, 1 May 2018 18:03:52 +0000 (14:03 -0400)]
Bug 20660: Return date override affects debarments in AddReturn

Re-did the patch to follow best practices.

TEST PLAN:
0. Apply first patch only
1. prove t/db_dependent/Circulation.t
2. Apply second patch
3. prove t/db_dependent/Circulation.t

prove should fail the first time and pass the second time.

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>
6 years agoBug 20660: Test AddReturn with $return_date override
David Bourgault [Tue, 1 May 2018 18:01:50 +0000 (14:01 -0400)]
Bug 20660: Test AddReturn with $return_date override

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>
6 years agoBug 21035: Handle new lines when running reports
Jonathan Druart [Wed, 4 Jul 2018 18:05:25 +0000 (15:05 -0300)]
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>
6 years agoBug 21131: Remove the TinyMCE.isDirty() check that caused unexpected behaviour
David Cook [Mon, 30 Jul 2018 04:35:40 +0000 (14:35 +1000)]
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>
6 years agoBug 19291: Make breadcrumbs for OPAC search history consistent with other patron...
Owen Leonard [Fri, 27 Jul 2018 17:22:54 +0000 (17:22 +0000)]
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>
6 years agoBug 21056: Add another flush later
Jonathan Druart [Tue, 31 Jul 2018 15:14:54 +0000 (12:14 -0300)]
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>
6 years agoBug 21056: Changing the logged in library can fail sporadically
Kyle M Hall [Mon, 9 Jul 2018 18:05:29 +0000 (14:05 -0400)]
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>
6 years agoBug 21141: Handle non-existent itemnumbers in batch item modification/deletion
Jonathan Druart [Mon, 6 Aug 2018 18:26:49 +0000 (15:26 -0300)]
Bug 21141: Handle non-existent itemnumbers in batch item modification/deletion

The itemnumber list passed from a file in the batch item
modification/deletion tools is not tested.
Like barcodes we should make sure they refer to a valid items in the DB.

Test plan:
- Create a file with barcodes, itemnumbers and random lines
- Use the batch item modification and deletion tools with this file
You should see a table with a list of invalid barcodes and itemnumbers.

Without this patch you got the following error:
Can't call method "title" on an undefined value at
/home/vagrant/kohaclone/tools/batchMod.pl line 580

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21050: Fix datepickers on LabelItemSearch
Jonathan Druart [Mon, 16 Jul 2018 14:21:48 +0000 (11:21 -0300)]
Bug 21050: Fix datepickers on LabelItemSearch

calendar.inc must be in the jsinclude block when jsfooter is set

Test plan:
- Open or create a label batch.
- Click "Add items" to trigger the pop-up search window.
- Date picker should work now

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21148: Dropdowns styled by the Select2 plugin do not highlight missing required...
Owen Leonard [Thu, 2 Aug 2018 13:46:31 +0000 (13:46 +0000)]
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>
6 years agoBug 21154: Remove unused subs from C4::Serials
Josef Moravec [Thu, 2 Aug 2018 16:11:07 +0000 (16:11 +0000)]
Bug 21154: Remove unused subs from C4::Serials

Test plan:
Run these commands, grep should not return any occurences, prove should
return green:

git grep GetSerialStatusFromSerialId
git grep GetDistributedTo
git grep SetDistributedTo
git grep SetDistributedto
git grep in_array
git grep is_barcode_in_use

kshell
prove t/db_dependent/Serials.t

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 7143: Update timeline (2 new devs)
Nick Clemens [Wed, 8 Aug 2018 21:24:56 +0000 (21:24 +0000)]
Bug 7143: Update timeline (2 new devs)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21145: Do not show buttons for datatables on opac detail page
Josef Moravec [Thu, 2 Aug 2018 06:45:26 +0000 (06:45 +0000)]
Bug 21145: Do not show buttons for datatables on opac detail page

Test plan:
0) Do not apply the patch
1) Go to opac detail page
2) There are up to three datatables
    - items
    - items from other branches (only if there are any and the OpacSeparateHoldings preference is set)
    - subscriptions
3) try to find record with all three tables and confirm, there is button
"Columns visibility" above the table
4) Apply the patch
5) Repeat 1-3 and confirm the button is no more here

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>
6 years agoBug 21075: Unit tests
Nick Clemens [Fri, 13 Jul 2018 15:13:31 +0000 (15:13 +0000)]
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>
6 years agoBug 21075: AutoUnsuspendHolds should unsuspend holds <= today
Nick Clemens [Fri, 13 Jul 2018 14:45:55 +0000 (14:45 +0000)]
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>
6 years agoBug 21099: Reposition floating toolbars earlier
Jonathan Druart [Fri, 20 Jul 2018 15:59:16 +0000 (12:59 -0300)]
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>
6 years agoBug 21048: (QA follow-up) Fix authorized value statuses in filter
Marcel de Rooy [Fri, 27 Jul 2018 07:42:06 +0000 (09:42 +0200)]
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>
6 years agoBug 21048: Fix display of suggestion's status (SUGGEST_STATUS)
Jonathan Druart [Wed, 11 Jul 2018 21:23:49 +0000 (18:23 -0300)]
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>
6 years agoBug 21041: "Merge patrons" button remains disabled with "Select all" option
Owen Leonard [Mon, 16 Jul 2018 17:24:04 +0000 (17:24 +0000)]
Bug 21041: "Merge patrons" button remains disabled with "Select all" option

This patch modifies the JavaScript functions for the select all/clear
all links so that each action triggers the "change" event, required to
enable or disabled the "merge selected patrons" button.

To test, apply the patch and perform a patron search which will return
multiple results.

 - Test the "select all" and "clear all" links, and confirm that the
   "Merge selected patrons" button is enabled and disabled.
 - Test that checking and unchecking multiple checkboxes still works
   correctly to enable and disable the button.

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21151: Fix SRU search fields mapping pop-up
Katrin Fischer [Wed, 1 Aug 2018 15:51:22 +0000 (15:51 +0000)]
Bug 21151: Fix SRU search fields mapping pop-up

The SRU search fields mapping pop-up comes up as a blank white
page.

To test:
- Go to Administration > Z39.50/SRU servers
- Modify or create an SRU server
- Click on the 'Modify' button to change mappings
- Verify the new window that opens is blank
- Apply patch
- Verify the pop-up now is no longer blank but works
  correctly.

Bonus: Spottd some HTML errors while looking for the
       problem. Also fixed in the patch.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19436: (QA follow-up) see 19608 Fix use of intranet-bottom in template
Marcel de Rooy [Fri, 16 Mar 2018 10:36:46 +0000 (11:36 +0100)]
Bug 19436: (QA follow-up) see 19608 Fix use of intranet-bottom in template

Bug 19608 incorrectly replaced intranet-bottom by popup-bottom.
Adjusting the new template in the same way.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19436: (QA follow-up) Revert change in _handle_one_result
Marcel de Rooy [Fri, 16 Mar 2018 08:52:19 +0000 (09:52 +0100)]
Bug 19436: (QA follow-up) Revert change in _handle_one_result

See Bugzilla comment 7. This change does not belong here and is
dubious on its own. Needs further attention on another report.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: In consultation with the author the same change is applied to the
corresponding lines in Z3950SearchAuth.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 19436: Add SRU support for authorities
Matthias Meusburger [Wed, 7 Feb 2018 15:02:35 +0000 (16:02 +0100)]
Bug 19436: Add SRU support for authorities

Test plan:
 - Apply the patch
 - Add an SRU authority server in admininistration -> Z39.50/SRU servers
   You can try with the French national library, configured as such:
   Hostname: catalogue.bnf.fr
   Port: 80
   Database: api/SRU
   Syntax: Unimarc
   Record type: authority
   Additional SRU options: version=1.2,sru=get
   SRU Search fields mapping example:
Keyword (any): aut.anywhere
Name (any): aut.anywhere
Author (any): (aut.type any "pep org") and aut.accesspoint
Author (personal): aut.type=pep and aut.accesspoint
Author (corporate): aut.type=org and aut.accesspoint
Author (meeting/conference): aut.type=org and aut.accesspoint
Subject heading: (aut.type any "geo ram_nc ram_ge ram_pe ram_co") and aut.accesspoint
Subject sub-division: aut.type=ram_pe and aut.accesspoint
Title (any): (aut.type any "tic tut tum ram_tp ram_tu") and aut.accesspoint
Title (uniform):(aut.type any "tut tum ram_tu") and aut.accesspoint

 - Try a search from Authorities -> New from Z39.50/SRU
 - Check that the authority is correctly displayed in "Show Marc"
 - Check that the authority is correclty added to koha in "Import"
 - prove t/db_dependent/Breeding.t

Signed-off-by: François Pichenot <fpichenot@ville-roubaix.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21163: Basket group detail page layout is broken
Owen Leonard [Mon, 6 Aug 2018 14:34:12 +0000 (14:34 +0000)]
Bug 21163: Basket group detail page layout is broken

This fixes a problem with layout of the page when viewing a closed
basket group. Changed the grid options for basket information when a
basket group is closed.

To test, apply the patch and go to Acquisitions -> Vendor -> Basket
groups. You should have multiple baskets and basket groups to test with.

- Edit an open basket group. The layout should look correct, with basket
  group information in the form in the left column and ungrouped basket
  in the right column. Grouping and ungrouping baskets should work
  correctly.
- View a closed basket group. The basket group information should
  display in a single column that spans the main part of the page.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21018: Allow uris defined in the item
Jonathan Druart [Wed, 11 Jul 2018 14:29:15 +0000 (11:29 -0300)]
Bug 21018: Allow uris defined in the item

We need to search for uri defined for the itemnumber we passed in
parameter.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21018: Fix TrackClicks for 952$u
Jonathan Druart [Fri, 29 Jun 2018 13:29:30 +0000 (10:29 -0300)]
Bug 21018: Fix TrackClicks for 952$u

Caused by
  commit 51b6cf2aafbfb45b9fcb072403b986fe3c2add53
  Bug 19847: Track links within the records and 404 for others

We should also accept uri stored in items.uri (952$u)

Test plan:
- Turn on TrackClicks
- Defined uri for some items
- At the OPAC click on the link (from opac-detail.pl)
=> Without this patch you will get 404 (redirected from tracklinks.pl)
=> With this patch applied you will be redirected correctly and the
linktracker will be filled correctly

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 14662: Add empty entries to pull downs in cataloguing form for mandatory subfields
Katrin Fischer [Thu, 2 Aug 2018 13:56:11 +0000 (15:56 +0200)]
Bug 14662: Add empty entries to pull downs in cataloguing form for mandatory subfields

First patch deals with the problem on the item form, this
patch fixes the same problem on catalouging form for the
bibliographic record.

To test:
- Adapt your frameworks:
  - Make sure 942$c is mandatory
  - Link another field to an authorised value, for example: 942$n to YESNO
- Add a new record
  - Verify that the first value of each pull down is preselected,
    there is no way to trigger the 'required' error
- Apply patch
  - Add a record
    - Verify that classification source is preselected according to the
      DefaultClassificationSource system preference
    - Verify that 942$c now defaults to empty
    - Verify all your other mandatory subfields can be set to empty
    - Verify that you can't save before correctly setting them
  - Chane your frameworks
    - Add a default value for 942$c, for example: CF
  - Add another record
    - Verify the itemtype is now preset to your default itemtype
  - Edit an existing record, verify all values show correctly

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>
6 years agoBug 14662: Add empty entries to pull downs on item form for mandatory subfields
Katrin Fischer [Tue, 31 Jul 2018 23:58:33 +0000 (23:58 +0000)]
Bug 14662: Add empty entries to pull downs on item form for mandatory subfields

The code assumed that if a subfield is marked as mandatory, there should be no
empty entry in the pull downs.

This assumption is not correct, as it leads to the first entry of the
pull down being preselected if there is no default set. Which means you
will never be alerted of any cataloguing errors and errors will be very
hard to find later on.

Correct behaviour would be to preselect the empty value when there is
no default. This means on saving the item an error message is triggered
and the cataloger is forced to set the value.

To test:
- Adapt your frameworks:
  - Make 942$c non-mandatory
  - In 952 make itemtype, classification source and some other pull downs
    like location or collection mandatory
- Add a new item
  - Verify that the first value of each pull down is preselected,
    there is no way to trigger the 'required' error
- Apply patch
  - Add a new item
    - Verify that classification source is preselected according to the
      DefaultClassificationSource system preference
    - Verify that the itemtype is preselected according to 942$c in
      the bibliographic record
    - Verify all mandatory fields can be set to empty
    - Verify that you can't save before correctly setting them
  - Change the 942$c in the record to empty
  - Add another item
    - Verify the itemtype is now empty
  - Change your frameworks and set a default for itemtype (Ex: BK)
  - Repeat default check with another pull down like collection or location

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We do not want empty values for branches (holdingbranch and homebranch
must be mandatory, see bug 21011)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21149: Fix superlibrarian creation in onboarding
Jonathan Druart [Thu, 2 Aug 2018 14:47:24 +0000 (11:47 -0300)]
Bug 21149: Fix superlibrarian creation in onboarding

See bug 21087 for more details.

Test plan:
Drop your DB
Start the installation process
Use the onboarding process to install missing data
The superlibrarian created during this process should be created
sucessfully and allowed to login

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 21031: Apache Rewrite rules don't work for API when using anything but Debian...
David Cook [Tue, 3 Jul 2018 09:04:50 +0000 (19:04 +1000)]
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>
6 years agoBug 20770: ILL loans OPAC form notes field allow arbitrary input
Andrew Isherwood [Tue, 15 May 2018 15:00:02 +0000 (16:00 +0100)]
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>
6 years agoBug 21122: Fix check-url-quick when utf8 characters in URL's
Liz Rea [Thu, 26 Jul 2018 04:26:15 +0000 (16:26 +1200)]
Bug 21122: Fix check-url-quick when utf8 characters in URL's

To test:

Make a record with a URL that has a UTF8 character, such as:
http://some.nonexistent.tld/MāoriWomenAotearoa.pdf
Run the check-url-quick.pl job, notice it dies at that URL
Apply this patch
Test again, it should work.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21094: Syndetics: always use https instead of http
Owen Leonard [Thu, 19 Jul 2018 16:57:42 +0000 (16:57 +0000)]
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>
6 years agoBug 21077: Fix database documentation for statistics.type
Katrin Fischer [Sun, 15 Jul 2018 17:27:03 +0000 (19:27 +0200)]
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>
6 years agoBug 21136: Fix add/edit patron when cities are defined
Jonathan Druart [Wed, 1 Aug 2018 12:59:01 +0000 (09:59 -0300)]
Bug 21136: Fix add/edit patron when cities are defined

Same as bug 21085.

When cities are defined, there is a select with name="select_city" added
to the DOM and its value will be passed to memberentry.pl
We must remove it from the attribute list before creating the
Koha::Patron object

No property select_city for Koha::Patron at
/usr/share/perl5/Exception/Class/Base.pm line 73

Test plan:
Define cities
Add or edit a patron, save

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21129: Fix typo created vs created_by
Jonathan Druart [Tue, 31 Jul 2018 13:09:40 +0000 (10:09 -0300)]
Bug 21129: Fix typo created vs created_by

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl
Blou [Fri, 27 Jul 2018 15:41:16 +0000 (11:41 -0400)]
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl

Bug 17234 made an effort to remove the ALTER IGNORE from updatedatabase.pl so that it could work with Mysql 5.7.  But new entries have since been added to it:

Bug 12395 - 18.06.00.005
Bug 19524 - 18.06.00.006
Bug 13560 - 18.06.00.008

This is corrected using column_exists to validate the existence of the new columns before ALTER

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21133: Fix use statements order
Jonathan Druart [Tue, 31 Jul 2018 18:24:10 +0000 (15:24 -0300)]
Bug 21133: Fix use statements order

Basically the idea is:
1. Undefined subroutine &C4::Items::ModZebra called at /home/vagrant/kohaclone/C4/Items.pm line 302.

=> Then use C4::Items before C4::Biblio

2. Undefined subroutine &C4::Circulation::GetItem called at /home/vagrant/kohaclone/C4/Circulation.pm line 1290

=> Then use C4::Circulation before C4::Items

And sometimes these 2 rules do not work...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21032: Fix using facet for searches made on specific index
Alex Arnaud [Tue, 3 Jul 2018 13:57:00 +0000 (13:57 +0000)]
Bug 21032: Fix using facet for searches made on specific index

Test plan:

  - Try a simple search (OPAC or staff) like "title:foo",
  - click on a facet: badaboum!
  - apply this patch,
  - retry

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21133: Add missing use C4::Accounts statement in Koha/Patron.pm
Jonathan Druart [Tue, 31 Jul 2018 15:36:35 +0000 (12:36 -0300)]
Bug 21133: Add missing use C4::Accounts statement in Koha/Patron.pm

It's a follow-up of
  commit 9c6f634469de4364d71bc0eb7520d04ead61fd00
  Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to->add_enrolment_fee_if_needed

One of the known issue:
> update categories set enrolmentfee=2;
The use misc/devel/create_superlibrarian.pl to create a new
superlibrarian patron

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21134: Correctly throw the exception in Koha::Patron::Modification->approve
Jonathan Druart [Tue, 31 Jul 2018 15:43:54 +0000 (12:43 -0300)]
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>
6 years agoBug 19166: Remove 'IF NOT EXISTS' in kohastructure
Jonathan Druart [Tue, 31 Jul 2018 11:30:53 +0000 (08:30 -0300)]
Bug 19166: Remove 'IF NOT EXISTS' in kohastructure

The table is removed just before, this clause is useless.

It also fixes a test:
t/db_dependent/Creators/Lib.t .. 1/645
  #   Failed test 'get_table_names return all tables matching'
  #   at t/db_dependent/Creators/Lib.t line 1258.
  #     Structures begin differing at:
  #          $got->[10] = 'aqinvoice_adjustments'
  #     $expected->[10] = 'aqinvoices'
  # Looks like you failed 1 test of 645.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 19604: Fix perlcritic "Loop iterator is not lexical"
Jonathan Druart [Tue, 31 Jul 2018 11:21:00 +0000 (08:21 -0300)]
Bug 19604: Fix perlcritic "Loop iterator is not lexical"

Loop iterator is not lexical at line 318, column 13.  See page 108 of
PBP.  (Severity: 5)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21087: (QA follow-up) Fix usage in create_superlibrarian.pl
Tomas Cohen Arazi [Tue, 31 Jul 2018 01:51:32 +0000 (22:51 -0300)]
Bug 21087: (QA follow-up) Fix usage in create_superlibrarian.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21087: Fix create_superlibrarian.pl script
Jonathan Druart [Wed, 25 Jul 2018 22:09:01 +0000 (19:09 -0300)]
Bug 21087: Fix create_superlibrarian.pl script

Signed-off-by: John Doe <you@example.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21087: Do not store the password in ->store for existing patrons
Jonathan Druart [Wed, 25 Jul 2018 13:38:48 +0000 (10:38 -0300)]
Bug 21087: Do not store the password in ->store for existing patrons

When ->store is called on an existing patron we must not save the
password, but keep the one in DB instead.
There is a dedicated method (update_password) to call when the password
need to be updated

Signed-off-by: John Doe <you@example.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21087: Fix one wrong call
Jonathan Druart [Wed, 25 Jul 2018 13:37:57 +0000 (10:37 -0300)]
Bug 21087: Fix one wrong call

Signed-off-by: John Doe <you@example.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21087: Hash passwords in ->update_password
Jonathan Druart [Wed, 18 Jul 2018 22:54:34 +0000 (19:54 -0300)]
Bug 21087: Hash passwords in ->update_password

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: John Doe <you@example.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 21087: Test to describe the issue
Jonathan Druart [Wed, 18 Jul 2018 22:14:40 +0000 (19:14 -0300)]
Bug 21087: Test to describe the issue

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: John Doe <you@example.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 years agoBug 20287: (RM follow-up) Restore use C4::Members
Nick Clemens [Tue, 24 Jul 2018 14:48:27 +0000 (14:48 +0000)]
Bug 20287: (RM follow-up) Restore use C4::Members

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 11911: DBRev 18.06.00.012
Nick Clemens [Mon, 23 Jul 2018 14:58:05 +0000 (14:58 +0000)]
Bug 11911: DBRev 18.06.00.012

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 11911: (follow-up) Hide suggestion box on acq start page if no permission
Katrin Fischer [Mon, 28 May 2018 21:56:51 +0000 (23:56 +0200)]
Bug 11911: (follow-up) Hide suggestion box on acq start page if no permission

When the user is not superlibrarian or has the manage_suggestions
permission, the suggestion box on the left of the acq start page
needs to be hidden.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 11911: Add a separate permission for managing suggestions
Katrin Fischer [Fri, 18 May 2018 10:40:21 +0000 (10:40 +0000)]
Bug 11911: Add a separate permission for managing suggestions

Without this patch only catalogue permission was required
for managing suggestions. This patch adds a new permission
in the acquisition module do manage suggestions and updates
staff user permissions accordingly.

To test:
- Make sure there is a pending suggestion
- Create a few users with different permission sets:
  - User 1: only catalogue
  - User 2: any acquisition permission
  - User 3: cataloguing permission
- Check all of them can access: /cgi-bin/koha/suggestion/suggestion.pl
- Apply the patch
- Verify all of them now have the suggestions_manage permission
- Verify everything displays correctly on:
  - intranet start page
  - patron account in staff
  - acquisition start page
  - suggestion page (try to access by URL too)
- Remove suggestions_manage for a staff user
- Repeat tests above, access should be denied/links not visible

Bonus:
- Fixes the link on the acquisition start page for late orders
  to mage the permissions of the page itself: order_receive

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: DBRev 18.06.00.011
Nick Clemens [Mon, 23 Jul 2018 15:18:01 +0000 (15:18 +0000)]
Bug 17698: DBRev 18.06.00.011

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: Do not send pending_checkout_notes from all circ scripts
Jonathan Druart [Wed, 13 Jun 2018 13:52:33 +0000 (10:52 -0300)]
Bug 17698: Do not send pending_checkout_notes from all circ scripts

It's safer to send what we need from C4::Auth it's needed from a whole
module.
The SELECT COUNT(*) query will only be done when needed (so not made
from scripts outside of circ)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (QA follow-up) few more things
Jonathan Druart [Wed, 13 Jun 2018 13:18:17 +0000 (10:18 -0300)]
Bug 17698: (QA follow-up) few more things

1. body tag was missing
2. make "Date" column sortable correctly
3. remove CDATA and type="text/javascript"
4. Handle server-side errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (follow-up) Fixing things in Comment 57
Aleisha Amohia [Tue, 12 Jun 2018 23:10:24 +0000 (23:10 +0000)]
Bug 17698: (follow-up) Fixing things in Comment 57

3. In the JS console: "ReferenceError: $ is not defined", I did not
investigate it.

Where do you see this in the console? I cannot recreate on opac-user.pl
or on circ/checkout-notes.pl.

5. The alert id=error is displayed then hide in JS, but it's then
displayed half a second. We should hide it by default (css)

Fixed in this patch

6. I would move the "mark seen" and "mark not seen" buttons at the
top of the table

Fixed in this patch

8. Cursor on "Select all" and "Clear all" links must be adjusted

Fixed in this patch

9. $(".btn-xs").click(function(event){
The selector should be $("button.seen, button.notseen"), you
do not want to apply this function to all other btn-xs on
the page (maybe there are only two for now, but who knows
later?)

Fixed in this patch

12. Important: When a note is updated, it's still marked as
seen. Is it the expected behavior?

I don't see this behaviour. When a note is updated it is
marked as not seen.
opav/svc/checkout_notes:79: $issue->set({ notedate =>
dt_from_string(), note => $clean_note, noteseen => 0
})->store;

13. What will happen when hundred of notes will be on this
table? Not blocker but we will need a "hide seen" buttons to
filters the already seen notes.

Added in this patch

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (QA follow-up) Fix minors design issues
Jonathan Druart [Tue, 12 Jun 2018 20:02:30 +0000 (17:02 -0300)]
Bug 17698: (QA follow-up) Fix minors design issues

This patch includes some changes required on comment 57:

1. Bad resolution conflict, permission self_checkout is re-add

2. The IGNORE modifier is missing in the INSERT statement

4. When I hit /circ/checkout-notes.pl from the side bar, the page displays "Checkout notes", nothing else. We should add "There is no checkout notes".

7. I would display the table on the confirmation screen as well

10. html filters are missing

11. span element should surround translatable string, to help translators

14. patron-title.inc must be used to display patron's info

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (follow-up) Rebase
Nick Clemens [Mon, 23 Jul 2018 13:50:33 +0000 (13:50 +0000)]
Bug 17698: (follow-up) Rebase

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (QA follow-up) Changes to use Asset TT plugin (bug 20538)
Katrin Fischer [Sun, 15 Apr 2018 11:51:55 +0000 (13:51 +0200)]
Bug 17698: (QA follow-up) Changes to use Asset TT plugin (bug 20538)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (follow-up) Fixing some small issues
Aleisha Amohia [Thu, 12 Apr 2018 04:04:48 +0000 (04:04 +0000)]
Bug 17698: (follow-up) Fixing some small issues

Fixing the comments in Comment 42

Ready to test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
6 years agoBug 17698: (follow-up) Koha Objects, access borrower through patron sub
Aleisha Amohia [Thu, 6 Jul 2017 01:28:06 +0000 (01:28 +0000)]
Bug 17698: (follow-up) Koha Objects, access borrower through patron sub

See Comment 27
This is ready to be tested.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>