koha.git
6 years agoBug 19542: Add Elasticsearch information in the 'About' page
Tomas Cohen Arazi [Tue, 31 Oct 2017 14:29:28 +0000 (11:29 -0300)]
Bug 19542: Add Elasticsearch information in the 'About' page

This patch adds Elasticsearch related information to the 'About' page.

The information is gathered and displayed only when the 'SearchEngine' syspref
is set to 'Elasticsearch'. It displays configured nodes, and the status:
- Running
- Not running

In case it is running, it displays the defined indices and the document count on each.
If there are configuration problems, exceptions are catch and a convenient warning
message is displayed.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/Koha/SearchEngine/Elasticsearch.t
=> SUCCESS: Tests pass!
- Have ES configured in your koha-conf.xml file (by default in kohadevbox)
- Set the 'SearchEngine' syspref to 'Elasticsearch'
- Comment out pieces of the elasticsearch-specific entries (server, index_name,
  the whole elasticsearch block). Reload on each change.
=> SUCCESS: Warning messages are displayed and make sense in the context of your changes.
----> the rest of the tests require having ES running on the dev env. This can be easily
      achieved by creating the kohadevbox using:
        $ KOHA_ELASTICSEARCH=1 vagrant up
- Stop the 'elasticsearch' service:
  $ sudo service elasticsearch stop
- Reload about.pl
=> SUCCESS: The configured nodes are displayed, and the status is 'not running'
- Start the 'elasticsearch' service:
  $ sudo service elasticsearch start
- Reload about.pl
=> SUCCESS: The configured nodes are displayed, the status is 'running' and
            created indices info is displayed, along with the document count
            on each index.
- Sign off :-D

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19542: Add a check for ES configuration health
Tomas Cohen Arazi [Tue, 31 Oct 2017 14:26:36 +0000 (11:26 -0300)]
Bug 19542: Add a check for ES configuration health

This patch adds a new statuc function to Koha::SearchEngine::ElasticSearch
which is instended to replace most of get_elasticsearch_params. This function
reads the configuration from C4::Context->config('elasticsearch') and raises
relevant exceptions when mandatory entries are missing.

Its behaviour is covered by tests.

To test:
- Run:
  $ kshell
 k$ prove t/Koha/SearchEngine/Elasticsearch.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 11210: Writeoff partial amounts
David Bourgault [Mon, 25 Sep 2017 17:05:01 +0000 (13:05 -0400)]
Bug 11210: Writeoff partial amounts

Minor changes to pay.pl and paycollect.tt to allow writing off a partial amount of a fine.

Test plan:
0) Go to the Fines tab of a test patron's profile
1) Create a fine if there are none (under the Manual invoice tab)
2) Go to the "Pay fines" tab
3) Press the write off button on the corresponding account line

Without patch, you'll be asked to confirm, but will not be able to edit the amount
With patch, you'll be able to edit the amount.

Followed test plan, patch worked as described. Also ran QA test tool and
modified files passed

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19769: 'Pickup library is different' message does not display library branch...
Claire Gravely [Thu, 7 Dec 2017 07:35:37 +0000 (07:35 +0000)]
Bug 19769: 'Pickup library is different' message does not display library branch name when placing hold

When placing a hold for a patron whose pickup library and home library
are different, the message displayed only shows the branch code and not
the branch name.

This patch displays the branch name as well as the branch code.

To test:
1. Search for an item
2. Click 'place hold'
3. Enter patron name/card number for a patron whose home library is
   different to the item's
4. Note the message displayed only shows the branch code but not the
   name
5. Apply Patch
6. Repeat 1-3
7. Message should now also display the branch name

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19746: Remove debug statements in returns.pl
Jonathan Druart [Mon, 4 Dec 2017 19:07:52 +0000 (16:07 -0300)]
Bug 19746: Remove debug statements in returns.pl

From bug commit bb6277ffcc593685554112d770ac273c9efeda33
Bug 14464: Add ability to cancel waiting holds from checkin screen

+use Carp 'verbose';
+$SIG{ __DIE__ } = sub { Carp::confess( @_ ) };

See also
http://lists.koha-community.org/pipermail/koha-devel/2017-November/044168.html

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 3841: Add the ACQ framework for new installations
Jonathan Druart [Thu, 26 Oct 2017 18:41:47 +0000 (15:41 -0300)]
Bug 3841: Add the ACQ framework for new installations

This patch adds the acquisition frameworks (frameworkcode=ACQ) for new
installations.
It copies the 952 (MARC21) or 995 (UNIMARC) fields from the default
framework (frameworkcode='')

Test plan:
Create a new installation and make sure the ACQ framework exists.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19563: (follow-up) Restore checking sort variable
Nick Clemens [Fri, 17 Nov 2017 12:13:55 +0000 (12:13 +0000)]
Bug 19563: (follow-up) Restore checking sort variable

This code seems a bit odd, $self->sort_fields()->{$name} is checking if
there is any mapping in ES for a field, so if one marc field in an index
is marked as sortable this will exists. We need to check the individual
marc field to see if it should be added to the sort index here.

If you apply the first patch, reindex, and view a record in es:
curl -XGET 'localhost:9200/koha_kohadev_biblios/data/19/?pretty' | grep
-A 10 author__sort

You will see that 245$c is included in the record without that
additional check

Apply this, reindex again, and that field should not be included

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19563: Unit tests
Nick Clemens [Fri, 17 Nov 2017 12:12:32 +0000 (12:12 +0000)]
Bug 19563: Unit tests

To test:
1 - Apply first patch and this patch
2 - prove -v t/db_dependent/Koha_Elasticsearch.t
3 - New tests will fail
4 - Apply followup patch
5 - Tests shuld pass

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19563: Generation of sort_fields uses incorrect condition
David Gustafsson [Thu, 2 Nov 2017 12:44:13 +0000 (13:44 +0100)]
Bug 19563: Generation of sort_fields uses incorrect condition

Fix incorrect condition for if clause for generating <field>__sort mappings
for Elasticsearch. Also remove redundant check for same condition when
generating fixer rules.

Test plan:
1. Inspect current mappings for example by viewing: http://<elasticsearch_host>:9200/koha_<koha_instance_name>_biblios/_mapping.
2. If using the default configuraion only "author" has a sort field (author__sort).
4. Appy patch.
5. Reindex using rebuild_elastic_search.pl.
6. All fields except those with sort sort set to "0" should now have sort fields, which in the default configuration is all but "author".

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: Only display outstanding fines in 'Pay fines'
Jonathan Druart [Mon, 11 Dec 2017 16:57:39 +0000 (13:57 -0300)]
Bug 10021: Only display outstanding fines in 'Pay fines'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: Remove notify headers from pay*.tt
Jonathan Druart [Mon, 11 Dec 2017 16:32:09 +0000 (13:32 -0300)]
Bug 10021: Remove notify headers from pay*.tt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19439: (follow-up) Remove four spaces from lines 133-149
Marcel de Rooy [Tue, 10 Oct 2017 13:50:24 +0000 (15:50 +0200)]
Bug 19439: (follow-up) Remove four spaces from lines 133-149

Speaks for itself. No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19439: Remove eval with exit statements from opac/unapi
Marcel de Rooy [Mon, 9 Oct 2017 13:12:05 +0000 (15:12 +0200)]
Bug 19439: Remove eval with exit statements from opac/unapi

The script contains some error responses that get lost when using them
in an eval statement. (Since exit should not be used within an eval
construction.) The eval is removed now.

Test plan:
[1] Before applying this patch, you could look at the current responses
    from unapi for the calls in the next steps. Apply the patch now.
[2] Call http(s)://[your-server]/cgi-bin/koha/unapi with only a format
    parameter.
    Check if you have a 400 status response. (In Firefox, look at Network
    tab of Developer Tools.)
    Note: Have to admit (reluctantly) that MS Edge shows the status code in
    the browser rightaway in contrast with Firefox.
[3] Call unapi with a format=marcxml&id=999
    The wrong id parameter should trigger a 404 response.
[4] Call unapi with format=marcxml&id=koha:biblionumber:[notexist]
    where notexist is a biblionumber that not exists.
    This should trigger again a 404 response.
[5] Call unapi with format=marcxmlx&id=koha:biblionumber:[exist]
    where exist should be a good biblionumber.
    The wrong format should trigger a 406 response.
[6] Bonus: The 500 response can be tested by manipulating a XSLT file.
    Create invalid xml in the file for marcxml (identity.xsl in intranet
    xslt folder).
    Call unapi with format=marcxml&id=koha:biblionumber:[exist].
    You should get a 500 response and have warnings in your logfile.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19726: Move admin templates JavaScript to the footer: Preferences
Owen Leonard [Fri, 1 Dec 2017 13:53:16 +0000 (13:53 +0000)]
Bug 19726: Move admin templates JavaScript to the footer: Preferences

This patch modifies the staff client's system preferences templates so
that JavaScript is included in the footer instead of the
header.

To test, apply the patch and test the JavaScript-driven features of
both the standard and local use system preferences:

 - WYSIWYG editor
 - Confirmation messages
 - Table sorting
 - Multiple selects (CoceProviders for example)

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19710: Move plugins templates javascript to the footer
Owen Leonard [Tue, 28 Nov 2017 19:04:43 +0000 (19:04 +0000)]
Bug 19710: Move plugins templates javascript to the footer

This patch modifies the staff client plugins template so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of
the modified template:

- The plugins link should be bold in the sidebar menu.
- Choosing "Uninstall" for an installed plugin should trigger a
  confirmation alert.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19700: Move template JavaScript to the footer: Some circulation pages
Owen Leonard [Mon, 27 Nov 2017 15:15:06 +0000 (15:15 +0000)]
Bug 19700: Move template JavaScript to the footer: Some circulation pages

This patch modifies some staff client circulation templates so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of the
modified templates: All button controls, DataTables functionality, tabs,
etc.

- Article requests (enable ArticleRequests system preference, have at
  least one outstanding article request)
  - Request article (Bibliographic detail page -> Request article).
- Item circulation statistics (Bibliographic detail page -> Items ->
  View item's checkout history).
- On-site checkouts (enable OnSiteCheckouts system preference; Check out
  some items as on-site checkouts; Go to Circulation ->
  Pending on-site checkouts
- Overdues report (Circulation -> Overdues).
- Holds to pull (Circulation -> Holds to pull).
- Renew
- Holds ratios (Circulation -> Holds ratios).
- Check in
- Transfers to receive (Circulation -> Transfers to receive).
- Holds queue (Circulation -> Holds queue).
- Holds awaiting pickup (Circulation -> Holds awaiting pickup).

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19697: Move template JavaScript to the footer: Search results
Owen Leonard [Mon, 27 Nov 2017 12:51:16 +0000 (12:51 +0000)]
Bug 19697: Move template JavaScript to the footer: Search results

This patch modifies the staff client catalog search results template so
that JavaScript is included in the footer instead of the header.

To test, apply the patch and test the various JavaScript-driven features
of the results page: Floating toolbar, cart, lists, cover images, search
to hold, etc.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19680: Move JS to the footer: Patron and circulation tools
Owen Leonard [Wed, 22 Nov 2017 19:03:15 +0000 (19:03 +0000)]
Bug 19680: Move JS to the footer: Patron and circulation tools

This patch modifies more staff client patrons and circulation tools
templates so that JavaScript is included in the footer instead of the
header.

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.

  - Batch patron deletion/anonymization
  - Overdue notice/status triggers
  - Batch patron modification

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19679: Move templates JavaScript to the footer: More tools templates
Owen Leonard [Wed, 22 Nov 2017 15:53:42 +0000 (15:53 +0000)]
Bug 19679: Move templates JavaScript to the footer: More tools templates

This patch modifies more staff client tools templates so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.

  Export data
  Inventory
  Notices & slips
  Upload local cover image

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19672: Move tools templates JavaScript to the footer: More MARC tools
Owen Leonard [Tue, 21 Nov 2017 15:14:58 +0000 (15:14 +0000)]
Bug 19672: Move tools templates JavaScript to the footer: More MARC tools

This patch modifies some staff client templates from the "Tools"
section so that JavaScript is included in the footer instead of the
header.

- Automatic item modifications by age
- MARC modification templates
- Stage MARC records for import
- Staged MARC record management

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19659: Move JS to the footer: Suggestions and tags
Owen Leonard [Mon, 20 Nov 2017 18:05:14 +0000 (18:05 +0000)]
Bug 19659: Move JS to the footer: Suggestions and tags

This patch modifies the staff client's suggestions and tags templates so
that JavaScript is included in the footer instead of the header.

This patch adds a new JS file, acquisitions-menu.js, which will be added
to each template which has the Acquisitions sidebar menu (in this case,
suggestions). Highlighting of the current page in the sidebar menu will
be broken for pages which have not been modified to use this file.

To test, apply the patch and test the JavaScript-driven features of
suggestions and tags pages: All button controls, DataTables
functionality, form validation, etc.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19657: Move lists templates JS to the footer
Owen Leonard [Mon, 20 Nov 2017 17:05:10 +0000 (17:05 +0000)]
Bug 19657: Move lists templates JS to the footer

This patch modifies the staff client's lists templates so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of the
lists page: All button controls, DataTables functionality, form
validation, etc.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19656: (QA follow-up) Add bold style to rotating colections menu item
Josef Moravec [Wed, 6 Dec 2017 16:14:51 +0000 (16:14 +0000)]
Bug 19656: (QA follow-up) Add bold style to rotating colections menu item

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19656: Move rotating collections templates JS to the footer
Owen Leonard [Mon, 20 Nov 2017 16:41:33 +0000 (16:41 +0000)]
Bug 19656: Move rotating collections templates JS to the footer

This patch modifies the staff client's rotating collections templates so
that JavaScript is included in the footer instead of the header.

The patch moves JavaScript from each template and the rotating
collections toolbar into a single external JavaScript file.

To test, apply the patch and test the JavaScript-driven features of
each page: All button controls, DataTables functionality, form
validation, etc.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19653: (QA follow-up) Add bold style to quotes menu item on quotes-upload page
Josef Moravec [Wed, 6 Dec 2017 15:19:46 +0000 (15:19 +0000)]
Bug 19653: (QA follow-up) Add bold style to quotes menu item on quotes-upload page

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19653: Move tools templates JavaScript to the footer: Additional tools
Owen Leonard [Tue, 28 Nov 2017 15:41:54 +0000 (15:41 +0000)]
Bug 19653: Move tools templates JavaScript to the footer: Additional tools

This patch modifies the staff client "Additional tools" templates so
that JavaScript is included in the footer instead of the header:

- Calendar
- CSV profiles
- Log viewer
- News
- Task scheduler
- Edit quotes for QOTD feature
- Upload

Note that the log viewer template has been modified so that the
"interface" variable (passed to the template to provide the correct path
to staff client assets) isn't overwritten by an "interface" variable
required by the log viewer.

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19628: Move course reserves templates JS to the footer
Owen Leonard [Wed, 15 Nov 2017 16:08:57 +0000 (16:08 +0000)]
Bug 19628: Move course reserves templates JS to the footer

This patch modifies the staff client course reserves templates so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of
each page: All button controls, DataTables, autocomplete, etc.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19601: Move admin templates JavaScript to the footer: Additional parameters
Owen Leonard [Thu, 9 Nov 2017 13:53:19 +0000 (13:53 +0000)]
Bug 19601: Move admin templates JavaScript to the footer: Additional parameters

This patch modifies the staff client "additional parameters"
administration templates so that JavaScript is included in the footer
instead of the header.

To test, apply the patch and test the JavaScript-driven features of
each page: All button controls, DataTables functionality, tabs, etc.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19600: (QA follow-up) Apply css to menu item for item_search_field page
Josef Moravec [Tue, 5 Dec 2017 10:58:11 +0000 (10:58 +0000)]
Bug 19600: (QA follow-up) Apply css to menu item for item_search_field page

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19600: Move admin templates JavaScript to the footer: Other catalog pages
Owen Leonard [Thu, 9 Nov 2017 13:24:04 +0000 (13:24 +0000)]
Bug 19600: Move admin templates JavaScript to the footer: Other catalog pages

This patch modifies the staff client catalog-related administration
templates so that JavaScript is included in the footer instead of the
header.

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
tabs, etc.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19647: Move patron lists templates JS to the footer
Owen Leonard [Fri, 17 Nov 2017 16:32:56 +0000 (16:32 +0000)]
Bug 19647: Move patron lists templates JS to the footer

This patch modifies the staff client patron lists templates so that
JavaScript is included in the footer instead of the header.

This patch adds a new JS file, tools-menu.js, which will be added to
each template which has the Tools sidebar menu. Highlighting of the
current page in the sidebar menu will be broken for pages which have not
been modified to use this file.

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.
resolved the issue, sorry about that, everything is working fine!Signed-off-by: Dominic Pichette <dominic@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19594: Move admin templates JavaScript to the footer: MARC-related
Owen Leonard [Wed, 8 Nov 2017 17:40:55 +0000 (17:40 +0000)]
Bug 19594: Move admin templates JavaScript to the footer: MARC-related

This patch modifies the staff client MARC-related administration
templates so that JavaScript is included in the footer instead of the
header.

To test, apply the patch and test the JavaScript-driven features of the
cart: All button controls, DataTables functionality, tabs, etc.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19592: Move admin templates JavaScript to the footer: Acquisitions
Owen Leonard [Wed, 8 Nov 2017 15:55:23 +0000 (15:55 +0000)]
Bug 19592: Move admin templates JavaScript to the footer: Acquisitions

This patch modifies the staff client acquisitions-related adminisration
templates so that JavaScript is included in the footer instead of the
header.

To test, apply the patch and test the JavaScript-driven features of the
cart: All button controls, DataTables functionality, tabs, etc.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12227: Remove the demo functionality
Jonathan Druart [Wed, 27 Sep 2017 17:30:20 +0000 (14:30 -0300)]
Bug 12227: Remove the demo functionality

This is a legacy mode that did not really work.

Test plan:
Play with frameworks and sysprefs and confirm the changes
(add/del/update) are taken into account.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19292: Add MARC code column on libraries list
Josef Moravec [Fri, 6 Oct 2017 07:26:31 +0000 (07:26 +0000)]
Bug 19292: Add MARC code column on libraries list

Test plan:
0) Apply the patch
1) Go to admin/branches.pl
2) In the list of libraries, you should see new column "MARC Organization Code"
3) Insert some codes to some libraries
4) Confirm they are shown in new column

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Fixed capitalization.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19299: Replace C4::Reserves::GetReservesForBranch with Koha::Holds->waiting
Jonathan Druart [Mon, 11 Sep 2017 15:49:33 +0000 (12:49 -0300)]
Bug 19299: Replace C4::Reserves::GetReservesForBranch with Koha::Holds->waiting

GetReservesForBranch simply returns the waiting holds, for a specific
branch of not. This can easily be replaced with a call to
Koha::Holds->waiting

To avoid any regressions, I reuse the exact conditions (priority = 0),
but I do not think it is useful.

Test plan:
Make sure the holds information are correctly displayed on the waiting
holds screen.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19751: Holds awaiting pickup report should not be fixed-width
Owen Leonard [Tue, 5 Dec 2017 15:26:58 +0000 (15:26 +0000)]
Bug 19751: Holds awaiting pickup report should not be fixed-width

This patch changes the grid used for the holds awaiting pickup report so
that the results are full page and fluid instead of fixed-width.

To test, apply this patch and the patch for Bug 19700 if necessary.

View the holds awaiting pickup report. The report should fluidly fill
the page width.

Test with the CircSidebar system preference enabled and disabled.

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: BWS Sandboxes <ByWaterSandboxes@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: DBRev 17.12.00.003
Jonathan Druart [Wed, 29 Nov 2017 18:18:31 +0000 (15:18 -0300)]
Bug 10021: DBRev 17.12.00.003

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: (QA follow-up) Rename variables
Jonathan Druart [Fri, 3 Nov 2017 16:40:38 +0000 (13:40 -0300)]
Bug 10021: (QA follow-up) Rename variables

To avoid $account, $accounts and @accounts variables in the same scope

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: Restore "Pay fines" list
Jonathan Druart [Tue, 24 Oct 2017 21:45:31 +0000 (18:45 -0300)]
Bug 10021: Restore "Pay fines" list

Previous changes were wrong, the notify_id was always equal to 1 and
GetBorNotifyAcctRecord was used to retrieved the account lines to pay

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: Remove notify columns in circ/branchoverdues.tt
Jonathan Druart [Tue, 24 Oct 2017 21:25:38 +0000 (18:25 -0300)]
Bug 10021: Remove notify columns in circ/branchoverdues.tt

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: Remove accountlines columns - DBIC Schema changes
Jonathan Druart [Mon, 23 Oct 2017 15:27:58 +0000 (12:27 -0300)]
Bug 10021: Remove accountlines columns - DBIC Schema changes

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: Update DB changes
Jonathan Druart [Mon, 23 Oct 2017 15:27:33 +0000 (12:27 -0300)]
Bug 10021: Update DB changes

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: Drop columns notify_id and notify_level from accountlines
Jonathan Druart [Wed, 18 Oct 2017 13:43:17 +0000 (10:43 -0300)]
Bug 10021: Drop columns notify_id and notify_level from accountlines

It appears that has never worked.
Could someone confirm?

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10021: Drop table notifys and related code
Jonathan Druart [Mon, 8 Aug 2016 15:24:21 +0000 (16:24 +0100)]
Bug 10021: Drop table notifys and related code

This patch drops the notifys table and its related code in C4::Overdues.
A second patch should remove the 2 columns notify_id and notify_level
from the accountlines table.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19096: DBRev 17.12.00.002
Jonathan Druart [Mon, 11 Dec 2017 14:22:41 +0000 (11:22 -0300)]
Bug 19096: DBRev 17.12.00.002

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19096: Add update DB entry to sync kohafield in all frameworks
Marcel de Rooy [Thu, 17 Aug 2017 08:57:28 +0000 (10:57 +0200)]
Bug 19096: Add update DB entry to sync kohafield in all frameworks

Squashed the last four follow-ups into one patch. Instead of adding
two routines to Koha::MarcSubfieldStructures, and instead of moving
them to Koha::Util::Dbrev, we finally ended up with converting the
code to raw SQL queries (thx Jonathan). No need to 'pollute' the git
history with all this moving around.

As Jonathan pointed out, there is a risk in using DBIx calls (with Koha
objects) while running database revisions. See also bug 17292 and
bug 19789.

I tested the resulting db revision by adding a few fields to the Default
framework and adding deviating kohafields in other frameworks. And confirm
that it works as expected.

Please read the remainder of this commit message in the light of the above:

===

The dbrev will use two new routines in MarcSubfieldStructures:
[1] get_kohafield_exceptions is used to report deviating kohafields in
    the additional frameworks,
[2] sync_kohafield is used to reset kohafield in the other frameworks to
    the mapping in Default.

Test plan:

Unit test and database revision:
[1] Run t/db_dependent/Koha/MarcSubfieldStructures.t
[2] Verify that your Default 100a is mapped to biblio.author. Go to another
    framework and clear the mapping via mysql command line:
    UPDATE marc_subfield_structure SET kohafield=NULL WHERE frameworkcode=[your_framework] AND tagfield='100' AND tagsubfield='a';
[3] Run the db revision. It should report that 100a was adjusted.
[4] Check in admin/marc_subfield_structure that your 100a is mapped to
    biblio.author again in that framework.

Additional interface testing (ensuring that the changes on this report do
not interfere with multiple mappings):
[5] Make two mappings for copyrightdate: 260c and 264a. And make two
    mappings for biblioitems.pages: 300a and say 300g. Toggle with some
    field values in those fields in the cataloging editor and verify the
    contents of biblio.copyrightdate and biblioitems.pages. The former
    should contain one year (due to additional logic) and the latter should
    contain A | B if both fields are filled.
    Remove the mapping for 300g.
[6] Set AcqCreateItem to ordering or placing. Verify that you can still
    add or receive an order as usual.
[7] Add a mapping for itemcallnumber to 952f (this should remove the one
    for coded_location_qualifier). This is very unusual but serves well in
    testing multiple mappings for items.
    Add or receive an order (fill 952f and 952o) with same and/or different
    values. Verify the contents of items.callnumber. (Check with regular
    item editor; see note.)
    Do a similar edit in the regular item editor.
    Note: You should expect to see A | B in both 952f and 925o if both
    fields are filled with a different value.
    Set items.coded_location_qualifier back to 952f in koha2marclinks.

    Note: When AcqCreateItem==ordering, you will not see A|B in the callno
    field when adding an item on neworderempty.pl. But when you submit
    the main form, addorder.pl is called. At that time an item is created
    and you will see that A|B is in both fields (952f and 952o).

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 19096: (QA follow-up) Move two routines out of Koha::MSS

As requested by RM, this patch moves sync_kohafield and
get_kohafield_exceptions from Koha/MarcSubfieldStructures.pm.

At this moment they are only used in a database revision; it is not clear
if they may be of use later on.

In order to keep them in a module and not remove the unit tests, this
patch adds a Koha::Util module Dbrev.pm. It is now required in the atomic
update, but could be added in a use statement in updatedatabase.pl.

Test plan:
[1] Run updatedatabase.pl
[2] Run t/db_dependent/Koha/MarcSubfieldStructures.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 19096: Use raw SQL queries instead for the update DB entry

I strongly thing we must not use C4 or Koha subroutine in the update DB
process, only sql queries.
Especially not DBIC Schema files as they will change.
For instance the update DB 17.12.00.00X is using a specific Koha::Schema::RS::MSS
representing the current schema, but in X months/years, this schema will change
and the ->search we used may failed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 19096: Move the sql queries to the update DB entry

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Print "Field 700$a" instead of "Field 700.a" in the dbrev.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19096: Restructure MarcSubfieldStructures.t first
Marcel de Rooy [Thu, 17 Aug 2017 09:44:18 +0000 (11:44 +0200)]
Bug 19096: Restructure MarcSubfieldStructures.t first

Before adding more tests, move all current tests in one subtest.

Test plan:
Run t/db_dependent/Koha/MarcSubfieldStructures.t

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>
6 years agoBug 19096: Online help changes
Marcel de Rooy [Wed, 16 Aug 2017 12:37:06 +0000 (14:37 +0200)]
Bug 19096: Online help changes

On the page admin/marc_subfields_structure we now tell that Koha link
has been disabled and refer to the help for koha2marclinks.
On the page admin/koha2marclinks we mention that the Default mapping is
considered authoritative now.

Test plan:
Read these online help pages and verify that the changes make sense.

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>
6 years agoBug 19096: Do not allow changes to kohafield within MARC frameworks
Marcel de Rooy [Mon, 7 Aug 2017 13:02:10 +0000 (15:02 +0200)]
Bug 19096: Do not allow changes to kohafield within MARC frameworks

This patch makes two changes in the script for managing the MARC
frameworks in order to support making the Default authoritative
as for Koha to MARC mappings:

[1] Disable the kohafield select combo. Add a hidden input to save value.
[2] When a new subfield is added, the kohafield is still empty and should
    be overwritten with its Default counterpart.
    Note: Although we could leave the field empty, since Koha looks at the
    Default framework only, it does not cost much to keep these fields in
    sync with Default and perhaps catch a bug when someone somewhere looks
    in the wrong framework.

Note: The description of Koha to MARC mapping on admin-home has been
adjusted accordingly (removing last two lines).

Test plan:
[1] Add a new tag and subfield in Default.
[2] Map it to a kohafield in koha2marclinks.pl
[3] Add the same tag and subfield in another framework.
    Verify that the kohafield is updated after you saved the subfield.

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>
6 years agoBug 19096: Adjusts unit tests
Marcel de Rooy [Thu, 10 Aug 2017 08:59:07 +0000 (10:59 +0200)]
Bug 19096: Adjusts unit tests

The subroutines listed in the former patch are extensively tested in
Biblio.t, TransformKohaToMarc.t and TransformMarcToKoha.t.
These tests do no longer use new frameworks to add mappings.

In Biblio.t and TransformMarcToKoha.t we also test passing an individual
framework code (for an empty framework) to see if Default is still used.
Note that this parameter will be removed later on.

In Items.t the cache keys MarcStructure-0- and MarcStructure-1- are not
touched, so they do not need to be cleared. The cache key
default_value_for_mod_marc- should be used without framework now.
Similar adjustments in Items/AutomaticItemModificationByAge.t and
Reserves.t.

Furthermore the subtest for _build_default_values_for_mod_marc in Items.t
is adjusted since framework is no longer relevant. The biblio record with
items is created in a new framework, but the mappings from Default are
consulted.

Test plan:
Run all adjusted unit tests.

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>
6 years agoBug 19096: Make Default authoritative in core modules
Marcel de Rooy [Thu, 10 Aug 2017 08:59:07 +0000 (10:59 +0200)]
Bug 19096: Make Default authoritative in core modules

After feedback from the dev mailing list, it seems appropriate here to
propose making the Default framework authoritative for Koha to MARC
mappings. This implies checking only the Default framework in the
routines:

[1] GetMarcFromKohaField: The parameter frameworkcode is removed. A
    follow-up report (19097) will update the calls not adjusted here.
    This is safe since the parameter is silently ignored.
[2] GetMarcSubfieldStructureFromKohaField: Framework parameter is removed
    and calls are adjusted. Includes acquisitions_stats.pl.
[3] TransformKohaToMarc: The parameter is removed; all calls are verified
    or adjusted.
[4] TransformMarcToKoha: The parameter is no longer used and will be
    removed in a follow-up report (19097). It always goes to Default now.
[5] TransformMarcToKohaOneField: The parameter is removed and all calls
    are adjusted. Including: Breeding, XISBN and MetadataRecord modules.
[6] C4::Koha::IsKohaFieldLinked: This routine was called only once (in
    C4::Items::_build_default_values_for_mod_marc. It can be replaced by
    calling GetMarcFromKohaField. If there is no kohafield linked, undef
    is returned. (Corresponding unit test is removed here.)
[7] C4::Items::ModItemFromMarc: The helper routine
    _build_default_values_for_mod_marc does no longer have a framework
    parameter. The cache key default_value_for_mod_marc- is no longer
    combined with a frameworkcode. Three admin scripts are adjusted
    accordingly; some tests will be corrected in the next patch.

Test plan:
See next patch. That patch adjusts all tests involved.

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>
6 years agoBug 10306: (QA follow-up) More feedback for admins in koha2marclinks
Marcel de Rooy [Mon, 23 Oct 2017 10:07:04 +0000 (12:07 +0200)]
Bug 10306: (QA follow-up) More feedback for admins in koha2marclinks

As requested by Tomas, this patch does:

[1] Add a js alert when you did not type field,subfield
[2] Print a yellow alert div when the field,subfield is not found.
[3] Bonus: Make it little bit more secure by demanding a POST. (Leaving
    CSRF etc. for another report.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10306: (QA follow-up) Correct a TestBuilder call
Marcel de Rooy [Thu, 24 Aug 2017 10:23:29 +0000 (12:23 +0200)]
Bug 10306: (QA follow-up) Correct a TestBuilder call

In order to create a new framework, MarcSubfieldStructure was used as
source. This works since that table contains a FK for frameworkcode.
But obviously, we should use BiblioFramework as source.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10306: Adjusted online help text for koha2marclinks
Marcel de Rooy [Thu, 27 Jul 2017 11:18:39 +0000 (13:18 +0200)]
Bug 10306: Adjusted online help text for koha2marclinks

Test plan:
Click on Help. Read the text.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10306: Support for multiple mappings in koha2marclinks
Marcel de Rooy [Mon, 24 Jul 2017 17:09:17 +0000 (19:09 +0200)]
Bug 10306: Support for multiple mappings in koha2marclinks

This actually refactors koha2marclinks.pl in order to support multiple
mappings per kohafield.

Instead of three separate mapping pages for biblio, biblioitems and items,
the script now lists them together. This gives a complete overview of all
mappings rightaway. Changes are applied immediately across all frameworks.

Note: This report handles the Default mappings just like it did before.
In this script Koha already considered them as authoritative, although
other parts of Koha did not. Follow-up report 19096 makes Default
mappings authoritative throughout all Koha.

On each line two buttons are provided, Add and Remove, in order to add or
remove an individual mapping. We do no longer provide a separate form with
the names of MARC tags. Since this form is targeted for administrators,
it should be enough to ask for a field tag and subfield code.

Note: The mappings for biblionumber, biblioitemnumber and itemnumber are
so vital that this form marks them as readonly. It is not recommended to
change them.

Test plan:
[1] Add a mapping. Verify via Frameworks or mysql command line that the
    kohafield is saved to the other frameworks too.
[2] Remove the mapping again. Check Frameworks or mysql cl again.
[3] Test adding a second mapping. Map copyrightdate to 260c and 264c.
    And map biblioitems.place to 260a and 264a.
[4] Edit biblio record 1: Put 1980 in 260c. Do not include 264c.
    Edit biblio record 2: Put 1990 in 264c. Do not include 260c.
    Edit biblio record 3: Put 2000 in both 260c and 264c. Put CityA in 260a
    and in 264a.
    Edit biblio record 4: Put 2010 in 260c, and 2015 in 264c (which you
    should refuse normally). Put CityA in 260a, and CityB in 264a.
[5] Create a report that shows biblioitems.place and biblio.copyrightdate
    for those biblio records.
    Record 4 should have 2010 in copyrightdate (since TransformMarcToKoha
    picks the first year for copyrightdate).
    Record 3 should have place CityA; record 4 should have CityA | CityB.
    Note: The CityA | CityB example illustrates that we should add some
    additional handling in TransformMarcToKoha for multiple 264s.
[6] Add these four biblio records to a new list. Sort by Year.
    With OPACXSLTListsDisplay==default, check if the order = 1,2,3,4.
    (The order is based on biblio.copyrightdate.)
    Note that (RDA) record 2 would be on top without this patch set, since
    copyrightdate would have been null.

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>
6 years agoBug 10306: Restructure TransformMarcToKoha and update some POD lines
Marcel de Rooy [Thu, 3 Aug 2017 10:56:08 +0000 (12:56 +0200)]
Bug 10306: Restructure TransformMarcToKoha and update some POD lines

This patch makes the following changes:

[1] Added POD for CountItemsIssued, GetBiblioItemData
[2] Moved TransformMarcToKohaOneField closer to TransformMarcToKoha (before
    sub CountItemsIssued)
[3] Restructured TransformMarcToKoha by extracting individual kohafields via
    TransformMarcToKohaOneField. The latter does no longer call the former.
    This small optimization avoids traversing the whole MARC record again
    and again.
[4] Moved adjusting copyrightdate/publicationyear to separate helper routine
    _adjust_pubyear
[5] Removed obsolete sub _get_inverted_marc_field_map.

Test plan:
Run t/db_dependent/Biblio/TransformMarcToKoha.t

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>
6 years agoBug 10306: Add tests for module changes
Marcel de Rooy [Wed, 19 Jul 2017 14:54:40 +0000 (16:54 +0200)]
Bug 10306: Add tests for module changes

GetMarcSubfieldStructure: In Biblio.t we are adding a subtest that checks
the structure returned by this routine. Is it a hashref pointing to
arrayrefs of hashrefs? ;)
In Search.t this routine was mocked. The change in the returned structure
is now applied to this mock too (moving the marc tag hashes into
arrayrefs).

GetMarcFromKohaField: In Biblio.t we add a subtest for it. We are checking
if it returns multiple mappings (per kohafield) and calling it in scalar
context too.

GetMarcSubfieldStructureFromKohaField: The existing subtest in Biblio.t is
expanded to also test the call in list context.

TransformKohaToMarc: This sub has its own test script. We are adding a
subtest in TransformKohaToMarc.t for a test with multiple mappings,
and for mapping to a control field in another framework. This also tests
the additional framework parameter.
Additionally, we add a test for the new no_split option used for items.

TransformMarcToKoha: This implicitly tests its helper sub _get_inverted.
This patch adds a new test script for this routine.

TransformMarcToKohaOneField: A few tests are added to the previous new
test script.

Test plan:
[1] Run t/db_dependent/Biblio.t
[2] Run t/db_dependent/Biblio/TransformKohaToMarc.t
[3] Run t/db_dependent/Biblio/TransformMarcToKoha.t
[4] Run t/db_dependent/Search.t

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>
6 years agoBug 10306: Allow controlfields in TransformKohaToMarc
Marcel de Rooy [Thu, 20 Jul 2017 10:37:56 +0000 (12:37 +0200)]
Bug 10306: Allow controlfields in TransformKohaToMarc

Since the interface allows you to connect a kohafield to a MARC
controlfield, this routine should be able to handle that. Unfortunately
it did not.

Test plan:
Change will be tested in Biblio/TransformKohaToMarc.t in the next patch.

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>
6 years agoBug 10306: Core module changes for multiple mappings
Marcel de Rooy [Wed, 19 Jul 2017 14:25:04 +0000 (16:25 +0200)]
Bug 10306: Core module changes for multiple mappings

In order to allow multiple Koha to MARC mappings (for one kohafield), we
need to adjust a few key routines in C4/Biblio.pm. This results in a few
changes in dependent modules too.

Note: Multiple mappings also include 'alternating' mappings. Such as the
case of MARC21 260 and 264: only one of both fields will be used. Sub
TransformMarcToKoha will handle that just fine; the opposite transformation
is harder, since we do no longer know which field was the source. In that
case TransformKohaToMarc will fill both fields. We only use that operation
in Koha for items (in Acquisition and Cataloging).

Sub GetMarcSubfieldStructure
This sub used a selectall_hashref, which is fine as long as we have only
one mapping for each kohafield. But as DBI states it: If a row has the same
key as an earlier row then it replaces the earlier row. In other words,
we lose the first mapping if we have two.
This patch uses selectall_arrayref with Slice and rearranges the output so
that the returned hash returns an arrayref of hashrefs for each kohafield.
In order to improve consistency, we add an order clause to the SQL
statement used too.

Sub GetMarcFromKohaField
This sub just returned one tag and subfield, but in case of multiple
mappings we should return them all now.
Note: Many calls still expect just one result and will work just fine:
    my ($tag, $sub) = GetMarcFromKohaField(...)
A possible second mapping would be silently ignored. Often the sub is
called for biblionumber or itemnumber. I would not recommend the use of
multiple mappings for such fields btw.
In case the sub is called in scalar context, it will return only the first
tag (instead of the number of tags and subfields).

Sub GetMarcSubfieldStructureFromKohaField
This sub previously returned the hash for one kohafield.
In scalar context it will behave like before: it returns the first hashref
in the arrayref that comes from GetMarcSubfieldStructure.
In list context, it returns an array of all hashrefs (incl. multiple
mappings).
The sub is not used in C4::Ris. Removed the use statement.

Sub TransformKohaToMarc
This sub got a second parameter: frameworkcode.
Historically, Koha more or less assumes kohafields to be defined across all
frameworks (see Koha to MARC mappings). Therefore it falls back to Default
when it is not passed.
When going thru all mappings in building a MARC record, it also supports
multiple mappings. Note that Koha uses this routine in Acquisition and in
Cataloging for items. Normally the MARC record is leading however and the
Koha fields are derivatives for optimization and reporting.

The added third parameter allows for passing a new option no_split => 1.
We use this option in C4::Items::Item2Marc; if two item fields are mapped to
one kohafield but would have different values (which would be very unusual),
these values are glued together. When transforming to MARC again, we do not
want to duplicate the item subfields, but we keep the glued value in both
subfields. This operation only affects items, since we are not doing this
reverse operation for biblio and biblioitem fields.

Sub _get_inverted_marc_field_map
This sub is a helper routine of TransformMarcToKoha, the opposite
transformation. When saving a MARC record, all kohafields are extracted
including multiple mappings.
Suppose that you had both 260c and 264c in your record (which you won't),
than both values get saved initially into copyrightdate like A | B. The
additional code for copyrightdate will extract the first year from this
string.
A small fix in TransformMarcToKoha makes that it only saves a value in a
kohafield if it is defined and not empty. (Same for concatenation.)

Sub TransformMarcToKohaOneField
This sub now just calls TransformMarcToKoha and extracts the requested
field. Note that since we are caching the structure, this does not result
in additional database access and is therefore performance-wise
insignificant. We simplify code and maintenance.
Instead of modifying the passed hashref, it simply returns a value. A call
in C4::Breeding is adjusted accordingly. The routine getKohaField in
Koha::MetadataRecord is redirected to TransformMarcToKohaOneField.
NOTE: The fourth patch restructures/optimizes TransformMarcToKoha[OneField].

Sub get_koha_field_from_marc
This sub can be removed. A call is replaced by TransformMarcToKohaOneField
in C4::XISBN.

Note: The commented lines for sub ModZebrafiles are removed (directly under
TransformMarcToKohaOneField).

Test plan:
For unit tests and interface tests, please see follow-ups.
Run qa tools in order to verify that the modules still compile well.
Read the code changes and verify that they make sense.

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>
6 years agoBug 19776: Fix random failures (category_type vs categorycode='X')
Jonathan Druart [Thu, 7 Dec 2017 17:42:03 +0000 (14:42 -0300)]
Bug 19776: Fix random failures (category_type vs categorycode='X')

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19775: Try & prevent Search/History.t to fail randomly
Jonathan Druart [Thu, 7 Dec 2017 16:41:06 +0000 (13:41 -0300)]
Bug 19775: Try & prevent Search/History.t to fail randomly

 #   Failed test 'There are still 8 searches after calling delete with an interval = 6 days'
 #   at t/db_dependent/Search/History.t line 185.
 #          got: '6'
 #     expected: '8'

 #   Failed test 'There are still 2 searches after calling delete with an interval = 2 days'
 #   at t/db_dependent/Search/History.t line 191.
 #          got: '0'
 #     expected: '2'
 # Looks like you failed 2 tests of 27.
[15:04:12] t/db_dependent/Search/History.t

It looks like it does not longer fail with this change (date comparaison wrongly rounded to second in mysql?)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 7143: Update about page for new dev - Victor Grousset
Jonathan Druart [Thu, 7 Dec 2017 14:28:54 +0000 (11:28 -0300)]
Bug 7143: Update about page for new dev - Victor Grousset

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19496: ReplytoDefault is a pref, not a C4::Context method
Jonathan Druart [Thu, 7 Dec 2017 13:52:28 +0000 (10:52 -0300)]
Bug 19496: ReplytoDefault is a pref, not a C4::Context method

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19496: Fixing to_address for patron notes
Aleisha Amohia [Mon, 27 Nov 2017 21:33:58 +0000 (21:33 +0000)]
Bug 19496: Fixing to_address for patron notes

This patch ensures the patron note to_address is the branch email or the
Koha Admin email, and the from_address is the patron's email.

To test:
1) Ensure syspref 'allowcheckoutnotes' is turned on
2) Go to OPAC, leave a note on a checkout
3) Confirm that the note is received (in mysql message_queue) but the
to_address is the patron's email - this is wrong
4) Apply patch and refresh OPAC
5) Leave a note on a checkout
6) Confirm that the note is received in message queue
7) Confirm that the to_address is one of:
- branch email
- branch reply to
- syspref ReplytoDefault
- syspref KohaAdminEmailAddress
8) Confirm that the from_address is one of:
- patron email
- patron emailpro
- patron B_email

Sponsored-by: Catalyst IT
Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19724: DBIC Schema changes
Jonathan Druart [Thu, 7 Dec 2017 13:26:32 +0000 (10:26 -0300)]
Bug 19724: DBIC Schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19724: DBRev 17.12.00.001
Jonathan Druart [Thu, 7 Dec 2017 13:20:36 +0000 (10:20 -0300)]
Bug 19724: DBRev 17.12.00.001

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18907: Build has deprecating message
Mark Tompsett [Thu, 6 Jul 2017 15:42:43 +0000 (15:42 +0000)]
Bug 18907: Build has deprecating message

Following the instructions at:
https://wiki.koha-community.org/wiki/Building_Debian_Packages_-_The_Easy_Way
Receiving the following message in the build:
dpkg-source: warning: relation < is deprecated: use << or <=

This patch tweaks the list-deps.
git diff origin/master -- debian/list-deps shows just the one line
changed from < to << as per the messages suggestion and eythian's
suggestion on IRC:
http://irc.koha-community.org/koha/2017-07-06#i_1950698

The control file can be regenerated from the command-line:
./debian/update-control
However, it will be attached separately.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12497: Fix OPAC search history reachable by URL even when disabled
Victor Grousset [Fri, 24 Nov 2017 11:02:47 +0000 (12:02 +0100)]
Bug 12497: Fix OPAC search history reachable by URL even when disabled

Test plan:
1. Set EnableOpacSearchHistory syspref to "Keep"
2. Make a search in the OPAC
3. Go to /cgi-bin/koha/opac-search-history.pl
4. Set the EnableOpacSearchHistory syspref to "Don't keep"
5. Refresh the OPAC page to show that history is still accessible
6. Apply the patch
7. Refresh the OPAC page, you should end on the 404 page
8. Set EnableOpacSearchHistory syspref to "Keep"
9. Go to /cgi-bin/koha/opac-search-history.pl which should be reachable

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 12497: Fix search history non-accessible when OPAC was private
Victor Grousset [Thu, 23 Nov 2017 15:03:14 +0000 (16:03 +0100)]
Bug 12497: Fix search history non-accessible when OPAC was private

(when the user didn't have the "borrowers" permission)

Test plan:
1. Set syspref "OpacPublic" to false (Disable)
2. Log in as a user without any permission
3. Try to access the search history. The link is next to "Log out"
4. Then you should see "Access denied"
5. Apply this patch
6. Refresh the page
7. Then you should see the search history

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19674: Broken indicators of changed fields in manage staged MARC records template
Owen Leonard [Tue, 21 Nov 2017 16:17:32 +0000 (16:17 +0000)]
Bug 19674: Broken indicators of changed fields in manage staged MARC records template

This patch returns some CSS to the manage staged MARC records template
which was incorrectly removed by Gug 16538.

To test, apply the patch and go to Tools -> Staged MARC management.
Choose a staged MARC file.

Changing any of the <select> fields in the first section should cause a
label to appear showing that the selection has changed, along with a
link to reset the option to its original state. Clicking 'Reset' should
make the label and the link disappear.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19602: Add usage statistics link to administration sidebar menu
Owen Leonard [Thu, 9 Nov 2017 16:47:42 +0000 (16:47 +0000)]
Bug 19602: Add usage statistics link to administration sidebar menu

This patch adds a link to the new usage statistics page in the
administration sidebar menu.

To test, apply the patch and view an administration page which includes
the admin sidebar. Confirm that the link to usage statistics is there.

Visit the usage statistics page and confirm that the usage statistics
link in the sidebar is display in bold.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19595: Clicking plugin link does not fill item's date acquired field
Owen Leonard [Fri, 10 Nov 2017 12:59:58 +0000 (12:59 +0000)]
Bug 19595: Clicking plugin link does not fill item's date acquired field

This patch updates the dateaccessioned plugin for the item edit form to
return functionality which was removed in a previous patch.

To test, apply the patch and open an item for editing. Clicking the
"..." link next to the "Date acquired" field should insert the current
date, overwriting the existing date.

Open a blank item add form. Putting the cursor in the "Date acquired"
field should automatically insert the current date.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Added a comment line in set_to_today.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19551: Fix wrong order of operations in cash register report
Nick Clemens [Tue, 31 Oct 2017 13:17:26 +0000 (13:17 +0000)]
Bug 19551: Fix wrong order of operations in cash register report

To test:
1 - Find or create a fine for a patron
2 - Write it off
3 - Home -> Reports -> Cash register
4 - Fill in current date and transaction type 'Write off'
5 - Click Submit
-- see your write off
6 - Fill in previous dates and transaction type 'Write off'
7 - Click Submit
-- see your write off (bad)
8 - Apply patch
9 - Rerun steps 3-7
-- write only visible for current date.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18993: Allow Test::More version 1.302073
Mason James [Thu, 16 Nov 2017 07:45:03 +0000 (20:45 +1300)]
Bug 18993: Allow Test::More version 1.302073

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18993: Bump Test::More to 1.302075
Jonathan Druart [Tue, 3 Oct 2017 15:37:14 +0000 (12:37 -0300)]
Bug 18993: Bump Test::More to 1.302075

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18993: Bump libtest-simple-perl to 1.302075
Mirko Tietgen [Mon, 31 Jul 2017 09:05:00 +0000 (11:05 +0200)]
Bug 18993: Bump libtest-simple-perl to 1.302075

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19724: Add timestamp to biblio_metadata and deletedbiblio_metadata
Julian Maurice [Fri, 1 Dec 2017 12:47:59 +0000 (12:47 +0000)]
Bug 19724: Add timestamp to biblio_metadata and deletedbiblio_metadata

Since bug 17196, biblioitems.timestamp is not always updated after a
change in the MARC record.
We need to know the last modification time of the MARC record for some
features (like OAI-PMH parameters 'from' and 'until' for instance)

This patch only adds the missing column in biblio_metadata and
deletedbiblio_metadata

Test plan:
1. Run updatedatabase.pl
2. Verify that both tables have the new column, its value should be the
   greatest timestamp value from the corresponding biblio and
   biblioitems table entries
   You can verify with the following SQL query:
     SELECT b.biblionumber, b.timestamp as biblio_ts,
     bi.timestamp as biblioitems_ts, m.timestamp as biblio_metadata_ts
     FROM biblio_metadata m
     LEFT JOIN biblioitems bi ON (bi.biblionumber = m.biblionumber)
     LEFT JOIN biblio b ON (b.biblionumber = m.biblionumber);

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19638: Remove false positive obsolete reports (auth_header.marcxml)
Jonathan Druart [Mon, 4 Dec 2017 18:39:48 +0000 (15:39 -0300)]
Bug 19638: Remove false positive obsolete reports (auth_header.marcxml)

Bug 17898 tries to help users identify reports affected by the move of marcxml to the biblio_metadata table, however, the auth_header table still uses the column name 'marcxml' and so reports as needing updated though it doesn't.

C4::Reports::Guided::convert_sql only converts if the sql query contain biblioitems and marcxml.
We should use the same regexp in the controler script.

Test plan:
Use a sql report that use auth_header.marcxml (see https://wiki.koha-community.org/wiki/SQL_Reports_Library)
After the this the report should not be longer marked as obsolete on the report list view

Replicated bug with the following SQL:
select marcxml from auth_header;

Patch applied correctly and functioned as expected.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 7143: Update about page for new dev - Simon Pouchol
Jonathan Druart [Thu, 7 Dec 2017 12:47:28 +0000 (09:47 -0300)]
Bug 7143: Update about page for new dev - Simon Pouchol

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10222: Correct and expand to other languages
Mark Tompsett [Mon, 23 Oct 2017 14:00:53 +0000 (14:00 +0000)]
Bug 10222: Correct and expand to other languages

This added column names, and reformated to be a bit more readable.
This also adds this change to de-DE, es-ES, fr-CA, and nb-NO.
While there was printer_profiles for it-IT, the Italian file seems
to not use the same numbers, and does not visibly look like it needs
these changes.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 10222: Error when saving Demco label templates
Chris Nighswonger [Thu, 16 Apr 2015 16:07:29 +0000 (12:07 -0400)]
Bug 10222: Error when saving Demco label templates

This patch fixes a bug whereby if you open either of the
Demco label templates (loaded by the sample data) and
click "save" without making any changes you will get an
error:

Can't bless non-reference value at C4/Creators/Profile.pm
line 92.

It also fixes another minor bug in the creator sample data.

To test:

1. Install all sample data in a clean database.
2. In the label tool, edit either of the Demco label templates.
3. Save the template and observe the error mentioned above.
4. Drop and recreate the database.
5. Apply the patch.
6. Repeate steps 1-3 and note the successful save.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18990: Overdue Notices are not sending through SMS correctly
Nick Clemens [Fri, 28 Jul 2017 11:58:46 +0000 (11:58 +0000)]
Bug 18990: Overdue Notices are not sending through SMS correctly

Bug 18478 fixed sms via email problems under the assumption that
to_address was either smsalertnumber or blank.

It seems overdues set the to_address to email. This patch changes the
code to enforce that an sms sent with emial driver will use the
smsalertnumebr and provider defined for the borrower, regardless of what
is set in the queue

To test:
 1 - Define a messaging prefs for a patron to recieve hold notices via
  SMS
 2 - Ensure you have defined an SMS message for an overdue letter
 3 - Set an SMS alert number for patron
 4 - Set the SMS::Send driver to 'Email'
 5 - Checkout an item as overdue to trigger notice above
 6 - Run overdue_notices.pl
 6 - Check the db and note the address is email
 7 - run process_message_queue.pl
 8 - Check db - address is email followed by service provider
 9 - Apply patch
 10 - repeat
 11 - Message to_address should be populated with smsalertnumber

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19643: Pagination buttons on staged marc management are stacking instead of inline
Owen Leonard [Thu, 16 Nov 2017 19:19:33 +0000 (19:19 +0000)]
Bug 19643: Pagination buttons on staged marc management are stacking instead of inline

This patch modifies the template for staged MARC import management to
correct a problem with the style of pagination links.

To test you must have more than 25 staged imports. Go to Tools -> Staged
MARC management. The pagination links, both at the top and the bottom,
should look correct (use multi-page SQL report results for reference).

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19681: Correct result count formatting
David Bourgault [Wed, 22 Nov 2017 18:58:21 +0000 (13:58 -0500)]
Bug 19681: Correct result count formatting

This simply passes the missing information to the template.

Test plan:
0) Apply patch
1) Go to Tools > Label creator > New > Label batch
2) Press 'Add items'
3) Do a search that will return few items
4) The result count will read "Results 1 through X of X"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19692: fix unclosed div in opac-shelves.tt
Simon Pouchol [Fri, 24 Nov 2017 15:53:49 +0000 (16:53 +0100)]
Bug 19692: fix unclosed div in opac-shelves.tt

Test plan:
1. set syspref OpacKohaUrl to "Show"
2. Log into the OPAC
3. /cgi-bin/koha/opac-shelves.pl
4. Notice that "Powered by Koha" is not in the footer in this page.
  When on the other tabs it's in the footer (out of .main)
5. Apply this patch
6. Notice that "Powered by Koha" now in the footer in the "your lists" page

Signed-off-by: Dominic Pichette <dominic@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19533: Hold pulldown for itemtype is empty if hold placement needs override
Kyle M Hall [Thu, 26 Oct 2017 11:35:53 +0000 (07:35 -0400)]
Bug 19533: Hold pulldown for itemtype is empty if hold placement needs override

Test Plan:
1) Enable AllowHoldPolicyOverride
2) Enable AllowHoldItemTypeSelection
3) Create a situation where adding a hold for a patron would trigger a tooManyReserves
   warning.
4) Note the itemtype pulldown is empty
5) Apply this patch
6) Reload the page
7) Itemtype pulldown should have values

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 18833: Plugin unimarc_field_210c pagination error
Fridolin Somers [Wed, 21 Jun 2017 11:05:40 +0000 (13:05 +0200)]
Bug 18833: Plugin unimarc_field_210c pagination error

In plugin unimarc_field_210c, the editors search results have pagination.
First page works but not other pages.

The main problem whas mainly because $startfrom var was missused. It is defined in C4::Output::pagination_bar as page number.
This patch corrects by using a $offset var.
Also removes dead code, obsoleted by using C4::Output::pagination_bar.
Also changes hardcoded results per page from 19 to 20.

Test plan :
- Use UNIMARC catalogue
- Define in framework value builder unimarc_field_210c on 210$c
- Create autority type EDITORS with heading 200$b
- Create 22 authorities of that type
- Index those new authorities
- Create a new biblio record
- Click on 210$c plugin
- Click on "Search"
- You see 20 results
- Click on page 2
=> Without patch you get empty table
=> With patch you get 2 results
- Check that you see "Results 21 to 22 of 22"
- Delete 2 autorities and retest

Works as intended.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19456: Make patron-title ability to be generated with or without html tags
Josef Moravec [Fri, 13 Oct 2017 06:44:55 +0000 (06:44 +0000)]
Bug 19456: Make patron-title ability to be generated with or without html tags

Modified pages:
circ/circulation.pl
circ/circulation_batch_checkouts.pl
members/boraccount.pl
members/files.pl
members/holdshistory.pl
members/housebound.pl
members/moremember.pl
members/notices.pl
members/purchase-suggestions.pl
members/readingrec.pl
members/routing-lists.pl
members/statistics.pl

Test plan:
0) Do not apply the patch
1) Have a patron with title/salution filled in
2) Confirm bug, go for example to circ/circulation page and see there is
html in <title> tag (you can see it in your browser page/window title)
3) Apply the patch
4) Go through circulation/patron pages (see modified page above) and
confirm there is no html in <title> tag, but on the page itself the
salutation should be in <span class="patron-title">

Signed-off-by: David Bourgalt <david.bourgault@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19640: fix OPAC IdRef webservice display
Fridolin Somers [Thu, 16 Nov 2017 14:22:48 +0000 (15:22 +0100)]
Bug 19640: fix OPAC IdRef webservice display

The OPAC webservice IdRef display was broken.
The call returns results but citations where empty.
Maybe the webservice has changed.

This patch corrects the fetch of datas in result.
Also fixes a small HTML missing tag tr.
Also adds a comment with link to official doc :
http://documentation.abes.fr/aideidrefdeveloppeur/index.html#MicroWebBiblio

Test plan :
1) Enable system preference IdRef
2) Choose an existing PPN like 032581270
3) Look result on : https://www.idref.fr/services/biblio/032581270.json
4) Call in OPAC website : /cgi-bin/koha/opac-idref.pl?unimarc3=032581270
5) Without patch you see only one role containing empty rows
6) With patch you see all roles with correct rows

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: removed unused @unimarc3 (not to be confused with $unimarc3).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19646: (QA follow-up) Fix tab character
Marcel de Rooy [Fri, 24 Nov 2017 08:27:14 +0000 (09:27 +0100)]
Bug 19646: (QA follow-up) Fix tab character

Resolve qa tools warning:
 FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt
   FAIL   forbidden patterns
                forbidden pattern: tab char (line 172)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19646: fix value_builder marc21_linking_section template
Fridolin Somers [Fri, 17 Nov 2017 12:38:06 +0000 (13:38 +0100)]
Bug 19646: fix value_builder marc21_linking_section template

When using marc21_linking_section cataloging plugin, you get the error :
Template process failed: undef error - The method selected is not
covered by tests! at /home/koha/src/C4/Templates.pm line 122.

It commes from [% IF ( itypeloo.selected ) %], selected is not defined
in itypeloo.

This patch removes this condition because all item types are fetched
from database, there is not one selected. It sets "All item types" as
selected. Also correctes two errors in HTML : ending form and div,
"<a_class=" instead of "<a class="

Test plan :
1) Use a MARC21 database
2) Define marc21_linking_section cataloging plugin in framework, on
   773$t for example
3) Create a new biblio record
4) Click on icon in 773$t
5) Check plugin works fine

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19683: Fix authority types in tools/export template
David Bourgault [Wed, 22 Nov 2017 19:35:27 +0000 (14:35 -0500)]
Bug 19683: Fix authority types in tools/export template

Fixes the bug by correcting the variable names in the template.

To test:
1) Tools > Export > Export authority records
2) Authority Types dropdown is not empty

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Changing the export script and unblessing is not needed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19766: (bug 19058 follow-up) Fix Preview routing slip
Jonathan Druart [Wed, 6 Dec 2017 19:33:56 +0000 (16:33 -0300)]
Bug 19766: (bug 19058 follow-up) Fix Preview routing slip

This patch fixes the following errors:
The method reserve_id is not covered by tests at /home/vagrant/kohaclone/C4/Reserves.pm line 859.
The method set is not covered by tests at /home/vagrant/kohaclone/C4/Reserves.pm line 871.
Can't call method "store" on an undefined value at /home/vagrant/kohaclone/C4/Reserves.pm line 871.

This is caused by
  commit ba1f2f93ef58c8dd935add3e215facdd4a589d12
    Bug 19058: Move C4::Reserves::GetReserveId to the Koha namespace

We are calling ->reserve_id on a Koha::Holds set.

Test plan:
- Serials -> Find subscription -> "Edit routing list" in the sidebar
- Add 1+ recipients
- Save -> "Save and preview routing slip"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoKoha 17.12 - Panuku (start of a new dev cycle)
Jonathan Druart [Wed, 29 Nov 2017 16:50:45 +0000 (13:50 -0300)]
Koha 17.12 - Panuku (start of a new dev cycle)

Panaku is a Māori word and have the meaning of "movement".
It can be used to talk about the unstable/development version of Koha.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoDBRev 17.11.00.000 v17.11.00
Jonathan Druart [Mon, 27 Nov 2017 15:28:18 +0000 (12:28 -0300)]
DBRev 17.11.00.000

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoAdd release notes for Koha 17.11
Jonathan Druart [Mon, 27 Nov 2017 15:27:39 +0000 (12:27 -0300)]
Add release notes for Koha 17.11

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoTranslation updates for Koha 17.11.00
Bernardo Gonzalez Kriegel [Mon, 27 Nov 2017 12:31:19 +0000 (09:31 -0300)]
Translation updates for Koha 17.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 19695: Fix another instance of ->find in list context (uncertainprice.pl)
Stefan Berndtsson [Mon, 27 Nov 2017 11:33:21 +0000 (12:33 +0100)]
Bug 19695: Fix another instance of ->find in list context (uncertainprice.pl)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 years agoBug 7143: Update timeline (2 new devs)
Jonathan Druart [Sun, 26 Nov 2017 19:37:35 +0000 (16:37 -0300)]
Bug 7143: Update timeline (2 new devs)

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