]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 28640: (QA follow-up) Prevent unit tests from failing
Kyle M Hall [Thu, 1 Jul 2021 13:25:22 +0000 (09:25 -0400)]
Bug 28640: (QA follow-up) Prevent unit tests from failing

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28640: Expose EDI Status on basket details page
Martin Renvoize [Wed, 30 Jun 2021 11:37:59 +0000 (12:37 +0100)]
Bug 28640: Expose EDI Status on basket details page

This patch adds the edi_order relationship method to
Koha::Acquisition::Basket to return the most recently attached
edi_message of type 'ORDER' for the basket.

NOTE: EDI currently returns raw DBIC results. I have opted to maintain
that approach here, but would like to work on upgradeing the
Koha::EDIFACT::Order class to be a subclass of Koha::Object at a later
date.

We then use this new relationship in acqui/basket to display the EDI
status for such baskets.

Test plan
1/ Setup a vendor with EDI Ordering enabled
2/ Add a new basket for the vendor.
3/ Note the new 'EDI status' field displays and reads 'Not ordered'
4/ Close the basker
5/ The 'EDI status' should continue to display 'Not ordered'
6/ Re-open the basket
7/ Close the basket via 'Create EDIFACT order'
8/ Navigate back to the now closed basket
9/ Note the 'EDI status' field now displays 'Pending' and the transfer
date.
10/ Progress the EDI order by running the edi_cron.pl script
11/ The EDI status field should now reflect that the message has been
sent.

Signed-off-by: Benjamin Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28640: Unit tests for edi_order relation
Martin Renvoize [Wed, 30 Jun 2021 13:26:02 +0000 (14:26 +0100)]
Bug 28640: Unit tests for edi_order relation

Test plan
1/ Run t/db_dependent/Koha/Acquisition/Basket.t

Signed-off-by: Benjamin Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27583: Proposed terminology changes
Martin Renvoize [Mon, 1 Feb 2021 13:14:45 +0000 (13:14 +0000)]
Bug 27583: Proposed terminology changes

This patch impliments some terminology changes and clarifications for
the cash management system

Test plan
1/ Apply the patches
2/ Enable 'UseCashRegisters'
3/ Navigate around the cash management system (via the Tools menu)
4/ Enable 'EnablePointOfSale'
5/ Navigate around the cash management system (via the Point of sale
module)
6/ Comment on what you think about the changes

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28662: Compiled CSS
Jonathan Druart [Mon, 26 Jul 2021 10:45:11 +0000 (12:45 +0200)]
Bug 28662: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28620: Replace remaining occurrence in test
Jonathan Druart [Mon, 26 Jul 2021 09:19:17 +0000 (11:19 +0200)]
Bug 28620: Replace remaining occurrence in test

Not useful but won't hurt either.
At least all our occurrences are identical now.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28620: Remove trailing space when logging with log4perl
Marcel de Rooy [Wed, 23 Jun 2021 11:59:21 +0000 (11:59 +0000)]
Bug 28620: Remove trailing space when logging with log4perl

Trivial change.
Do sed -i -r -e'/log4perl/ s/\s%n$/%n/' on the log4perl configs.

Test plan:
Update your own config.
Trigger some logging and check that logfile.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28662: Not possible to log out of patron account in OPAC with JavaScript disabled
Owen Leonard [Tue, 6 Jul 2021 13:07:42 +0000 (13:07 +0000)]
Bug 28662: Not possible to log out of patron account in OPAC with JavaScript disabled

This patch adds a "Log out" link to the OPAC header which is hidden by
CSS when JavaScript is enabled.

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

 - Log in to the OPAC with JavaScript disabled in your browser.
 - In the header next to the logged-in user's name there should be a
   "Log out." link.
 - Confirm that it logs the user out.
 - Enable JavaScript and repeat the process to confirm that the new
   logout link doesn't appear.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28408: Add new column to the table settings config
Jonathan Druart [Mon, 26 Jul 2021 09:01:10 +0000 (11:01 +0200)]
Bug 28408: Add new column to the table settings config

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28408: Add 'Last updated' column to suggestions table
Nick Clemens [Fri, 28 May 2021 12:52:03 +0000 (12:52 +0000)]
Bug 28408: Add 'Last updated' column to suggestions table

We have specific meanings for the different dates in suggestions
Managed - means the status was changed or the suggestion edited, but doesn't change if item type updated
Modification - implies an edit of the subscript, not updated if status changed alone
Updated - this is the date field in the DB, which is actually a timestamp

The cronjob purge_suggestions.pl uses teh 'date' field

For a user, a suggestion can look old in the interface, but be considered recent by the script

To clear the confusion we should show the timestamp as well

To test:
1 - Add a suggestion
2 - In the DB, pretend you set it in the past:
    UPDATE suggestions SET manageddate='2021-01-01', suggesteddate='2021-01-01', date='2021-01-01 12:12:12';
3 - Click 'Go' In Organize by: Status
4 - Note the suggestion looks old now
5 - Check the box, and click 'Update item types with:' -> Submit
6 - Prganize by status again
7 - No change?
8 - Check the DB:
    SELECT date FROM suggestions;
9 - The field is updated
10 - Apply patch
11 - Organize by status again
12 - See the 'Last updated' ate set to today

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28336: Add missing input for item_action
Nick Clemens [Wed, 12 May 2021 17:00:57 +0000 (17:00 +0000)]
Bug 28336: Add missing input for item_action

To test:
1 - Stage a marc file of authorities
2 - Manage the staged file
3 - Attempt to change the matching rule
4 - 500 Error, in intranet-error.log:
[Wed May 12 16:53:03.046652 2021] [cgi:error] [pid 52072] [client 172.19.0.1:50580] AH01215: C4::ImportBatch::SetImportBatchItemAction(): DBI Exception: DBD::mysql::st execute failed: Column 'item_action' cannot be null [for Statement "UPDATE import_batches SET item_action = ? WHERE import_batch_id = ?" with ParamValues: 0=undef, 1="1"] at /kohadevbox/koha/tools/manage-marc-import.pl line 160: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=1
5 - Apply patch
6 - Reload page and change matching rule
7 - Success!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27885: (follow-up) Use biblionumbers instead of biblionumber in form action for...
Nick Clemens [Wed, 26 May 2021 12:17:41 +0000 (12:17 +0000)]
Bug 27885: (follow-up) Use biblionumbers instead of biblionumber in form action for club search

This simply matches the code on the patrons search tab

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27885: Populate biblionumbers parameter using biblionumbers array
Nick Clemens [Fri, 5 Mar 2021 17:32:28 +0000 (17:32 +0000)]
Bug 27885: Populate biblionumbers parameter using biblionumbers array

Currently we send $biblionumbers as the parameter, but this is just apassthrough form when a list of biblios is selected for placing a hold

If passed a single biblionumber we push it into @biblionumbers and use that for building the biblio loop

This patch uses @biblionumbers to avoid sending a blank variable in the URL

To test:
1 - On the staff client click 'place hold' for an individual record
2 - Use the form to find a patron
3 - Note the url is:
    http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumbers=
4 - Apply patch
5 - Repeat
6 - The url is now like:
    http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumbers=248
    (but with whatever biblionumber you chose)
7 - Perform a search and select multiple biblios and confirm you can place holds as before

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
JD Amended patch: Add missing space

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28718: handle multiple deletions from news
Lucas Gass [Fri, 16 Jul 2021 14:44:10 +0000 (14:44 +0000)]
Bug 28718: handle multiple deletions from news

To test:
1. have multiple news
2. check several of them and and click 'Delete selected'
3. see ugly error
4. apply patch
5. try again
6. no error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28622: (bug 15758 follow-up) Remove incorrect branch selection in adv search
Jonathan Druart [Wed, 23 Jun 2021 14:19:15 +0000 (16:19 +0200)]
Bug 28622: (bug 15758 follow-up) Remove incorrect branch selection in adv search

From
  commit df97814f3034a3d5015546c4eca21f08ae951e37
  Bug 15758: Koha::Libraries - Remove GetBranches

+    selected_branchcode => ( C4::Context->IsSuperLibrarian ? C4::Context->userenv : '' ),

And

-        [% PROCESS options_for_libraries libraries => Branches.all() %]
+        [%# FIXME Should not we filter the libraries displayed? %]
+        [% PROCESS options_for_libraries libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %]

The change in the pl is wrong as it should pass C4::Context->userenv->{branch},
but prior to this commit it seems that we didn't select the logged in
library anyway.

Looks like we should remove this code but preserve the current behavior and select "All libraries".

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22801: (follow-up) Use date-of-publication directly
Nick Clemens [Thu, 17 Jun 2021 12:36:01 +0000 (12:36 +0000)]
Bug 22801: (follow-up) Use date-of-publication directly

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22801: Advance search yr must use date-of-publication and not copydate
Fridolin Somers [Fri, 22 Jan 2021 08:39:33 +0000 (09:39 +0100)]
Bug 22801: Advance search yr must use date-of-publication and not copydate

In advanced search with Elasticsearch the limit on years range is actually using copydate :

Koha/SearchEngine/Elasticsearch/QueryBuilder.pm in _fix_limit_special_cases() :
        if ( $l =~ /^yr,st-numeric,ge=/ ) {
            my ( $start, $end ) =
              ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ );
            next unless defined($start) && defined($end);
            push @new_lim, "copydate:[$start TO $end]";
        }

With Zebra it uses date-of-publication and also in Koha/SearchEngine/Elasticsearch/QueryBuilder.pm :

our %index_field_convert = (
(...)
    'yr' => 'date-of-publication',

This patch uses %index_field_convert to perform 'yr' limit.

Test plan:
1) Apply patch
2) Use Elasticsearch searchengine
3) Go to advanced search with 'More options'
4) Perform a search with a year limit (value or range)
5) Check results are correct

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28747: Clarify working on RestrictionBlockRenewal
Andrew Fuerste-Henry [Fri, 23 Jul 2021 11:57:36 +0000 (11:57 +0000)]
Bug 28747: Clarify working on RestrictionBlockRenewal

To test, apply patch, restart services and reload page, confirm that now the syspref says "from the staff interface."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28585: (follow-up) Tests for q= supporting date/date-time parameters
Tomas Cohen Arazi [Fri, 25 Jun 2021 14:49:06 +0000 (11:49 -0300)]
Bug 28585: (follow-up) Tests for q= supporting date/date-time parameters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28585: Use the datetime_parser for handling API dates
Tomas Cohen Arazi [Fri, 25 Jun 2021 14:37:29 +0000 (11:37 -0300)]
Bug 28585: Use the datetime_parser for handling API dates

This patchset takes the GET /patrons route as a sample usage for filtering
on date and date-time (including timestamp) fields.

It then makes Koha::Object->attributes_from_api use the DB storage
datetime parser for format the parameters correctly.

To test:

1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: It doesn't find the patron when filtering by date
3. Apply this patch
4. Repeat 2
=> SUCCESS: It works now!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28585: Regression tests
Tomas Cohen Arazi [Fri, 25 Jun 2021 12:57:11 +0000 (09:57 -0300)]
Bug 28585: Regression tests

This patch adds tests for filtering GET calls with date/date-time
parameters. Tests fail because the feature is not working

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28679: Unable to click "Log in to your account" when GoogleOpenIDConnect is enabled
Owen Leonard [Mon, 12 Jul 2021 13:29:27 +0000 (13:29 +0000)]
Bug 28679: Unable to click "Log in to your account" when GoogleOpenIDConnect is enabled

This patch corrects the login link in the OPAC when GoogleOpenIDConnect
is enabled. It removes modal-related markup which was causing the link
to fail.

To test, apply the patch and enable the GoogleOpenIDConnect system
preference.

- In the OPAC, click the "Log in to your account" link in the header.
  You should be redirected to a Google authentication form.
- Disable the GoogleOpenIDConnect preference. The login link in the OPAC
  should trigger a modal login form.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28631: Holds History title link returns "not found" error
Owen Leonard [Wed, 30 Jun 2021 15:42:50 +0000 (15:42 +0000)]
Bug 28631: Holds History title link returns "not found" error

This patch corrects a broken path in the OPAC holds history page.

This patch also corrects the breadcrumb markup which didn't conform to
the new Bootstrap 4 pattern.

To test, apply the patch and log into the OPAC as a patron who has past
or current holds.

- View the "your holds history" page.
- Click a title link in the table of holds. It should take you to the
  correct bibliographic detail page.
- Check the breadcrumbs of the page. They should look consistent with
  breadcrumb navigation on other pages in the OPAC.

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28745: (bug 28158 follow-up) Restore the items table once the job is done
Jonathan Druart [Fri, 23 Jul 2021 09:46:33 +0000 (11:46 +0200)]
Bug 28745: (bug 28158 follow-up) Restore the items table once the job is done

Caused by bug 28158, the batch item modifications tool does not longer
display the table with the items that have been modified on the result screen.

There is no more fork and so no more completedJobID var.
We must process the items THEN build the items' info.

Test plan:
Use the batch item modification tools to modify some items.
Confirm that with this patch the table with the modified items is
displayed on the last screen.

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>
3 years agoBug 28660: (bug 21325 follow-up) Fix auto self check
Jonathan Druart [Tue, 6 Jul 2021 12:48:51 +0000 (14:48 +0200)]
Bug 28660: (bug 21325 follow-up) Fix auto self check

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works as expected.
The need for an additional check of pref WebBasedSelfCheck is
merely theoretical.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28731: (bug 17600 follow-up) Import necessary subroutines in reports svc endpoint
Nick Clemens [Wed, 21 Jul 2021 14:55:01 +0000 (14:55 +0000)]
Bug 28731: (bug 17600 follow-up) Import necessary subroutines in reports svc endpoint

TO test:
 1 - Write a report
 2 - Click the svc link in the saved reports list
 3 - ISE
 4 - Make report public
 5 - Click the svc link in saved reports list
 6 - ISE
 7 - Apply patch
 8 - Comfirm opac/public link works
 9 - Make report not public
10 - Confirm the internal svc link works

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 17600: Fix batchMod.pl
Jonathan Druart [Mon, 19 Jul 2021 14:39:06 +0000 (16:39 +0200)]
Bug 17600: Fix batchMod.pl

Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_tools_batchMod_2epl::haspermission called at /kohadevbox/koha/tools/batchMod.pl line 89

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 17600: Fix tests
Jonathan Druart [Fri, 16 Jul 2021 07:46:59 +0000 (09:46 +0200)]
Bug 17600: Fix tests

No idea why UpdateStats in C4::Circulation needs the fully qualified
namespace!

I kept getting
Undefined subroutine &C4::Circulation::UpdateStats called at /kohadevbox/koha/C4/Circulation.pm line 1643.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 17600: Standardize our EXPORT_OK
Jonathan Druart [Wed, 9 Nov 2016 12:06:44 +0000 (12:06 +0000)]
Bug 17600: Standardize our EXPORT_OK

On bug 17591 we discovered that there was something weird going on with
the way we export and use subroutines/modules.
This patch tries to standardize our EXPORT to use EXPORT_OK only.

That way we will need to explicitely define the subroutine we want to
use from a module.

This patch is a squashed version of:
Bug 17600: After export.pl
Bug 17600: After perlimport
Bug 17600: Manual changes
Bug 17600: Other manual changes after second perlimports run
Bug 17600: Fix tests

And a lot of other manual changes.

export.pl is a dirty script that can be found on bug 17600.

"perlimport" is:
git clone https://github.com/oalders/App-perlimports.git
cd App-perlimports/
cpanm --installdeps .
export PERL5LIB="$PERL5LIB:/kohadevbox/koha/App-perlimports/lib"
find . \( -name "*.pl" -o -name "*.pm" \) -exec perl App-perlimports/script/perlimports --inplace-edit --no-preserve-unused --filename {} \;

The ideas of this patch are to:
* use EXPORT_OK instead of EXPORT
* perltidy the EXPORT_OK list
* remove '&' before the subroutine names
* remove some uneeded use statements
* explicitely import the subroutines we need within the controllers or
modules

Note that the private subroutines (starting with _) should not be
exported (and not used from outside of the module except from tests).

EXPORT vs EXPORT_OK (from
https://www.thegeekstuff.com/2010/06/perl-exporter-examples/)
"""
Export allows to export the functions and variables of modules to user’s namespace using the standard import method. This way, we don’t need to create the objects for the modules to access it’s members.

@EXPORT and @EXPORT_OK are the two main variables used during export operation.

@EXPORT contains list of symbols (subroutines and variables) of the module to be exported into the caller namespace.

@EXPORT_OK does export of symbols on demand basis.
"""

If this patch caused a conflict with a patch you wrote prior to its
push:
* Make sure you are not reintroducing a "use" statement that has been
removed
* "$subroutine" is not exported by the C4::$MODULE module
means that you need to add the subroutine to the @EXPORT_OK list
* Bareword "$subroutine" not allowed while "strict subs"
means that you didn't imported the subroutine from the module:
  - use $MODULE qw( $subroutine list );
You can also use the fully qualified namespace: C4::$MODULE::$subroutine

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28606: Remove warning from C4::Auth 887
Jonathan Druart [Tue, 13 Jul 2021 09:42:03 +0000 (11:42 +0200)]
Bug 28606: Remove warning from C4::Auth 887

[WARN] Use of uninitialized value in sprintf at /kohadevbox/koha/C4/Auth.pm line 887.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27948: Fix file mode
Jonathan Druart [Tue, 13 Jul 2021 07:49:24 +0000 (09:49 +0200)]
Bug 27948: Fix file mode

From
  commit b7acefa116c9ae1e738b5c53f30cf0d6c11d8784
  Bug 27948: (follow-up) Use Koha.news and PROCESS koha_news_block to bring disclaimer

opac/opac-request-article.pl changed file mode from 100755 to 100644

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28483: Fix t/Search/buildQuery.t
Jonathan Druart [Tue, 13 Jul 2021 07:46:59 +0000 (09:46 +0200)]
Bug 28483: Fix t/Search/buildQuery.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28636: Add POD to t:lib::Mocks
Tomas Cohen Arazi [Tue, 22 Jun 2021 20:32:20 +0000 (17:32 -0300)]
Bug 28636: Add POD to t:lib::Mocks

There's no POD. This patch adds it. I wrote it as part of bug 28615 but
then it took another direction, so submitting here.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28177: (follow-up) Add time to date column
Owen Leonard [Tue, 6 Jul 2021 11:11:31 +0000 (11:11 +0000)]
Bug 28177: (follow-up) Add time to date column

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28177: Add date column and column configuration to uploads
Owen Leonard [Tue, 20 Apr 2021 14:24:29 +0000 (14:24 +0000)]
Bug 28177: Add date column and column configuration to uploads

This patch adds a "Date added" column to the table showing uploaded
files. Column configuration is added to the table, and the date column
is hidden by default.

To test, apply the patch and restart all.

- Go to Tools -> Upload.
- If necessary, upload multiple files with the same category.
- Use the "Search uploads by category" form to find those uploads.
- In the table of uploads, confirm that table settings and other
  DataTable controls work correctly, including the option to show the
  "Date added" column.
- Go to Administration -> Table settings -> Tools -> upload.
- Change the settings for the uploads table.
- Return to Uploads and confirm that your changes are reflected in the
  display of the uploads table.

Signed-off-by: Salman Ali <salman.ali@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28175: (follow-up) Preselect correct category after search
Owen Leonard [Tue, 22 Jun 2021 19:09:23 +0000 (19:09 +0000)]
Bug 28175: (follow-up) Preselect correct category after search

This patch modifies the script and template so that if the user submits
a search by category, that category will be preselected on the search
results page.

Also added is an empty "Choose" option so that a search category isn't
selected by default.

To test, apply the patch and view the uploads page.

 - In the category search form, a "Choose" option should be selected.
   Submitting the form without selecting a category should not work.
 - Search using one of your existing categories. On the search results
   page the category you selected should remain selected.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28175: (follow-up) Adapt layout when there are no upload categories
Owen Leonard [Fri, 23 Apr 2021 16:05:40 +0000 (16:05 +0000)]
Bug 28175: (follow-up) Adapt layout when there are no upload categories

This patch adds some logic to the uploads template so that if there are
no upload categories there isn't an empty space on the page where the
"Search by category" form would be.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28175: Usability improvements to uploads page
Owen Leonard [Tue, 20 Apr 2021 12:13:28 +0000 (12:13 +0000)]
Bug 28175: Usability improvements to uploads page

This patch makes a variety of changes to the uploads page in order to
improve usability:

- Add a toolbar with an "Upload" button so that it can be accessed from
  the upload results or search results views
- On views other than the "main" view, add search forms to the sidebar
  - The search form markup has been modified somewhat in order to make
    it work well in both the sidebar and the main body of the page.
- Show the upload category description instead of the code
- Link the upload category in search results to a search for that
  category

The "enctype" attribute has been removed from the search forms because
it is unnecessary and causes form resubmission errors in some browsers
(Firefox at least).

To test, apply the patch and make sure you have at least one entry under
Authorized values for the category UPLOAD.

- Go to Tools -> Upload.
- Upload a file, adding a category as you do so.
- On the upload results page, test that the "Upload file" button
  returns you to the main upload page.
- On the upload results or search results view, confirm that the "Search
  uploads by category" and "Search uploads by name" forms work
  correctly.
- When viewing upload or search results, confirm that the category
  discription is shown instead of the code. Confirm that the category is
  a link to a search for other files in that category.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27873: Compiled CSS changes
Jonathan Druart [Mon, 12 Jul 2021 13:43:52 +0000 (15:43 +0200)]
Bug 27873: Compiled CSS changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27873: Improve message consistency: checkout and patron detail pages
Owen Leonard [Thu, 1 Apr 2021 13:29:29 +0000 (13:29 +0000)]
Bug 27873: Improve message consistency: checkout and patron detail pages

This patch creates a new include for showing circulation and
patron-related messages on both the checkout page and the patron detail
page. This allows the two pages to be consistent with each other.

The patch also makes some minor CSS adjustments, including the addition
of an SVG to replace an old GIF, arrow-bullet.gif.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- View both the checkout and patron details page for patrons in the
  staff interface, confirming that the information is displayed in the
  same way, including:

  - Pending modifications
  - Pending expiration
  - Expired
  - Address in doubt
  - Card lost
  - Restricted (indefinite and with expiration)
  - Outstanding overdues
  - Outstanding return claims
  - Patron age incorrect for their category
  - Outstanding charges
  - Account credit
  - Waiting holds (at logged-in library or other library)
  - Circulation note (from borrowers.borrowernotes)
  - Messages (added at logged-in library or other library)

EDIT: Fixed merge error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27445: Compiled CSS changes
Jonathan Druart [Mon, 12 Jul 2021 13:44:10 +0000 (15:44 +0200)]
Bug 27445: Compiled CSS changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27445: OPAC header tweaks for non-JavaScript users
Owen Leonard [Fri, 15 Jan 2021 19:15:06 +0000 (19:15 +0000)]
Bug 27445: OPAC header tweaks for non-JavaScript users

This patch makes some minor changes to the header menu in the OPAC
visible only to users with JavaScript support.

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

 - View the OPAC with JS disabled in your browser.
 - The "Cart" button should not be visible.
 - The "List," "Log in," and "Search history" links should be styled
   blue like other links.
 - Log in to the OPAC and confirm that the "Welcome <name>" link is also
   styled like other links.
 - Enable JavaScript and verify that the links appear and function just
   as they did before the patch.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28384: Add 'no_items' option to TransformMarcToKoha
Nick Clemens [Wed, 19 May 2021 10:19:33 +0000 (10:19 +0000)]
Bug 28384: Add 'no_items' option to TransformMarcToKoha

This patch adds a new option 'no_items' and uses it in the C4::Search::searchResults
routine. We don't use the item info fetched here, so skipping those lines saves us time.

Additionally, I fix an incorrect FIXME comment, and pass the ISBN returned by the routine above
into GetNormalizedISBN to save another lookup

TO test:
1 - Enable AmazonCoverImages system preference
2 - Search staff client with a term that returns books with covers
3 - Apply patch
4 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t
5 - Confirm searching works
6 - Confirm Amazon images display (normalized_isbn is used for these)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Amended, replacing a tab character.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27985: Add option to send a record to batch modification from details page
Nick Clemens [Thu, 18 Mar 2021 13:52:37 +0000 (13:52 +0000)]
Bug 27985: Add option to send a record to batch modification from details page

This patch adds an option to modify a single record using a marc modification
template to the 'Edit' menu on the details page

To test:
 1 - Apply patch
 2 - Browse to details page on the staff client
 3 - Be a user with permission to edit records and use batch record modification
 4 - Verify the option 'Modify record using template' appears in list
 5 - Click it
 6 - You should be sent to batch record modification screen
 7 - If you have no templates there will be a link prompting you to create on, do that
 8 - If oyu already had one, or created on above you shoudl now be able to select a template
 9 - Apply the template
10 - Browse to the record again
11 - Confirm changes were applied correctly

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: DBRev 21.06.00.010
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 20472: DBRev 21.06.00.010

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: DBRev 21.06.00.009
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 20472: DBRev 21.06.00.009

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: DBIC schema changes
Jonathan Druart [Mon, 12 Jul 2021 13:41:45 +0000 (15:41 +0200)]
Bug 20472: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: Add kohastructure changes
Jonathan Druart [Mon, 12 Jul 2021 13:37:14 +0000 (15:37 +0200)]
Bug 20472: Add kohastructure changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: Make DB rev idempotent
Jonathan Druart [Mon, 12 Jul 2021 11:52:02 +0000 (13:52 +0200)]
Bug 20472: Make DB rev idempotent

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: (QA follow-up) Add few TT filters
Marcel de Rooy [Thu, 24 Jun 2021 11:50:05 +0000 (11:50 +0000)]
Bug 20472: (QA follow-up) Add few TT filters

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
No more warns from qa tools.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: Update translated AR notices
Marcel de Rooy [Wed, 29 Jul 2020 13:32:22 +0000 (13:32 +0000)]
Bug 20472: Update translated AR notices

Originally, we had:
de-DE/mandatory/sample_notices.sql
fr-CA/obligatoire/sample_notices.sql
fr-FR/1-Obligatoire/sample_notices.sql
it-IT/necessari/notices.sql
nb-NO/1-Obligatorisk/sample_notices.sql
pl-PL/mandatory/sample_notices.sql
ru-RU/mandatory/sample_notices.sql
uk-UA/mandatory/sample_notices.sql

Obviously, the landscape changed in the meantime.
We still have: fr-CA, fr-FR, nb-NO.

Test plan:
Reinstall notices for one of the languages above.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Have run all sql files thru mysql on the command line.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: Add format to sample notices
Marcel de Rooy [Wed, 29 Jul 2020 11:12:12 +0000 (11:12 +0000)]
Bug 20472: Add format to sample notices

NOTE: We are only changing English here. A follow-up will care for
the translated languages. (English is in yml format, the remainder
not yet.)

We need to change the following notices:
AR_SLIP, AR_CANCELED, AR_PROCESSING, AR_PENDING and AR_COMPLETED.
In AR_COMPLETED the last sentence about picking up has been modified
too.

Test plan:
Reinstall Koha. Choose English. Check notice text.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: Edit URL field on staff form
Marcel de Rooy [Thu, 5 Apr 2018 12:22:42 +0000 (14:22 +0200)]
Bug 20472: Edit URL field on staff form

This patch makes the following changes:

Add menu option Edit URLs.
Edit modal form to edit URLs.
Save URLs via ajax call to svc/article_request (Add action update_urls).
Add URL column to pending and processing table.
Allow Edit URLs for pending table too (just as Complete).
Do not allow 'Complete request' if a scan request has no URL(s).

Test plan:
[1] Add a few scan and photocopy requests.
[2] Fill url-A and url-B in two separate scan requests.
[3] Verify that these two urls are really saved (refresh form).
[4] Check that you cannot complete a scan request without URL and that you
    cannot add a URL to a photocopy request.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: Add format field to the interface
Marcel de Rooy [Tue, 3 Apr 2018 14:19:13 +0000 (16:19 +0200)]
Bug 20472: Add format field to the interface

We need to add the format to the forms entering new requests:
  opac/opac-request-article
  circ/request-article
If the pref contains multiple formats like SCAN|PHOTOCOPY, the first listed
format will be preselected on the request form. If there is only one option,
we should not disable the select however. (Possibly hide it.)

If we have no mandatory fields, we should not allow the submit of a complete
empty form (check on OPAC).

And we need to show the format of pending requests on forms:
  opac/opac-user
  circ/request-article (biblio detail tab)
  circ/article-requests (staff form to handle requests)
  members/moremember (Article requests tab at the bottom)
  circ/circulation (Checkout/Article requests tab)
Note: The last two forms use the same include file.

Test plan:
[1] Add an article request via opac or staff. Choose Scan.
[2] Verify that you see the Scan format on opac-user and the
    above-mentioned staff forms.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: Db rev for new preference ArticleRequestsSupportedFormats
Marcel de Rooy [Mon, 26 Mar 2018 13:10:54 +0000 (15:10 +0200)]
Bug 20472: Db rev for new preference ArticleRequestsSupportedFormats

This preference controls which formats are actually offered to patrons of
the library via the Article Request feature.
By default, it only contains PHOTOCOPY. This is default behavior.

The request format SCAN will be made possible by this report and can be
added by changing the preference.

Test plan:
Run the dbrev. Check the new pref on Administration.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20472: Add new fields article_requests.format and urls
Marcel de Rooy [Mon, 26 Mar 2018 12:41:06 +0000 (14:41 +0200)]
Bug 20472: Add new fields article_requests.format and urls

The field 'format' will allow to make a distinction between requests for
photocopies and digital scans.
The field 'urls' will be used to save the URLs that allow the client to
download the scanned materials.

Test plan:
Run new install or upgrade existing install with atomic update.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: DBRev 21.06.00.008
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 20310: DBRev 21.06.00.008

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: (QA follow-up) Add 'Opac' to pref and description
Nick Clemens [Fri, 9 Jul 2021 12:02:38 +0000 (12:02 +0000)]
Bug 20310: (QA follow-up) Add 'Opac' to pref and description

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: (follow-up) Rename method to get_marc_host
Martin Renvoize [Mon, 28 Jun 2021 13:13:07 +0000 (14:13 +0100)]
Bug 20310: (follow-up) Rename method to get_marc_host

This method is a mix of database relationship accessor and marc field
accessor. We have get_marc_notes already and other patches in the queue
are also starting to introduce get_marc_* named methods. This patch
updates the method name to conform with that scheme.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: (follow-up) Move syspref check into controller
Martin Renvoize [Mon, 28 Jun 2021 13:07:53 +0000 (14:07 +0100)]
Bug 20310: (follow-up) Move syspref check into controller

I believe the syspref check is better placed in the controller. This way
the host_record method is not so closely tied to the articel requests
feature and may subsequently prove useful to future use cases.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: (follow-up) Check if biblio exists; 755 host_record.t
Marcel de Rooy [Fri, 9 Apr 2021 07:39:49 +0000 (07:39 +0000)]
Bug 20310: (follow-up) Check if biblio exists; 755 host_record.t

In order to prevent an error like:
Can't call method "host_record" on an undefined value at opac/opac-request-article.pl

Also chmod's host_record.t to 755 (File must have the exec flag)

Test plan:
Change the URL so that the biblionumber does not exist.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: Adding a pref to control behavior
Marcel de Rooy [Tue, 8 Sep 2020 13:29:45 +0000 (13:29 +0000)]
Bug 20310: Adding a pref to control behavior

If people want to control the redirection, we could add a pref
like ArticleRequestsHostRedirection. If it is not enabled,
the party is over.

Test plan:
Test if redirection stops on a child and host when you disable.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: (follow-up) Add or remove orgcode in second try
Marcel de Rooy [Tue, 8 Sep 2020 12:59:53 +0000 (12:59 +0000)]
Bug 20310: (follow-up) Add or remove orgcode in second try

We did remove an orgcode, but we could also do the other way
around.

Note: Hard to include in the unit test since it mocks the whole
search engine part.

Test plan:
[1] Run t/db_dependent/Koha/Biblio/host_record.t
[2] Test host 001 = number and child 773 = (org)number
[3] Test host 001 = (org)number and child 773 = number

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: Redirect article record without items for article requests
Marcel de Rooy [Mon, 19 Mar 2018 13:14:39 +0000 (14:14 +0100)]
Bug 20310: Redirect article record without items for article requests

If an article record has been catalogued separately, has no items and
contains a reference to its host via MARC21 field 773 (host item entry),
this patch makes an article request redirect to the host record while
copying title, author and page info (from 773$g).

This is accomplished by using the new Koha::Biblio->host_record method.

Note: Subfield 773$g may contain additional information on volume and
issue number etc. It will be very hard or perhaps impossible to parse $g
and copy these details into the corresponding fields of the article
request form for all possible variations used in libraries. A similar
remark can be made for selecting the correct item (when item level is
used). We could try this on a future report, but will probably need at
least a preference to define the expected format.

Test plan:
[1] Enable article requests. Add rules for an ART and a SER itemtype.
[2] Create a SER host biblio record.
[3] Create an ART biblio record, no items. Include a 773w pointing to the
    SER record with '(MARCorgcode)[recno]' (keep the parentheses, remove
    the square brackets when inserting the biblionumber).
    Include text in 773$g too.
[4] Place an article request on the ART record. Verify that it redirects
    you to the SER record while copying title, author, page info.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27948: Remove unused branchcode var
Jonathan Druart [Mon, 12 Jul 2021 11:34:15 +0000 (13:34 +0200)]
Bug 27948: Remove unused branchcode var

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20310: Introduce Koha::Biblio->host_record
Marcel de Rooy [Mon, 19 Mar 2018 13:14:39 +0000 (14:14 +0100)]
Bug 20310: Introduce Koha::Biblio->host_record

This is a more generic method that allows you to get to the host record
as defined in MARC21 field 773$w. This control number is looked up in the
search engine (MARC21 field 001).

Note: The current implementation is based on MARC21 and does not change
behavior for UNIMARC.
This includes the follow-up originally submitted separately on Bugzilla,
dealing with multiple 773 fields.

Test plan:
Run t/db_dependent/Koha/Biblio/host_record.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27908: Add support for circulation status 1 ( other ) for damaged items
Kyle M Hall [Wed, 10 Mar 2021 15:45:18 +0000 (10:45 -0500)]
Bug 27908: Add support for circulation status 1 ( other ) for damaged items

Some libraries would like to transmit if an item is damaged via the
circulation status field. There is no specific code for a damaged item,
so we should use value 1 (other) along with an AF screen message to
describe the reason for the the circulation status of 1.

Test Plan:
1) Apply these patches
2) prove t/db_dependent/SIP/Transaction.t

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27908: Add unit test
Kyle M Hall [Wed, 10 Mar 2021 15:45:15 +0000 (10:45 -0500)]
Bug 27908: Add unit test

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27907: Add support for circulation status 2 ( on order )
Kyle M Hall [Wed, 10 Mar 2021 15:33:28 +0000 (10:33 -0500)]
Bug 27907: Add support for circulation status 2 ( on order )

In Koha, we represent on order items by giving those items a notforloan
value less then zero. We can use this to implement circ status 02 ( on
order ) in for SIP.

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27907: Add unit test
Kyle M Hall [Wed, 10 Mar 2021 15:33:23 +0000 (10:33 -0500)]
Bug 27907: Add unit test

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27906: Add support for circulation status 9 ( waiting to be re-shelved )
Kyle M Hall [Wed, 10 Mar 2021 15:24:16 +0000 (10:24 -0500)]
Bug 27906: Add support for circulation status 9 ( waiting to be re-shelved )

In Koha, we can support circ status 09 in SIP by checking if the item's
location is "CART".

Test Plan:
1) prove t/db_dependent/SIP/Transaction.t

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27906: Add unit test
Kyle M Hall [Wed, 10 Mar 2021 15:22:54 +0000 (10:22 -0500)]
Bug 27906: Add unit test

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27883: (follow-up) Make label match input id
Owen Leonard [Tue, 30 Mar 2021 15:04:24 +0000 (15:04 +0000)]
Bug 27883: (follow-up) Make label match input id

This change alters the list of columns under "Preserve existing values,"
changing the label for each checkbox can be clicked to trigger the
checkbox change.

To test, apply the patch and refresh the patron import page. Expand the
"Preserve existing values" section and click any label in the list. The
corresponding checkbox should be checked.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27883: Add ability to preserve patron field from being overwritten by import
Kyle M Hall [Fri, 5 Mar 2021 14:13:34 +0000 (09:13 -0500)]
Bug 27883: Add ability to preserve patron field from being overwritten by import

Some libraries would like to be able to preserve particular fields for
existing patrons when overwriting them via the patron import tool.
Effectively, this means the specified columns of the CSV are used for
new patrons, but ignored for existing patrons.

Test Plan:
1) Create a patron CSV with one new patron, make the surname and
   firstname "Test1". Add a cardnumber so we can upload it again later.
2) Import the file
3) Change the firstname and surname in the CSV to "Test2"
4) Return to the patron import tool, choose to match on cardnumber,
   overwrite existing patrons, and preserve exiting firstnames
5) Import the file with these settings
6) Referesh the patron details for this patron, the patron's surname
   should still be "Test" while the firstname should now be "Test2"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26760: Escape URI parameters in redirect URI to paycollect.pl
Julian Maurice [Wed, 12 May 2021 08:24:30 +0000 (10:24 +0200)]
Bug 26760: Escape URI parameters in redirect URI to paycollect.pl

Also remove useless '%.2f' formatting of amount and amountoutstanding

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26760: Redirect to paycollect.pl when clicking on "Save and pay"
Julian Maurice [Wed, 21 Oct 2020 10:58:29 +0000 (12:58 +0200)]
Bug 26760: Redirect to paycollect.pl when clicking on "Save and pay"

Bug 14898 added the "Save and pay" button that redirects to "Make a
payment" tab after creating a manual invoice
This requires the user to click on another "Pay" button before being
taken to the real payment form.
By redirecting directly to paycollect.pl, this useless step will no
longer be needed.

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26340: Code simplification
Jonathan Druart [Mon, 12 Jul 2021 12:53:38 +0000 (14:53 +0200)]
Bug 26340: Code simplification

And rename $range with $barcode_length

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26340: (QA follow-up) Remove warns and set input fields hidden again
Katrin Fischer [Sat, 3 Jul 2021 20:22:35 +0000 (22:22 +0200)]
Bug 26340: (QA follow-up) Remove warns and set input fields hidden again

Removes traces of debugging.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26340: When printing labels from a barcode range, keep zero padding
Ivan Dziuba [Mon, 14 Jun 2021 18:41:14 +0000 (14:41 -0400)]
Bug 26340: When printing labels from a barcode range, keep zero padding

TEST PLAN:

1. Go  Tools > Label creator
2. Click +New -> Barcode range
3. Print barcode range with zero(s) in the start (Ex. from 00011881 to 00012000 )
4. Select a template to be applied:: Code à barre 48467
Select a layout to be applied: Code à barres
5. Export
6. Open PDF

The prefix is not displayed. We should see 00011881 on the labels, but we see 11881, 11882, ... without zeros in the start of labels.
This patch fix it.

Signed-off-by: hakam <hakam@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11879: DBRev 21.06.00.007
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 11879: DBRev 21.06.00.007

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11879: DBIC schema changes
Jonathan Druart [Mon, 12 Jul 2021 13:40:22 +0000 (15:40 +0200)]
Bug 11879: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11879: Remove primary_contact_method from REST API
Jonathan Druart [Mon, 12 Jul 2021 13:04:56 +0000 (15:04 +0200)]
Bug 11879: Remove primary_contact_method from REST API

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11879: Remove the 'unwanted' preferences from the main contact method pull-down...
Alexis Ripetti [Mon, 29 Mar 2021 14:03:40 +0000 (10:03 -0400)]
Bug 11879: Remove the 'unwanted' preferences from the main contact method pull-down menu in the OPAC

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11879: (follow up) Some fixes and code cleanup
Maryse Simard [Tue, 20 Oct 2020 15:56:42 +0000 (11:56 -0400)]
Bug 11879: (follow up) Some fixes and code cleanup

- Display the value in the patron detail page
- Adds support for BorrowerUnwantedField (staff)
- Removes unecessary code in opac/opac-memberentry.pl

Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11879: Add a new field to patron record: main contact method
Bin Wen [Wed, 18 Dec 2019 16:52:49 +0000 (11:52 -0500)]
Bug 11879: Add a new field to patron record: main contact method

This patch adds the "Main Contact Method" field in the borrower
modification form.

This field is useful for reporting purposes, or to
know which contact method to use first when trying to contact a borrower.

Test plan:
0) Apply patch
1) updatedatabase.pl
2) In the staff client, edit a patron's contact info. There should be a new dropdown select to choose the main contact method
3) In the opac page, edit the personal details.There should be a new dropdown select to choose the main contact method.
4) Save the form. It should work.

Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27948: (QA follow-up) Remove NewsChannels reference
Marcel de Rooy [Mon, 12 Jul 2021 07:47:34 +0000 (07:47 +0000)]
Bug 27948: (QA follow-up) Remove NewsChannels reference

We only need to remove the obsolete module here.
Note that the two NewsToDisplay calls were removed already.
Replaced by a KohaNews.get call.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27948: (QA follow-up) Correct empty branchcode
Marcel de Rooy [Fri, 2 Jul 2021 07:02:22 +0000 (07:02 +0000)]
Bug 27948: (QA follow-up) Correct empty branchcode

Let us just fix it here and leave the rest to bug 28650.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27948: (QA follow-up) Remove unused $disclaimer code
Marcel de Rooy [Fri, 2 Jul 2021 06:19:14 +0000 (06:19 +0000)]
Bug 27948: (QA follow-up) Remove unused $disclaimer code

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27948: (follow-up) Use Koha.news and PROCESS koha_news_block to bring disclaimer
Agustin Moyano [Fri, 2 Jul 2021 00:00:31 +0000 (21:00 -0300)]
Bug 27948: (follow-up) Use Koha.news and PROCESS koha_news_block to bring disclaimer

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27948: Add disclaimer to article request
Agustin Moyano [Wed, 26 May 2021 19:00:32 +0000 (16:00 -0300)]
Bug 27948: Add disclaimer to article request

If ArticleRequestsDisclaimerText news is set, a disclaimer text will appear before an article request can be made

To test:
1. apply patches
2. enable ArticleRequest syspref
3. in OPAC place an article request for a patron
CHECK => No disclaimer text should appear before placing article request
4. add a text in ArticleRequestsDisclaimerText news
5. repeat step 3
SUCCESS => A disclaimer text is shown before you can place an article request

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14237: DBRev 21.06.00.006
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 14237: DBRev 21.06.00.006

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14237: (follow-up) Make the routines exclusively take itemnumber, biblionumber...
Nick Clemens [Fri, 11 Jun 2021 19:17:27 +0000 (19:17 +0000)]
Bug 14237: (follow-up) Make the routines exclusively take itemnumber, biblionumber, or ci_id

This patch changes the parameters for several of the CourseReserves routines to take a single
identifier exclusively.

Following the existing pattern we simply return if the params are incorrect

This patch also:
removes an unused 'title' variable
adds a prefetch to save some db calls where we fetch related objects
adjusts tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14237: Set course_items.biblionumber in the DBrev
Jonathan Druart [Fri, 7 May 2021 07:22:50 +0000 (09:22 +0200)]
Bug 14237: Set course_items.biblionumber in the DBrev

We need to create the new column without the NOT NULL clause, set the
correct values, then add the NOT NULL clause.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14237: Tests
Aleisha Amohia [Sun, 14 Mar 2021 20:15:32 +0000 (09:15 +1300)]
Bug 14237: Tests

Confirm all tests pass: t/db_dependent/CourseReserves/CourseItems.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14237: Schema updates
Aleisha Amohia [Tue, 2 Feb 2021 21:04:30 +0000 (10:04 +1300)]
Bug 14237: Schema updates

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14237: Database updates
Aleisha Amohia [Tue, 2 Feb 2021 21:01:15 +0000 (10:01 +1300)]
Bug 14237: Database updates

This patch adds a biblionumber column to course_items, adds a
relationship between course_items.biblionumber and biblio.biblionumber,
and changes course_items.itemnumber to allow null values.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14237: Add individual bibliographic records to course reserves
Aleisha Amohia [Wed, 3 Feb 2021 00:03:31 +0000 (13:03 +1300)]
Bug 14237: Add individual bibliographic records to course reserves

This feature allows a patron to add bibliographic records to course
reserves. They can be added individually or in a batch. The courses that
have reserved this record will also show on the record's detail page.

To test:
1) Update database, refresh schema, and restart services
2) Enable the system preference UseCourseReserves
3) Set up a couple of biblios and a couple of items (attached to
    different biblios)
4) Go to Course Reserves and add a new course
5) Click Add reserves and put something in both the barcode field and
biblionumber field. Click submit and confirm you get an error.
6) Add a barcode in the barcode field and submit. Confirm the item is
reserved for the course as expected.
7) Add a biblionumber in the barcode field and submit. Add notes and
Save. Confirm the record is reserved for the course as expected and the
notes are saved correctly.
8) Edit the record-level course reserve that you just added. Confirm the
correct record shows and any edits save as expected.
9) Go back to the course and try removing reserves. Use both the Remove
action button for individual reserves and the Remove all reserves
button. Confirm both work as expected.
10) Go to Batch add reserves and put something in both the barcodes
field and biblionumbers field. Click submit and confirm you get an
error.
11) Remove the barcodes and put some biblionumbers in the biblionumbers
field. Add notes and Submit. Confirm the records are all added as
expected.
12) Click on one of the biblios that has been reserved for the course.
Confirm that the course shows under 'Courses that have reserved this
title' on the biblio detail page.
13) Go back to the course and click Add reserves. Try and add a
biblionumber that is already reserved. Confirm it detects that the
biblio has already been reserved.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28644: Fix calling borrowernumber on undefined value
Marcel de Rooy [Thu, 1 Jul 2021 14:13:05 +0000 (14:13 +0000)]
Bug 28644: Fix calling borrowernumber on undefined value

If the hold is not found (e.g. already cancelled), we should
return earlier without crashing:
    Can't call method "borrowernumber" on an undefined value at /usr/share/koha/C4/Reserves.pm line 521
    (Note: line number from 19.11)

Test plan:
Run t/db_dependent/Reserves.t
Add a hold, go to user menu with holds in OPAC.
At the same time, cancel this hold from staff.
Now click the Cancel in OPAC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28483: Remove warnings from Search.t
Tomas Cohen Arazi [Tue, 22 Jun 2021 19:41:55 +0000 (16:41 -0300)]
Bug 28483: Remove warnings from Search.t

There are too many warnings about uninitialized variables in Search.pm.
This patch deals with that, the same way it is dealt accross the file:
by setting an empty string when things are not defined.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Search.t
=> FAIL: Wow, too many warnings. Some related to this bug, some not.
2. Apply this patch
3. Repeat 1
=> SUCCESS: No more warnings!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28673: Add missing ampersand to amp; construction
Marcel de Rooy [Wed, 7 Jul 2021 12:38:48 +0000 (12:38 +0000)]
Bug 28673: Add missing ampersand to amp; construction

Super trivial one character fix ;)

Test plan:
Open Your Lists from the button on main page.
Click again on Your lists under Lists in the middle of the form.
Verify that the URL does no longer show something like:
    op=listamp;category=1

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>