Commit graph

1040 commits

Author SHA1 Message Date
24936a656d Bug 34913: Adjust "Manage staged MARC records"
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3f0715ef0a73eea69258b807590419a9091619ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-01-29 10:15:53 +01:00
41580a0a58 Bug 35641: Reduce DB lookups when sending a list of barcodes to inventory
This patch does three things:
1 - Removes a specific query for withdrawn status of each item scanned - we can use the withdrawn field
2 - Removes a specific query for checkouts on each item scanned - we can use the onloan field
    a - additionally we don't need to fetch the checkout as we check it in to the homebranch,
    this is likely incorrect - we should use the current branch, but I preserve behavior for now
3 - Fetches the items ahead of time and builds a hash based on barcode, reduces DB lookups, may raise memory usage

To test:
1 - Checkout some items
2 - Withdraw some items
3 - Generate a lsit of barcodes including some checked out items and some withdrawn items
4 - Enter that list of barcodes into inventory tool
5 - Note your results
6 - Apply patch
7 - Issue the items again
8 - Repeat inventory
9 - Confirm results are the same as before patch

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5ae5e4367b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-01-17 10:43:36 +01:00
Aleisha Amohia
b30898c8bf
Bug 35291: (QA follow-up) Tidying script for QA test tools
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-24 16:43:25 -03:00
bae5256216
Bug 35291: Validate filepaths in linking files
Validate that the files in linking files are contained within the ZIP.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-24 16:43:24 -03:00
4b019fcbb0
Bug 35291: Don't allow symlinks for link files in cover image ZIP
There's no reason to allow symlinks for link files in cover image
ZIP files. Preventing their use prevents someone from uploading
a symlink pointing to an existing file on the Koha server.

Test plan:
0. Apply patch and restart/reload Koha
1. Create a PNG cover image
2. Create a datalink.txt file that contains something like the
following:
29,Untitled.PNG
3. Turn on "LocalCoverImages" system preference
4. Upload via http://localhost:8081/cgi-bin/koha/tools/upload-cover-image.pl
5. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
6. Note the cover image has been uploaded

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-24 16:43:23 -03:00
6023acd648
Bug 35291: Prevent leaks from FS
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-24 16:43:23 -03:00
c53e6e977f
Bug 32986: (follow-up) Tidy conditional in letter.pl
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 17:59:34 -03:00
Katrin Fischer
6322e08a02
Bug 32986: (QA follow-up) Fix QA script complaints: tabs and TT filters
* Perltidied the section with tabs in printslip.pl
* Fixed indentation and tabs in letter.tt
* Added missing TT filters to members-toolbar.inc

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 17:59:33 -03:00
c3b40a5499
Bug 32986: Add patron_slip module to letters and allow printing on members account
This patch adds a new module to letters 'patron_slip' / Patrons toolbar
(slip)

This also combines some of the slip printing JS to make things more
direct

To test:
1 - Apply patch
2 - restart_all
3 - yarn build
4 - Confirm you can print slip, summary, quickslip, and checkin slip
  when viewing a patron's account
5 - Enable  DisplayClearScreenButton syspref, and test that it works
  with both values
6 - Go to Tools->Notices and slips
7 - Define a new notice in the 'Patron toolbar (slip)' module
8 - Enter content like below in the 'Print' transport:
Patron has [% borrower.holds.count %] holds

List of holds:
[% FOREACH hold IN borrower.holds %]
===============================
    Reserve id: [% hold.reserve_id %]
    Title [% hold.biblio.title %]
[% END %]
9 - Go to patron scree
10 - Note new option under 'Print'
11 - Print the new slip and confirm it works (try with and without
  placing holds for patron

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 17:59:33 -03:00
f979752031
Bug 34773: Improve translation of title tags: Cataloging tools
This patch modifies cataloging tools templates so that title tags can be
more easily translated. The patch also makes some modifications to
titles, breadcrumb navigation, and page headers in order to make them
more consistent with each other and with other similar pages.

Note that stockrotation.pl has been modified so that rota information is
available to the template in more cases for the purpose of showing that
information in navigation and headings.

To test, apply the patch and go to Cataloging. Test each page and each
variation of the page to confirm that titles, breadcrumbs, and page
headers look correct.

- Export catalog data
- Stage records for import
  - Main page
  - Upload file -> Stage for import
- Manage staged records
  - Main page
    - Batch details
      - Import batch
- Batch item modification and batch item deletion
  - Main page
    - Submit batch
      - Save
- Batch record modification
  - Main page
    - Submit batch
      - Modify selected
- Batch record deletion
  - Main page
    - Submit batch
      - Delete selected
- MARC modification templates
  - Main page
    - Edit actions for a template
- Item modifications by age
  - Main page
    - Add rules
- Stock rotation
  - Main page
    - New rota
    - Edit rota
    - Manage stages for rota
      - New stage
      - Edit stage
    - Manage items for rota
      - Add items

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-06 08:42:44 -03:00
5bab527644
Bug 31383: (QA follow-up) Tidy
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 14:44:03 -03:00
a072b5305e
Bug 31383: Restore updated_on for individual content
Sponsored-by: Rijksmuseum, Netherlands
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 14:44:00 -03:00
f5ac2916f2
Bug 31383: Create a parent-child DB relation for additional content
In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations.
But we do this in one table coming from the old news items.

Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang.

Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come.

What is this patchset doing?
* DB changes
- Rename additional_contents.idnew with id
- Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents
- Move the content to this new table
- Remove title, content and lang columns from additional_contents
- Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist.

* CRUD
- We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple.
- No changes expected for "NewsLog" logging
- Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language.

Test plan:
0. Preparation steps, use master
  a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us.
  b. Create several news, additional contents, pages. Some with translated contents, some without.
  c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here
  d. Turn on NewsLogs
1. Apply the patches, restart_all, updatedatabase
=> Confirm that the new table is created and filled with the contents you had prior to the update
=> Confirm that additional_contents_localizations.updated_on has been kept to the previous values
=> Confirm that ISSUESLIP has been replaced properly
=> Confirm that you get a warning about the additional_contents
2. Create, update, delete news, html customs, pages
=> Confirm that the additional_contents_localizations.updated_on is only adjusted when required
=> Confirm that the logs are correctly created when NewsLogs is on
3. Check some items out, generate a slip
=> Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted
4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages
=> Confirm that the default values is displayed when you are using the interface in a language without translation
=> Confirm that the translated version is picked when it exists

Notes for QA:
* I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP.
Shouldn't it hurt?
* There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability?

Sponsored-by: Rijksmuseum, Netherlands
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 14:43:56 -03:00
Hinemoea Viault
a19f1ffbbd
Bug 26978: Add item type option to batch extend due date tool
Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-11 12:13:03 -03:00
80b85e1bb3
Bug 34820: (QA follow-up) add filter, update CSV output
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-04 09:44:04 -04:00
dcd698a4b4
Bug 34349: Validate/escape inputs for task scheduler
This change validates and escapes inputs for task scheduler.

Test plan:
0. Apply patch
1. koha-plack --reload kohadev
2. Go to http://localhost:8081/cgi-bin/koha/tools/scheduler.pl
3. Input a time a minute in the future and leave the date blank
4. Choose an existing report and output format
5. Type a malicious string which is also a valid email address
into the Email field
6. Click "Save"
7. Note that the job is added but the Email is wrapped in single
quotes
8. Try using a non-malicious email address with a single quote.
9. Note that the single quote is escaped, so that it will still
be used by runreport.pl

JD amended patch: tidy

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed pars for $email =~ regex, removed old commented lines.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-25 18:18:38 -03:00
0018fe8fba
Bug 34818: (bug 21083 follow-up) Fix batch patron modification tool
It is not possible to perform batch patron modification without selecting
a patron attribute

Test plan:
Test the batch patron modification tool, with or without extended
attributes.

The error was
Can't call method "category_code" on an undefined value at /kohadevbox/koha/tools/modborrowers.pl line 407

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-19 16:34:15 -03:00
9254af7b41
Bug 34257: (QA follow-up): tidy up code
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-12 09:45:05 -03:00
13d5ff9424
Bug 34257: Limit item types by branch in batchMod.pl
To test:
1. Go to Item types administration.
2. Set some items types to be limited to a branch you are not logged in as.
3. Find some items from the branch you are logged in at and go to Batch item modification.
4. Add the barcodes and attempt to edit the item type to the one you limited in step 2.
5. You can change these item types to ones that your branch should not be able to.
6. Apply patch
7. Try steps 4 -5 again but this time you should not see item types in the dropdown that are limited to other branches.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-12 09:45:04 -03:00
88be91a786
Bug 21083: Remove all attributes
not only the first one

Signed-off-by: Philip Orr <philip.orr@lmscloud.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-05 14:46:07 -03:00
40a37ecccd
Bug 21083: Handle repeatable patron attributes in batch patron modification tool
This patch adds the ability to set patron attributes marked as
repeatable in the batch patron modification tool.
Prior to this patch they were ignored.

Test plan:
You should try with several combinaisons and set patron attributes using
the batch patron modification tool.
Make sure there is no data lose and that the result is what you expect
Please detail in a comment what you tested.

Signed-off-by: Philip Orr <philip.orr@lmscloud.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-05 14:46:06 -03:00
Katrin Fischer
5d35c3596d
Bug 22135: Display 'shelved out of order' error in inventory CSV export
When using the inventory tool with an uploaded barcode file
and checking the "Compare barcodes list to results",
"Check barcodes list for items shelved out of order" and
"Export to CSV file" checkboxes, the resulting CSV file showed
a blank in the "problem" column for items with out of order
callnumbers. With this patch, you'll see "Shelved out of order".

To test:
* Create 3 items with callnumbers and barcodes a, b, and c
* Go to Cataloguing > Inventory
* Enter a c b (each on its own line) into the barcode field
* Check "Compare barcodes list to results"
* Check "Check barcodes list for items shelved out of order"
* Check "Export to CSV file" (at the bottom)
* Verify the file has empty lines in the problem column
* Apply patch
* Repeat test, the empty lines should now read: "Shelved out of order"

Note: Also fixes "problem" to "Problem" to make capitalization
consistent. All those strings are currently not translatable,
this will be filed separately.

Co-authored-by: Mark Alexander <marka@pobox.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-05 14:35:38 -03:00
Pascal Uphaus
af60975fbc
Bug 34441: Fixed Typo "Paramater"
To test:
1. git grep paramater
2. notice 3 files have spelling mistakes
3. apply the patch
4. git grep paramater
5. notice there are no spelling mistakes for that word

Signed-off-by: Thomas Klausner <domm@plix.at>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-01 11:23:21 -03:00
38fc85ade9
Bug 33755: Set profile_id and add missing import
This patch adds a missed parameter (profile_id) in stage-marc-import.pl and also adds a missing import in the background job for staging marc files. This means that the profile used when importing can now be shown in the import batches table and also in batch details

Test plan:
1) Stage a record for import and make sure to save the import profile you use
2) Import a record using that profile
3) Navigate to Cataloging > Manage staged MARC records
4) In the Profile column, no value will be shown for the staged record
5) Click on the batch, the profile will be missing in this screen as well
6) Apply patch
7) Restart_all
8) Repeat steps 2-5, the profile name should be visible in both places

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-08-15 12:16:59 +03:00
593e1dc584
Bug 34368: Add CSRF token to Content Management pages
This change adds a CSRF token to the Content Management pages
at additional-contents.pl.

Test plan:
0. Apply patch
1. koha-plack --restart kohadev
2. Try to add "News", "HTML customizations", and "Pages".
3. Try to delete these new content entries
4. Note that you were successful in your endeavours

JD amended patch: remove empty line removal (no need to create
unecessary conflicts)

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-08-07 21:00:00 -03:00
Emmi Takkinen
83589f0317
Bug 33667: Allow copying holidays to all libraries when editing
When editing an existing holiday and checking the
"copy to all libraires" checkbox, the other calendars won't
get updates. Allow this by first checking if holiday exists
in target calendar and if not, add it.

To test:
1. Add unique holiday to branch A.
2. Don't check checkbox "Copy to all libraries".
3. Save.
4. Verify the holidays shows on all calendars as
a green box.
5. Edit the holiday, now check "Copy to all libraries"
and save.
=> Verify nothing has changed in other calendars:
only the green box, no holiday in list on the right
6. Edit again, make a change to description,
check checkbox, save.
=> Verify it's still not showing in the other
calendars.
9. Apply this patch.
10. Edit holiday again, check "Copy to all libraries"
and save.
=> Verify holiday is now added to other calendars.
11. Edit again, this time do not copy and save.
=> Verify holiday was edited just in branch A.
12. Again edit, check and save.
=> Verify holiday was edited in all libraries.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-06 10:08:45 -03:00
30be338c24
Bug 33989: Only look up authorized value descriptions for items in results
This patch changes the inventory tool so that it only populates the
authorized value descriptions for items that show up in the results.
That is, items that will be viewed by a human.

This change saves a lot of time by not performing unnecessary
database lookups.

Test plan:

0. Apply patch and koha-plack --restart kohadev
1. Go to create a SQL report from SQL
/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL
2. Save a report with the following SQL:
SELECT barcode FROM items where barcode <> '';
3. Run the report
4. Download as CSV
5. Edit the CSV and remove the "barcode" heading

6. Go to edit item for barcode 3999900000001
/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=1&itemnumber=1
7. Add "Damaged status" of "Damaged"
8. Click "Save changes"

9. koha-mysql kohadev
10. update items set notforloan = 9 where barcode = 3999900000001;

11. Go to inventory tool
http://localhost:8081/cgi-bin/koha/tools/inventory.pl
12. Upload barcode file via "Choose file"
13. Uncheck "Compare barcodes list to results"
14. Open F12 tools
15. Click "Submit"
16. Click "OK" on confirm box

17. Note that the inventory job takes around 30 seconds to run
instead of 60 seconds
17b. The exact figures may vary. If you compare with before patch
inventory runs, you'll be saving roughly 18 seconds.
18. Note that "Damaged" appears in the "Damaged" column, which
demonstrates that the authorized value lookup was completed for
the item in the result list

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-26 11:39:58 -03:00
37f441edd8
Bug 33963: Remove C4::BackgroundJob
Finally! No more occurrences of this module, we can happily remove it!

Test plan:
git grep is your friend

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-15 08:48:12 -03:00
45d99e7a0b Bug 33595: (bug 26628 follow-up) Fix authorization for tools-home.pl
If you log into the OPAC as a user with no flags, you can see a restricted view of
/cgi-bin/koha/tools/tools-home.pl instead of seeing the login screen.

Test plan:
Use a patron with catalogue permission only
Login and access the tools home page
=> redirected to the login screen

Add a club sub permission
Login and access the tools home page
=> You see the tools home page with the clubs link

Add a tool sub permission, remove club
Login and access the tools home page
=> You see the tools home page with the relevant link

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-05-16 11:47:15 +02:00
Julian Maurice
d6d7d4b876
Bug 25503: Add option to export items bundle contents in checkouts table
Test plan:
1. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   2, but also the biblio and items that are part of the bundle

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

https://bugs.koha-community.org/show_bug.cgi?id=25508
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:20 -03:00
4ea2f11718
Bug 33412: Fix comparison when checking for overlay framework
TO test:
 1 - Cataloging -> Export catalog data
 2 - Export a record fom your catalog
 3 - Cataloging -> Stage record for import
 4 - Import the record, use Record matchign rule: KohaBiblio (999c)
 5 - Stage, view batch
 6 - Record should match the one that was exported
 7 - When replacing record use this framework, choose a different value than current framework of record
 8 - Import this batch
 9 - View and edit record - note framework did not change
10 - Apply patch
11 - Restart all
12 - Repeat 4-8
13 - View and edit record, confirm framework has changed
14 - Sign off

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-09 10:58:04 -03:00
10d12f999f
Bug 33341: Address some perlcritic errors in 5.36
Some old-style code is making our tests fail when run in Debian Testing.

This patch addresses this.

To test:
1. Launch bookworm KTD:
   $ KOHA_IMAGE=master-bookworm ktd up -d
2. Run:
   $ ktd --shell
  k$ prove t/00-testcritic.t
=> FAIL: It fails!
3. Apply the patch
4. Repeat 2
=> SUCCESS: Tests now pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-28 14:50:33 +02:00
cf06f05ec0
Bug 30869: Add the ability to delete stock rotation rotas
'At the moment, it isn't possible to delete any rotas that have 0 items linked to it. The only way to do it is in MySQL - it would be good if this was possible from the staff client.'
This patch implements this, and also implements the possibility of deleting a rota with items linked to it, providing a warning that the item(s) currently in rotation will remain at its/their current stage library.

Test plan:
1) Enable StockRotation system preference
2) Cataloging > Stock rotation > New rota
3) Enter Name, save
4) Verify 'Delete' button shows on the right
5) Click 'Delete' -> Confirm 'Yes'
6) Repeat steps 1-3 and click 'Manage'->'Stages'
7) Add a new stage, enter Library and Duration, click 'Save'
8) Return to rotas, click 'Manage'->'Items'
9) Add item, enter barcode, click 'Save' (optional: add more than 1 item)
10) Optional: Click 'Move to next stage' and verify that item is now in different branch
11) Click 'return to rotas' and press 'Delete'
12) Verify the warning now shows, because items are attached, with the attached items count
13) Click 'Delete' -> Deletion is successful
14) If you did step 10, verify the item is still in the branch that it was at the time the rota was deleted

Sponsored-by: PTFS-Europe

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

JD Amended patch:
* Fix QA failures
   FAIL   forbidden patterns
                forbidden pattern: tab char (line 150)
                forbidden pattern: tab char (line 151)
* Adjust commit message to describe what the patch does
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-24 17:52:23 -03:00
78e144a9a0
Bug 32019: Add option to mark items returned via batch modification
Ther are options that allow avoiding marking an issue returned when se tot lost.
Libraries do this to tie a lost item to a patron clearly.

Eventually, after the patron has paid, or after some time, the library may wish
to delete the item. When doing so, they do not wish to check the item in and affect any statuses
or fines. This is also true for withdrawn items

It would be helpful to have a way to mark issues returned in bulk, when they have not been marked
returned in the past

To test:
 1 - Apply patches
 2 - Restart all
 3 - Set 'MarkLostItemsAsReturned' system preferences to 'None'
 4 - Check out some items that have replacement fees set
 5 - Mark them lost
 6 - Check out more items, mark them withdrawn
 7 - Set system preference 'BlockReturnOfWithdrawnItems' to block
 8 - Enter item barcodes into batch modification
 9 - Leave 'Mark items returned as blank
10 - Verify nothing was checked in
11 - Repeat but set 'Mark items as returned' to 'No'
12 - Verify nothing was checked in
13 - Repeat, but set 'Mark items as returned' to 'Yes'
14 - Verify items are returned
15 - Verify no fines have been adjusted
16 - Verify withdrawn items are sitll withdrawn
17 - Verify you can now delete the items

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-20 09:54:20 -03:00
ae4c09ed5e
Bug 15869: (QA follow-up) Don't pass placeholder framework '_USE_ORIG'
This param in the dropdown is meant to signify no change, distinct from
"" when means to set to default. In rebasing this condition was lost, this patch
restores undef of the variable to avoid setting framework to an invalid value

To test:
1 - Stage a record with a match (export and import a record)
2 - Attempt to import and overlay with option 'When replacing records use this framework:' 'Keep original framework'
3 - It fails, logs note 'value too long for field frameworkcode'
4 - Apply this patch
5 - Try again, it succeeds - framework is not changed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-07 10:32:23 -03:00
e5f251a709
Bug 15869: Change framework on overlay
This patch allows for selection of framework to use when overlaying
records - by default it is set to keep the initial framework

To test:
 1 - Create some records using one framework
 2 - Export the records
 3 - Edit the records to add fields not in original framework
 4 - Stage records using a rule that will find matches
 5 - Import
 6 - Note records contain new fields on display, but they are lost on edit
 7 - Apply patch
 8 - Stage records again
 9 - Select a framework that contains the new fields on import
10 - Import records
11 - Note records now use selected framework and are displayed/edited
correctly

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-07 10:32:22 -03:00
e84d5ccb6c Bug 20256: Use new methods
Signed-off-by: Bob Bennhoff - CLiC <bbennhoff@clicweb.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-02 11:59:26 -03:00
Katrin Fischer
50927bb9b5
Bug 26628: Fix access to clubs when user only has clubs permission
If a user only has the clubs and no permission from the tools section,
they can't access the patron clubs page by navigation. This patch
extends the permission checks for tools to include the clubs, that
live on the tools page, but have a top level permission.

To test:
- create a patron with only the catalogue and clubs permissions
- log in to the staff client as that patron
- navigate to a patron record, confirm you can see the Clubs tab in the patron account, can add patrons to and remove patrons from clubs
- confirm you don't have a link to the Tools module either on the Koha homepage or in the More menu
- enter the clubs URL manually (/cgi-bin/koha/clubs/clubs.pl), confirm you are allowed to open the page
- Apply patch
- The only changes should be:
  - You can now see the Tools entry in the More navigation menu
  - You can now see the Tools module link on the start page
  - Both take you to the tools page, only visible tools is 'Patron clubs'

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-01-31 10:50:52 -03:00
847d50f865
Bug 31095: (follow-up) Iterate debarments in batch mod
Signed-off-by: Nick Clemens <nick@bywatersolutions.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: Tomas Cohen Arazi <tomascohen@theke.io>
2023-01-31 10:19:42 -03:00
e44c5146d3
Bug 31095: Remove GetDebarments from tools/modborrowers.pl
This patch removes GetDebarments from the modborrowers tool controller
and replaces it with $patron->restrictions as appropriate.

Test plan
1. Confirm that the 'Batch patron modification' tool pages still load
   and perform as expected.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-01-31 10:19:37 -03:00
9608b16a6b
Bug 32221: Borrowers.password should no longer be an option
When creating a notice template the user has the option to add the borrower's
password to the template. This should be removed as the password should not be
an option to be added to a notice.

Test plan:
1) Navigate to Tools > Notices and slips
2) Either create a new notice or edit an existing notice
3) Observe that in the list of fields available to insert into the message body,
   there is the option for "borrowers.password"
4) Apply patch
5) Navigate to the same menu
6) Observe that the "borrowers.password" option is now no longer visible

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-01-20 13:55:17 +00:00
4907e96ba8
Bug 31711: (bug 27421 follow-up) Fix add to basket from a new file
We lost the display of the "Add staged files to basket" link when create
a new order from a new file

Test plan:
Add order to basket from a new file, select a file and import
See the detail of the job and notice the "Add staged files to basket",
click and confirm that it works as expected.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-15 18:44:30 -03:00
41fa262a96
Bug 27920: (QA follow-up) Change radios to a single select pulldown
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-09 14:37:24 -03:00
e4e453d5df
Bug 27920: Add ability to update patron expiration dates when importing patrons
Some libraries need to recalculate a patron's expiration date any time they are updated via a patron import from file.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Patrons/Import.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-09 14:37:07 -03:00
03c8725b4e
Bug 32037: Check for existence of object before building link
This patch adds a check on the existence of the object and passes this to the template

I also drop a level of IF by moving to ELSIF

To test:
 1 - Enable ReturnLog amd IssueLog
 2 - Checkout an item to a patron
 3 - Return it
 4 - View 'Modification log' tab of the borrwer
 5 - Note item links, test them, they work
 6 - Delete the item
 7 - Reload and try links again, they do not work
 8 - Apply patch
 9 - Reload, no more links
10 - Checkout and return another item
11 - This one has links, and they work as before

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-04 19:18:54 -03:00
30b5350b04
Bug 31590: Remove Text::CSV::Unicode
This modules is really not needed.
The wide character test does not make much sense. Just use
encoding as you should.

Test plan:
Run xt/author/Text_CSV_Various.t.
Check about page, perl modules.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-21 16:07:21 -03:00
9470cf8c1b
Bug 27421: Commit and revert
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-19 15:14:56 -03:00
8497ed67b7
Bug 27421: Use Background job for staging MARC records for import
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-19 15:14:55 -03:00
d5dc514f93
Bug 31373: DRY - Use try/catch around _process_tt
This patch reduces the repetition in the tools/letter.pl controller
replaceing it with a try/catch block wrapping a call to
C4::Letters::_process_tt instead.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-16 11:03:04 -03:00
3df1672eb3
Bug 31373: Add INCLUDE_PATH to notice validation
This is a follow-up to bug 31211. It adds the same INCLUDE_PATH
variables as C4::Templates adds during processing to prevent false
failures.

Test plan
1) Add an INCLUDE to any valid notice, for example:
   [% INCLUDE 'patron-title.inc' patron => patron %]
2) Save and continue
3) Confirm you are faced with a validation error complaining that
   the include file cannot be found
4) Apply this patch
5) Confirm that the reported error has dissapeared

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-16 11:03:04 -03:00