If Today is clicked when we only allow dates in the past and today/now,
we should select the current date/time
We need to update the maxDate to make it up-to-date, or the maxDate may
be set to the minute before and clicking Today will blank the input.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
This patch adds some CSS to _flatpickr.scss in order to give a deafult
style to the "yesterday," "today," and "tomorrow" controls added by the
shortcut plugin.
A missed translatable string is now wrapped in the __() function:
__("or").
The patch also updates the date calculation for those shortcuts to use
Flatpickr's date calculation shorthand. This isn't strictly necessary
but I think it makes the code more readable.
To test, apply the patch and build the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
In the staff client, view some pages with date-picker widgets. A
calendar widget time selection:
- Circulation -> Check out -> Checkout settings -> Select date:
- The calendar widget should have "yesterday," "today," and "tomorrow"
controls styled like links appearing after the time selector. The
controls should be centered, with the "or" label on the same line.
A calendar widget without time selection:
- Tools -> Log viewer -> Display from.
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>
It's not implemented, looks like we need to use a plugin for that
https://github.com/flatpickr/flatpickr/issues/576https://github.com/jcsmorais/shortcut-buttons-flatpickr
Test plan:
Confirm that flatpickr instances now have a yesterday, today and
tomorrow buttons.
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>
Bug 29241 was supposed to fix this but it didn't properly.
We are accepting other dates in the past when we should only accept the
original one (the one from the DB) AND dates in future.
Test plan:
Retry test plan for 29241 and confirm that you cannot set manually another
date in the past.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes a few corrections, including adding the
correct Flatpickr date format option when the timepicker is enabled.
Besides past and future date options, I've added a "pastinclusive"
option which allows dates in the past OR today. This option was
previously applied to the checkin page.
The patch also corrects a couple of places where the wrong date field
was modified with the new data attributes.
To test, apply the patch and test the datepickers on the batch checkout
and renew pages. When you select a date and time the "TimeFormat" system
preference should be correctly applied.
The calendar widget on the checkin page should allow you to select
today's date.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We must reduce the instantiations as much as possible to take advantages
of the default values and specific behaviours we have defined in
calendar.inc
This patch is suggesting to have a .flatpickr class and using the data
attributes:
- flatpickr-futuredate
- flatpickr-pastdate
- flatpickr-enable-time
- flatpickr-on-close-focus
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
search_field.weight is of type NUMERIC(5,2) in the database, and values
are rendered as floats in /admin/searchengine/elasticsearch/mappings.pl
But the field validation only accepts INTs. This patch fixes the pattern
to accept NUMERIC(ish) values
- Enable Elasticsearch (but no need to actually index anyting)
- go to cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
- Enter an integer (eg "8") into any "weight" column and click save
- Koha now displays the value as NUMERIC, eg. "8.00"
- Change nothing, and click save again
- Save does not work, you get a warning by the browser that the input
does not match the requested format (because in the html field only
ints are allowed, but the DB stored the value as numeric and returns
it as such)
- Workaround: Change all the values back to ints (i.e. remove ".00"),
but this is very cumbersome if you have several weights
- Apply the patch
- Now try to save again (without changing eg "8.00" to "8". It works
- Add a new weight (eg "4"), save, it's turned into "4.00", but saving
again still works
Sponsored-by: Steiermärkische Landesbibliothek
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>
We now have some tests for BreedingSearch.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The code in the script and the module attempt to determine whether a term is an isbn, or not. Rather
than try to do this, we can simply search it on the three fields: isbn, title, author
Additionally, we should search as any of the ISBN variations to broaden our matches
Note: Curently only an ISBN 10 is stored in import biblios, so for an ISBN13 that doesn't convert
the value will be blank - this is another bug
To test:
1 - Perform a cataloging search for a valid ISBN 13 with no ISBN10 counterpart:
9798200834976
2 - 500 error
3 - Apply patch
4 - Repeat, no results
5 - Import some records
6 - Search by title/author/isbn
7 - Confirm searching works as expected
WNC amended to fix spelling
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
AMENDED: Useless call of ISBNs (plural) when you only pass one parameter.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
This was missed when initially adding the notice.
To test:
- Go to Administraiton > patron categories
- Edit a patron category and check "Hold reminder" in messaging
preferences, save.
- Go to the overview page and verify it shows as 'Unknown'.
- Apply patch.
- Descrpition should now display.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The new message appears in the list on the edit view, but the list view
is showing "unknown"
Test plan:
Set AutoRenewalNotices to "according to patron messaging prefs"
Edit a patron category
Tick all the checkboxes
On the category list view you should see a correct display in the
"Messaging" column
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We dropped it on bug 12561 when removing the non-XSLT view. This feature
has never been implemented for XSLT views and the pref must then be
removed.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To test:
1) go to the main page of Koha and search in the "Check out" search window type "näyttö".
2) see that umlauts got replaced with replacement characters.
3) apply the patch.
4) repeat 1-2, ensure that umlauts displayed correctly and are not getting replaced with replacement characters.
JK: remove period from commit title
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Can't locate object method "new" via package "Koha::BackgroundJob::BatchUpdateBiblio" (perhaps you forgot to load "Koha::BackgroundJob::BatchUpdateBiblio"?) at t/db_dependent/Koha/BackgroundJobs/BatchUpdateBiblio.t line 45.
How did it pass at signoff?
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
If an exception is raised by one the methods/subroutines called when batch biblio update, the job will fail in the middle and some records won't be processed.
Test plan:
0. Don't apply the patch
In KTD you can run the a batch mod biblio on the 100 first records and
the worker will fail with
"""
countered object 'C4::Biblio::_koha_modify_biblioitem_nonmarc(): DBI Exception: DBD::mysql::st execute failed: Data too long for column 'lccn' at row 1 at /kohadevbox/koha/C4/Biblio.pm line 423
', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /kohadevbox/koha/Koha/BackgroundJob/BatchUpdateBiblio.pm line 120.
"""
The UI is not saying anything about this problem.
Generate 100 biblionumbers: perl -e 'for (1..100){print "$_\n"}'
1. Apply the patch and confirm than now you see the detail of the batch
update and that biblionumber 72 is marked as not been modified with the
correct error (raw DBI error)
JK: add executable bit to BatchUpdateBiblio.t
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Behave like the statistics table and don't remove the code even if the
branch or patron's category is removed.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The validation of the forms were blocked with "X item mandatory fields
empty" when at least one dropdown list subfield was marked as mandatory.
We need to add the 'input_marceditor' class to the select (does it
actually make sense? select vs input...)
Caused by
commit 6ed29bccef
Bug 27526: Fix mandatory and important checks
Which lamentably failed as it was stating:
"Using .input_marceditor let us fix the additem.tt form and prevent to break the other ones"
Signed-off-by: Marion Durand <marion.durand@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Since one of the patches of BZ 27526 (Bug 27526: Fix mandatory and
important checks), CheckMandatorySubfields use the class
"input_marceditor" but in file serials-edit.tt this class is not set for
all field (it is present on text input but not on select input) 5
9- Check that no error appear and that your item has been created.
In consequence if a select field is set as mandatory, it is detected as
missing even if it is filed and so you can't submit the form and receive
the new serial.
Test plan:
0- Be sure to be in a version of koha where the patch that introduces
the bug is present (it is present in master since Jul 8 2021 (it is
present in 21.06.00.046) and will be pushed in 21.11.00)
1- Create (or find) a subscription for a biblio record and select the
option "Create an item record when receiving this serial"
2- Be sure to have at least one mandatory subfield that is filed with a
select input in the framework used by the biblio record. (ex: 995$b,
995$c or 995$e in unimarc; 952$a, 952$b or 952$c in marc21)
3- From the subscription-detail page click on "Receive"
4- Change the status to "Arrived" and fill the item form that appears.
5- Click on "Save"
6- Check that an error box appear with the message " Form not submitted
because of the following problem(s) 1 mandatory fields empty
(highlighted)" (the number can be different according to the number of
concerned subfields)
7- Apply the patch
8- Repeat step 3 to 5
9- Check that no error appear and that your item has been created
JD amended patch: remove comma to separate classes
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
It was defaulting to 12:00 which was an unexpected change in behaviour
caused by flatpickr switch.
Test plan:
On the circulation view, check some items out and play with the time
part and "Remember for session". The behaviour must be correct, ie. the
same as prior to flatpickr switch.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Usage: POSIX::exit(status) at /kohadevbox/koha/tags/review.pl line 72. at /usr/share/perl/5.28/Carp.pm line 289
Carp::croak('Usage: POSIX::exit(status)') called at /usr/lib/x86_64-linux-gnu/perl/5.28/POSIX.pm line 22
POSIX::usage('exit(status)') called at (eval 2066) line 3
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Test plan:
Run t/db_dependent/Log.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Fix the bug where object is first stringified and then tested for
being a Koha::Item.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Trivial add. Reads much better. And might help future diffs.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To make sure we have logging the values from DB.
It will reduce DB action_log table size when we log the full object and
it contains DateTime object.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Since bug 19185, and Koha_Master running the tests after t/db_dependent/selenium/01-installation.t is ran, t/db_dependent/selenium/administration_tasks.t is failing randomly with:
12:32:59 koha_1 | STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
12:32:59 koha_1 | /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
12:32:59 koha_1 | (eval 1710):1 in Selenium::Remote::Driver::__ANON__
12:32:59 koha_1 | (eval 1712):2 in Selenium::Remote::Driver::__ANON__
12:32:59 koha_1 | /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
12:32:59 koha_1 | /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:1340 in (eval)
12:32:59 koha_1 | /kohadevbox/koha/t/lib/Selenium.pm:170 in Selenium::Remote::Driver::find_element
12:32:59 koha_1 | t/db_dependent/selenium/administration_tasks.t:188 in t::lib::Selenium::click
I don't recreate it locally.
The screenshot of the failure shows that the screen is still on the authorised value list view.
This does not make a lot of sense, but I am failing to find a logic
here.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
# Failed test 'Identify - earliestDatestamp in the right format'
# at t/db_dependent/OAI/Server.t line 182.
# Compared $data->{"Identify"}{"earliestDatestamp"}
# got : '2021-11-15T13:16:09Z'
# expect : '2014-05-07T13:36:23Z'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds some JSDoc formatted parameter documentation for the
kohaTable function.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch goes through the codebase and updates existing revelant calls
to .api referencing the Koha REST dataTables wrapper to use the name
name 'kohaTable'.
Test plan.
1) Ensure the tables on the following pages all continue to work as
expected
a) acqui/parcel
b) admin/branches
c) admin/cities
d) admin/smtp_servers
e) pos/register
f) tools/quotes
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch renames the Koha REST JS dataTables wrapper from the
ambigious 'api' to the clearer 'kohaTable'.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch just adds the 'date' format string to ensure we are
validating the input/output of the date_renewed field correctly.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This reads better when converted to regular if.
Note that last within such a block is allowed in Perl, but it feels
better to use it only in a loop context.
Test plan:
Read the patch ;)
Bonus: Test if you enter the block by using pref OPACSuggestionMandatoryFields
when adding a suggestion from opac.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: Added a space between 'if' and '(' :-D
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>