Commit graph

42593 commits

Author SHA1 Message Date
79854d6c45 Bug 28750: (bug 17600 follow-up) Use full routine names in svc/new_bib svc/bib
To test:
1 - Attempt to save a record in the advanced cataloging editor
2 - It fails
3 - Apply patch
4 - It succeeds

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 16:28:52 +02:00
f8813f8d37 Bug 28750: (bug 17600 follow-up) Use full path for subroutines
Throughout the file we call methods with the module
Following suit rather than importing the methods

To test:
1 - Attempt to load advanced cataloging editor
2 - it fails
3 - http://localhost:8081/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=define
4 - Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_svc_cataloguing_framework::GetMarcStructure called at /kohadevbox/koha/svc/cataloguing/framework line 18
5 - Apply patch
6 - Cataloging editor loads!
7 - Link in #3 loads!

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 16:28:52 +02:00
f891156f42 Bug 28565: Refactor tests
Tests were too complex with no gain. They even deleted the whole DB to
run (inside a transaction). I refactored to test the same thing, and
make it rely (mostly) on existing data.

_count behavior is tested implicitly by comparing with Koha::*->count.

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

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

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-07-26 12:46:35 +02:00
b7c955c950 Bug 28565: Move the sysprefs to a reusable sub
This patch moves the big sysprefs list to a sub. Behavior shouldn't
change.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/UsageStats.t
=> SUCCESS: Things work as expected, no changes.
2. Sign off :-D

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

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-07-26 12:46:35 +02:00
c623dfa946 Bug 28394: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
07ae0dfb0c Bug 28394: Improve style of patron category entry form
This patch makes some style and structure changes to the patron
cartegory entry form:

- Margin added to the enrollment period fieldset so that it aligns with
  the rest of the form.
- Informational text inside the form wrapped in <div class="hint"> like
  it is on other pages.
- Converted heading tag to legend tag in the messaging preferences
  fieldset.

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

Go to Administration -> Patron categories -> New category and confirm
that the style updates look good.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
0511ced01c Bug 28347: Add DataTables, additional information to patron attribute types management
This patch enhances the display of patron attribute information on the
attribute management page.

To test, apply the patch and go to Administration -> Patron attribute
types.

 - If necessary, add multiple patron attributes so that there is data to
   display. Include:
   - Some which are mandatory
   - Some which are linked to an authorized value category
   - Some which share a class.
 - The tables showing your attributes should each have DataTables
   sorting and controls (except for column configuration, which isn't
   added by this patch).
 - Confirm that DataTable controls work correctly for each table.
 - The table should include columns showing authorized value category
   and whether the attribute is mandatory.
 - If you are logged in as a user with permission to manage
   authorized values, the data in the authorized value category
   column should be linked to that category on the authorized values
   page.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
7e1227890b Bug 28073: Patron modifications should auto-open panel for referring patron record
This patch makes it possible to link directly to the correct panel on
the "Update patron records" page. The link on the checkout and patron
details screen has been updated to read "Patron has pending
modifications."

Also changed: Moved the "Patron's address in doubt" message so that it
is above the table of changed fields.

To test, apply the patch and if necessary submit patron modification
requests from multiple patrons via the OPAC.

 - Open the checkout page for one of these patrons.
   - If you are logged in as a user with permission to edit patron
     records you should see a message, "Pending modifications: Review
     pending modifications," which links to the pending modifications
     page.
     - Clicking the link should open the page for reviewing pending
       patron modifications, and the correct panel should be
       automatically expanded.
   - If you are logged in as a user without permission to edit patrons
     you should see the message "Pending modifications: Patron has
     pending modifications," which isn't linked.
 - The process should work exactly the same from the patron detail page.
 - Following the "Pending modifications" link from the staff interface
   home page or the patrons home page should work as before: The page
   opens with the first panel expanded.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
6d9e145716 Bug 27747: (QA follow-up) Make code consistent and add explicit brackets
The while statements were including the next statement, I add brackets to make it
more obvious

Also the highlighting was applying to [[borrowernumber|Borrow number]
I removed the break to match code above and only highlight when syntax complete and correct

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
3c8be8bf7a Bug 27747: Add CodeMirror custom syntax highlighting for column placeholders
This patch adds some additional configuration to CodeMirror so that
column placeholders have a distinct color in the CodeMirror SQL editor.

To test, apply the patch and create or edit an SQL report which contains
one or more column placeholders, e.g. [[itemnumber|Item number]],
[[borrowernumber|Borrower number]], etc.

Confirm that when editing the SQL, these placeholders should appear as
red text. Save your report and view it. The syntax highlighting should
be updated in this view too.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
601a969915 Bug 25464: Adjust occurrence in debian/koha-core.postinst
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
006c70f4f2 Bug 25464: Add ability to specify client IP and SIP account used in SIP2 logging
Bug 15253 originally had the ability to specify the incoming IP address used for
a given log statement via SIP, as well as the SIP2 account that was in use at the time.
This data is very helpful for debugging purposes, and should be brought back.

Test Plan:
1) Apply this patch
2) Update you SIP ConversionPattern to "[%d] [%p] %X{accountid}@%X{peeraddr}: %m %l %n"
3) Restart SIP
4) Use the SIP cli tester to make some SIP requests
5) View the SIP2 log, note the account id and client ip address show in the log!

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>
2021-07-26 12:46:32 +02:00
cb2eae80d9 Bug 28624: Remove Smart::Comments
It's not used in those files (there is no occurrence of ###), and it's
not installed anyway (it is by koha-testing-docker however).

We should remove those lines.

Test plan:
Confirm the above

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-07-26 12:46:32 +02:00
024c491132 Bug 28543: Clicking on 'New record' will use default framework
In biblio records cataloguing, clicking on 'New from z39.50/SRU' will run action with default framework.
Clicking on 'New record' should do the same.

Test plan :
1) Go to cataloguing home page
2) Check you see 'New record' with a sparator and then a caret
(like 'New from z39.50/SRU')
3) Click on button text
=> You go to record edition with default framework
4) Clik on caret
=> You see list of framworks

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-07-26 12:46:32 +02:00
1339fd5143 Bug 27850: Search link for 260 a and c in MARC21 XSLT OPAC display
In MARC21 XSLT OPAC display, 260$b is a search link on 'Provider'.
$a and $c also have a search field, we can create search links.

Test plan:
1) Create 2 records with same 260 : two $a, one $b, two $c
2) Use XSLT display in OPAC
2) Look at first record details page in OPAC
3) Click on a $a link => you see both records
4) Click on a $c link => you see both records

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
4debc8c514 Bug 27850: Search link for 260 a and c in MARC21 XSLT intranet display
In MARC21 XSLT intranet display, 260$b is a search link on 'Provider'.
$a and $c also have a search field, we can create search links.

Test plan:
1) Create 2 records with same 260 : two $a, one $b, two $c
2) Use XSLT display in staff inteface
2) Look at first record details page in staff interface
3) Click on a $a link => you see both records
4) Click on a $c link => you see both records

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
e87f51bd7f Bug 28469: Move "Skip to main content" to top of OPAC page
This patch moves the "Skip to main content" button out of the nav
element and to the top of the <body> element, so that it's the first
(potentially) viewable element on the page.

This means you can inject content above the navbar, which has
a relative position, and it won't disrupt the display of the
"Skip to main content" button.

To test:
1) Apply patch
2) Same test plan as Bug 22807:
Go to any page in the OPAC and hit the tab key. The "Skip to main
content" link should appear. Tabbing away from it should cause the link
to hide. Hitting the ENTER key when the link is highlighted should cause
the page to scroll to the main content.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
Katrin Fischer
e4d91955e9 Bug 28677: (QA follow-up) Correct capitalization
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:32 +02:00
07564cd4bb Bug 28677: Update wording on ExpireReservesOnHolidays
To test:
1: look at ExpireReservesOnHolidays syspref description
2: apply patch, restart
3: look at wording again, see that it now clarifies that it only pertains to systems using ExpireReservesMaxPickUpDelay and includes the word "calendar"

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-07-26 12:46:32 +02:00
896e0e6622 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>
2021-07-26 12:46:32 +02:00
33dd62d661 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>
2021-07-26 12:46:32 +02:00
b17b691e01 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>
2021-07-26 12:46:32 +02:00
da24b92793 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>
2021-07-26 12:46:32 +02:00
252a4759b7 Bug 28662: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 12:46:07 +02:00
7de0384e42 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>
2021-07-26 11:19:17 +02:00
9eee9f931d 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>
2021-07-26 11:17:46 +02:00
66b6b284da 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>
2021-07-26 11:07:13 +02:00
3d1889d82d Bug 28408: Add new column to the table settings config
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-26 11:02:20 +02:00
783e140767 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>
2021-07-26 10:47:54 +02:00
33b89f3a13 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>
2021-07-26 10:47:54 +02:00
c9228ffbd6 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>
2021-07-26 10:47:54 +02:00
66ce3c1a8b 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>
2021-07-26 10:47:36 +02:00
4a2447f432 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>
2021-07-26 10:39:26 +02:00
fc96399c95 Bug 28622: (bug 15758 follow-up) Remove incorrect branch selection in adv search
From
  commit df97814f30
  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>
2021-07-26 10:39:22 +02:00
c739305d85 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>
2021-07-26 10:39:18 +02:00
0fb60358dc 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>
2021-07-26 10:39:18 +02:00
f148cae6bd 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>
2021-07-26 10:39:14 +02:00
89d9dd6d5d 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>
2021-07-26 10:39:13 +02:00
2e266f35f9 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>
2021-07-26 10:39:13 +02:00
8d74d3226a 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>
2021-07-26 10:39:13 +02:00
5dcac8523c 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>
2021-07-26 10:39:11 +02:00
dcc8229e13 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>
2021-07-26 10:39:08 +02:00
638b3df2e8 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>
2021-07-23 15:02:26 +02:00
09e0799a8d 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>
2021-07-22 08:12:51 +02:00
3748efc8ab 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>
2021-07-21 17:04:06 +02:00
f0108f4ff7 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>
2021-07-19 16:39:11 +02:00
f5bf73f722 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>
2021-07-16 09:47:01 +02:00
9d6d641d1f 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>
2021-07-16 08:58:47 +02:00
af7e41d114 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>
2021-07-16 08:58:45 +02:00
f132fc8203 Bug 27948: Fix file mode
From
  commit b7acefa116
  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>
2021-07-13 09:49:29 +02:00