]> git.koha-community.org Git - koha.git/log
koha.git
5 years agoBug 23049: Remove manual_debit as it's never called
Martin Renvoize [Thu, 10 Oct 2019 15:43:48 +0000 (16:43 +0100)]
Bug 23049: Remove manual_debit as it's never called

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Capitalise type passed to add_debit for lost_item
Martin Renvoize [Thu, 10 Oct 2019 15:41:22 +0000 (16:41 +0100)]
Bug 23049: Capitalise type passed to add_debit for lost_item

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Update 'HE' to 'RESERVE_EXPIRED' for consistency
Martin Renvoize [Thu, 10 Oct 2019 15:38:24 +0000 (16:38 +0100)]
Bug 23049: Update 'HE' to 'RESERVE_EXPIRED' for consistency

This patch updates all cases where debit_type_code was 'HE' to
'RESERVE_EXPIRED' which is more informative and consistent with the
new style guidelines.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Capitalise type passed to add_debit for `account`
Martin Renvoize [Thu, 10 Oct 2019 15:31:17 +0000 (16:31 +0100)]
Bug 23049: Capitalise type passed to add_debit for `account`

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Update 'PF' to 'PROCESSING' for consistency
Martin Renvoize [Thu, 10 Oct 2019 16:15:39 +0000 (17:15 +0100)]
Bug 23049: Update 'PF' to 'PROCESSING' for consistency

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Capitalise type passed to add_debit for `rent`
Martin Renvoize [Thu, 10 Oct 2019 15:17:48 +0000 (16:17 +0100)]
Bug 23049: Capitalise type passed to add_debit for `rent`

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Update debit_type_code 'Res' to 'RESERVE'
Martin Renvoize [Thu, 10 Oct 2019 15:10:07 +0000 (16:10 +0100)]
Bug 23049: Update debit_type_code 'Res' to 'RESERVE'

This patch updates all cases where debit_type_code was 'Res' to
'RESERVE' which is more informative and consistent with the new style
guidelines.

The patch also ensure all calls to add_debit with a type or 'reserve'
now pass the capitalised code instead.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Update existing code to use debit_type
Martin Renvoize [Thu, 10 Oct 2019 16:15:10 +0000 (17:15 +0100)]
Bug 23049: Update existing code to use debit_type

* Update C4::Accounts::chargelostitem
* Update C4::Accounts::manualinvoice
* Update C4::Circulation::_FixOverduesOnReturn
* Update C4::Circulation::_FixAccountForLostAndReturned
* Update C4::Overdues::UpdateFine
* Update C4::Overdues::GetFine
* Update C4::Overdues::GetOverduesForBranch
* Update Koha::Account->pay
* Update Koha::Account->add_debit
* Update Koha::Account->non_issues_charges
* Update Koha::Account::Line->apply
* Update Koha::Account::Line->adjust
* Update controller scripts
* Update reports scripts
* Update tests

Test Plan
1) Run the test suit and ensure everything still passes
2) Test reports/cash_register_stats still works
3) Test that adding manual invoices still works
4) Test that making payments still works
5) Test that lost item fee handling still works
6) Test that invoice printing still works
7) Test that the sco still works

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Add tests
Martin Renvoize [Thu, 10 Oct 2019 16:14:47 +0000 (17:14 +0100)]
Bug 23049: Add tests

Test plan:
  prove t/db_dependent/Koha/Account/DebitType.t
  prove t/db_dependent/Koha/Account/DebitTypes.t

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Update maninvoice to reference debit types
Martin Renvoize [Thu, 10 Oct 2019 16:14:39 +0000 (17:14 +0100)]
Bug 23049: Update maninvoice to reference debit types

Test plan:
1) Naviage to a patron record and select the accounts > manual invoice
   tab
2) Add some manual invoices and confirm they are working as expected
3) Signoff

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Filter out system types by default
Martin Renvoize [Thu, 10 Oct 2019 08:08:55 +0000 (09:08 +0100)]
Bug 23049: Filter out system types by default

Test Plan
1) Navigate to the debit types management page added in previous patches
2) Note that system types are now filtered out by default
3) Click on the new unfilter button to include system types
4) Signoff

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Account types configuration - Admin page
Martin Renvoize [Thu, 10 Oct 2019 16:14:23 +0000 (17:14 +0100)]
Bug 23049: Account types configuration - Admin page

Test plan:
1) Go to admin home, note there is new Debit types page in Accounting
   section
2) Go to any other admin page and confirm there is link to Debit types
   in the admin menu as well
3) Go to Debit types page
4) You should see a datatable listing existing debit types, ensure they
   are working as expected.
5) Try to create, edit and delete some debit types. Note: Some debit
   types cannot be deleted as they are needed for koha functionality.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Add CHECK constraint to accountlines
Martin Renvoize [Thu, 26 Sep 2019 13:36:06 +0000 (14:36 +0100)]
Bug 23049: Add CHECK constraint to accountlines

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23049: Add debit_type
Martin Renvoize [Thu, 28 Feb 2019 16:58:06 +0000 (16:58 +0000)]
Bug 23049: Add debit_type

* Add account_debit_types table
* Add ac_debit_types_branches table
* Add account_debit_types defaults
* Add Koha::Account::DebitType and Koha::Account::DebitTypes
* Prevent deletion of defaults
* Migrate MANUAL_INV values
* Remove MANUAL_INV references
* Migrate accounttype values

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23152: Fix more pluralisation (and add tests)
Jonathan Druart [Tue, 25 Jun 2019 22:26:13 +0000 (17:26 -0500)]
Bug 23152: Fix more pluralisation (and add tests)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23413: Remove wrong return
Nick Clemens [Thu, 24 Oct 2019 15:40:47 +0000 (15:40 +0000)]
Bug 23413: Remove wrong return

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23413: Update tests to use build_sample_biblio
Nick Clemens [Tue, 3 Sep 2019 11:20:24 +0000 (11:20 +0000)]
Bug 23413: Update tests to use build_sample_biblio

Before these changes the tests fail if run under Elasticsearch

This makes sure they pass either way

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23413: (follow-up) Rename variables
Nick Clemens [Tue, 3 Sep 2019 11:14:24 +0000 (11:14 +0000)]
Bug 23413: (follow-up) Rename variables

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23863: Add signoff line for recognition
Martin Renvoize [Thu, 24 Oct 2019 12:50:35 +0000 (13:50 +0100)]
Bug 23863: Add signoff line for recognition

Signed-off-by: Sarah Cornell <sbcornell@cityofportsmouth.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23633: Hide paid transactions by default on the OPAC
Martin Renvoize [Tue, 22 Oct 2019 11:38:50 +0000 (12:38 +0100)]
Bug 23633: Hide paid transactions by default on the OPAC

This patch adds filtering on paid for type transactions to the OPAC
accounts page.  The filtering is enabled by default but may be toggled
to show historical transactions.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23392: Don't display private notes in MARC21
Nick Clemens [Mon, 29 Jul 2019 13:19:19 +0000 (13:19 +0000)]
Bug 23392: Don't display private notes in MARC21

To test:
1 - Add some notes to a record in fields 541,542,561,583,590
2 - Ensure all of these are visible in the frameworks
3 - Note they appear in the 'Title notes'/'Description' tabs on OPAC/Staff client
4 - Mark first indicator '0' on all notes
5 - They still display
6 - Apply patch
7 - Notes no longer show on OPAC
8 - Notes still show on Staff client
9 - prove -v t/Biblio/GetMarcNotes.t

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23863: (QA follow-up) Add missing html filter
Katrin Fischer [Mon, 21 Oct 2019 22:08:45 +0000 (22:08 +0000)]
Bug 23863: (QA follow-up) Add missing html filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23863: Editing a basket clears create_items value
Kyle M Hall [Tue, 22 Oct 2019 18:07:46 +0000 (14:07 -0400)]
Bug 23863: Editing a basket clears create_items value

Test Plan:
1) Create a basket with a non-default value for aqbasket.create_items
2) Click Edit from basket.pl
3) Click Save without changing anything
4) Note that aqbasket.create_items is no longer set
5) Apply this patch
6) Restart all the things!
7) Repeat steps 1-3
8) Note create_items is unchanged!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23855: Fix "Mark selected suggestion as" status
Jonathan Druart [Mon, 21 Oct 2019 15:55:17 +0000 (17:55 +0200)]
Bug 23855: Fix "Mark selected suggestion as" status

On the suggestions management page (suggestion/suggestion.pl) you can
select suggestions and change their status.
But it only works for "ACCEPTED" or "REJECTED".

Maybe caused by bug 22905.

Test plan:
Select at least one suggestion on the screen and select the "Pending"
status.
=> The status of the selected suggestions must have been updated

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Acquisition::Fund
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:47:50 +0000 (13:47 -0300)]
Bug 23843: Add mapping to Koha::Acquisition::Fund

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_funds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Acquisition::Bookseller
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:29:47 +0000 (13:29 -0300)]
Bug 23843: Add mapping to Koha::Acquisition::Bookseller

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Item
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:27:25 +0000 (13:27 -0300)]
Bug 23843: Add mapping to Koha::Item

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Patron
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:27:11 +0000 (13:27 -0300)]
Bug 23843: Add mapping to Koha::Patron

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Library
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:26:57 +0000 (13:26 -0300)]
Bug 23843: Add mapping to Koha::Library

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/libraries.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Hold
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:26:07 +0000 (13:26 -0300)]
Bug 23843: Add mapping to Koha::Hold

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Club::Holds
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:25:34 +0000 (13:25 -0300)]
Bug 23843: Add mapping to Koha::Club::Holds

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/clubs_holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Checkout
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:24:45 +0000 (13:24 -0300)]
Bug 23843: Add mapping to Koha::Checkout

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Add mapping to Koha::Account::Line
Tomas Cohen Arazi [Mon, 21 Oct 2019 16:24:27 +0000 (13:24 -0300)]
Bug 23843: Add mapping to Koha::Account::Line

This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.

Once this is pushed we need to implement the counter-wise methods and
clean the controllers.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23843: Make funds endpoint tests more robust
Tomas Cohen Arazi [Mon, 21 Oct 2019 18:18:32 +0000 (15:18 -0300)]
Bug 23843: Make funds endpoint tests more robust

Now that we use ->to_api all the object attributes are returned, so the
original tests that didn't follow the FKs would pass, and now they
don't. If there is no budget linked to the fund, it will return undef,
which is not accepted on the API (though it accepts not returning the
attribute).

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_funds.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23793: Unit tests
Tomas Cohen Arazi [Mon, 14 Oct 2019 12:05:46 +0000 (09:05 -0300)]
Bug 23793: Unit tests

This patch introduces full test coverage for the EmbedItems filter.

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Filter/EmbedItems.t
=> SUCCESS: Tests pass!
3. Sign off :-D
4. Use it to improve Koha!

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23793: Add an EmbedItems RecordProcessor filter for MARC::Record objects
Tomas Cohen Arazi [Thu, 10 Oct 2019 16:17:18 +0000 (13:17 -0300)]
Bug 23793: Add an EmbedItems RecordProcessor filter for MARC::Record objects

This patch introduces a RecordProcessor filter for MARC::Record objects
that embeds MARC::Field's for each item that is passed to the processor.

Target usage:

my $biblio = Koha::Biblios->find(
    $biblio_id,
    { prefetch => [ items, metadata ] }
);

my $opachiddenitems_rules;
eval {
    my $yaml = C4::Context->preference('OpacHiddenItems') . "\n\n";
    $opachiddenitems_rules = YAML::Load($yaml);
};

my @items  = grep { !$_->hidden_in_opac({ rules => $opachiddenitems_rules }) @{$biblio->items->as_list};
my $record = $biblio->metadata->record;

my $processor = Koha::RecordProcessor->new(
    {
        filters => ('EmbedItems'),
        options => {
            items        => \@items
        }
    }
);

$processor->process( $record );

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 13937: (follow-up) Fix searching with UTF-8 characters.
Ere Maijala [Wed, 23 Oct 2019 13:23:19 +0000 (16:23 +0300)]
Bug 13937: (follow-up) Fix searching with UTF-8 characters.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoUpdate docs/teams.yaml for 19.11.x development cycle
Martin Renvoize [Tue, 22 Oct 2019 14:14:43 +0000 (15:14 +0100)]
Update docs/teams.yaml for 19.11.x development cycle

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: DBRev 19.06.00.042
Martin Renvoize [Tue, 22 Oct 2019 14:05:15 +0000 (15:05 +0100)]
Bug 22445: DBRev 19.06.00.042

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Replace %% with {}
Jonathan Druart [Wed, 16 Oct 2019 07:13:20 +0000 (09:13 +0200)]
Bug 22445: Replace %% with {}

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Add new pattern %normalized_isbn%
Martin Renvoize [Tue, 22 Oct 2019 13:58:52 +0000 (14:58 +0100)]
Bug 22445: Add new pattern %normalized_isbn%

Quite bad to use C4::Koha from Koha::Biblio :-/

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: (follow-up) Use CSS to set a max-width for images - Staff client
Owen Leonard [Mon, 18 Mar 2019 17:44:30 +0000 (17:44 +0000)]
Bug 22445: (follow-up) Use CSS to set a max-width for images - Staff client

This patch adds some CSS and markup to staff client templates so that
custom cover images have a maximum width of 140px (to match the width of
generated local cover image thumbnails). This prevents oversized images
from displaying inconsistently compared to images from other services.

This patch also adds a missing </a> to fix display problems.

To test, apply the patch and regenerate the staff client CSS. Post an
oversized image which corresponds to a record in your catalog.

View the following pages to confirm that the image displays well:

 - Catalog search results
 - Bibliographic detail page

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: (follow-up) Use CSS to set a max-width for images - OPAC
Martin Renvoize [Tue, 22 Oct 2019 13:58:29 +0000 (14:58 +0100)]
Bug 22445: (follow-up) Use CSS to set a max-width for images - OPAC

This patch adds some CSS and markup to OPAC templates so that custom
cover images have a maximum width of 140px (to match the width of
generated local cover image thumbnails). This prevents oversized images
from displaying inconsistently compared to images from other services.

To test, apply the patch and regenerate the OPAC CSS. Post an oversized
image which corresponds to a record in your OPAC which can be added to a
user's checkouts and to a list.

View the following pages to confirm that the image displays well:

 - OPAC search results
 - Bibliographic detail page
 - Shelf browser
 - List contents
 - Recent comments
 - "Your summary"

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - search resulta (staff)
Jonathan Druart [Thu, 28 Feb 2019 22:13:42 +0000 (19:13 -0300)]
Bug 22445: Custom cover images - search resulta (staff)

Test plan:
Search for bibliographic records, the custom covers should be displayed.

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - detail (staff)
Jonathan Druart [Thu, 28 Feb 2019 22:11:19 +0000 (19:11 -0300)]
Bug 22445: Custom cover images - detail (staff)

Test plan:
Staff side now, go the detail page of a bibliographic record
You should see the cover image.

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - opac user (checkout list)
Martin Renvoize [Tue, 22 Oct 2019 13:58:00 +0000 (14:58 +0100)]
Bug 22445: Custom cover images - opac user (checkout list)

Test plan:
- Check an item out to a patron
- At the OPAC loggin as this patron
On the checkout list you should see the cover image.

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - opac reviews (rss)
Jonathan Druart [Thu, 28 Feb 2019 21:58:21 +0000 (18:58 -0300)]
Bug 22445: Custom cover images - opac reviews (rss)

Test plan:
Same as previous patch, then click on the feeds link

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - opac reviews
Jonathan Druart [Thu, 28 Feb 2019 21:55:38 +0000 (18:55 -0300)]
Bug 22445: Custom cover images - opac reviews

Test plan:
- enable OpacShowRecentComments
- make a comment (OPAC)
- approve it (staff)
- click 'Recent comments' (OPAC)
=> You should see the custom cover

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - opac shelves
Jonathan Druart [Thu, 28 Feb 2019 21:50:21 +0000 (18:50 -0300)]
Bug 22445: Custom cover images - opac shelves

Test plan:
Add a bibliographic record (that has a custom image) to a shelf,
view the shelf (OPAC).
You should see the image.

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - opac result (rss)
Jonathan Druart [Thu, 28 Feb 2019 21:39:59 +0000 (18:39 -0300)]
Bug 22445: Custom cover images - opac result (rss)

This cannot be tested, it seems that the template is broken.

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - opac detail
Jonathan Druart [Fri, 1 Mar 2019 11:01:28 +0000 (08:01 -0300)]
Bug 22445: Custom cover images - opac detail

Test plan:
Go to the bibliographic record detail page at the OPAC, you should see
the custom cover image.

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - opac results
Jonathan Druart [Fri, 1 Mar 2019 11:01:05 +0000 (08:01 -0300)]
Bug 22445: Custom cover images - opac results

Test plan:
Search for bibliographic records at the OPAC, the custom cover should be
displayed

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Custom cover images - opac shelfbrowser
Martin Renvoize [Tue, 22 Oct 2019 13:56:53 +0000 (14:56 +0100)]
Bug 22445: Custom cover images - opac shelfbrowser

Test plan:
Go to the detail page of a bibliographic record (at the OPAC)
and confirm the at custom cover images are displayed in the shelf
browser

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Allow marc fields as pattern
Martin Renvoize [Tue, 22 Oct 2019 13:56:40 +0000 (14:56 +0100)]
Bug 22445: Allow marc fields as pattern

%tag$field%

There is a limitation here, only one replacement will work.
Let see if it is needed later to support several patterns

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Add tests for Koha::Biblio->custom_cover_image_url
Martin Renvoize [Tue, 22 Oct 2019 13:56:25 +0000 (14:56 +0100)]
Bug 22445: Add tests for Koha::Biblio->custom_cover_image_url

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Add new method Koha::Biblio->custom_cover_image_url
Jonathan Druart [Fri, 1 Mar 2019 11:00:53 +0000 (08:00 -0300)]
Bug 22445: Add new method Koha::Biblio->custom_cover_image_url

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22445: Add new prefs *CustomCoverImages*
Jonathan Druart [Fri, 1 Mar 2019 11:00:02 +0000 (08:00 -0300)]
Bug 22445: Add new prefs *CustomCoverImages*

This patch set adds a new method to display cover images for
bibliographic records.
The idea is to provide a flexible way allowing several use cases:
- local path
- remote url
- webservice
which would follow a given pattern.

So far only the following patterns are available:
- {isbn} will be replaced byt the isbn of the record
- {issn}
- using MARC subfields:
  {024$a} to replace with the value in 024$a
(Note that the selector has been changed from %% to {} in a coming
patch)

For example
- /your/local/images/{isbn}.png
- https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb
- etc.

There are 3 new sysprefs:
CustomCoverImagesURL
=> Define the path/url
CustomCoverImages
=> Turn on/off the display of the custom cover image in the staff client
OPACCustomCoverImages
=> Turn on/off the display of the custom cover image at the OPAC

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoUpdate Developer Statistics
Martin Renvoize [Tue, 22 Oct 2019 13:25:31 +0000 (14:25 +0100)]
Update Developer Statistics

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23867: Resolve "truncated incorrect double" for empty string
Marcel de Rooy [Tue, 22 Oct 2019 12:29:40 +0000 (12:29 +0000)]
Bug 23867: Resolve "truncated incorrect double" for empty string

Updatedatabase, rev. 18.12.00.051
Solved by testing the value of the pref first.
Tested by copying the change in a new atomic update with XXX.

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: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23770: (follow-up) Use ->to_api in /cities
Tomas Cohen Arazi [Tue, 8 Oct 2019 18:43:10 +0000 (15:43 -0300)]
Bug 23770: (follow-up) Use ->to_api in /cities

This patch aims to prove the behaviour does not differ. So you can run
the tests for the endpoints, and the behaviour remains.

The mappings and methods cannot be removed until $c->objects->search is
fixed to make use of them as well. That will happen once all used
Koha::Object-based classes implement the mappings.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/cities.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23770: (follow-up) Add tests for Koha::Objects->TO_JSON
Tomas Cohen Arazi [Tue, 8 Oct 2019 15:51:52 +0000 (12:51 -0300)]
Bug 23770: (follow-up) Add tests for Koha::Objects->TO_JSON

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23770: Unit tests
Tomas Cohen Arazi [Tue, 8 Oct 2019 15:13:23 +0000 (12:13 -0300)]
Bug 23770: Unit tests

This patch introduces tests for the new to_api method introduced in
Koha::Object(s).

It uses Koha::City as a sample for simplicity. And it also uses
Koha::Illrequests to test the case in which there's no to_api_mapping
method defined on the class, to highlight that a fallback to calling
TO_JSON is done. [1]

[1] This is done under the assumption Illrequests controller code
doesn't use any kind of mapping as the rest of the API controllers do,
so there's little chance it would be added in a future.

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t \
           t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23770: Add to_api_mapping method to Koha::City
Tomas Cohen Arazi [Tue, 8 Oct 2019 15:12:56 +0000 (12:12 -0300)]
Bug 23770: Add to_api_mapping method to Koha::City

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23770: Add Koha::Object(s)->to_api method
Tomas Cohen Arazi [Mon, 7 Oct 2019 18:55:09 +0000 (15:55 -0300)]
Bug 23770: Add Koha::Object(s)->to_api method

Generic method that changes the attribute names of an object in the
presence of the to_api_mapping method. It otherwise falls back to
returning the TO_JSON output.

This is WIP submitted early for scrutiny. Tests and example usage in an
API controller coming.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23346: Add without-db-name parameter to koha-dump
Marcel de Rooy [Fri, 19 Jul 2019 10:24:01 +0000 (10:24 +0000)]
Bug 23346: Add without-db-name parameter to koha-dump

Test plan:
Run koha-dump [yourdb]. Rename the files in var/spool/koha/[yourdb]
Run koha-dump --without-db-name [yourdb]
Run a diff between the unzipped sql files. The last dump should not
contain a CREATE DATABASE and USE statement. See BZ 15664 c4.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22922: (follow-up) Markup corrections
Owen Leonard [Wed, 16 Oct 2019 16:57:01 +0000 (16:57 +0000)]
Bug 22922: (follow-up) Markup corrections

This patch adds a "size" attribute to the datepicker input fields and
adds self-closing "/".

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22922: Use jQuery datepicker instead of <input type="date">
Julian Maurice [Fri, 17 May 2019 14:06:41 +0000 (16:06 +0200)]
Bug 22922: Use jQuery datepicker instead of <input type="date">

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22922: Allow reservedate changes only if AllowHoldDateInFuture is on
Julian Maurice [Fri, 17 May 2019 12:40:12 +0000 (14:40 +0200)]
Bug 22922: Allow reservedate changes only if AllowHoldDateInFuture is on

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22922: Allow to modify hold dates on reserve/request.pl
Julian Maurice [Tue, 14 May 2019 14:42:24 +0000 (16:42 +0200)]
Bug 22922: Allow to modify hold dates on reserve/request.pl

Test plan:
1. Place some holds
2. Go to the 'Holds' tab of the biblio record
3. Modify dates in the table and click on 'Update holds' button
4. Verify that dates have been correctly updated

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23791: DBRev 19.06.00.041
Martin Renvoize [Mon, 21 Oct 2019 08:56:43 +0000 (09:56 +0100)]
Bug 23791: DBRev 19.06.00.041

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23791: Compiled CSS
Martin Renvoize [Mon, 21 Oct 2019 08:52:38 +0000 (09:52 +0100)]
Bug 23791: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23791: (follow-up) Add missing CSS changes
Owen Leonard [Thu, 17 Oct 2019 15:12:46 +0000 (15:12 +0000)]
Bug 23791: (follow-up) Add missing CSS changes

This patch adds OPAC CSS changes which were missing from the original
patch. It also adds a missing title attribute to the Twitter link.

To test, apply the patch and regenerate the OPAC SCSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Follow the previous test plan.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23791: (follow-up) Fix database update description
Katrin Fischer [Mon, 14 Oct 2019 21:36:28 +0000 (23:36 +0200)]
Bug 23791: (follow-up) Fix database update description

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23791: Allow granular control of social networks enabled by SocialNetworks syspref
Owen Leonard [Fri, 11 Oct 2019 18:32:19 +0000 (18:32 +0000)]
Bug 23791: Allow granular control of social networks enabled by SocialNetworks syspref

This patch updates the SocialNetworks system preference so that it
offers a choice of social networks (and email) which can be enabled in
the OPAC.

This patch also replaces the social network images with Font Awesome
icons styled so that the colors match the social networks' current
branding. The old social networks sprite image is removed.

To test, apply the patch and run the database update. Rebuild the OPAC
CSS:
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client

 - Go to Administration -> Global system preferences -> OPAC -> Features
   and find the SocialNetworks preference.
   - If your SocialNetworks preference was enabled, all choices should
     be selected. Otherwise none should be selected.
   - If none are selected, select them all and save.
 - Locate a record in the OPAC and view the details page.
 - The social network icons should appear as expected and function as
   before.
 - Return to system preferences in the staff client and try enabling and
   disabling different options, verifying each time that the OPAC
   reflects your choices.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20086: (follow-up) No need to call ->new on Koha::Database
Martin Renvoize [Thu, 17 Oct 2019 16:28:15 +0000 (17:28 +0100)]
Bug 20086: (follow-up) No need to call ->new on Koha::Database

We should use the existing pattern of calling schema directly on
Koha::Database rather than creating a new object.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20086: Execute AddRenewal in a transaction to avoid partial success and doubled...
Nick [Thu, 17 Oct 2019 14:31:27 +0000 (14:31 +0000)]
Bug 20086: Execute AddRenewal in a transaction to avoid partial success and doubled fines

This patch starts a transaction and only commits if renewal and fines
updates and charges are successful (partial in any cna be problematic)

There is no feedback (as currently there is none either) but if part
fails, all fails.

I didn't include stats and notifications in the transaction, but we
could. (Edit JD: not true, they are included)

To test:
1 - Apply patch
2 - prove t/db_dependent/Circulation.t
3 - Attempt circs and renewals should be no difference
4 - If possible make part of transaction fail and ensure all fails

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended: commit title and one indendation (return statement)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23700: Fix output of koha-plack --restart
Magnus Enger [Mon, 30 Sep 2019 13:01:35 +0000 (15:01 +0200)]
Bug 23700: Fix output of koha-plack --restart

To test:
- Run "sudo koha-plack restart kohadev" and verify the output is
  out of line.
- Apply the patch
- If you are on e.g. kohadevbox you need to copy koha-plack to
  /usr/sbin/ thus:
  sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack
- Run "sudo koha-plack restart kohadev" again and check that you
  get two lines of output, nicely aligned with the "OK" inside the
  square brackets.

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23712: (QA follow-up) Silence two other warns too
Marcel de Rooy [Fri, 18 Oct 2019 12:34:43 +0000 (12:34 +0000)]
Bug 23712: (QA follow-up) Silence two other warns too

Caused by undefined method:
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/Koha/Illrequest.pm line 857.
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/Koha/Illrequest.pm line 859.

Test plan:
Run test again

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23712: Silence warns from Koha/Illrequest/Logger.pm
Magnus Enger [Tue, 1 Oct 2019 14:41:31 +0000 (16:41 +0200)]
Bug 23712: Silence warns from Koha/Illrequest/Logger.pm

To test:
- Run: $ sudo koha-shell -c "prove t/db_dependent/Illrequests.t" kohadev
- Observe the warnings about "no query in themelanguage"
- Apply the patch
- Run prove again
- Observe the lack of warnings about "no query in themelanguage"
  (There will be a couple of other warnings, but they are not
  related to the present bug.)

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23444: Terminology - Use library instead of branch
Katrin Fischer [Fri, 9 Aug 2019 15:26:12 +0000 (15:26 +0000)]
Bug 23444: Terminology - Use library instead of branch

This changes some strings in the templates for:

- Receiving orders (creating items on receive)
    Home branch    -> Home library
    Holding branch -> Current location
   (matches item display in staff)
- Callnumber browser item value builder plugin
    Branch -> Library
- Accounts wizard in reports
    Transaction branch -> Transaction library
- Serials wizard in reports
    Branch -> Library

Also fixes 2 capitalization issues:
  Subscription id -> Subscription ID
  Call Number     -> Call number

Signed-off-by: Alex Sassmannshausen <alex@komputilo.eu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23807: Unit tests
Tomas Cohen Arazi [Mon, 14 Oct 2019 11:32:58 +0000 (08:32 -0300)]
Bug 23807: Unit tests

This patch introduces tests for the Koha::Item->as_marc_field method. It
tries to cover all the use cases.

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS; Tests pass!
3. Sign off :-D

Signed-off-by: Jan Kolator <kolatorj@email.cz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 23807: Add Koha::Item->as_marc_field
Tomas Cohen Arazi [Fri, 11 Oct 2019 17:43:09 +0000 (14:43 -0300)]
Bug 23807: Add Koha::Item->as_marc_field

Signed-off-by: Jan Kolator <kolatorj@email.cz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Add default authority type
Julian Maurice [Mon, 14 Oct 2019 07:15:43 +0000 (09:15 +0200)]
Bug 20434: Add default authority type

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Add missing fields
Julian Maurice [Thu, 3 Oct 2019 15:34:56 +0000 (17:34 +0200)]
Bug 20434: Add missing fields

018 - [Reserved for other International Standard Numbers]
033 - Other System Persistent Record Identifier
183 - Coded Data Field: Type of Carrier
203 - Content Form and Media Type
231 - Digital File Characteristics
283 - Carrier Type
338 - Funding Information Note

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Add missing authority types
Julian Maurice [Thu, 3 Oct 2019 13:58:03 +0000 (15:58 +0200)]
Bug 20434: Add missing authority types

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Add UNIMARC field 214 and its subfields
Julian Maurice [Wed, 2 Oct 2019 12:40:56 +0000 (14:40 +0200)]
Bug 20434: Add UNIMARC field 214 and its subfields

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - script
Julian Maurice [Wed, 2 Oct 2019 11:45:32 +0000 (13:45 +0200)]
Bug 20434: Update UNIMARC framework - script

Test plan:
1. Take a look at files in misc/migration_tools/ifla/data. It
   contains all data that will be inserted into Koha. Its content is
   based on the previous patches.
2. Run the script misc/migration_tools/ifla/update.pl and verify
   that it effectively added the new fields, subfields, authorised
   values and authority types.
3. Run the script again and see that it doesn't update existing fields
4. Run with --force and verify that it update existing fields (you can
   modify unimarc_ifla.yml to see changes)
5. Run with --force --po-file misc/migration_tools/ifla/language/fr.po
   and verify that the labels are now in french

There is a POT file in misc/migration_tools/ifla/language/template.pot,
use it to create PO files for other languages.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - translations
Julian Maurice [Wed, 2 Oct 2019 11:45:18 +0000 (13:45 +0200)]
Bug 20434: Update UNIMARC framework - translations

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (WORK)
Julian Maurice [Wed, 2 Oct 2019 11:44:37 +0000 (13:44 +0200)]
Bug 20434: Update UNIMARC framework - auth (WORK)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (TU)
Julian Maurice [Wed, 2 Oct 2019 11:44:31 +0000 (13:44 +0200)]
Bug 20434: Update UNIMARC framework - auth (TU)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (TM)
Julian Maurice [Wed, 2 Oct 2019 11:44:23 +0000 (13:44 +0200)]
Bug 20434: Update UNIMARC framework - auth (TM)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (SNG)
Julian Maurice [Wed, 2 Oct 2019 11:44:15 +0000 (13:44 +0200)]
Bug 20434: Update UNIMARC framework - auth (SNG)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (SNC)
Julian Maurice [Wed, 2 Oct 2019 11:44:10 +0000 (13:44 +0200)]
Bug 20434: Update UNIMARC framework - auth (SNC)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (SAUTTIT)
Julian Maurice [Wed, 2 Oct 2019 11:44:01 +0000 (13:44 +0200)]
Bug 20434: Update UNIMARC framework - auth (SAUTTIT)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (PUB)
Julian Maurice [Wed, 2 Oct 2019 11:43:27 +0000 (13:43 +0200)]
Bug 20434: Update UNIMARC framework - auth (PUB)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (PERS)
Julian Maurice [Wed, 2 Oct 2019 11:43:16 +0000 (13:43 +0200)]
Bug 20434: Update UNIMARC framework - auth (PERS)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (PA)
Julian Maurice [Wed, 2 Oct 2019 11:43:08 +0000 (13:43 +0200)]
Bug 20434: Update UNIMARC framework - auth (PA)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (NTWORK)
Julian Maurice [Wed, 2 Oct 2019 11:43:01 +0000 (13:43 +0200)]
Bug 20434: Update UNIMARC framework - auth (NTWORK)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (NTEXP)
Julian Maurice [Wed, 2 Oct 2019 11:42:52 +0000 (13:42 +0200)]
Bug 20434: Update UNIMARC framework - auth (NTEXP)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20434: Update UNIMARC framework - auth (NP)
Julian Maurice [Wed, 2 Oct 2019 11:42:33 +0000 (13:42 +0200)]
Bug 20434: Update UNIMARC framework - auth (NP)

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>