]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 15668: (follow up) add selector to th
Lucas Gass [Mon, 16 Mar 2020 17:48:26 +0000 (17:48 +0000)]
Bug 15668: (follow up) add selector to th

follow up add a selector to the <th> to ensure we count the table in questions.
Should not affect other pages but is needed on detail.tt where there are two tables to configure

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15668: Add column configuration to the items table in staff detail pages
Lucas Gass [Thu, 12 Mar 2020 14:50:57 +0000 (14:50 +0000)]
Bug 15668: Add column configuration to the items table in staff detail pages

To test:
1 - Apply patches
2 - View biblio details in staff client
3 - Should be able to toggle columns
4 - Go to admin columns settings
5 - Change some settings, verify they work
6 - Enable SeparateHoldings
7 - Go to a record that has holdings from 2 different branches
8 - Change some settings, verify they work.
9 - Check the Other Holdings Tabs, change some settings make sure they work.
10. - Test all the dataTable functions like the search box, columns, export. make sure they on both tabs

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25341: Remove whitespace from barcode in add_items.pl
Lucas Gass [Fri, 1 May 2020 17:01:11 +0000 (17:01 +0000)]
Bug 25341: Remove whitespace from barcode in add_items.pl

TEST PLAN:
1. Go to course reserves and trying adding a course with a barcode that has some leading/trailing whitespace.
2. It doesnt work
3. Apply patch and restart_all
4. Try again with leading/trailing whitespace, it should work.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24522: Show alert when trying to add nothing to a list in staff
Owen Leonard [Fri, 1 May 2020 13:23:12 +0000 (13:23 +0000)]
Bug 24522: Show alert when trying to add nothing to a list in staff

This patch modifies the JavaScript which handles the process of adding
items to a list in the staff client. Error-handling is added in the case
when a set of biblionumbers hasn't been passed to the vShelf function.

To test, apply the patch and perform a catalog search in the staff
client.

On the search results page, select any list from the "Add to list" menu
at the top of the search results table without checking any checkboxes.

You should get an alert, "No item was selected."

Also test that adding to a list works correctly after selecting one or
more titles.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13388: Compiled CSS
Martin Renvoize [Mon, 4 May 2020 08:44:09 +0000 (09:44 +0100)]
Bug 13388: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13388: (QA follow-up) Add id to nav item and use singleBranchMode
Katrin Fischer [Fri, 1 May 2020 15:07:07 +0000 (15:07 +0000)]
Bug 13388: (QA follow-up) Add id to nav item and use singleBranchMode

This uses the existing singleBranchMode variable to display either
Library or Libraries depending on the number of existing libraries
in the installation.

It also adds an id to the navigation item for customization purposes.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13388: (follow-up) Inlcude OpacNav
Martin Renvoize [Fri, 1 May 2020 14:12:14 +0000 (15:12 +0100)]
Bug 13388: (follow-up) Inlcude OpacNav

I believe this page should include the optional OpacNav and
OpacNavBottom blocks

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13388: (follow-up) Remove display of email address
Owen Leonard [Fri, 1 May 2020 12:06:03 +0000 (12:06 +0000)]
Bug 13388: (follow-up) Remove display of email address

Since the email address configured for a library may not be the email
address libraries want to use as a contact email address the email
should not be displayed by default.

This patch removes display of the email address. Libraries may choose to
add the information to the opac_info column, so there is already a
built-in alternative.

To test, apply the patch and view the detail page for a library in your
system which has an email address configured. The email address should
not display on the page.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13388: Add library pages to the OPAC
Owen Leonard [Tue, 28 Apr 2020 19:23:55 +0000 (19:23 +0000)]
Bug 13388: Add library pages to the OPAC

This patch adds a script and a template for showing library information
pages in the OPAC. A "libraries" page lists all the libraries in the
system, linking to individual pages for each library showing more
information..

If there is only one library in the system the page shows all of that
library's information.

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

 - Go to /cgi-bin/koha/opac-library.pl in the OPAC.
 - Verify that all the correct information is displayed for the
   libraries in your system.
 - Verify that page title and breadcrumbs look correct.
 - Click to view details for a library.
   - The details page should show the full contents of
     branches.opac_info
   - A menu should show links to other libraries' detail pages.

EDIT: This revised patch adds a "Libraries" link to the links under the
search bar; Corrects encoding in the breadcrumb link; Makes the page
title more specific when viewing an individual library.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18308: Increase minPasswordLength default to 8
Alex Buckley [Fri, 20 Oct 2017 23:22:13 +0000 (23:22 +0000)]
Bug 18308: Increase minPasswordLength default to 8

To test:
- Run the web installer for any language
- Verify that minPasswordLength is set to 8 now

Sponsored-By: Catalyst IT
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25340: Pass biblio object to OPAC comments template
Owen Leonard [Fri, 1 May 2020 12:43:40 +0000 (12:43 +0000)]
Bug 25340: Pass biblio object to OPAC comments template

This patch modifies the OPAC comments system so that the biblio object
is passed to the template. This allows the biblio-title include to
properly access the title and subtitle information.

Unrelated change: Remove some custom CSS from the page which was
obsolete.

To test, apply the patch and make sure the "reviewson" preference is
enabled.

- Log in to the OPAC and open a bibliographic record's detail page.
- Under the "Comments" tab, click the "Post your comments" link to
  trigger the pop-up window.
- In the pop-up window, verify that the item's title is correct in the
  page title and the heading. Author should display correctly, if
  present.
- Test submitting a comment and editing a comment. Everything should
  work correctly.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24636: (follow-up) - move 'by' into include file
Bernardo Gonzalez Kriegel [Sun, 3 May 2020 22:19:21 +0000 (19:19 -0300)]
Bug 24636: (follow-up) - move 'by' into include file

To ease correct translation.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24636: translate planning sections
Bernardo Gonzalez Kriegel [Wed, 29 Apr 2020 00:21:09 +0000 (21:21 -0300)]
Bug 24636: translate planning sections

This patch adds a new inc file to process
and translate plannig sections

To test:
1) Apply patch
2) Create new language files
(cd misc/translator; ./translate create xx-YY)
3) Verify new file is taken into account in
translation files
egrep -n budget_planning misc/translator/xx-YY*.po
check new strings in staff-prog file
4) Go to Administration > Budgets > Founds > Planning
select different options, check page title and
'Planning for...' phrase
5) Translate strings, install new language, enable it,
verify the text change with options like point 4)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25335: group by authorised_value in addbiblio.pl
Andrew Fuerste-Henry [Thu, 30 Apr 2020 19:35:51 +0000 (19:35 +0000)]
Bug 25335: group by authorised_value in addbiblio.pl

To Test:
1- Edit your default framework, connect any subfield outside of the 952 to an authorised value (for example, connect the 942$n to the Yes_No auth value)
2 - Find a record in that framework
3 - Edit the record and find your subfield
4 - The subfield shows a dropdown with no contents
5 - check plack log, see "DBD::mysql::st execute failed: 'koha_kohadev.authorised_values.authorised_value' isn't in GROUP BY "
6 - apply patch, restart all
7 - reload edit record page, see your auth value dropdown has contents

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25133: (follow-up) Remove Names as they do no affect display
Nick Clemens [Tue, 21 Apr 2020 12:06:09 +0000 (12:06 +0000)]
Bug 25133: (follow-up) Remove Names as they do no affect display

In testing I couldn't make any changes to the names have an effect
and everythign worked as expected without these lines

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25133: Handle 12hr format for dt_from_string
Jonathan Druart [Mon, 20 Apr 2020 08:59:55 +0000 (10:59 +0200)]
Bug 25133: Handle 12hr format for dt_from_string

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25133: Fix time part of due date for 12hr
Jonathan Druart [Fri, 17 Apr 2020 10:11:25 +0000 (12:11 +0200)]
Bug 25133: Fix time part of due date for 12hr

With Timeformat system preference set to 12 hours format:

Prior to 19.05.08, when due date was specified at checkout,
the time in the box would show in 24hr format (e.g. 15:59)
while the due date in the patron's checkouts would show
in 12hr format (e.g. 3:59 PM).

After 19.05.08, the format in the specify a due date box
shows in 24hr format and the due date in 12hr format
(in patron checkouts) as before.

But when checking out multiple items using the specify due
date option for the session, the time changes from PM to
AM.

To test:
- Check out an item with specified due date 15:50 PM
- Check out a second item in same transaction
- Verify date changed to AM
- Apply patch
- Repeat
- Verify this time the date is kept as set

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25305: Translation process - Open all files specifying the utf8 encoding
Jonathan Druart [Wed, 29 Apr 2020 09:53:45 +0000 (11:53 +0200)]
Bug 25305: Translation process - Open all files specifying the utf8 encoding

To test:
1) Create translation files for a new language
( cd misc/translator; ./translate create xx-YY)
A new language means one that isn't already in Koha, xx-YY=>something you
invent.
2) Verify double encoding
egrep "Aix-Marseille|Jean Prunier|periodika|Bokm" misc/translator/po/xx-YY-*
check strange strings
3) Apply the patch
4) Create po files again
( cd misc/translator; rm -f po/xx-YY*; ./translate create xx-YY)
5) Verify no more double encoding
egrep "Aix-Marseille|Jean Prunier|periodika|Bokm" misc/translator/po/xx-YY-*
check normal string

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22515: Improve logic determining how to show OPAC suggestions
Owen Leonard [Mon, 27 Apr 2020 13:20:23 +0000 (13:20 +0000)]
Bug 22515: Improve logic determining how to show OPAC suggestions

This patch makes changes to the OPAC suggestions view so that the logic
around logged in users and the OPACViewOthersSuggestions preference is
more specific.

To reproduce the bug you should have pending purchase susggestions in
your system from more than one patron.

1. Set the OPACViewOthersSuggestions preference to "Show."
2. Log in to the OPAC as a user who has not submitted any suggestions.
3. Follow the link to the purchase suggestions page from the menu under
   the search bar.
4. The page will say that there are no  purchase suggestions.
5. Add "?suggested_by_anyone=1" to the end of the page URL.
6. You should see suggestions from other users.

To test, apply the patch and repeat steps 2-3 above. The suggestions
page should show other patrons' suggestions.

Test with different combinations of factors:

 - Logged in user, OPACViewOthersSuggestions off
 - No logged in user, OPACViewOthersSuggestions on
 - No logged in user, OPACViewOthersSuggestions off

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25247: Only convert data ot objects when displaying on screen
Nick Clemens [Wed, 22 Apr 2020 12:11:53 +0000 (12:11 +0000)]
Bug 25247: Only convert data ot objects when displaying on screen

To test:
 1 - Modify a patron
 2 - Circulate some items to the patron
 3 - Click 'Modification log'
 4 - Verify you see your actions
 5 - Under 'Output' select 'To a file'
 6 - Save the output to a file
 7 - View the file
 8 - Not you have references ot objects in stead of patron/item data
 9 - Apply patch
10 - Repeat
11 - Note viewing on screen has not changed
12 - Note exporting to file inlcudes borrower/item numbers and not references
13 - Sign off

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21565: (follow-up) Make confirmation buttons more detailed
Owen Leonard [Wed, 29 Apr 2020 17:57:44 +0000 (17:57 +0000)]
Bug 21565: (follow-up) Make confirmation buttons more detailed

This patch updates the confirmation buttons to be more specific about
what each one does. My concern was that it wasn't clear that "No" meant
"No receipt" and not "Cancel logging out."

The patch also updates the modal confirmation code so that the modal
body is removed if no message is passed for it.

To test, apply the patch and repeat the previous test plan. When you
click "Finish" you should have the options "Print receipt and end
session" and "End session."

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21565: Add modal to SCO confirm
Lucas Gass [Fri, 24 Apr 2020 18:39:02 +0000 (18:39 +0000)]
Bug 21565: Add modal to SCO confirm

This patch uses the confirmModal framework to add a modal confirm to
SCO Finish.

TO TEST:

1. Enable SCO and go to /cgi-bin/koha/sco/sco-main.pl. Make sure
   SelfCheckReceiptPrompt is set to 'show'
2. Login and click 'Finish' to see the old print alert box.
3. Apply patch and repeat steps 1 and 2.
4. Make sure the modal works for confirming and denying a receipt.
   Checkout some items and make sure everything still functions the
   same.
5. Make sure when printing a receipt that the print dialog automatally
   shows
6. Set SelfCheckReceiptPrompt to 'Don't show' and confirm behavior is
   acceptable.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25107: Remove double passing of $server variable to maybe_add in C4::SIP::Sip...
Kyle M Hall [Fri, 10 Apr 2020 10:58:43 +0000 (06:58 -0400)]
Bug 25107: Remove double passing of $server variable to maybe_add in C4::SIP::Sip::MsgType

At some point some calls to maybe_add got an extra $server var in their
parameter lists. This doubled parameter does nothing and should be
removed.

Test Plan: No change in behavior should be noted

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23119: MARC21 added title 246, 730 subfield i displays out of order, and should...
David Roberts [Mon, 6 Apr 2020 23:42:19 +0000 (23:42 +0000)]
Bug 23119: MARC21 added title 246, 730 subfield i displays out of order, and should display before subfield a

This patch makes the subfield i display before subfield a in the 246 and
730 fields

To test:

1) Create a bibliographic record with data in several subfields in tags
246 and 730.
2) See that subfield i displays at the end of the field in the 246
field, and probably not at all in the 730 field. Check in both the OPAC
and staff client
3) Apply the patch.
4) Check your bib record again in both clients. Subfield i should now
display before subfield a.

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25309: Limit size of streetnumber field to 10
Jonathan Druart [Wed, 29 Apr 2020 12:57:57 +0000 (14:57 +0200)]
Bug 25309: Limit size of streetnumber field to 10

It's its size in DB (varchar(10))

Test plan:
Create or editing a patron and confirm that you fill in more than 10
characters in the streetnumber field
Save
=> The patron has been correctly created/updated

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25311: (QA follow-up) Add misssing filter
Katrin Fischer [Fri, 1 May 2020 22:04:15 +0000 (22:04 +0000)]
Bug 25311: (QA follow-up) Add misssing filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25311: Better error handling when updating a patron
Jonathan Druart [Wed, 29 Apr 2020 12:48:38 +0000 (14:48 +0200)]
Bug 25311: Better error handling when updating a patron

Same as the precedent patch for patron's modification

Test plan is identical but with an existing patron

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25311: Better error handling when creating a patron
Jonathan Druart [Wed, 29 Apr 2020 12:38:41 +0000 (14:38 +0200)]
Bug 25311: Better error handling when creating a patron

This is still not ideal but brings a bit of enhancement.

One possible problem is that the patron creation will fail if the
streetnumber field is too long (borrowers.streetnumber is varchar(10).

Test plan:
0. Don't apply this patch
1. Create a new patron with a streetnumber longer than 10 characters
2. Save
=> The patron has not been created and the app explodes
The error is about extended_attributes and not meaningful
Can't call method "extended_attributes" on an undefined value at /kohadevbox/koha/members/memberentry.pl line 560
3. Apply the patch
4. Repeat 1. and 2
=> You get a warning on the interface and you still see the creation
form
5. Check the logs
=> The error is meaningful
"Data too long for column 'streetnumber'"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: DBRev 19.12.00.084
Martin Renvoize [Mon, 4 May 2020 07:35:59 +0000 (08:35 +0100)]
Bug 17268: DBRev 19.12.00.084

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: Schema Update
Martin Renvoize [Mon, 4 May 2020 07:33:02 +0000 (08:33 +0100)]
Bug 17268: Schema Update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: (follow-up) Don't show the macro ID in front of description
Katrin Fischer [Fri, 1 May 2020 21:35:38 +0000 (21:35 +0000)]
Bug 17268: (follow-up) Don't show the macro ID in front of description

I believe it's nicer to allow users to organize the macros as
they want using the descrpitions they prefer.

Submitting as a suggestion.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: (QA follow-up) Make "Convert old browser macros" translatable
Katrin Fischer [Fri, 1 May 2020 21:33:00 +0000 (23:33 +0200)]
Bug 17268: (QA follow-up) Make "Convert old browser macros" translatable

The code was missing the necessary markup to make the string translatable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: Update patchs per RFC
Nick Clemens [Wed, 22 Apr 2020 21:13:34 +0000 (21:13 +0000)]
Bug 17268: Update patchs per RFC

https://wiki.koha-community.org/wiki/Advanced_editor_macros_endpoint_RFC

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: (follow-up) Fix translatability
Nick Clemens [Fri, 27 Mar 2020 10:38:04 +0000 (10:38 +0000)]
Bug 17268: (follow-up) Fix translatability

This patch moves the error messages to translatable strings

Also includes capitalization fixes and POD adjustment

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: Set boolean for shared column in schema
Nick Clemens [Wed, 11 Mar 2020 13:39:25 +0000 (09:39 -0400)]
Bug 17268: Set boolean for shared column in schema

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Heather Hernandez <Heather_Hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: Schema update
Nick Clemens [Thu, 2 Jan 2020 15:02:04 +0000 (15:02 +0000)]
Bug 17268: Schema update

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Heather Hernandez <Heather_Hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: (follow-up) Fix licenses
Nick Clemens [Wed, 11 Mar 2020 13:31:39 +0000 (09:31 -0400)]
Bug 17268: (follow-up) Fix licenses

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Heather Hernandez <Heather_Hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: Use API to store/retrieve values
Nick Clemens [Tue, 3 Mar 2020 13:14:03 +0000 (13:14 +0000)]
Bug 17268: Use API to store/retrieve values

To test:
 1  - Enable AdvancedCatalogingEditor
 2  - Add some macros (they don't need to be valid, just have content)
 3  - Apply patches
 4  - updatedatabase
 5  - Set user to have 'create_shared_macros' and 'delete_shared_macros'
 6  - Load the advanced editor (Cataloging->Advanced editor)
 7  - Click on 'Macros'
 8  - Previous macros should not show, but you should have a 'Convert' button
 9  - Convert old macros and confirm they show
10  - Edit the macros, changing content and the public checkbox, confirm 'Saved' shows in the top right of editor when updating
11  - Have at least on valid macro and run it, e.g.:
    new 100=Testing this out
12  - Run the macro, confirm it runs
13  - Try a macro with gibberish, confirm there is an error when running
14  - Ensure you have a few macros marked public
15  - In a private browser window sign in as a patron with neither shared macro permission
16  - Confirm the public macros load, but cannot be edited
17  - Grant create_shared_macros permission to this patron
18  - Reload editor, they should now be able to edit shared macros
19  - Confirm they cannot delete shared macros
20  - Grant delete_shared_macros permission
21  - Reload editor
22  - Confirm they can now delete shared macros

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Heather Hernandez <Heather_Hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: Advanced cataloging editor macros - add endpoint
Nick Clemens [Wed, 4 Dec 2019 11:39:41 +0000 (11:39 +0000)]
Bug 17268: Advanced cataloging editor macros - add endpoint

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Heather Hernandez <Heather_Hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17268: Add macros table and permissions
Nick [Wed, 2 Oct 2019 13:28:39 +0000 (13:28 +0000)]
Bug 17268: Add macros table and permissions

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Heather Hernandez <Heather_Hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24808: enable translation on results.js
Bernardo Gonzalez Kriegel [Tue, 28 Apr 2020 22:37:52 +0000 (19:37 -0300)]
Bug 24808: enable translation on results.js

String sorrounded by "__()"

To test:
1) create translation files for a language
(cd misc/translator; ./translate create xx-YY)

2) Check string
egrep -l "No cover image available" misc/translator/po/xx-YY-*
present in 2 files, opac-bootstrap and staf-prog

3) Apply patch

4) Create files again
(cd misc/translator; rm -f po/xx-YY*; ./translate create xx-YY)

5) Check again
egrep -l "No cover image available" misc/translator/po/xx-YY-*
present in 3 files, new in messages-js

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17355: DBRev 19.12.00.083
Martin Renvoize [Mon, 4 May 2020 06:46:00 +0000 (07:46 +0100)]
Bug 17355: DBRev 19.12.00.083

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17355: (QA follow-up) Add description to updatedatabase entry
Katrin Fischer [Fri, 1 May 2020 15:47:07 +0000 (17:47 +0200)]
Bug 17355: (QA follow-up) Add description to updatedatabase entry

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17355: Add the ability to remove authorised value categories
Jonathan Druart [Tue, 28 Apr 2020 09:53:57 +0000 (11:53 +0200)]
Bug 17355: Add the ability to remove authorised value categories

This new patch set is adding a new DB field is_system to distinguish
internal categories.

The list of internal categories is in the patch "DB changes - set
is_system for categories" and can be discussed/extended.

Test plan:
0.
- Apply patch
- updatedabase
1.
- Create a new AV category
- Create an authorised value
- List the AVs for this category
- Remove all the AVs for this category
=> You see 2 buttons "Add a new authorised value" and "Delete category
'XXX'"
- Click the delete button
=> You get a popup
- Accept
=> The category is deleted

2.
- List the AV for Asort1 (internal category)
/cgi-bin/koha/admin/authorised_values.pl?searchfield=Asort1
- Delete the AVs for this category (if there is any)
=> You do not see the "Delete category" button

3.
- Create a new AV category 'foo'
- Create an authorised value
- Hit /admin/authorised_values.pl?op=delete_category&categor_name=foo
=> You get an error message (expected because the category cannot be
deleted if it has AV linked)
=> message text:
=> An error occurred when deleting this authorized value category. Check the logs.

4.
- Hit /admin/authorised_values.pl?op=delete_category&categor_name=Asort1
=> You get an error message (expected because the category Asort1 cannot
be deleted, it's an internal category.
=> message text:
=> An error occurred when deleting this authorized value category. Check the logs.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17355: DB changes - set is_system for categories
Jonathan Druart [Tue, 28 Apr 2020 09:32:23 +0000 (11:32 +0200)]
Bug 17355: DB changes - set is_system for categories

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17355: Override delete methods
Jonathan Druart [Tue, 28 Apr 2020 09:23:02 +0000 (11:23 +0200)]
Bug 17355: Override delete methods

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17355: DBIC changes - boolean flag
Jonathan Druart [Tue, 28 Apr 2020 09:05:46 +0000 (11:05 +0200)]
Bug 17355: DBIC changes - boolean flag

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17355: DBIC changes
Jonathan Druart [Tue, 28 Apr 2020 09:03:25 +0000 (11:03 +0200)]
Bug 17355: DBIC changes

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17355: DB changes
Jonathan Druart [Tue, 28 Apr 2020 09:01:19 +0000 (11:01 +0200)]
Bug 17355: DB changes

This patch adds a new authorised_value_category.is_system boolean/tinyint(1)
DB field.

Name 'is_system' is coming from existing tables account_credit_types and
account_debit_types and should not be discussed here (if you disagree
fill a new bug report and deal with naming issue separately)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23433: (RM follow-up) One last consistency improvement
Martin Renvoize [Mon, 4 May 2020 06:40:21 +0000 (07:40 +0100)]
Bug 23433: (RM follow-up) One last consistency improvement

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23433: Make consistent use of patron-title.inc in hold confirmation dialogs
Owen Leonard [Fri, 6 Mar 2020 15:06:02 +0000 (15:06 +0000)]
Bug 23433: Make consistent use of patron-title.inc in hold confirmation dialogs

Use of patron-title.inc on the checkin page is inconsistent, resulting
in patron names being displayed differently under different
circumstances. This patch makes it more consistent.

To test, apply the patch and check in items with the following statuses:

 - On hold for a patron at your library
 - On hold for a patron not at your library
 - On hold and already marked 'Waiting'
 - On hold while HoldsAutoFill preference is enabled
 - An item which has been marked with a LOST status in the
   'ClaimReturnedLostValue' system preference.
 - An item which was checked out to a manually-restricted patron and
   checked in with a back-dated checkin date. See test plan on Bug
   24776.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15751: Add ModDateLastSeen to ProcessOfflineReturn
Martin Renvoize [Wed, 11 Dec 2019 11:53:51 +0000 (11:53 +0000)]
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn

Test plan:
1) Before the patch when one checks in something using the KOCT the last seen
date is not updated.
2) After the patch when one checks in something using the KOCT the last seen
   date is updated.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23794: (RM follow-up) Make DB update consistent
Martin Renvoize [Fri, 1 May 2020 16:27:52 +0000 (17:27 +0100)]
Bug 23794: (RM follow-up) Make DB update consistent

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24772: Don't revert course item fields when deleting a course item unless it...
Martin Renvoize [Fri, 1 May 2020 15:04:21 +0000 (16:04 +0100)]
Bug 24772: Don't revert course item fields when deleting a course item unless it is enabled

Deactivating a from Course Reserves reverts Item's Shelving Location
correctly, then deleting the same course reverts the Course Reserve
Items to old shelving location values.

Test Plan:
1) Add items to a Course - make sure they all have shelving locations
prior to being added to the course.
2) When adding items change their shelving location to something else.
   See that Shelving Location has changed; permanent location in
parentheses
3) Deactivated course
   See that Shelving Location has changed back to its original location
4) Deleted course
   See that Shelving Location has changed back to what was picked during
adding it to the Course.
5) Apply this patch, restart all the things!
6) Repeat steps 1-4, note the shelvig location is not lost!

NOTE: Empty commit simply to restore the updated test plan and QA signoff

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Hannah Olsen <holsen@duncanville.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24772: Don't revert course item fields when deleting a course item unless it...
Kyle M Hall [Wed, 29 Apr 2020 14:40:21 +0000 (10:40 -0400)]
Bug 24772: Don't revert course item fields when deleting a course item unless it is enabled

Deactivating a from Course Reserves reverts Item's Shelving Location
correctly, then deleting the same course reverts the Course Reserve
Items to old shelving location values.

Test Plan:
1) Add items to a Course - make sure they all have shelving locations
prior to being added to the course.
2) When adding items change their shelving location to something else.
   See that Shelving Location has changed; permanent location in
parentheses
3) Deactivated course
   See that Shelving Location has changed back to its original location
4) Deleted course
   See that Shelving Location has changed back to what was picked during
adding it to the Course.
5) Apply this patch, restart all the things!
6) Repeat steps 1-4, note the shelvig location is not lost!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Hannah Olsen <holsen@duncanville.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25127: Use Koha::Number::Price->round for comparison
Martin Renvoize [Mon, 20 Apr 2020 11:09:27 +0000 (12:09 +0100)]
Bug 25127: Use Koha::Number::Price->round for comparison

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25127: Correction to tests
Martin Renvoize [Mon, 20 Apr 2020 08:34:19 +0000 (09:34 +0100)]
Bug 25127: Correction to tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25127: Unit tests
Nick Clemens [Mon, 13 Apr 2020 12:47:03 +0000 (12:47 +0000)]
Bug 25127: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25119: Fix account type and description for individual writeoffs/payments
Katrin Fischer [Sat, 11 Apr 2020 12:02:03 +0000 (12:02 +0000)]
Bug 25119: Fix account type and description for individual writeoffs/payments

When paying or writing off a single line from the list of pending charges,
the account type displayed the code instead of the description.

And when bug 23483 fixed the display of the description, 2 variables where
missed. This change is only visible when looking at the page source:

<input type="hidden" name="description" id="description" value="" />

With the patch applied, the value will be filled with the description.

To test:
- Create one or more manual invoices of different types
- Try to pay/write off using the buttons within the table
- Verify the account type shows as code, not description
- Apply patch
- Repeat
- Bonus points: Check the source code for the hidden input with description.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23794: DBRev 19.12.082
Martin Renvoize [Fri, 1 May 2020 07:19:27 +0000 (08:19 +0100)]
Bug 23794: DBRev 19.12.082

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23794: Convert OpacMainUserBlock system preference to news block
Owen Leonard [Wed, 11 Dec 2019 16:24:50 +0000 (16:24 +0000)]
Bug 23794: Convert OpacMainUserBlock system preference to news block

This patch builds on Bug 22318 to move the OpacMainUserBlock system
preference into the Koha news system, making it possible to have
language- and library-specific content.

To test you should have some content in the OpacMainUserBlock system
preference. Apply the patch and run the database update process.

 - Go to the OPAC and confirm that the content which was previously in
   the OpacMainUserBlock system preference now displays correctly where
   it was before.
 - In the staff client, go to Tools -> News and verify that the content
   from OpacMainUserBlock is now stored in news items. There should be
   one entry for each of the enabled translations in your system, for
   instance 'opacmainuserblock_en', 'opacmainuserblock_fr-FR',
   'opacmainuserblock_cs-CZ'
 - Go to Administration -> System preferences and confirm that the
   OpacMainUserBlock preference has been removed.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25297: Consistent return value in K::A::Order->current_item_level_holds
Tomas Cohen Arazi [Mon, 27 Apr 2020 21:55:59 +0000 (18:55 -0300)]
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds

This patch makes the return values for 'current_item_level_holds'
consistent: they will always be a Koha::Holds iterator.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Order.t
=> FAIL: It doesn't work as expected, cannot call ->count on undef, etc
3. Apply this patch
4. Repeat 2.
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25297: Regression tests
Tomas Cohen Arazi [Mon, 27 Apr 2020 21:55:32 +0000 (18:55 -0300)]
Bug 25297: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24980: (follow-up) return '' when date is null
Agustin Moyano [Tue, 31 Mar 2020 20:56:22 +0000 (17:56 -0300)]
Bug 24980: (follow-up) return '' when date is null

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24980: Only add timezone if passed a date-time
Martin Renvoize [Wed, 25 Mar 2020 20:41:45 +0000 (20:41 +0000)]
Bug 24980: Only add timezone if passed a date-time

This patch prevents a timezone from being assigned to the js moment if
the input string is only at the full-date and not date-time resolution

To test:
1. Do not apply this patch
2. Set your system time zone to CET
3. Apply previous patch (It's just for test)
4. In your browser go to koha main page, open a console and type $date('2020-03-25', {tz:
   'UTC'})
CHECK => you sould get '03/24/2020' (notice day is 24 instead of 25)
5. Apply this patch and reload the browser
6. repeat step 4
SUCCESS => now you get '03/25/2020' (day is correct)
7. Sing off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24043: (QA follow-up) Fix another TypeError when retrieving status name
Josef Moravec [Thu, 30 Apr 2020 11:29:56 +0000 (11:29 +0000)]
Bug 24043: (QA follow-up) Fix another TypeError when retrieving status name

Test plan:
1) Apply first patch, and have the same requests as in previous patch
test plan
2) Load ill requests list
2a) You can see another TypeError in console
2b) You can notice, the Placed on and Updated on columns have prepended
another columns with unformatted dates and without header label
3) Apply this patch
4) Reload page (be sure it is not loaded from cache - Ctrl+F5)
5) Errors from 2a and 2b are gone

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24043: Fix retrieval of of status name
Andrew Isherwood [Mon, 13 Jan 2020 10:18:19 +0000 (10:18 +0000)]
Bug 24043: Fix retrieval of of status name

This patch modifies the way in which a request's status name is
retrieved. I think the previous way it was done (which can never have
worked properly) must have come from a time when we weren't embedding
the request's backend capabilities in each request. So now we can just use
the current row.

Test plan:

1. *Before applying the patch*:
2. Ensure you have at least two requests, from two different backends.
One of the backends you are using must have a possible status that
doesn't exist in the other. For example, the BLDSS backend has a status
of STAT, that doesn't not exist in any other backends.
3. Ensure that the request who's backend has the unique status is *not*
the first request in the returned list.
4. Load the "View ILL requests" page
5. Observe that the page JS fails with a "Cannot read property 'name' of
undefined" error
6. Apply the patch
7. Reload the page (maybe doing a hard reload to ensure the JS is not
cached)
8. TEST: Observe that the error no longer occurs and the requests all
have their statuses displayed correctly.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25303: Add a test for ->reset
Jonathan Druart [Thu, 30 Apr 2020 12:15:28 +0000 (14:15 +0200)]
Bug 25303: Add a test for ->reset

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25303: Call ->reset before iterate on the set
Jonathan Druart [Thu, 30 Apr 2020 11:24:30 +0000 (13:24 +0200)]
Bug 25303: Call ->reset before iterate on the set

In case we already started to iterate.

This fixes a failing tests in t/db_dependent/Koha/Biblios.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25131: (follow-up) Make sure plugin data is fresh
Tomas Cohen Arazi [Wed, 29 Apr 2020 22:12:09 +0000 (19:12 -0300)]
Bug 25131: (follow-up) Make sure plugin data is fresh

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25303: Effectively delete the city to avoid endless loop
Jonathan Druart [Wed, 29 Apr 2020 13:47:27 +0000 (15:47 +0200)]
Bug 25303: Effectively delete the city to avoid endless loop

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25303: Make Koha::Objects->delete loop on the object set
Jonathan Druart [Tue, 28 Apr 2020 12:37:43 +0000 (14:37 +0200)]
Bug 25303: Make Koha::Objects->delete loop on the object set

If we call Koha::Libraries->delete but Koha::Library->delete exists
(ie. Koha::Object->delete is overridden), then we Koha::Objects->delete
will be called and the overridden will not be executed.

This patch suggests to test if the method is overridden (using
Class::Inspector->function_exists). If so we loop on the different
objects of the set in a transaction and call the overridden ->delete method.

Existing tests widely cover this change.
t/db_dependent/Koha/Objects.t
    subtest 'Return same values as DBIx::Class' => sub {

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25303: Unit tests
Tomas Cohen Arazi [Tue, 28 Apr 2020 14:31:28 +0000 (11:31 -0300)]
Bug 25303: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25296: Make ->empty work for uninstantiated calls
Tomas Cohen Arazi [Wed, 29 Apr 2020 12:28:04 +0000 (09:28 -0300)]
Bug 25296: Make ->empty work for uninstantiated calls

In OO we would usually instantiate the class and then interact with it
like in:
    my $rs = Koha::Patrons->new;
    $rs->empty;

Koha's practice is to call things like Koha::Patrons->search without
instantiating the Koha::Patrons class. To keep consistency, this patch
instantiates the resultset object on behalf of the caller if required.

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  $k prove t/db_dependent/Koha/Objects.t
=> FAIL: Tests fail because it is expected to have the class
instantiated
3. Apply this patch
4. Repeat 2.
=> SUCCESS: Tests pass, instantiation happens implicitly.
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25296: Tests for uninstantiated behaviour
Tomas Cohen Arazi [Wed, 29 Apr 2020 12:27:22 +0000 (09:27 -0300)]
Bug 25296: Tests for uninstantiated behaviour

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25296: Add a way to force an empty Koha::Objects resultset
Tomas Cohen Arazi [Mon, 27 Apr 2020 21:33:05 +0000 (18:33 -0300)]
Bug 25296: Add a way to force an empty Koha::Objects resultset

This patch adds a new ->empty method to Koha::Objects, that can be used
to make the underlying DBIC resultset empty. This way, we can have
consistency in our method's return values without the need to build
a query that we know in advance that will be empty. No need to hit the
DB at all.

To test:
1. Apply this patches
2. Notice the tests cover what is expected
3. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass! Yay!
4. 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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25296: Unit tests
Tomas Cohen Arazi [Mon, 27 Apr 2020 21:32:50 +0000 (18:32 -0300)]
Bug 25296: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19313: Fix typo in in unimarc_field_130.pl value builder
George Veranis [Wed, 22 Apr 2020 11:53:56 +0000 (13:53 +0200)]
Bug 19313: Fix typo in in unimarc_field_130.pl value builder

This patch fixes a simple typo

Test plan:
1) Go to Administration -> MARC bibliographic framework
2) Select a framework and add plugin unimarc_field_130.pl to 130 field
3) Open cataloguing screen
4) Go to 130 field and check if for subfield a shows value for
   'unknown' select it and close the window, check on value on 130$a at
   position 8 to have the value 'd'.
5) Repeat step 4 and select the value 'mixed emulsion' close the plugin
   window and check at position 8 to have the value 'u'
6) Apply the patch
7) Go to field 130, open the plugin window and select value 'unknown'
   close the window and check at position 8 to have the value 'u'
8) Go to field 130, open the plugin window and select value 'mixed
   emulsion', close the window and check at position 8 to have the
   value 'v'

https://www.ifla.org/files/assets/uca/unimarc_updates/BIBLIOGRAPHIC/b_130_update2017.pdf

Mentored-by: Andreas Roussos
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25271: Compiled CSS
Martin Renvoize [Wed, 29 Apr 2020 17:57:47 +0000 (18:57 +0100)]
Bug 25271: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25271: Add floating toolbar to OPAC cart
Owen Leonard [Fri, 24 Apr 2020 00:51:35 +0000 (00:51 +0000)]
Bug 25271: Add floating toolbar to OPAC cart

This patch adds JavaScript to the OPAC cart view so that the toolbar at
the top of the display "floats" as you scroll down.

The patch also makes a minor correction to the OPAC SCSS affecting the
display of the buttons in the cart toolbar.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Add some items to a cart in the OPAC.
 - Open the cart and confirm that the toolbar sticks to the top of the
   window as you scroll down.
 - Confirm that it works in the "More details" view.
 - Confirm that other JavaScript-based operations are not affected:
   table sorting and all the various toolbar buttons.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25166: (follow-up) Update icons generated in JS
Owen Leonard [Thu, 23 Apr 2020 11:50:34 +0000 (11:50 +0000)]
Bug 25166: (follow-up) Update icons generated in JS

This patch adds aria attributes to Font Awesome icons generated by
JavaScript. The icons won't appear under normal circumstances because
the code for displaying the modal dialog should replace the icons with a
text label. The icons are a fallback.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25166: Add "aria-hidden = true" to Font Awesome icons in the OPAC
Owen Leonard [Wed, 15 Apr 2020 23:14:15 +0000 (23:14 +0000)]
Bug 25166: Add "aria-hidden = true" to Font Awesome icons in the OPAC

Font Awesome's accessibility guidelines
(https://fontawesome.com/v4.7.0/accessibility/) suggest that we include
'aria-hidden="true"' in the icon markup. This prevents screen
readers from trying to read the icon. This patch adds the attribute.

To test apply the patch and browse the OPAC looking for any problems
with icons: On search results, bibliographic details page, the cart,
lists, etc.

Check the source and verify that Font Awesome icons have the
"aria-hidden" attribute.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Attribute present, all looks good. The 'aria-label' attribute is
not translatable, but it's another problem.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25294: Don't show deletion button if user can't delete suggestions
Owen Leonard [Mon, 27 Apr 2020 15:21:30 +0000 (15:21 +0000)]
Bug 25294: Don't show deletion button if user can't delete suggestions

This patch adds logic to the OPAC suggestions template so that when the
OPACViewOthersSuggestions system preference is enabled and the logged-in
user is viewing other users' suggestions, the "Delete selected" button
is only displayed when there are suggestions the user can delete.

To test you should have suggestions in your system from at least two
users.

- Set the OPACViewOthersSuggestions preference to "Show"
- Log in to the OPAC as a user who hasn't submitted any suggestions
- Go to the suggestions page (with "?suggested_by_anyone=1" appended to
  the URL if necessary, see Bug 22515).
- In the table of suggetions, there should be no titles with a checkbox
  in the first column.
- At the bottom of the table there should be no "Delete selected"
  button.

- Log in to the OPAC as a user with suggestions.
- Return to the suggestions page and view all suggestions.
- There should be titles with corresponding checkboxes and the "Delete
  selected" button should appear at the bottom.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25002: JS Includes should be wrapped with template comments
Owen Leonard [Fri, 27 Mar 2020 23:35:51 +0000 (23:35 +0000)]
Bug 25002: JS Includes should be wrapped with template comments

This patch adds HTML comments to Template::Toolkit include files which
contain <script> tags so that it is clear where the embedded scripts can
be found in the code.

To test, apply the patch and view source on the following pages to
verify the presence of the comments:

Acquisitions home page:
  - acquisitions-toolbar.inc
  - validtor-strings.inc
  - js_includes.inc
  - format-price.inc
Acquisitions -> Add order from new record,
Acquisitions -> Receive order:
  - additem.js.inc
Cataloging -> Add/Edit item:
  - columns_settings.inc
  - strings.inc
  - select2.inc
  - calendar.inc
  - str/cataloging_additem.inc
Authorities home page:
  - authorities_js.inc
Bibliographic detail page:
  - catalog-strings.inc
Cataloging -> Advanced editor:
  - cateditor-ui.inc
  - cateditor-widgets-marc21.inc
Administration -> Item types:
  - greybox.inc
ILL requests:
  - ill-list-table-strings.inc
Web installer
  - installer-intranet-bottom.inc
Web installer -> Onboarding
  - installer-strings.inc
Lists -> List contents -> Merge records
  - merge-record-strings.inc
Patrons -> Patron -> Change password
  - password_check.inc
  - str/members-menu.inc
Patrons -> Patron -> Print summary
  - slip-print.inc
Circulation -> Check out
  - timepicker.inc
Administration -> System preferences:
  - str/tinymce_i18n.inc
  - wysiwyg-systempreferences.inc
Cataloging -> Z39.50 Search:
  - z3950_search.inc

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25149: Fix Zebra language code for Greek
Andreas Roussos [Wed, 15 Apr 2020 07:46:50 +0000 (09:46 +0200)]
Bug 25149: Fix Zebra language code for Greek

According to the list of two-letter language codes found in ISO 639-1
(https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), the correct
Zebra language option for Greek should be 'el', not 'gr'.

This patch fixes that.

Test plan:
0) Apply the patch.
1) Confirm that 'gr' has been changed to 'el' in all relevant files.
2) Create a new Koha instance using `koha-create --zebralang el testinst1`.
3) Edit /etc/koha/koha-sites.conf and set ZEBRA_LANGUAGE to 'el'. Then,
   create another Koha instance with `koha-create testinst2`.
4) Confirm that both instances created in steps 2) and 3) have picked up
   the Zebra CHR file from the /etc/koha/zebradb/lang_defs/el/ directory.
   This is done by inspecting the value of 'profilePath' in these files:
   /etc/koha/sites/testinst{1,2}/zebra-authorities-dom.cfg
   /etc/koha/sites/testinst{1,2}/zebra-biblios-dom.cfg

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24908: Add text-formatted MARC support in /biblios/{biblio_id}
Tomas Cohen Arazi [Thu, 19 Mar 2020 15:04:39 +0000 (12:04 -0300)]
Bug 24908: Add text-formatted MARC support in /biblios/{biblio_id}

This patch makes the route support requesting (through the Accept
header) the MARC record to be output as formatted text as in
$record->as_formatted.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: Tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Try the route with your favourite API testing tool (Postman?)
=> SUCCESS: Accept: text/plain returns the expected results
=> SUCCESS: Wrong Accept header returns a list of valid formats, and
includes 'text/plain'.
6. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24908: Unit tests
Tomas Cohen Arazi [Thu, 19 Mar 2020 15:04:27 +0000 (12:04 -0300)]
Bug 24908: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22630: Schema Update
Martin Renvoize [Wed, 29 Apr 2020 16:11:35 +0000 (17:11 +0100)]
Bug 22630: Schema Update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22630: DBRev 19.12.00.081
Martin Renvoize [Wed, 29 Apr 2020 16:11:13 +0000 (17:11 +0100)]
Bug 22630: DBRev 19.12.00.081

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22630: Fix capitalization
Katrin Fischer [Mon, 27 Apr 2020 06:23:59 +0000 (06:23 +0000)]
Bug 22630: Fix capitalization

Home Library -> Home library
Holding Library -> Holding library

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22630: Set is_boolean flag for course_items.homebranch_enabled
Julian Maurice [Fri, 24 Apr 2020 09:01:46 +0000 (11:01 +0200)]
Bug 22630: Set is_boolean flag for course_items.homebranch_enabled

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22630: Update Koha::Schema::Result::CourseItem
Julian Maurice [Fri, 24 Apr 2020 08:58:07 +0000 (10:58 +0200)]
Bug 22630: Update Koha::Schema::Result::CourseItem

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22630: Allow to change homebranch in course reserves
Julian Maurice [Wed, 3 Apr 2019 12:49:00 +0000 (14:49 +0200)]
Bug 22630: Allow to change homebranch in course reserves

Test plan:
1. Create a course (disabled)
2. Add a reserve to this course for an item and set a homebranch
   different from the item's homebranch
3. Enable the course
4. Verify that the item's homebranch has changed
5. Disable the course
6. Verify that the item's homebranch was reset to its initial value
7. prove t/db_dependent/CourseReserves/CourseItems.t

Sponsored-by: Université de Lyon 3
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25110: (QA follow-up) Add aria-hidden="true" to FA icons
Katrin Fischer [Sat, 25 Apr 2020 23:06:05 +0000 (23:06 +0000)]
Bug 25110: (QA follow-up) Add aria-hidden="true" to FA icons

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25110: Allow patrons to add star ratings to titles on their summary/checkout...
Owen Leonard [Tue, 14 Apr 2020 16:31:28 +0000 (16:31 +0000)]
Bug 25110: Allow patrons to add star ratings to titles on their summary/checkout page

This patch adds the ability for logged-in patrons to add star ratings to
titles in their list of current checkouts and on the reading history
page.

The reading history page previously only showed existing ratings. Now it
will allow the entry of ratings as well.

The JS and markup for the feature are in separate include files to
facilitate re-use. It includes markup for non-js display of ratings and
js-driven ratings controls.

To test, apply the patch and set the OpacStarRatings to all, "results,
details, and user" pages.

 - Log in to the OPAC as a user with checkouts.
 - On the "your summary" page, test the features of setting star
   ratings:
   - Any title with existing ratings should show the rating and the
     average rating number.
   - Set a rating. Confirm that it shows a message with your rating.
   - Click the "cancel rating" link, and confirm that your rating is
     removed.
   - Set a rating and reload the page. Confirm that the rating was
     saved.
   - Test the "cancel rating" link on the title you set before you
     reloaded the page. The rating should be cancelled.
 - Test the same functionality on the "your reading history" page.
 - Test these pages with the  OpacStarRatings preference set to "only
   details" or "no." The pages should function correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25281: Use modal confirmation when deleting a list in the OPAC
Owen Leonard [Fri, 24 Apr 2020 18:29:21 +0000 (18:29 +0000)]
Bug 25281: Use modal confirmation when deleting a list in the OPAC

This patch modifies the process of deleting a list in the OPAC so that
the deletion confirmation alert is replaced with a Bootstrap modal.

In the process, I moved the repeated deletion form markup into a block

To test, apply the patch and log in to the OPAC as a user who has
multiple lists, including some which have been shared with other users.

Go to the list of your lists and click the "Delete" link next to any of
your lists. It should trigger a confirmation modal:

 - The modal should show the title of the list you're deleting.
 - If the list has titles on it, it show how many.
 - If the list has been shared with someone it should say so.

Next, view a list which is not empty.

 - Test the "Delete list" link in the toolbar.
 - You should see the same information in the confirmation message as in
   the previous step.

Do the same with a list which is empty.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25280: Use modal confirmation when removing share from a list in the OPAC
Owen Leonard [Fri, 24 Apr 2020 14:48:21 +0000 (14:48 +0000)]
Bug 25280: Use modal confirmation when removing share from a list in the OPAC

This patch updates the process of removing a share from a list in the
OPAC so that the confirmation request shown to the user is a Bootstrap
modal instead of a plain JavaScript confirm dialog.

To test you should have the OpacAllowSharingPrivateLists enabled.

 - Log in to the OPAC as a user who has multiple private lists.
 - Share two or more lists with another user in the system.
 - Accept the list shares on behalf of the other user and log in to the
   OPAC as that user.
   - In the list of that user's lists, test the process of removing a
     share:
     - Clicking "Remove share" should trigger a modal which asks if you
       want to remove sharing. It should show the name of the list in
       question.
     - Test the funcionality of both the "No" and "Yes" options.
     - Confirm that the "Remove share" button works correctly for any of
       multiple lists.
   - View the contents of a list which has been shared with this user.
     - Test the "Remove share" button at the top of the list's contents.
       - The same confirmation dialog should be triggered.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23137: Move cache flushing to the method
Jonathan Druart [Wed, 15 Apr 2020 14:38:16 +0000 (16:38 +0200)]
Bug 23137: Move cache flushing to the method

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23137: Add documentation
Nick Clemens [Tue, 14 Apr 2020 10:14:00 +0000 (10:14 +0000)]
Bug 23137: Add documentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23137: Add reset and delete to koha-elasticsearch
Nick Clemens [Thu, 19 Mar 2020 16:37:24 +0000 (16:37 +0000)]
Bug 23137: Add reset and delete to koha-elasticsearch

Same as previous test, but use the script to run the reindex
reset_all to update the scripts or use
misc4dev/cp_debian_files.pl

sudo koha-elasticsearch --rebuild -r -v

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>