Commit graph

43602 commits

Author SHA1 Message Date
e6e4d74b0f Bug 27360: Use 'public' to filter libraries for opac display
This patch adds the ability to set a library as 'public' or not; this
allows librarians to hide back office library branches from the opac.

Test plan
1/ Set a library as public from `admin > libraries`.
2/ Navigate to the `Libraries` page in the OPAC
3/ Note that only `public` libraries are displayed.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
568733d1a6 Bug 27360: DBIC Build
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
06d4a1f982 Bug 27360: Add public field to branches table
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
d85ada469a Bug 25883: (follow-up) Update columns_settings
Replace 'holdinglibrary' with 'transferlibrary' in checkedin
columns_settings description.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
dcf93633b3 Bug 25883: Replace 'holdingbranch' with 'transfer to' in returns
This patch replaces the "Holding library" column in the returns table
with a 'Transfer to' column that displays the destination for the item
awaiting transfer if a transfer exists.

Signed-off-by: Ben Daeuber <bdaeuber@fargolibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
064933165b Bug 27173: Add tests
Test plan:
Run t/db_dependent/Koha/Plugins/authority_hooks.t

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>
2021-11-03 15:40:52 +01:00
e366d0d1dd Bug 27173: Add plugin hooks for authority record changes
2021-09-28 Updated version

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2021-11-03 15:40:52 +01:00
404e6d901f Bug 28474: Pass process_message_queue.pl params to before_send_messages plugin hooks
It would be useful to send most of the process_message_queue.pl script parameters to any plugin before_send_messages hooks. For example, the Twilio Voice plugin uses before_send_messages to send phone messages, but if the script is called with "-t email", it doesn't know and will make phone calls! If that info were passed in, the plugin could be made aware of it and only make calls if no "-t" or a "-t phone" were set in the parameters.

Test Plan:
1) Apply this patch
2) Install Kitchen Sink plugin v2.2.0 or later
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases/download/v2.2.0/dev-koha-plugin-kitchen-sink-2.2.0.kpz
3) Run misc/cronjobs/process_message_queue.pl with any or all non-email
   related paramters
4) Note the plugin output shows the parameters were passed to the plugin

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Katrin Fischer
aa2d8b024f Bug 24406: Wrap patron category type code in a span on patron search results
The patron category type code (A, C, O, ...) is currently displayed in the
patron module search and the patron card creator and acquisition patron searches.

This information is not useful for most users, as these are internal codes
that cannot be easily "decoded". And while you might be able to guess A as
Adult in English, it doesn't translate to other languages.

This patch wraps a span around the patron category type code shown
in () after the patron category.

To test:
- Verify for each of the following three searches, that the patron category code
  displays in the search results, but is wrapped in a span with the class
  patron_category_type
- Tools > Patron card creator
  - New > New card batch > Add patrons
  - Search for patrons
- Patrons
  - Search for patrons
- Acquisitions
  - Add a budget
  - Add a fund for the budget
  - Search for a user or owner to add

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>
2021-11-03 15:40:52 +01:00
37005486d3 Bug 28417: Don't require C4::Auth_with_cas from opac-user if not needed
Note that without the use URI::QueryParam statement in C4::Auth we get:
Can't locate object method "query_param_delete" via package "URI::_generic" at /kohadevbox/koha/C4/Auth.pm line 1254

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
e0931d1004 Bug 28417: (follow-up) Fix typo
- There are CAS demo servers, pick one [1]
- They all seem to have the same user/pass as of writing this:
  User: casuser
  Password: Mellon

To test:
1. Enable CAS and all related preferences. I chose v3 or higher, it only affects the logout action.
2. Set the CAS URL: https://casserver.herokuapp.com/cas (note that if you click on any of the examples, they include a trailing /login, don't put it).
3. Generate a Koha user, with userid: casuser (I also used that for cardnumber, just in case). Set no password to the user, or its irrelevant anyway. Add it stff permissions.
4. Open your Koha OPAC, I use KTD thus:
   http://kohadev.myDNSname.org:8080
5. Try to login using CAS
=> SUCCESS: You are redirected to the right login page
6. Login using casuser/Mellon as advertised in the 'demos' site.
=> SUCCESS: You are logged in!
7. Now logout
=> SUCCESS: You are sent to CAS so they know you wanted to logout (if you enabled CAS logout)
8. Repeat on the staff interface.
=> SUCCESS: Things work!
9. Apply this patches, restart all the things:
   $ restart_all
10. Repeat all in OPAC and admin interfaces
=> SUCCESS: Things work!
11. Sign off :-D

[1] https://apereo.github.io/cas/Demos.html

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
bf1c4c2431 Bug 28417: Don't use C4::Auth_with_cas if CAS is not used
We should follow the same pattern as ldap and not use C4::Auth_with_cas
if the cas syspref is not turned on.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Johanna Raisa
b3adc5de90 Bug 27375: Set YAML file settings in .editorconfig
To test:
1) Start an editor that supports .editorconfig.
2) Open YAML file mappings.yaml for example.
3) Format the file.
4) Observe that nothing changes.

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
320b162827 Bug 28879: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Andrew Isherwood
b286d9be41 Bug 28879: Fix display of request metadata
This commit adjusts the CSS surrounding the display of request
metadata, it improves the display for metadata with long key names.

Test plan:

- Do not apply patch
- Create a FreeForm ILL request with a custom metadata field with a long
  name
- View the created request
- Observe that the long metadata name breaks the display of the metadata
- Apply the patch
- View the created request
  => TEST: Observe that the display is no longer broken

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Andreas Jonsson
8605082a78 Bug 26402: Add --framework parameter to commit_file.pl
This patch adds the option to pass a frameworkcode to the commit_file.pl
script.

To test:
1. Stage a MARC file using stage_file.pl.  For instance using the devbox:

   cd ~/kohaclone
   sudo koha-shell -c 'perl misc/stage_file.pl --file t/db_dependent/www/data/marc21record.mrc' kohadev

2. Note the assigned batch number and commit the batch using --framework parameter to commit_file.pl.  For example using the devbox:

   sudo koha-shell -c 'perl misc/commit_file.pl --batch-number 1 --framework ACQ' kohadev

3. Verify that the framework code was correctly assigned:

   sudo koha-mysql kohadev -e 'SELECT frameworkcode FROM biblio ORDER BY timestamp DESC LIMIT 1;'
=> SUCCESS: It picked it

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
e44b4837f5 Bug 28973: Improve Koha::Patron::can_see_patron_infos efficiency
The method can_see_patron_infos looks up a row in the branches table by branchcode just to get the branchcode it already has. This seems inefficient.

Test Plan:
1) Apply this patch
2) No changes should be noted

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
2f4d5954c9 Bug 28365: (Bug 19873 follow-up) Make it possible to search on value 0
Bug 19873 fixed search with value 0.
It works in first page but not in other pages.

This patch fixes query_cgi var.

Test plan:
  - create a st-numeric index in zebra conf related to
    a numeric field
    i.e:
    yourindex 1=yourindex 4=109
  - fill a field with 0 in several biblio records,
  - reindex your biblios,
  - search yourindex=0 and go to second page of results,
  - should not work,
  - apply this patch,
  - test again,
  - should work

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
e9a68f9f7d Bug 28365: Add unit test
Run prove t/db_dependent/Search.t

Without fix you get error :
    #   Failed test 'buildQuery should keep 0 value in query_cgi'
    #   at t/db_dependent/Search.t line 670.
    #          got: 'idx=su%2Cphr'
    #     expected: 'idx=su%2Cphr&q=0'

This patch also adds a test for query_desc in case it is broken in the
future.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Joonas Kylmälä
9ead068920 Bug 29380: Correct table name in joins to prevent errors
The commit "Bug 29290: Rename relationships borrower =>
patron" (d46492ac23) renamed the relation for the borrowers table from
'borrower' to 'patron' but the joins were not updated accordingly so a
few scripts got broken.

To test:
 1) Notice that
    $ perl misc/cronjobs/automatic_renewals.pl -c -s -v
    returns 255 error code on exit
 2) Apply patch
 3) Notice the automatic_renewals.pl works now and exit code is 0
 4) Make sure /cgi-bin/koha/tools/batch_extend_due_dates.pl works.
 5) Try to grep for 'borrower' in Koha source code and see if there
    are any other join done using the Koha::Checkout or
    Koha::Old::Checkout objects.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 29380: (follow-up) Fix renewal feature in staff interface

The commit "Bug 29290: Rename relationships borrower =>
patron" (d46492ac23) renamed the relation for the borrowers table from
'borrower' to 'patron' but the usage in the renew.pl script was not
updated.

To test:
 1) Try to renew a book in intranet through the renewal tab
 2) Notice it gives error
 3) Apply patch
 4) Notice the error is now gone

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Johanna Raisa
35c279ac59 Bug 28236: Allow access to json files from apache config
This patch grants json files from koha-tmpl. Otherwise systempreferences won't be able to fetch them.

TEST PLAN:

1) Try to set systempreference BorrowerUnwantedField.
2) The modal is empty.
3) Modify Apache configurations like in this patch.
4) Try again set the systempreference.
5) The modal should show list of parameters.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

JD Amended patch: replace tab characters and reword commit title

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
eb017ee239 Bug 24850: Correctly handle suspended_until for PUT
if we are passing suspended_until to the body, it should be a rfc3339 (what the spec is expecting)
but $hold->suspend_until will be iso

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
9d1ad49ec9 Bug 24850: Date only are not RFC3339
We removed the fallback on 'Bug 24850: Don't fallback when date_format
is passed', and the dates passed for date only (YYYY-MM-DD) are not
RFC3339 formatted but ISO8601.
We must assume that all dates will be YYYY-MM-DD, without fallback.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
9c718e18da Bug 24850: suspended_until is a date-time
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>
2021-11-03 15:40:52 +01:00
5da73b604f Bug 24850: Fix api/v1/holds.t
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
54fa48b139 Bug 29395: use EXPORT_OK from Koha::Patron::Debarments
Missed from bug 17600.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
4f57531d14 Bug 29261: (bug 15812 follow-up 3) Fix translation issue in include file
This is getting messy. No idea how I tested the previous patches but it
was not working, the problem still persisted.

This patch is using the I18N TT plugin to make things easier and fix the
original problem.

Test plan:
Apply the patch
perl translate update fi-FI
Edit misc/translator/po/fi-FI-messages.po
Locate and translate "Check out"
 61 #: koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt:20
 62 msgid "Check out"
 63 msgstr "Laina"
Locate and transate "View"
 182 #: koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt:22
 183 msgid "View"
 184 msgstr "Nayta"
Apply the change to the fi-FI templates
perl translate install fi-FI

Now enable the fi-FI in the lang syspref, search for patron and confirm
that the result view is displayed correctly.
Note that the "Check out" and "View" strings are correctly translated
(when you hover the cardnumbers or patron's names)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
fab97c6d38 Bug 28901: (follow-up) Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 13:36:04 +01:00
e4a05feef3 Bug 28729: Additions to POD
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
7130f7d4ed Bug 28729: Unit tests
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>
2021-11-02 16:50:01 +01:00
3955815a47 Bug 28729: Make Koha::Email->send_or_die handle returnpath
Koha used to rely on Mail::Sendmail for sending emails. As an SMTP
client, the library would extract the from address from the Sender
header to pass along in the MAIL FROM: field of the SMTP protocol [1].

This was overlooked when we moved to Email::Stuffer/Email::Simple and
there's a different behavior as it expects the envelope to be passed and
falls back to extracting the 'From' header when said envelope is not
found [2].

This patchset re-introduces the behavior from Mail::Sendmail by
overriding the send_or_die method locally (in Koha::Email) and doing the
right thing.

Unless an explicit {from} parameter is passed, it extracts the MAIL FROM
envelope from the Sender header, as Mail::Sendmail did, and calls
$self->SUPER::send_or_die with the right parameters.

To test:
1. Apply the unit tests
2. Run:
   $ kshell
   k$ prove t/Koha/Email.t
   => FAIL: Sender is not handled correctly!
3. Apply this patch
4. Repeat 2
   => SUCCESS: Tests pass!
   The from parameter is correct!
   No Sender header sent!
5. Sign off :-D

[1] https://metacpan.org/dist/Mail-Sendmail/source/lib/Mail/Sendmail.pm#L284
[2] https://metacpan.org/pod/Email::Sender::Manual::QuickStart#envelope-information

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

AMENDED (SHORTENED)
-        my @headers = $self->email->header_str_pairs;
-        foreach my $pair ( pairs @headers ) {
-            my ( $header, $value ) = @$pair;
-            $args->{from} = $value if $header eq 'Sender';
-        }
-
-        # Remove the Sender header
-        $self->email->header_str_set('Sender');
+        $args->{from} = $self->email->header_str('Sender');
+        $self->email->header_str_set('Sender'); # remove Sender header

Tested with same results (scrambled domains):
From: noreply@mydevserver.com
Cc: marcel@email.nl
To: test@somewhere.nl
Reply-To: bieb@mydevserver.com
Return-Path: postmaster@mydevserver.com

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
b2e4b90f99 Bug 28904: Fix typo and display
Fix typo in template: Newletter => Newsletter
Fix latest newsletter editor definition.. it's a has not an array.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
9d242cd259 Bug 28904: Update team list to include newsletter editors
It seems we stopped recording the newsletter editor as part of the team
for a while :(.

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>
2021-11-02 16:50:01 +01:00
b6c1fbb08a Bug 28904: Add newsletter editor to about page display
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>
2021-11-02 16:50:01 +01:00
036d7bd428 Bug 29329: Remove stray character in opac-detail.tt
1. Have  OpacBrowseResults on.
2. Make search with many results.
3. Go to the record detail page
4. Click 'Browse results'
5. At the bottom of the container notice the stray "s".
6. apply patch
7. Try again, the "s" is gone!

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>
2021-11-02 16:50:01 +01:00
David Gustafsson
2666f34b0c Bug 27884: Add tests
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>
2021-11-02 16:50:01 +01:00
David Gustafsson
6a45b3d2dc Bug 27884: Add html support for report mails
To test:
1) Create a new notice, for example with Koha module "Patrons",
   name/code TEST and message body "<strong>testing<strong>".
2) Create a new sql report, the query could be someting like:
   SELECT "<number>" as `borrowernumber`, "to@example.com", as `email`, "from@example.com" as `from`;
   where "<number>" is a valid borrowernumber.
3) Run patron_emailer.pl --report=<id> --notice=TEST --module=members -commit
   where <id> is the report id.
4) Check the message_queue table that the content_type column has been
   set to text/html; charset="UTF-8".
5) Ideally process the message queue and veriy that the sent email is displayed
   as rendered html.
6) Run tests in t/db_dependent/Reports/Guided.t

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>
2021-11-02 16:50:01 +01:00
Maryse Simard
2ef3556548 Bug 25459: Makes barcode position respect units in patron cards layout
When using any unit besides postscript points, barcode positionning
doesn't work correctly. There is an error in the calculation: the unit
factor must be applied to the individual card part only and not to the
full page position.

This patch moves the unit part of the calculation to the right place.

To test :
1. Create a working patron card setup, using postscript points:
    card template, layout and card batch. Use barcode and at least
    one other element (text or images) in the layout.
    => Some tips for testing:
        - activate guides for the layout
        - use a template and a batch containing more than one card; the
        displacement will be different for each card and depend on the
        barcode position relative to the bottom left of the entire page.
2. Change units from postscript points to any other unit.
    => At least for the layout, but changing it in the template will
    scale the page as well.
4. Export the card batch.
3. Note the guides are scaled to fit the new unit and the lower left
corner of text and images are still correctly placed relative to the
guides, but the barcode is not.
    => In some cases, the barcode even seem to not print at all since
    it's new coordinates are out of screen.
4. Apply patch.
5. Generate the batch again.
6. Note the barcode now appears exactly where it should.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
080197d175 Bug 28263: DBRev 21.06.00.040
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
Joonas Kylmälä
f831175338 Bug 28263: (QA follow-up) Use new atomicupdate code style
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
3a722d8147 Bug 28263: Fix too_many auto renewal message
To test:
1. Make an item eligible for auto_renewal.
2. Set circ rule so only 1 auto_renewal is allowd.
3. Run auto_renew once, get a successful message.
4. Run it again and get the too_many error "You have reached the maximum number of checkouts possible."
5. This has nothing to do with the number of checkouts
6. Apply patch and updatedatabase.
7. Do 1-4 again.
8. Message is now "You have reached the maximum number of renewals possible."

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
51f42b8734 Bug 29356: Pickup location dropdowns should perform 'contains' searches
When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville.

On the Libraries page in Admin, however, the search box both left- and
right-truncates, so one can type "en" and find Centerville.

This patch makes the search perform 'contains' searches.

To test:
1. Try placing a hold. Make sure your rules allow Centerville to be a
   valid pickup location.
2. Search 'cen'
=> SUCCESS: Centerville shows
3. Search 'en
=> FAIL: Centerville doesn't show
4. Apply this patch and reload
5. Repeat 2
=> SUCCESS: Works!
6. Repeat 3
=> SUCCSS: Centerville shows!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
413d882488 Bug 29355: Make pickup location dropdowns RESTdefaultPageSize agnostic
This patch makes the select2 dropdowns for pickup locations not be
limited to the RESTdefaultPageSize syspref limit.

To test:
1. Have less than 20 libraries in your system as valid pickup locations
2. Place a hold via the staff client
=> SUCCESS: See that all your libraries appear in the pickup location dropdowns at the bib and item level
3. Update RESTdefaultPageSize, set the value to something lower than your count of pickup libraries
4. place another hold
=> FAIL: Your pickup location list gets cut off and only shows as many locations as RESTdefaultPageSize allows
5. Apply this patch
6. Repeat 4
=> SUCCESS: All your pickup locations show
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2021-11-02 16:50:01 +01:00
07464b53ed Bug 29351: Add missing cn_source parameter to reports parameter menu
This patch adds an option to insert "Source of classification or
shelving scheme" as a runtime parameter in SQL reports. The ability to
use cn_source as a parameter seems to have always been part of this
feature but wasn't documented.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select
   "Classification source."
 - Customize the parameter label if you wish and click "Insert
   parameter."
 - The parameter should be inserted like this:

   <<Source of classification or shelving scheme|cn_source>>

 - Use it to create a valid SQL report, for example:

   SELECT * FROM items WHERE cn_source = <<Source of classification or
   shelving scheme|cn_source>> LIMIT 10

 - Confirm that upon running the report you are prompted to select a
   classification source.
 - Confirm that the report runs correctly.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
ca6c81ec5c Bug 29352: Runtime parameter labels should not be said to be optional
This patch alters the form shown when using the "Insert runtime
parameter" button in SQL reports. It makes the label field required and
removes "optional" from the field hint.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select "Authorized
   value."
 - Clear the "parameter label" field and click "Insert parameter."
 - The form should display an error asking you to fill in the label
   field.
 - Test that the category field is also required.
 - Close the modal and select a different runtime parameter.
 - Test again that the label field is required.
 - Test that the form submits correctly when the label field is
   populated.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
c0a000d5df Bug 29328: Add missing list parameter to reports parameter menu
This patch adds an option to insert "list" as a runtime parameter in SQL
reports (As added by Bug 27380).

To test, apply the patch and go to Reports -> Create from SQL.

- Click the "Insert runtime parameter" button and select
  "List."
- Customize the parameter label if you wish and click "Insert
  parameter."
- The parameter should be inserted like this:

  <<List of values|list>>

- Use it to create a valid SQL report, for example:

  SELECT * FROM borrowers WHERE categorycode IN  <<List of values|list>>
  LIMIT 10

- Confirm that upon running the report you are shown a textarea. Enter
  two or more values in the textarea, each on a separate line.
- Confirm that the report runs correctly. The SQL above would show you
  this when you click "Show SQL code":

  SELECT * FROM borrowers WHERE categorycode IN  ('A','S')  LIMIT 10

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
e9c4fe3d9f Bug 29242: Flatpickr - Should autocomplete be turned off?
This patch adds a step to Flatpickr initialization to add an
autocomplete attribute set to "off" so that browsers' built-in
autocomplete menus do not obscure the calendar.

To test you must be using a browser which has form history enabled.

Locate a form that includes a Flatpickr input field, e.g.  Reports
-> Catalog statistics.

Fill the date fields and submit the form. Go back to the form and click
one of the form fields you previously filled out (once in Chrome, twice
in Firefox). The browser should not show its native form history
dropdown.

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>
2021-11-02 16:50:01 +01:00
9210f71836 Bug 28901: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
2de22db29c Bug 28901: showCart incorrectly calculates position if content above navbar
This patch makes changes to the OPAC Cart's CSS and JS so that the cart
pop-up message display more consistently. The CSS is changed to use
position "fixed" instead of "absolute." This allows the message to
display without recalculating the position every time, and keeps the
appearance we expect.

The z-index of the message is also increase to prevent it from being
hidden behind a floating toolbar.

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).

 - Perform a catalog search in the OPAC which will return multiple
   results.
 - In the list of search results, click the "Add to cart" link next to
   several search results. Each time you should see a message appear in
   the upper left corner of the screen, "The item has been added to the
   cart."
 - The position of the messages should be consistent no matter how far
   down the page you scroll.
 - Test again after adding content to the OpacHeader region. One way to
   do this is to add the following to the OpacUserJS preference:

   $(document).ready(function(){
     $("#wrapper").prepend('<img src="https://generative-placeholders.glitch.me/image?width=900&height=200&style=triangles&gap=30">');
   });

 - Test at various browser widths, from a phone-sized screen width up to
   wide desktop-sized.

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>
2021-11-02 16:06:51 +01:00
60e60cad6e Bug 28910: Correct eslint errors in OPAC basket.js
This patch corrects eslint errors in the OPAC copy of basket.js:
Indentation inconsistencies, undeclared variables, unused functions,
etc.

To test, apply the patch and test the "Cart" functionality in the
OPAC:

- In the OPAC, add an item to the cart.
- A popup message should appear telling you the item has been added.
- The "Add to cart" link should update to read "In your cart."
- The count if cart items in the header should be updated.
- The "In your cart (remove)" link should work correctly.
- Test this process from both the search results and
  detail pages.
- Open the cart.
- The cart should open correctly.
- In the cart, test all the controls:
  - More details
  - Send
  - Download
  - Empty and close
  - Hide window
  - Print
  - Select all / clear all
  - With checked items:
    - Remove
    - Add to list
    - Place hold
    - Tag

The following unused functions were removed: readCookieValue,
AllAreChecked, SelectAll, and quit. A search of the Koha codebase should
return no results from the opac-tmpl directory.

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>
2021-11-02 16:06:51 +01:00