Commit graph

1419 commits

Author SHA1 Message Date
Caroline Cyr La Rose
9127ab6773 Bug 27848: Elasticsearch - include 245p to default title index mappings
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-08-04 14:06:43 +02:00
Caroline Cyr La Rose
8bfb85d7e1 Bug 27848: Elasticsearch - include 245b subtitle subfield in the default title index mappings
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-08-04 14:06:43 +02:00
Caroline Cyr La Rose
f331238ef4 Bug 28391: Elasticsearch - Add 264b to publisher index mapping
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-08-04 14:06:43 +02:00
6b7e17f9fd Bug 28567: Fix 0 vs "" vs undef on the admin library form
There are two things here:
* Branches.pickup_location has a default = 1 in DB, we should not set to undef if 0
or it will be set to 1 when stored.
* The other fields are all text (varchar, mediumtext or longtext) and
can be NULL. They are correct set to NULL when a new library is created
but set to an empty string when the library is modified. That's not
consistent

Test plan:
0. Don't apply the patch
1. Create a new library, set pickup location to "No"
2. Save
=> Pickup location is set to YES
=> In DB notice that the different values you didn't fill in are set to
NULL
3. Edit the library
4. Save
=> In DB notice that the different values you didn't fill in are now set
to an empty string
5. Apply the patch, restart_all
6. Run the updatedatabase script
=> In DB all the empty string values are set to NULL
7. Repeat 1 to 4 and confirm that everything is now working as expected

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-30 15:54:12 +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
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
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
ae79ba3e25 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>
2021-07-12 15:47:34 +02:00
3fe837bc74 Bug 28572: Remove C4::Debug
We are using Koha::Logger when it makes sense to keep the info,
otherwise we simply remove it

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

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

Bug 28572: Replace missing occurrence in misc/admin/koha-preferences

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-06-22 12:04:32 +02:00
6f204fdf96 Bug 28591: Don't pass debug to get_template_and_user
There is a "debug" parameter we are passing from the controller scripts
to C4::Auth::get_template_and_user, but it's not actually used!

Test plan:
Confirm the assumption
Review the changes from this patch

Generated with:
perl -p -i -e 's#\s*debug\s*=\>\s*(0|1),?\s*##gms' **/*.pl

git checkout misc/devel/update_dbix_class_files.pl # Wrong catch
+ Manual fix in acqui/neworderempty.pl

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-06-22 12:04:32 +02:00
c5c33163ad Bug 28418: Show template_id of MARC modification templates
This patch adds an "id" column to the table of MARC modification
templates. The table is now a DataTable with table settings, with the
new column hidden by default to preserve the existing configuration.

To test, apply the patch and restart services.

 - Go to Administration -> MARC modification templates.
 - If necessary, add two or more templates.
 - Confirm that table of templates displays as a DataTable, with all
   associated sorting, filtering, export, etc.
 - The "id" column should be hidden by default.
 - Confirm that column visibility controls work correctly.
 - Confirm that the table settings found under Administration -> Table
   settings work correctly to set the default visibility of the table
   columns.

Signed-off-by: Barbara Johnson  <barbara.johnson@bedfordtx.gov>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-06-21 14:01:51 +02:00
Julian Maurice
4b65d099d7 Bug 28276: Do not fetch config ($KOHA_CONF) from memcached
memcached address and namespace are in $KOHA_CONF, so it is required to
read it before being able to access the cache. And after that,
configuration is kept in memory forever. Storing this in memcached is
useless and even counter-productive, since Koha reads both the file and
the cache

This patch addresses this issue by removing the cache-related code from
C4::Context->new.
It means that C4::Context->new will always read the configuration file,
so this patch also replaces inappropriate calls to
C4::Context->new->config by appropriate calls to C4::Context->config

It also fixes a bug where C4::Context->new would ignore the filepath
given in parameters if there was something in cache.

It also removes a problematic call to Koha::Caches->get_instance.
Because this call was outside of any subroutine, it would have happened
before the initialization of $C4::Context::context (which happen in
C4::Context::import)

Test plan:
1. Do not apply the patch yet
2. Add the following line at the beginning of Koha::Config::read_from_file
    warn "read_from_file($file)";
   This will allow you to check how many times the file is read.
3. Flush memcached and restart starman
4. Check the logs, you should see "read_from_file" a bunch of times
5. Apply the patch
6. Re-add the line from step 2
7. Flush memcached and restart starman
8. Check the logs, you should see "read_from_file" only once
9. Make sure the memcached config from $KOHA_CONF (memcached_servers,
   memcached_namespace) is taken into account by checking the About page

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-05-10 10:28:04 +02:00
f3b28bfe44 Bug 28207: Fix biblio_framework.frameworktext isn't in GROUP BY
When a new framework is created and "Marc structure" is opened, a SQL
error happened if sql_strict_mode is on.

Test plan:
Create a 2 new biblio frameworks
Click "Marc structure" for one of them
=> You see the list of all frameworks with an existing structure

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-30 17:07:32 +02:00
ad2dec0737 Bug 27790: Add the new column to columns_settings.yml
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-27 16:23:49 +02:00
7ec4820a65 Bug 23271: (follow-up) Fix typo 'limlits'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-23 13:55:09 +02:00
253534673b Bug 23207: (QA follow-up) Add new column on item types UI table
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-22 11:11:05 +02:00
Agustin Moyano
7439579b8b Bug 23207: Add automatic checkin feature
This patch adds the posibility to set an itemtype with automatic
checkin. It means that when the checkout is due, it will
automatically check in.

To test:
1. apply patches
2. updatedatabase
3. go to koha administration -> item types and edin an item type (from
   now on called itemtype1)
CHECK => there is a checkbox almost at the end called automatic checkin
4. check that checkbox and save
5. checkout 2 items from itemtype1 and one item from another itemtype
   (from now on called itemtype2)
6. go to mysql database console (koha-mysql) and manually set date_due = current_timestamp
   in issues table for the item of itemtype2 and only one of the items of
itemtype1
7. run cronjob at misc/cronjobs/automatic_checkin.pl
8. go to mysql database console again and select * from issues
SUCCESS => All issues are present except for the issue of itemtype1
which had it's date_due set to current_timestamp. That one was
automatically checked in.
9. prove t/db_dependent/Koha/Checkouts.t

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Hasina Akhter <HasinaA@pascolibraries.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-22 11:11:05 +02:00
295d865b06 Bug 28190: Fix columns_settings.yml itemtypes entry
The parent_code column is missing on the columns_settings.yml file, so
columns are shifted and thus 'Library limitations' is not toggable.

To test:
1. Verify you are not offered the chance to hide the column
2. Apply this patch, restart all the things
=> SUCCESS: You can toggle the column
3. Sign off :-D

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-22 10:08:32 +02:00
cef6bbd660 Bug 27465: Add column visibility to admin/cities.pl
We want admin/cities.pl to be using as much DT features as possible to be used as an example.

Test plan:
Add some cities, go to admin/cities.pl confirm that you can show/hide
column.

Go to the tables settings admin page and confirm that you can set some
default settings from there.

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-04-21 15:25:07 +02:00
f6e0b04f48 Bug 23271: Replace search_limited with search_with_library_limits
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-21 15:25:07 +02:00
5c0c623168 Bug 23271: Use Koha::Object::Limit::Library for Koha::Patron::Categories
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-21 15:25:07 +02:00
140926c210 Bug 23271: Improve library limitation selection for item types
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-21 15:25:07 +02:00
24f510d479 Bug 28014: Add table settings to batch patron modification
This patch adds table settings to the tables shown before and after
a batch of patrons has been submitted for batch patron modification.

To test you must have ExtendedPatronAttributes enabled and at least one
configured.

- Go to Tools -> Batch patron modification
- Submit a set of patrons for modification
- In the table showing patron records which will be modified, confirm
  that all DataTables controls work correctly.
  - Confirm that the column visibility settings work correctly,
    including the controls for extended patron attribute columns.
- Submit a change to your patron batch.
- On the page showing the results, confirm that the DataTables controls
  continue to work as expected.
- Go to Administraion -> Table settings and confirm that making changes
  to the default configuration for this table (Tools ->
  batch_patron_modification -> borrowerst) results in the correct
  default columns being shown on the batch patron modification pages.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-14 15:34:27 +02:00
7523bb35bf Bug 28092: Add reserve notes column to holds to pull
To test:
-PLace a hold and add a reserve note to that hold
-Go to Circulation > Holds to pull
-Notice there is no reserve notes column
-Apply patch and restart all the things
-Reload the Holds to pull report and you should see a reserve notes column
-Go to table settings (/cgi-bin/koha/admin/columns_settings.pl) and make sure you can properly hide the column.
-Test other columns in the table and make sure you can properly hide them

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-07 16:08:04 +02:00
01e4ba089f Bug 27805: Use input type "email" for email preferences
This patch changes the way input fields are output in the system
preferences template for preferences which have an "email" class. The
input type will now be "email" instead of "text."

Email type inputs are "loosely" validated. Mozilla's documentation says
valid patterns are "username@domain or username@domain.tld," so Koha's
default "root@localhost" will still work.

The other advantage of an "email" type input is that it typically
triggers different keyboard options in mobile devices.

To test, apply the patch and go to Administration -> Global system
preferences.

- Search system preferences for "email."
- Test the email type preferences you find (e.g. KohaAdminEmailAddress,
  ReplytoDefault, SendAllEmailsTo), confirming that email
  addresses like username@domain or username@domain.tld work correctly.
- Confirm that any other value triggers a validation error.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-06 15:56:30 +02:00
Katrin Fischer
bc919ed914 Bug 26633: Fix indirect object notation
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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-03-16 16:08:30 +01:00
fd57518148 Bug 26633: Add advanced editor for transfer limits
The current transfer limits editor works great for Koha instances with
small numbers of branches. However, for consortiums with dozens or even
hundreds of libraries, the editor does not work well or effectively.

We should provide an "advanced" editor displays all to/from library
combinations in a grid and allows them to be edited in a manner somewhat
similar to the transport cost matrix editor.

Test Plan:
1) Apply this patch
2) Browse to the transfer limits editor
3) Click the new "Switch to advanced editor" link
4) Select a collection code/item type to edit limits for
5) Test the "Check all" function
6) Test the "Uncheck all" function
7) Test the "Check" column function
8) Test the "Uncheck" column function
9) Test the "Check" row function
10) Test the "Uncheck" row function
11) Test individual checkboxes/table cells

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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-03-16 16:08:30 +01:00
010181a6a0 Bug 27652: Display patron's categories for sysprefs expecting them
This patch adds a new type of system preference entry option: patron
category. A preference with this type will show either a <select> with
patron categories to choose from or a multiple-select menu for choosing
one or more.

This prevents possible errors from incorrect category codes being
entered manually.

To test, apply the patch and run the database update.

- Go to Administration -> System preferences.
- Test each of the updated preferences to confirm that the available
  options are correct and that your selections are correctly saved.

  - Single category selections, PatronSelfRegistrationDefaultCategory
    and GoogleOpenIDConnectDefaultCategory. With each of these you
    should see a dropdown where you can select of all the existing
    patron categories.

  - Multiple selections, OPACHoldsIfAvailableAtPickup and
    BatchCheckouts: These preferences should have an option for
    selecting one or more system preferences at once.

- Test the pages affected by the updated system preferences:

- With BatchCheckouts enabled, confirm that the batch checkout page is
  correctly limited by patron category.

- Set the OPACHoldsIfAvailableAtPickup preference to "Don't allow" and
  select at least one patron category in the
  OPACHoldsIfAvailableAtPickupExceptions preference.
- Log in to the OPAC as a patron whose category was not selected in
  the OPACHoldsIfAvailableAtPickupExceptions preference.
- Try to place a hold on an item which is available at a library.
- When confirming the hold, the libraries where the item is available
  should be disabled in the "Pick up location" dropdown.
- Repeat the process as a patron whose category was selected in
  OPACHoldsIfAvailableAtPickupExceptions. There should be no disabled
  pickup locations.

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-03-09 17:20:47 +01:00
592ab10fe5 Bug 22824: Remove C4::Boolean, true_p, boolean_preference, etc.
It seems that we don't really need all this overhead.
YesNo must be a boolean and contain 1 or 0.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-04 16:18:42 +01:00
d6d0116950 Bug 22824: Replace YAML::Syck with YAML::XS
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-04 16:18:42 +01:00
ab19068a4b Bug 8976: Use existing Koha::Authority::Subfield[s]
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 11:57:51 +01:00
8650f8111b Bug 8976: Code cleaning
It was tricky to write the previous patch so I decided to clean the
ground (a bit) for later, taking advantage of having people who are
going to test the whole area.
We can move it to its own bug report if QA wants to.

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:22 +01:00
ebe11f70e2 Bug 8976: Sort subfields for authority records
Same patch for the authority frameworks/records

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:22 +01:00
b387502eaf Bug 8976: Add the ability to sort subfields for the MARC frameworks
This new enhancement adds the ability to change the default order the subfields.

Both bibliographic and authority MARC subfield structure are taken into
account. And so the item edition as well (in the different screens when
item can be added/edited).

This will answer the following needs that have been listed in the
comments of the bug report:
- $i in 7xx fields should be the first subfield in the sequence
- 300 fields are sorted number first when cataloguers enter the letter fields first
- 100 field, it's commonly $a, $q, $d.

Test plan:
1. Edit a MARC frameworks, field 300
2. Resort the subfield (drag and drop the tab of the subfield) as you
like
3. Save
=> Notice that the list of fields are displayed following the order you
chose
4. Edit it again
=> The order is correctly kept!
5. Create a new bibliographic record
6. Notice that the subfields are order in the same sequence
7. Fill different subfields, not all
8. Save, edit again
9. Note that the subfields that have been filled are listed first, then
the empty ones. But the sequence defined at the framework level is kept.
10. Do the same for an authority framework and create/edit an authority
record
11. Modify item (952) subfields order
12. Create an item and confirm that the order is correct
13. Modify the ACQ framework, 952, modify the order of the subfield
14. Create a new order and confirm that the item form has the subfield
ordered following the sequence defined at the framework level

QA: Note that this patch is about bibliographic records only, next
patches deal with authotiries and items.

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 15:14:22 +01:00
8790fe908d Bug 26051: Add sort=1 on cn-sort in mappings.yaml
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-02-23 13:12:56 +01:00
46f7239b08 Bug 27673: Replace YAML with YAML::XS
From tht YAML pod:

"""
This module has been released to CPAN as YAML::Old, and soon YAML.pm will be changed to just be a frontend interface module for all the various Perl YAML implementation modules, including YAML::Old.

If you want robust and fast YAML processing using the normal Dump/Load API, please consider switching to YAML::XS. It is by far the best Perl module for YAML at this time. It requires that you have a C compiler, since it is written in C.
"""

See also
https://gitlab.com/koha-community/qa-test-tools/-/merge_requests/35

Test plan:
Try some place where YAML::XS is not used and confirm that it works
correctly

QA note: This patch removes some uses of YAML that were not useful

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-16 14:54:50 +01:00
a066f03b5e Bug 8326: Make repeatable and unique_id modifiable when editing patron attribute type
This patch add the ability to modify the attribute "repeatable" and
"unique_id" for a patron's attribute type.
Prior to this patch it was not possible, to keep data integrity.

When editing an attr type, the controller will check is the value can be
modified, depending on the existing patron's attributes.

Test plan:
0/ Setup
Create 1 patron attribute PA1 that can be repeatable
Create 1 patron attribute PA2 that does not have the unique restriction
Create 1 patron attribute PA3 that cannot be repeatable and does not
have the unique restriction

1/
Edit them and confirm that you can modify the repeatable and unique
restrictions

2/ Restore values from 0.
Create a patron P1 with several PA1, PA2=42 and whatever in PA3

3/ Edit PA1 => you cannot remove the repeatable flag but can still
remove the unique

4/ Create a patron P2 with PA2=42

5/ Edit PA2 => you cannot add the unique flag

Play a bit more with the different combinaisons and confirm that it
works as advertised.

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-02-15 11:48:55 +01:00
Petro Vashchuk
175a1eddd1 Bug 27655: Add barcode "columnname" to "column_settings.yml"
Preferences of the "Holds to pull" table missing the "Barcode" column.
This patch appends that column name to the "column_settings.yml"
in correct order. This also led to checked out columns in this settings
page that were not those which were hidden when the table displayed
(i.e. columns were shifted).

To reproduce:
    1) Head over to /cgi-bin/koha/admin/columns_settings.pl
    2) Open the collapsed "Circulation" list, go to the "Holds" page
and find preferences of the "Holds to pull" table there.
    3) Check that the "Barcodes" column is missing from it.
    4) Mark the last few columns for not to be
displayed (for example, three) and save the preferences.
Remember the column names you checked out.
    5) Open the circulations section, then open "Holds to pull" report
when you have there some elements displayed, you should notice that
hidden columns shifted by one, as well if you press "gear" icon to
quickly enable/disable the columns, you will see those unchecked in
list last three will be not those you marked out.
    6) Apply the patch.
    7) Reload the "table settings" page, check that the "Barcodes"
column is present.
    8) Check that on the "Circulation -> Holds to Pull" page all
columns hidden accordingly and properly (as explained in step 5.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-09 09:23:50 +01:00
b986a8419b Bug 17364: Add ability to exclude some columns from selection for system preferences
Bug 22844 Added the option to provide a modal for selecting database columns for system preferences

Some system preferences are limited to a subset of the columns allowed. For instance, setting branchcode
in BorrowerUnwantedFields prevents adding new patrons

This patch allows for defining exclusions in the .pref file

To test:
1 - Alter BorroweUnwantedFields and select branchcode
2 - Attempt to add a new patron
3 - Get a message like "Something went wrong. Check the logs"
4 - Apply patches
5 - Alter the preference again
6 - Note that branchcode is unchecked and disabled
7 - Save the pref
8 - Add a patron
9 - It succeeds

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

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

Bug 17364: (follow-up) Add missing filter

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-01 16:36:36 +01:00
Katrin Fischer
009ec76b1a Bug 27486: (QA follow-up) Fix occurence in aqplan.pl
There was another mention of the old system preference name in the
budget planning code. This patch replaces it with the new name.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-29 09:03:45 +01:00
fd8aee9270 Bug 25054: Display search field aliases in Search Engine Configuration
It'd be great if the Search Engine Configuration page would display
the various aliases (shortcuts) available : ti for title, sn for local-number, etc.

Patch changes Koha/SearchEngine/Elasticsearch/QueryBuilder.pm to move
hard-coded vars at the beging and adds a method to provide to %index_field_convert via a method.

Test plan :
1) Use Elasticsearch
2) Go to Administration > Search engine configuration (Elasticsearch)
3) Check you see new column 'Aliases' with for example ti for title.
4) Perform a search 'ti:<title>' and check you get results

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-01-14 14:03:49 +01:00
4491cdd803 Bug 27416: Make "Modify tag" and "Add tag" translatable
Those two strings are not translatable as they are passed from the
controller.

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-01-13 17:17:00 +01:00
5bc62d240c Bug 26991: Add action logs to search engine administration
Search engine administration is very important,
we should log who/when it is changed.
I don't add a preference system to disable it,
like there is no for preference system logs.

Test plan :
1) Use searchengine Elasticsearch
2) Go to Administation > Search engine configuration (Elasticsearch)
3) Click on 'Reset Mappings' and accept
4) Edit some lines and save
5) Go to 'Tools' > 'Log viewer'
6) Select only 'Search engine' in Modules and submit
7) Select only 'Edit mappings' in Actions
8) Check you see a log
9) Select only 'Reset mappings' in Actions
10) Check you see a log

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-01-12 16:40:41 +01:00
3dc90c66c7 Bug 27043: Add to number_of_replicas and number_of_shards to index config
With Elasticsearch 6 (>6.4), we have a warning on index creation :
  the default number of shards will change from [5] to [1] in 7.0.0

See https://github.com/elastic/elasticsearch/pull/30587

I propose to add number_of_shards in index config.

Also add number_of_replicas that is better explicit.
In case on only one node, it must be 0.

Test plan :
1) Use Elasticsearch
2) Apply patch and flush memcached
3) Rebuild indexes : misc/search_tools/rebuild_elasticsearch.pl -v -b -d
4) Check you dont have a warning about number of shards
5) Check the settings of index :
   curl '<cluster>:9200/<myindex>_biblios/_settings?pretty&filter_path=**.number_of_*'
6) You should see :
   "number_of_shards" : "5",
   "number_of_replicas" : "1"

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-04 13:29:51 +01:00
1aeeaf4c2b Bug 22343: (follow-up) Correctly handle password on editing
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-20 08:16:38 +01:00
b2093e4162 Bug 24083: Delete the new rule when needed
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-11 16:09:58 +01:00
Andrew Isherwood
d67b2b5d46 Bug 24083: Add circ rules management
This patch adds the ability to set the "Unseen renewals allowed" value
in the circulation rules

Signed-off-by: Sally Healey <sally.Healey@cheshirewestandchester.gov.uk>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-11 16:09:58 +01:00
Andrew Isherwood
51895cd7fb Bug 22818: Add notices sysprefs and DB column
This patch adds two new sysprefs. 'ILLDefaultEmail', 'ILLSendStaffNotices' and a new column to the
branches table called 'branchillemail'. It also adds five ILL related
notices.

Here we are providing the ability for a branch to have a dedicated email
address for it's ILL staff, the idea being that any notices sent by ILL
to staff need to go to specific staff, rather than the general branch
email address. If no branch specific address is defined, the address
specified in the ILLDefaultEmail syspref is used.

We're also providing a syspref 'ILLSendStaffNotices' to allow the user to specify which
notices should be sent to staff upon certain events.

We are also providing patron messaging preferences for the two patron
bound notices

We are also providing five notices for various ILL related events.

Sponsored-by: PTFS Europe
Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-11 08:35:10 +01:00
Aleisha Amohia
1deb47e793 Bug 14866: Make high holds work with different item types
To test:
1) Apply patch, update database, restart services
2) Enable decreaseLoanHighHolds sysprefs if not already active
3) Go to circulation rules and set a value under 'Decrease loan holds
(day)' that is DIFFERENT from decreaseLoanHighHoldsDuration
4) Check out an item with holds and confirm that the value from the rule
is used instead of the system preference
5) Confirm tests pass before and after the patch
t/db_dependent/DecreaseLoanHighHolds.t

Sponsored-by: Catalyst IT

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-06 15:55:17 +01:00
7a07e11128 Bug 23091: Add handling for new lostreturn rules
This patch adds handing for the new values available for the lostreturn
policy settings.

* undef - Do nothing, leave fees and fines as they were at the point of
  lose.
* refund - Refund the lost item fee only
* charge - Refund the lost item fee and charge a fresh overdue fine
  dated for a return on the date the item is 'found'
* restore - Refund the lost item fee and restore the original overdue
  fine (dated for a 'return' on the date the item was 'lost'

Test plan
1/ apply patch
2/ updatedatabase, restart_all
3/ verify finesmode and CalculateFinesOnReturn and WhenLostChargeReplacementFee are on
4/ verify WhenLostForgiveFine is set to "Forgive"
5/ verify circ rules include fines
6/ set Default lost item fee refund on return policy to "Refund lost item charge"
7/ create 4 overdue checkouts that will incur fines
8/ run fines.pl
9/ confirm 4 items checked out with accruing fines
10/ confirm all 4 items have a replacement price

Item 1
11/ mark the first item lost
12/ verify that fine is gone and lost fee has been charged
13/ check item in
14/ verify that lost fee is gone and overdue charge has not returned

Item 2
15/ set Default lost item fee refund on return policy to "Refund lost item charge and charge new overdue fine"
16/ mark second item lost
17/ verify that fine is gone and lost fee has been charged
18/ check item in
19/ verify that lost fee is gone and a new overdue charge has been made

Item 3
20/ set Default lost item fee refund on return policy to "Refund lost item charge and restore overdue fine"
21/ mark third item lost
22/ verify that fine is gone and lost fee has been charged
23/ check item in
24/ verify that lost fee is gone and the old overdue charge has been restored

Item 4
25/ set Default lost item fee refund on return policy to "Leave lost item charge"
26/ mark fourth item lost
27/ verify that fine is gone and lost fee has been charged
28/ check item in
29/ verify that lost fee remains and the overdue charge is still gone

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-06 15:55:17 +01:00