koha.git
8 years ago Bug 13238: Specific string if no results
Jonathan Druart [Mon, 14 Mar 2016 16:40:59 +0000 (16:40 +0000)]
 Bug 13238: Specific string if no results

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 13238: Improve heading on vendor search when searching for all vendors
Aleisha [Wed, 2 Mar 2016 00:36:49 +0000 (00:36 +0000)]
 Bug 13238: Improve heading on vendor search when searching for all vendors

To test:
1) Go to Acquisitions and do an empty vendor search
2) Should now read "Vendor search: X results found"
3) Enter a search term and search for vendor
4) Should now read "Vendor search: Y results found for 'search term'"

Sponsored-by: Catalyst IT
NOTE: two nested if/else/end's could make it result/results,
      as suggested in comment #3. However, this meets my understanding
      of the problem as defined in comment #0.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 13464 - Standardize the pagination class
Owen Leonard [Mon, 21 Mar 2016 13:32:39 +0000 (09:32 -0400)]
 Bug 13464 - Standardize the pagination class

There are a few template which use a different wrapper class for the
pagination links. These should be made consistent for a consistent
style.

To test, apply the patch and go to Administration -> Budgets.

- On this page the pagination markup has been removed in favor of
  DataTables pagination. The budget tables were already sorted using
  DataTables, so having server-side pagination on top of that doesn't
  make sense.

In Administration -> Class sources:

- This page had pagination markup which was unused.

In Authorities -> Authority search results:

- Perform an authority search which will return more than one page of
results. Confirm that the pagination links are correctly styled.

In Search -> Item search:

- Perform a search which will return more than one page of results.
Confirm that the pagination links are correctly styled.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Since the funds are all displayed (and nobody complained), it makes sense to
display all budgets.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 14582 - OPAC detail shows an unuseful link to "add tag" when user is not logged in
Owen Leonard [Mon, 21 Mar 2016 14:47:56 +0000 (10:47 -0400)]
 Bug 14582 - OPAC detail shows an unuseful link to "add tag" when user is not logged in

This patch rearranges some parts of the OPAC detail page template so
that the "add tag" link does not appear if the user is not logged in.

This patch also includes some whitespace changes, so please diff
accordingly.

To test, apply the patch and set "TagsEnabled" to "Allow."

- With "TagsInputOnDetail" set to "Allow," view the detail page for a
  bibliographic record in the OPAC when /not/ logged in. You should see
  a "Log in to add tags" link which triggers the login modal when
  clicked.

- Log in and view the same page. Confirm that there is now an "Add
  tag(s)" link which triggers the add tags form. Confirm that the
  behavior of the add tags form is still correct.

- With "TagsInputOnDetail" set to "Don't allow" view the detail page
  again and verify that the "Log in to add tags" link doesn't appear
  when not logged in, and the "Add tags" link doesn't appear when logged
  in.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15044: Add date suggestion to OPAC suggestions table
Aleisha [Sun, 13 Mar 2016 23:29:42 +0000 (23:29 +0000)]
 Bug 15044: Add date suggestion to OPAC suggestions table

To test:
1) Log in to OPAC, go to your purchase suggestions (opac-suggestions.pl)
2) Confirm there is now a 'Suggested on' column displaying the date of your past suggestions
3) Add a new purchase suggestion and confirm that the date displayed is correct

Sponsored-by: Catalyst IT
Signed-off-by: Marjorie <marjorie.barry-vila@ccsr.qc.ca>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15196: Default sorting of patron lists
Aleisha [Sun, 20 Mar 2016 23:47:30 +0000 (23:47 +0000)]
 Bug 15196: Default sorting of patron lists

This patch sorts users by surname.
Also string fix -> Firstname to First name in column heading

To test:
1) Go to a patron list
2) Confirm it is sorted by surname
3) Add a patron that will need to slot in the middle somewhere
4) Confirm the data table sorts it correctly
5) Confirm column heading change

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15672: (follow-up) Show descriptions instead of codes on the hold ratios report
Jonathan Druart [Thu, 17 Mar 2016 08:48:56 +0000 (08:48 +0000)]
 Bug 15672: (follow-up) Show descriptions instead of codes on the hold ratios report

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15672 [Revised] Show descriptions instead of codes on the hold ratios report
Owen Leonard [Wed, 16 Mar 2016 14:00:40 +0000 (10:00 -0400)]
 Bug 15672 [Revised] Show descriptions instead of codes on the hold ratios report

This patch revises the hold ratios report so that it uses template
plugins to display descriptions instead of codes for item holding
branch, item home branch, item type, and shelving location.

To test you should have multiple items on the hold ratio report (set the
ratio to a small number to increase the number of results). It should
include one or more items which have a shelving location set.

View the hold ratios report and confirm that library names, shelving
location descriptions, and item type descriptions are shown instead of
codes.

This revised patch steals from Bug 15560 to enable the correct display
of multiple home libraries, holding libraries, shelving locations, item
types, and call numbers. To properly test you should have records in
your report which have multiple values for each of those fields.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15825 - Patron lists does not show tools menu sidebar
Owen Leonard [Tue, 15 Mar 2016 17:43:37 +0000 (13:43 -0400)]
 Bug 15825 - Patron lists does not show tools menu sidebar

Patron lists pages do not show the Tools sidebar menu like other tools
pages do. This page adds it to two views: The list of lists, and the
page for adding to a list.

To test, apply the patch and go to Tools -> Patron lists.

- Confirm that this page has the tools sidebar menu.
- On any existing list click Actions -> Add patrons.
- Confirm that the page has the tools sidebar menu.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15952: Add missing <tr>
Jonathan Druart [Wed, 16 Mar 2016 11:09:18 +0000 (11:09 +0000)]
 Bug 15952: Add missing <tr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15952: Moving cataloging search actions into a drop-down menu
Aleisha [Tue, 1 Mar 2016 23:09:39 +0000 (23:09 +0000)]
 Bug 15952: Moving cataloging search actions into a drop-down menu

Edit: Have removed the datatables stuff - wasn't necessary. Also fixed a
merge conflict
Edit: Comment 7

To test:
1) Go to Cataloging and do a search in the catalog and reservoir
   (cataloguing/addbooks.pl)
2) Confirm that for the results found in catalog, the options (MARC and
   Card preview, Edit biblio, Add/edit items) are there and behave as
   expected.
3) Confirm that for the results found in reservoir, the options (MARC
   and Card preview, Add biblio) are there and behave as expected.
4) Set user permissions so that the user cannot edit the catalog or
   items. (editcatalogue -> edit_catalogue and edit_items)
5) Confirm that you no longer see the options to edit or add
   items/biblio in either table.

Sponsored-by: Catalyst IT
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Expected result following the test plan.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15989 [Follow-up] Making classification sources actions buttons
Owen Leonard [Fri, 11 Mar 2016 17:56:11 +0000 (12:56 -0500)]
 Bug 15989 [Follow-up] Making classification sources actions buttons

This trivial follow-up adds an "actions" class to the table cell
containing the new buttons. In conjunction with the style update in Bug
16048, this will prevent the buttons from wrapping at narrow browser
window widths.

Also changed in this patch: A couple of capitalization errors.

To test, apply the patch for Bug 16048 and go to Administration ->
Classification sources. Confirm that the "Edit" and "Delete" buttons do
not stack on top of each other even at narrow browser widths.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15989: Making classification sources actions buttons
Aleisha [Thu, 10 Mar 2016 01:39:55 +0000 (01:39 +0000)]
 Bug 15989: Making classification sources actions buttons

To test:

1) Go to Administration -> Classification sources
2) Confirm that the actions 'Edit' and 'Delete' now show as buttons for
   BOTH tables and work as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16032 - Use Font Awesome icon in "note" styled divs
Owen Leonard [Wed, 9 Mar 2016 18:58:17 +0000 (13:58 -0500)]
 Bug 16032 - Use Font Awesome icon in "note" styled divs

Several pages use <div class="note"> to display important information
about the functionality on the page. The style of this div can be
modified to use Font Awesome, eliminating an image file.

To test, apply the patch and clear your browser cache if necessary.

- Go to Administration -> Authorized values.
- Confirm that the "NOTE" box is styled correctly.
- Edit an existing authorized value.
- Confirm that the "NOTE" box is styled correctly.

- Go to Tools -> Batch record deletion.
- Submit a batch of biblionumbers.
- Confirm that the "Reminder" box is styled correctly.
- Go back and submit a batch of authority numbers.
- Confirm that the "Reminder" box is styled correctly.

- Go to Tools -> Batch record modification.
- Submit a batch of biblionumbers.
- Confirm that the "Reminder" box is styled correctly.
- Go back and submit a batch of authority numbers.
- Confirm that the "Reminder" box is styled correctly.

- Check that there are no other references to "note.png" in the
  templates.

Followed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16037: Renaming 'Print basket group' as 'Export as PDF'
Aleisha [Sun, 13 Mar 2016 21:35:06 +0000 (21:35 +0000)]
 Bug 16037: Renaming 'Print basket group' as 'Export as PDF'

To test:
1) Go to Acquisitions
2) Go to the basket groups for a vendor
3) Confirm that an open basket group has the option to 'Close and export as PDF'
4) Confirm that a closed basket group has the option to 'Export as PDF'
5) Confirm these buttons still work as expected

Sponsored-by: Catalyst IT
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16039: Remove useless exit
Jonathan Druart [Mon, 21 Mar 2016 15:04:56 +0000 (15:04 +0000)]
 Bug 16039: Remove useless exit

pod2usage will exit with the status given in parameter.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16039: Added -q flag to share_usage_with_koha_community.pl
Srdjan [Thu, 10 Mar 2016 06:03:51 +0000 (19:03 +1300)]
 Bug 16039: Added -q flag to share_usage_with_koha_community.pl

To test:

With UsageStats syspref set to No:

* run misc/cronjobs/share_usage_with_koha_community.pl
  (without -q)
  - "The UsageStats system preference is not set." message
    with usage info should be output

* run misc/cronjobs/share_usage_with_koha_community.pl -q
  - the output should be quiet

NOTE: See comment #7.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16043 - Use Font Awesome icon in hold confirmation dialog
Owen Leonard [Thu, 10 Mar 2016 15:32:11 +0000 (10:32 -0500)]
 Bug 16043 - Use Font Awesome icon in hold confirmation dialog

This patch fixes another instance in the checkin template where a Font
Awesome icon should be used instead of a background image.

To test, apply the patch and locate an item which is on hold for a
patron at your logged in library.

- Check in the item.
- Confirm the hold.
- Check in the item again.
  - You should get a "Hold found (item is already waiting)" message. The
    "Print and confirm" button in this dialog should have a Font Awesome
    icon.
  - Confirm that the print button still works correctly.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16046 - Use Font Awesome icons on patron edit pages
Owen Leonard [Thu, 10 Mar 2016 16:43:32 +0000 (11:43 -0500)]
 Bug 16046 - Use Font Awesome icons on patron edit pages

This patch updates links in the patron edit and batch patron
modification templates to use Font Awesome icons instead of
background-images.

To test you must have ExtendedPatronAttributes enabled and at least one
repeatable attribute defined.

- Apply the patch and edit any patron record.
- In the section for editing attributes and identifiers, check the
  styling and behavior of the "Clear" and "New" links.
- In Tools -> Batch patron modification, load a batch of patron records.
- In the "Edit" form, check the style and behavior of the "Clear" link
  for date inputs.
- Test the "New" and "Delete" links for patron attributes.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16052: Putting buttons from after MARC records have been staged into a toolbar
Aleisha [Tue, 15 Mar 2016 00:34:31 +0000 (00:34 +0000)]
 Bug 16052: Putting buttons from after MARC records have been staged into a toolbar

EDIT: Incorporating Owen Leonard's changes from Comment 6

To test:
1) Go to Tools -> Stage MARC records for import
2) Upload any file and click Stage for import once it has uploaded
3) Confirm both links are now buttons in a toolbar and work as expected
4) Notice that 'Stage MARC records' (what was once the 'Back' button)
   now takes you back to stage-marc-records.pl instead of tools-home.pl
5) Also confirm that the space between results and colon (MARC staging
   results :) is gone

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Thank you, this is a great improvement.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16057: Use font awesome button for cleaning a batch of staged MARC records
Aleisha [Sun, 13 Mar 2016 22:08:22 +0000 (22:08 +0000)]
 Bug 16057: Use font awesome button for cleaning a batch of staged MARC records

To test:
1) Go to Tools -> Staged MARC management (tools/manage-marc-import.pl)
2) Confirm that 'Clean' button is now styled as a font awesome button
   and works as expected

Sponsored-by: Catalyst IT
NOTE: If anyone can suggest an appropriate font awesome icon to go with
this button, feel free to add it. I had a play around with some buttons
and couldn't really find one that fit.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16059: Use Font Awesome icons in standard cataloging duplicate warning dialog
Owen Leonard [Wed, 9 Mar 2016 02:08:01 +0000 (21:08 -0500)]
 Bug 16059: Use Font Awesome icons in standard cataloging duplicate warning dialog

In the standard MARC editor, when a duplicate record is suspected a
dialog is shown. This patch updates the template to show Font Awesome
icons in this dialog.

Also changed: Using <h3> instead of <h4> in dialog so that it is
correctly styled. Adding "popup" class to duplicate record link to
indicate that a new window will be opened.

To test, apply the patch and go to Cataloging -> New record.

- Use Z39.50 to import a record which is already in your catalog.
- Save the record. Confirm that the duplicate warning dialog is styled
  correctly.
- Confirm that both the "Save as new" and "Edit items" buttons work
  correctly.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16062 - (follow-up) Remove CSS and images related to old "approve" and "deny...
Jonathan Druart [Thu, 17 Mar 2016 09:46:09 +0000 (09:46 +0000)]
 Bug 16062 - (follow-up) Remove CSS and images related to old "approve" and "deny" button styles

Remove another obsolete CSS rule for input.approve

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16062 - Remove CSS and images related to old "approve" and "deny" button styles
Owen Leonard [Wed, 9 Mar 2016 12:54:22 +0000 (07:54 -0500)]
 Bug 16062 - Remove CSS and images related to old "approve" and "deny" button styles

Now that confirmation dialogs have all been udpated to use Font Awesome
icons, the old CSS for styling "approve" and "deny" buttons can be
removed along with the associated images.

To test, apply the patchs for Bugs 16061 and 16064 if necessary.

- Search the templates for instances of the "approve" or "deny" class
  which don't have a Font Awesome icon associated with it. There should
  be none.
- Confirm that there are no other references to the files "approve.gif"
  and "deny.gif"

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16071: Use Font Awesome icons in authority duplicate warning dialog
Owen Leonard [Mon, 14 Mar 2016 17:47:01 +0000 (13:47 -0400)]
 Bug 16071: Use Font Awesome icons in authority duplicate warning dialog

In the authority editor, when a duplicate record is suspected a
dialog is shown. This patch updates the template to show Font Awesome
icons in this dialog.

Also changed: Using <h3> instead of <h4> in dialog so that it is
correctly styled. Adding "popup" class to duplicate record link to
indicate that a new window will be opened.

To test, apply the patch and go to Authorities -> New record.

- Use Z39.50 to import a record which is already in your catalog.
- Save the record. Confirm that the duplicate warning dialog is styled
  correctly.
- Confirm that both the "Save as new" and "Edit existing" buttons work
  correctly.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16074: Replace Modify with Edit
Jonathan Druart [Fri, 18 Mar 2016 07:56:07 +0000 (07:56 +0000)]
 Bug 16074: Replace Modify with Edit

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16074: Making frequencies actions buttons
Aleisha [Tue, 15 Mar 2016 06:14:40 +0000 (06:14 +0000)]
 Bug 16074: Making frequencies actions buttons

To test:

1) Go to Serials -> Manage frequencies
2) Confirm that buttons 'Modify' and 'Delete' show as buttons and work
   as expected
3) Confirm that when you make your window narrow, the column with the
   buttons does not wrap
4) Confirm that column heading is now 'Actions'

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Buttons look correct and work correctly.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15866: Add confirm message for deleting rotating collection from toolbar
Aleisha [Sun, 20 Mar 2016 23:24:18 +0000 (23:24 +0000)]
 Bug 15866: Add confirm message for deleting rotating collection from toolbar

To test:
1) Go to Tools -> Rotating Collections
2) Click on any rotating collection ('Add or remove items' from drop down menu)
3) Click 'Delete' from toolbar. Validate you are now asked to confirm your deletion. Check that cancel works, then check that confirm works.

Sponsored-by: Catalyst IT
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I've added the word 'rotating' before collection, to make
it clear for translators what is meant here.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years agoBug 15773: Fix and standardise checkboxes code in framework
Jonathan Druart [Tue, 9 Feb 2016 17:02:05 +0000 (17:02 +0000)]
Bug 15773: Fix and standardise checkboxes code in framework

When creating a new subfield for an authority framework, the checkboxes
don't behave as they should.
If you click on the 'repeatable', 'mandatory' or 'is url' checkbox's
label, the checkbox from the second tab will be checked/unchecked.
This is caused by a non-unique id of the input element.

I have found this bug when working on the removal of CGI::checkbox in
both admin/auth_subfields_structure.pl and
admin/marc_subfields_structure.pl scripts.

This patch remove the use of CGI::checkbox as well as the generation of
html code from these 2 pl scripts (which should be avoided).
The code these scripts are now pretty similar.

Test plan:
Add/modify/remove subfield for a MARC framework and an Authority
framework.
Use as many field as possible and confirm that the values are correctly
inserted/displayed.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16114: Koha::ItemType->translated_description should return a string
Jonathan Druart [Tue, 22 Mar 2016 09:38:52 +0000 (09:38 +0000)]
Bug 16114: Koha::ItemType->translated_description should return a string

This patch fixes a regression introduce by bug 14828.
If an itemtype is translated, its description won't be displayed
correctly on the item search form.

Koha::ItemType->translated_description is only used once.

Test plan:
- define a translation for an item type (Administration ->
  Item types -> Edit -> Translate into other languages)
- go on the item search form, the item type should be displayed
  correctly.

QA note: This module is not covered by tests, it seems that I forgot to
write them...

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16075: Making numbering patterns actions buttons
Aleisha [Tue, 15 Mar 2016 06:26:06 +0000 (06:26 +0000)]
Bug 16075: Making numbering patterns actions buttons

To test:

1) Go to Serials -> Manage numbering patterns
2) Confirm that buttons 'Edit' and 'Delete' show as buttons and work as
   expected
3) Confirm that when you make your window narrow, the column with the
   buttons does not wrap
4) Confirm that column heading is now 'Actions'

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Buttons look correct and work correctly.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16078 [Revised] Remove unused YUI CSS
Owen Leonard [Tue, 15 Mar 2016 13:58:22 +0000 (09:58 -0400)]
Bug 16078 [Revised] Remove unused YUI CSS

The YUI CSS file "skin.css" is no longer relevant to the staff client
templates and can be removed. Other references to YUI-related classes,
with the exception of grids, can also be removed.

This patch removes references in CSS to:

.yuimenuitemlabel
.yui-button
.yui-menu-button

...and removes the "yui-skin-sam" class from two templates' body tag.

skin.css is also included in a list of assets cached by the offline
circulation page. It can be safely removed.

To test, apply the patch and clear your cache if necessary. Look around
and confirm that the style of the staff client is unchanged.

Search for references to the listed classes and confirm that none are
found.

Revised patch squashes in the follow-up as well as a missing commit
removing skin.css from staff-global.css.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16081: Making Koha to MARC mapping actions buttons
Aleisha [Wed, 16 Mar 2016 03:25:58 +0000 (03:25 +0000)]
Bug 16081: Making Koha to MARC mapping actions buttons

To test:

1) Go to Admin -> Koha to MARC mapping
2) Confirm that Edit shows as a font awesome button and works as
   expected.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16096: Change 'modify' to 'edit' for OAI sets config
Aleisha [Thu, 17 Mar 2016 22:39:57 +0000 (22:39 +0000)]
Bug 16096: Change 'modify' to 'edit' for OAI sets config

To test:
1) Go to Admin > OAI Sets Configuration
2) Confirm button in dropdown now says 'Edit'. Click button
3) Confirm heading of page now says 'Edit' and says 'Edit' in breadcrumbs

Sponsored-by: Catalyst IT
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16097: Making messages for subscription fields more user friendly
Aleisha [Thu, 17 Mar 2016 23:15:40 +0000 (23:15 +0000)]
Bug 16097: Making messages for subscription fields more user friendly

To test:
1) Go to Serials -> Add Subscription fields
2) Create a field, confirm message.
3) Attempt to create a new field that has the same name as an existing
   field, confirm message.
4) Create another field with a different name. Attempt to edit this
   field to have the same name as another field. Confirm message
5) Edit field (change name to something different)
6) Delete field, confirm message.
6) Turn off permissions to delete subcriptions ONLY. Attempt to delete a
   field, confirm message.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16098: Making subscription fields actions buttons
Aleisha [Thu, 17 Mar 2016 23:52:14 +0000 (23:52 +0000)]
Bug 16098: Making subscription fields actions buttons

To test:
1) Go to Serials -> Add subscription fields
2) Confirm actions "Edit" and "Delete" now show as buttons and work as
   expected
3) When you make your browser narrow, confirm that the Actions column
   does not wrap
4) Confirm that you cannot sort on the Actions column

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16099: Make name required field when creating subscription field
Aleisha [Fri, 18 Mar 2016 00:02:20 +0000 (00:02 +0000)]
Bug 16099: Make name required field when creating subscription field

To test:
1) Notice behaviour when adding subcription field (Serials) without a
   name
2) Apply patch
3) Attempt to create subscription field without a name and click Save
4) Notice that you not cannot submit the form without adding the name

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16110: Making lists actions buttons
Aleisha [Sat, 19 Mar 2016 21:43:36 +0000 (21:43 +0000)]
Bug 16110: Making lists actions buttons

To test:
1) Go to Lists
2) Confirm that actions (Edit and Delete) now show as font awesome buttons and work as expected for both Public and Private lists

Sponsored-by: Catalyst IT
NOTE: Pretty! :)

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15119: Hide search header text boxes on render
Jonathan Druart [Wed, 6 Jan 2016 13:10:00 +0000 (13:10 +0000)]
Bug 15119: Hide search header text boxes on render

When the page rendering is slow or the page is heavy, the tabs in the
header shown be not correctly displayed as tabs.

This patch suggests to hide them, display the first one, and wait for
the JS code to display them nicely.

To easily reproduced the ergonomic issue, go on the circulation home
page (/cgi-bin/koha/circ/circulation.pl) and search for a patron 'a' or
'd', you will get a lot of result and the page will be slow to be fully
displayed.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15861: Isolated 'The' in help files untranslatable
Aleisha [Sun, 20 Mar 2016 23:37:38 +0000 (23:37 +0000)]
Bug 15861: Isolated 'The' in help files untranslatable

Changes made:

help/reports/reports-home.tt
    Line 11: Koha database schema: shows the entire Koha database structure so that you can write effective SQL Queries
    Line 12: Koha reports library: lists reports written by Koha users around the world.

help/rotating_collections/rotatingCollections.tt
    Line 7: Important: AutomaticItemReturn (system preference) must be set to ..

TEST PLAN
---------
1) Log in to staff client
2) Click 'Reports'
3) Click 'Help'
   -- Notice the two lines starting with 'The'
4) Click 'Tools'
5) Click 'Rotating collections' in the Catalog column
6) Click 'Help'
   -- Notice the Important has a 'The'
7) Apply patch
8) Repeat steps 2-6
   -- Notice the wording has changed to eliminate 'The'
9) Run koha qa test tools

Sponsored-by: Catalyst IT
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16025 [Revised] Use Font Awesome icons on item types localization page
Owen Leonard [Wed, 9 Mar 2016 15:27:03 +0000 (10:27 -0500)]
Bug 16025 [Revised] Use Font Awesome icons on item types localization page

The item types localization page uses a Glyphicon. This patch converts
it to a Font Awesome icon.

Also changed in this patch: "Delete" text has been added to the delete
link, and a dummy "href" attribute has been added to the link so that it
triggers the right kind of cursor. The deletion confirmation JavaScript
has been edited to ignore the default click action.

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

- Edit any existing item type and click the "Translate into other
  languages" link.
- If there is not an existing translation, add one. Close the modal
  window and click the "Translate into other languages" link again to
  redisplay it.
- Confirm that there is a "Delete" link next to your translation which
  is styled correctly.
- Confirm that the behavior of the "Delete" link is correct both when
  confirming and when canceling.

Revision adds the "actions" class to the table cell with the delete link
to prevent a line break between the icon and the text.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15946 Valid namespace for OAI marcxml schema
Zeno Tajoli [Tue, 1 Mar 2016 10:18:04 +0000 (11:18 +0100)]
Bug 15946 Valid namespace for OAI marcxml schema

This path fixes the value of xml schema variable and the link to Library
of Congress.  For Dublin Core format those values are defined in
UNIMARCslim2OAIDC.xsl and MARC21slim2OAIDC.xsl.  For MARCXML those
values are written into the code

To test it:
1) Setup OAI-PMH
2) Test the site inserting the BaseURL into http://validator.oaipmh.com
3) See the problem with ListMetadataFormats [link:
   http://validator.oaipmh.com/#ListMetadataFormats]
4) Insert the patch
5) See the problem is over

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Invalid before patch, valid after.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15809: Redefine multi_param is CGI < 4.08 is used
Jonathan Druart [Fri, 12 Feb 2016 11:32:02 +0000 (11:32 +0000)]
Bug 15809: Redefine multi_param is CGI < 4.08 is used

On debian Jessie, the CGI version is >= 4.08
Since this version, the param method raise a warning
"CGI::param called in list context".
Indeed, it can cause vulnerability if called in list context

https://metacpan.org/pod/CGI#Fetching-the-value-or-values-of-a-single-named-parameter
http://blog.gerv.net/2014/10/new-class-of-vulnerability-in-perl-web-applications/

There is a long journey to get rid of these warnings.
First I suggest to redefine the multi_param method when the CGI version
 installed is < 4.08, it will allow us to move the wrong ->param calls to
 ->multi_param without waiting for everybody to upgrade.

The different ways to call these 2 methods are:

my $foo = $cgi->param('foo'); # OK

my @foo = $cgi->param('foo'); # NOK, will raise the warning
my @foo = $cgi->multi_param('foo'); #OK

$template->param( foo => $cgi->param('foo') ); # NOK, will raise the warning
                                               # and vulnerable
$template->param( foo => scalar $cgi->param('foo') ); # OK

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested a call to multi_param with CGI < 4.08.
With reference to the comments on Bugzilla, this workaround is arguable,
but provides a base to move to multi_param. If we come up with a better
solution, it should be easy to adjust.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15585: Remove "shift on reference is experimental" warning
Jonathan Druart [Tue, 22 Mar 2016 11:04:41 +0000 (11:04 +0000)]
Bug 15585: Remove "shift on reference is experimental" warning

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15585 - Move C4::Passwordrecovery to the new namespace Koha::Patron::Password...
charles [Wed, 27 Jan 2016 20:17:32 +0000 (15:17 -0500)]
Bug 15585 - Move C4::Passwordrecovery to the new namespace Koha::Patron::Password::Reset

As promised, here is the long-awaited sequel to #8753.

What has changed :

    - The Koha::Patron::Password::Reset is now used in place of C4::Passwordrecovery
    - That ugly shift-grep contraption is no more (goodbye old friend)
    - The generated unique key won't end in a dot anymore

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16106 Correct loose to lose in comment
Colin Campbell [Fri, 18 Mar 2016 13:49:56 +0000 (13:49 +0000)]
Bug 16106 Correct loose to lose in comment

Comment was using incorrect (but similarly spelled) word, obscuring
the meaning slightly. Also corrected the release note altering the
grammar there additionally as it should have been 3rd person singular
so that it now reads more clearly

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15421: Show 'Duplicate' and 'Schedule' on Reports toolbar
Aleisha [Thu, 17 Mar 2016 22:34:08 +0000 (22:34 +0000)]
Bug 15421: Show 'Duplicate' and 'Schedule' on Reports toolbar

To test:
1) Go to Reports -> Use saved
2) Click 'Show' on the dropdown for any report
3) Confirm that 'Duplicate and 'Schedule' are now on the toolbar and work as expected

Sponsored-by: Catalyst IT
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15984 - Correct templates which use the phrase "issuing rules"
Owen Leonard [Fri, 18 Mar 2016 13:41:15 +0000 (09:41 -0400)]
Bug 15984 - Correct templates which use the phrase "issuing rules"

This patch corrects two places in the templates where the phrase
"issuing rules" is used instead of "circulation and fine rules."

To test, apply the patch and view the help pages for Administration ->
Circulation and fine rules; and Tools -> Automatic item modification by
age. Confirm that the term "circulation and fine rules" is used instead
of "issuing rules."

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoDBREV for Bug 16019 - Remove unused blue.css
Brendan Gallagher [Tue, 22 Mar 2016 01:03:03 +0000 (01:03 +0000)]
DBREV for Bug 16019 - Remove unused blue.css

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16019 - Remove unused blue.css
Owen Leonard [Wed, 9 Mar 2016 13:51:26 +0000 (08:51 -0500)]
Bug 16019 - Remove unused blue.css

This patch removes blue.css and one image which was used only by
blue.css, css_header.png.

To test, apply the patch and search Koha files for references to
blue.css and css_header.png. There should be none.

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: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16019: Add a warning in the update DB process if intranetcolorstylesheet=blue.css
Jonathan Druart [Fri, 18 Mar 2016 16:34:09 +0000 (16:34 +0000)]
Bug 16019: Add a warning in the update DB process if intranetcolorstylesheet=blue.css

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 16020 - Remove unused CSS and images following label creator UX changes
Owen Leonard [Wed, 9 Mar 2016 14:20:14 +0000 (09:20 -0500)]
Bug 16020 - Remove unused CSS and images following label creator UX changes

Since the changes made by Bug 16020, some CSS and images are no longer
needed by the label and patron card creator modules. This patch removes
the unnecessary files and CSS.

To test, apply the patch and go to Tools -> Label creator.

- Confirm that the label creator home page doesn't look broken.
- Go to Tools -> Patron card creator and confirm that the page doesn't
  look broken.
- Search Koha files for references to label-creator-image.png. There
  should be none.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16023 - Use Font Awesome icons on audio alerts page
Owen Leonard [Wed, 9 Mar 2016 15:02:08 +0000 (10:02 -0500)]
Bug 16023 - Use Font Awesome icons on audio alerts page

The audio alerts management page uses Glyphicons in a few places. This
patch replaces them with Font Awesome icons.

To test, apply the patch for Bug 15886 if necessary and enable
the AudioAlerts system preference.

 - Go to Administration -> Audio alerts
 - Confirm that icons for "Edit" and "Delete selected" look correct.
 - Edit an existing alert and confirm that the "play" button looks
   correct and works correctly.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16029: Hide patron toolbar if patron does not exist
Aleisha [Sun, 13 Mar 2016 23:40:53 +0000 (23:40 +0000)]
Bug 16029: Hide patron toolbar if patron does not exist

To test:
1) Create a patron, take note of the borrower number
2) Delete the patron
3) Navigate to the page of the patron you just deleted by typing the url (ie /cgi-bin/koha/members/moremember.pl?borrowernumber=X)
4) Confirm that the patron toolbar is not showing on the page
5) The message now has a link that says 'Find another patron?'. Click this link and confirm you are taken to the member home pgae.

Sponsored-by: Catalyst IT
Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16047 [Follow-up] Software error on deleting a group with no category code
Owen Leonard [Thu, 17 Mar 2016 13:08:39 +0000 (09:08 -0400)]
Bug 16047 [Follow-up] Software error on deleting a group with no category code

This follow-up take the original patch a little further, making category
name required on the entry form as well. Without a category name there
is no label in the interface when selecting a category. That doens't
make any sense.

Also changed on the group entry form:

- Added "required" attribute to labels on required fields.
- Changed "Update" submit button label to "Submit."
- Added a "Cancel" link.
- Added the "validated" class to the form so that our built-in
  validation script will process it (not strictly necessary but makes
  the validation appearance more consistent).

Followed test plan, form displays and behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16047: Making category code a required field on creating a group
Aleisha [Thu, 10 Mar 2016 21:49:57 +0000 (21:49 +0000)]
Bug 16047: Making category code a required field on creating a group

This will prevent users from creating a group without a category code,
which causes a software error when you try to delete it

To test:
1) Go to Admin -> Libraries and groups
2) Create new group without category code
3) Attempt to delete the group you just created and notice software
   error
4) Apply patch
5) Create new group without category code
6) Notice you now cannot save the group without putting in a category
  code

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16077 - Remove unused script and template card-print
Owen Leonard [Tue, 15 Mar 2016 14:02:22 +0000 (10:02 -0400)]
Bug 16077 - Remove unused script and template card-print

I can find no reference to card-print.pl being used in Koha. This patch
deletes it and its associated template.

To test, apply the patch and search for references to "card-print" in
Koha. There should be none.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This script does not work, it fails with 'Undefined subroutine
get_label_output_formats'. This subroutine was in C4::Labels::Lib which
has been removed by 2433a91 (Feb 8 2010): Removing depricated file from the
C4::Labels module.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15868: Ask for confirmation when deleting a MMT action
Jonathan Druart [Tue, 8 Mar 2016 11:07:43 +0000 (11:07 +0000)]
Bug 15868: Ask for confirmation when deleting a MMT action

Test plan:
Create marc modification template
Add an action
Delete it
With this patch you must get a confirmation mesg

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15962: Block the currency deletion if used
Jonathan Druart [Tue, 8 Mar 2016 10:46:46 +0000 (10:46 +0000)]
Bug 15962: Block the currency deletion if used

A currency should not be deleted if used by a vendor or a basket.

Test plan:
1/ Add a new currency
2/ Create a vendor using this currency
3/ Create a basket using this currency
4/ Try to delete the currency
5/ Delete the basket
6/ Try to delete the currency
7/ Delete the vendor
8/ Delete the currency

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15962: Add messages on the currency admin page
Jonathan Druart [Tue, 8 Mar 2016 10:38:37 +0000 (10:38 +0000)]
Bug 15962: Add messages on the currency admin page

Bug 15084 rewrote the currency admin page but forgot to add the messages
block.

Test plan:
Add/update/delete vendors.
You should get information messages.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15997 - Hold Ratios for ordered items doesn't count orders where AcqCreateItem...
Kyle M Hall [Mon, 7 Mar 2016 14:04:44 +0000 (14:04 +0000)]
Bug 15997 - Hold Ratios for ordered items doesn't count orders where AcqCreateItem is set to 'receiving'

Currently, the hold ratios script only counts on order items where the
record item is created at the time the order is placed, and not if the
item is created when the item is received.

Test Plan:
1) Set AcqCreateItem to recieving
2) Run the hold ratios report with "include ordered" checked
3) From aquisitions, order some additional items for the record
4) Re-run the hold ratios report, not there is no change in the ratio
   for that record
5) Apply this patch
6) Re-run the hold ratios reporat again, the ratio should now have
   changed

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16012: Restore the ability to edit default authority type
Jonathan Druart [Wed, 9 Mar 2016 11:16:07 +0000 (11:16 +0000)]
Bug 16012: Restore the ability to edit default authority type

Bug 15380 introduced a regression on the authority types admin page: the
default authority type (authtypecode="") is no longer editable.

Test plan:
Edit the authority type to update the summary
=> Without this patch you will get the "add a new authority type" form
=> With this patch applied, the correct behavior will be restored

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16013: Make classification sources deletable
Jonathan Druart [Wed, 9 Mar 2016 11:28:04 +0000 (11:28 +0000)]
Bug 16013: Make classification sources deletable

Because of a wrong variable scope, the classification sources are not
deletable.

Test plan:
Create a classification sources (admin/classsources.pl)
Try to delete it
Without this patch, the classification source won't be deleted
With this patch, it will work!

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16030: Add 'Automatic item modifications by age' to the tool sidebar
Jonathan Druart [Wed, 16 Mar 2016 10:14:44 +0000 (10:14 +0000)]
Bug 16030: Add 'Automatic item modifications by age' to the tool sidebar

Test plan:
Go on a page of the tools module
You should see a "Automatic item modifications by age" link
Click on it
The list should not be styled to highlight the fact that you are on this
page.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16053: Do not remove the active flag when editing the active currency
Jonathan Druart [Fri, 11 Mar 2016 11:42:09 +0000 (11:42 +0000)]
Bug 16053: Do not remove the active flag when editing the active currency

From commit b574b615919a6463708d4c1d7b1153a061c1ea0a
   Bug 15084: Make sure the previous active currency is marked as inactive

When a currency is stored, all the active flags of all currencies are unset.
Only the active ones and different than the one we are editing should be updated.

Test plan:
Edit the active currency
=> Without this patch the active flag was removed
=> With this patch, the active flag is kept

Edit another currency and set it the active flag
=> The active flag must have been removed from the previously active
currency.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16053: Add tests
Jonathan Druart [Fri, 11 Mar 2016 11:32:22 +0000 (11:32 +0000)]
Bug 16053: Add tests

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16066 - JavaScript error on new patron form when duplicate is suspected
Owen Leonard [Mon, 14 Mar 2016 15:36:19 +0000 (11:36 -0400)]
Bug 16066 - JavaScript error on new patron form when duplicate is suspected

When a new patron is submitted which is suspected to be a duplicate, the
entry form is redisplayed with a new name attribute, "form_nodouble."
Other scripts on the page still look for a form named "form," so there
is an error.

This patch removes the use of "form_nodouble" on the assumption that it
is unnecessary to name the form something different when a duplicate is
suspected. All the same validation scripts should be run on the form
either way.

To test, apply the patch and clear your cache if necessary.

- Go to Patrons -> New patron and add a patron which matches an existing
  one in order to trigger the duplicate warning.
- Confirm that Firebug (or similar) is not reporting a JavaScript error.
- Confirm that the 'Edit existing' and 'Save as new' buttons work
  correctly.

Reproduced JavaScript error and verified that it no longer appears with
this patch.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16060 - Add Font Awesome icon to Z39.50 search button when no results are found
Owen Leonard [Thu, 10 Mar 2016 14:19:14 +0000 (09:19 -0500)]
Bug 16060 - Add Font Awesome icon to Z39.50 search button when no results are found

When a staff client catalog search returns no results, a Z39.50/SRU
search button is shown. This patch adds a Font Awesome icon to that
button.

Also changed: A stray extra double quote has been removed. The onclick
attribute has been removed from the search button in favor of an event
already defined.

To test, apply the patch and perform a search in the staff client
catalog which will return no results.

- Confirm that the Z39.50/SRU button looks correct and works correctly.
- Validate the HTML of the page and confirm that no unexpected errors
  are returned.

NOTE: Pretty!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16061: Use Font Awesome icons in reports when filter returns no results
Owen Leonard [Tue, 8 Mar 2016 19:40:02 +0000 (14:40 -0500)]
Bug 16061: Use Font Awesome icons in reports when filter returns no results

In Reports -> Saved reports, when the filter form returns no results a
dialog is shown. This patch updates the dialog to use Font Awesome
icons.

Also changed: The dialog now includes a button for creating a new SQL
report, not just one to create a new guided report. The "clear" link in
the sidebar has been modified to pass HTML validation.

To test, apply the patch and go to Reports -> Saved reports.

- In the left-hand sidebar filter, submit terms which will return no
  results.
- Verify that the resulting dialog is correctly styled.
- Confirm that all three buttons in the dialog work correctly: New
  guided report, new SQL report, and Cancel.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
I'm passing this one, while I don't like it is hardcoding a URL path,
because it will make is easier to spot it when time comes and we
make Koha delpoyable in any endpoint.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16064 - Remove use of image to indicate approval in tags moderation
Owen Leonard [Mon, 14 Mar 2016 14:12:38 +0000 (10:12 -0400)]
Bug 16064 - Remove use of image to indicate approval in tags moderation

This patch updates the tags moderation template to use text labels to
mark tag moderation status, eliminating the use of an image file to
signify approval.

To test you should have some tags in each approval state: pending,
approved, and rejected.

- Apply the patch and go to Tools -> Tags.
- Confirm that the status of each tag is clearly shown with a text
  label.

Works as expected (Do not forget to set filter at the left to 'all' for testing)
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16065 - Use Font Awesome icons in dialog when duplicate patron is suspected
Owen Leonard [Mon, 14 Mar 2016 15:07:14 +0000 (11:07 -0400)]
Bug 16065 - Use Font Awesome icons in dialog when duplicate patron is suspected

This patch updates the new patron template to use Font Awesome icons in
the dialog which is shown when a duplicate patron is suspected.

The patch modifies the CSS rules for a dialog button with "white-space:
pre-line" so that line breaks in button text markup are treated as line
breaks on display. Allowing the text to wrap prevents the buttons from
being too wide and stacking one below the other.

To test, apply the patch and go to Patrons -> New patron.

- Attempt to save a new patron with details matching an existing patron
  in order to trigger the duplicate patron warning.
- Confirm that the resulting dialog is styled correctly.
- Confirm the behavior of both the 'Edit existing' and 'Save as new'
  buttons.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15840: Catch errors if userid already exists when importing patrons
Jonathan Druart [Wed, 17 Feb 2016 16:21:50 +0000 (16:21 +0000)]
Bug 15840: Catch errors if userid already exists when importing patrons

Import borrowers tool explodes if userid already exists. This error
should be caught to avoid the script to explodes.

TEST PLAN
---------
1) back up DB
2) drop DB, create empty DB
3) Apply patch 15842
4) web install all the sample data
5) login as system user and import patron data
   -- sample provided to trigger error.
   -- you will get a DBIx::class exception
      "Duplicate entry ' for key 'userid'"
6) Apply this patch
7) Repeat steps 2-5
   -- patrons won't be inserted but an error
      will be nicely displayed in the error list.
8) run koha qa test tools

Note that it would be easy to insert the patrons anyway and generate a
userid based on the surname and firstname.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16095: Remove target="_blank" when a link refer to an external link
Jonathan Druart [Fri, 18 Mar 2016 08:34:22 +0000 (08:34 +0000)]
Bug 16095: Remove target="_blank" when a link refer to an external link

If you click on a link that opens a new tab/window to another site, that tab
has access to the original window through JavaScript. The browsing context is
related, even if the domains are totally different.

The tab retains access to the original window's object via window.opener, even
if you navigate to another page or domain, in the new or original window.
Access to the Window object means the new window can use Window.location to
open a different URL in the original window, perfect for phishing attacks.

Depending on the site's Same-Origin Policy settings, the new window may have
access to other parts of the original window's DOM as well.

Any  'A HREF' that contains a target of of '_blank' or '_new' or a fixed name
is vulnerable. Previous security best practice often suggested creating a random
fixed name for an unpredictable namespace - that won't help with this problem!
Targets of '_self' and '_parent' are safe.

We do not use _new (at first glance) but several _blank. Some are used
to refer internal url, we do not need to update or remove them. Others
are used to satisfy OPACURLOpenInNewWindow, in these case, we should add
the rel="noreferrer" attribute to the a tags.
In other cases, we can simply remove them and let the users discover
that a mouse has more than one button (we are in 2016, they can do it!)

Signed-off-by: Chris <chrisc@catalyst.net.nz>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16010: follow-up of 15381 - FIX merge_authorities migration script
Jonathan Druart [Wed, 9 Mar 2016 08:20:04 +0000 (08:20 +0000)]
Bug 16010: follow-up of 15381 - FIX merge_authorities migration script

Caused by commit 7e70202d34d75f988fbaea9b911347417c203aac
    Bug 15381: Remove GetAuthType and GetAuthTypeCode

If you execute perl misc/migration_tools/merge_authority.pl -f 1 -t 2
you will get:
Can't locate object method "authtypecode" via package "1" (perhaps you forgot to load "1"?)
 at misc/migration_tools/merge_authority.pl line 58.

GetAuthority does not return a Koha::Authority but a MARC::Record:
there is no authtype code method!

Test plan:
perl misc/migration_tools/merge_authority.pl -f X -t Y
Should not return any error.
Note that if the authid X or Y does not exist, the script will die.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16015: Restore the ability to delete a group of libraries
Jonathan Druart [Wed, 9 Mar 2016 12:21:14 +0000 (12:21 +0000)]
Bug 16015: Restore the ability to delete a group of libraries

If a group of libraries is linked to at least 1 library, the group
cannot be delete and the librarian should get a warning message.
But if no libraries are linked, the deletion should be allowed.
Since bug 15294 this behavior is broken: The deletion is always blocked:
"This library category cannot be deleted. 0 libraries are still using
it", hum...

Test plan:
Create a group of libraries, delete it

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16082: Display a friendly "patron does not exist" message if that's the case...
Jonathan Druart [Wed, 16 Mar 2016 10:01:18 +0000 (10:01 +0000)]
Bug 16082: Display a friendly "patron does not exist" message if that's the case - circulation.pl

The major part of pages you can access from a patron detail page (menu)
does not take into consideration the 'patron does not exist' case.
If the borrowernumber is linked to a deleted patron, a friendly message
should be displayed instead of an empty patron detail page.

Test plan:
Go on circ/circulation.pl?borrowernumber=424242
and   circ/circulation.pl?borrowernumber=424242&batch=1
Notice the difference before and after this patch

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15163: Do not erase patron attributes if limited to another library
Jonathan Druart [Mon, 22 Feb 2016 10:08:55 +0000 (10:08 +0000)]
Bug 15163: Do not erase patron attributes if limited to another library

The patron attributes displayed on editing a patron are not displayed if
limited to another library.

C4::Members::Attributes::SetBorrowerAttributes will now only delete attributes
the librarian is editing.
SetBorrowerAttributes takes a new $no_branch_limit parameter. If set,
the branch limitations have not effect and all attributes are deleted
(same behavior as before this patch).

Test plan:
1/ Create 2 patron attributes, without branch limitations.
2/ Edit a patron and set a value for these attributes
3/ Limit a patron attributes to a library (one you are not logged in
with).
4/ Edit again the patron.
=> You should not see the limited attributes
5/ Edit the patron attributes and remove the branch limitation
=> Without this patch, it has been removed from the database and is not
displayed anymore.
=> With this patch, you should see it.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16073: (follow-up) Fix software error in circulation.pl
Jonathan Druart [Wed, 16 Mar 2016 09:32:58 +0000 (09:32 +0000)]
Bug 16073: (follow-up) Fix software error in circulation.pl

Do not crash if the patron does not exist.

Test plan:
Access circ/circulation.pl?borrowernumber=42424242
you should get an error without this patch
With this patch, you will get an empty patron detail page (should be
fixed in another patch, but this behavior exists for a while)

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16073: Fix software error in circulation.pl
Jonathan Druart [Mon, 14 Mar 2016 18:41:02 +0000 (18:41 +0000)]
Bug 16073: Fix software error in circulation.pl

Can't call method "guarantor" on an undefined value at
/home/koha/src/circ/circulation.pl line 588.
 at /home/koha/src/circ/circulation.pl line 673

Introduced by bug 15656

Test plan:
Just trigger circ/circulation.pl

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Triggered circ/circulation.pl - nothing exploded, and error is gone
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16089: (Follow up) Display currency symbol properly
Marc Véron [Thu, 17 Mar 2016 16:10:54 +0000 (17:10 +0100)]
Bug 16089: (Follow up) Display currency symbol properly

This patch fixes the display of the currency symbol on invoice.tt

See comment #5

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16089: Acquisitions -> Invoice broken by Bug 15084
Marc Véron [Thu, 17 Mar 2016 15:02:02 +0000 (16:02 +0100)]
Bug 16089: Acquisitions -> Invoice broken by Bug 15084

To test:
- Reproduce error described in first comment.
- Apply patch
- Try to reproduce error. Page will display as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15990: (follow-up) Making record matching rules actions buttons
Jonathan Druart [Mon, 14 Mar 2016 16:49:50 +0000 (16:49 +0000)]
Bug 15990: (follow-up) Making record matching rules actions buttons

Adds the actions class to the td elt to keep the buttons next to each
other.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15990: Making record matching rules actions buttons
Aleisha [Thu, 10 Mar 2016 01:46:57 +0000 (01:46 +0000)]
Bug 15990: Making record matching rules actions buttons

To test:

1) Go to Administration -> Record matching rules
2) Confirm that the actions 'Edit' and 'Delete' are not buttons and behave as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15993 [Follow-up] Making currency actions buttons
Owen Leonard [Fri, 11 Mar 2016 16:13:08 +0000 (11:13 -0500)]
Bug 15993 [Follow-up] Making currency actions buttons

This trivial follow-up adds an "actions" class to the table cell
containing the new buttons. In conjunction with the style update in Bug
16048, this will prevent the buttons from wrapping at narrow browser
window widths.

To test, apply the patch for Bug 16048 and go to Administration ->
Currencies and exchange rates.

In the table of currencies, confirm that the "Edit" and "Delete" buttons
are not stacked one on top of the other even at narrow browser window
widths.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15993: Making currency actions buttons
Aleisha [Thu, 10 Mar 2016 01:53:30 +0000 (01:53 +0000)]
Bug 15993: Making currency actions buttons

To test:

1) Go to Administration -> Currencies and exchange rates
2) Confirm that the actions 'Edit' and 'Delete' are now buttons and behave as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15995 [Follow-up] Making libraries actions buttons
Owen Leonard [Fri, 11 Mar 2016 16:47:01 +0000 (11:47 -0500)]
Bug 15995 [Follow-up] Making libraries actions buttons

This trivial follow-up adds an "actions" class to the table cell
containing the new buttons. In conjunction with the style update in Bug
16048, this will prevent the buttons from wrapping at narrow browser
window widths.

To test, apply the patch for Bug 16048 and go to Administration ->
Libraries and Groups.

Confirm that the "Edit" and "Delete" buttons do not wrap even at narrow
browser window widths.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
You forgot to add the class to one of the tables, but I have added it

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15995: Making libraries actions buttons
Aleisha [Thu, 10 Mar 2016 01:59:20 +0000 (01:59 +0000)]
Bug 15995: Making libraries actions buttons

To test:

1) Go to Administration -> Libraries and Groups
2) Confirm that the actions 'Edit' and 'Delete' are now buttons for BOTH
   tables under one column 'Actions' and buttons behave as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16036 [Follow-up] Making basket actions buttons
Owen Leonard [Fri, 11 Mar 2016 13:28:18 +0000 (08:28 -0500)]
Bug 16036 [Follow-up] Making basket actions buttons

This trivial follow-up adds an "actions" class to the table cell
containing the new buttons. In conjunction with the style update in Bug
16048, this will prevent the buttons from wrapping at narrow browser
window widths.

To test, apply the patch for Bug 16048 and search for a vendor in
Acquisitions which has at least one open basket.

Confirm that the "View" and "Add to basket" buttons look correct and do
not wrap when you make your browser window narrower.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16036: Making basket actions buttons
Aleisha [Thu, 10 Mar 2016 03:35:08 +0000 (03:35 +0000)]
Bug 16036: Making basket actions buttons

To test:
1) Go to Acqui -> do a vendor search
2) Confirm actions 'View' and 'Add to basket' are now buttons and behave as
   expected

Sponsored-by: Catalyst IT
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: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16054: Fix variable scope error in paycollect.pl
Jonathan Druart [Fri, 11 Mar 2016 12:47:26 +0000 (12:47 +0000)]
Bug 16054: Fix variable scope error in paycollect.pl

$borrower, $borrowernumber and $template and not visible in the
subroutine.
Using $b_ref and passing $template fixes the issue.

Test plan:
Under plack, use the pay selected button.
On the paycollect page, you should see the image of the patron

It certainly fixes some other bugs.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: Clear L1 cache from psgi files
Jonathan Druart [Thu, 10 Mar 2016 09:12:52 +0000 (09:12 +0000)]
Bug 11998: Clear L1 cache from psgi files

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: Add a L1 cache for sysprefs
Jonathan Druart [Thu, 10 Mar 2016 08:55:27 +0000 (08:55 +0000)]
Bug 11998: Add a L1 cache for sysprefs

Accessing to the cache for each call to C4::Context->preference might
have an impact on performances.
To avoid that this patch introduces a L1 cache (simple hashref). It will
be populated by accessing the L2 cache (Koha::Cache).
If a pref is retrieved 10x, the first one will get the value from the L2
cache, then the L1 cache will be check.
To do so we will need to clear the L1 cache every time a page is loaded.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: follow-up for the debian package psgi file
Jonathan Druart [Thu, 3 Mar 2016 16:52:51 +0000 (16:52 +0000)]
Bug 11998: follow-up for the debian package psgi file

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: Revert "Bug 13805: (Plack) Disable syspref cache"
Jonathan Druart [Thu, 3 Mar 2016 16:45:07 +0000 (16:45 +0000)]
Bug 11998: Revert "Bug 13805: (Plack) Disable syspref cache"

This reverts commit ca00f0ddaeb76106b4aa274fd1848844ae042f58.

Bug 13805 fixes an installer bug by disabling the syspref cache.
It was not a good idea, it introduced performance issues (see bug 13805
comment 14).

Test plan:
Test plan:
0/ Create a new database and fill the database entry in the koha conf
with its name
1/ Go on the mainpage, you should be redirected to the installer
2/ Try to log in
You should not get the login form again.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Test plan not followed by me for this patch, due to lack of working
plack setup, but I don't expect it to cause any problems, and performace
gain for plack will be tremendous

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: Do not clear syspref cache in psgi file
Jonathan Druart [Thu, 3 Mar 2016 17:17:40 +0000 (17:17 +0000)]
Bug 11998: Do not clear syspref cache in psgi file

This in only in koha.psgi, it has been introduced by bug 13815 but
should not have been added by this patch.

Removing it should not introduce any changes.
Not that it won't impact debian packages.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: Make HoldsQueue.t tests pass [TO REVERT]
Jonathan Druart [Mon, 7 Mar 2016 09:24:14 +0000 (09:24 +0000)]
Bug 11998: Make HoldsQueue.t tests pass [TO REVERT]

This patch should not be the way to make these tests pass.
The prefs should not be updated using set_preference, it will modify the
values in the cache.

I have no idea how to make them pass using the correct way, please help
:)

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: Use C4::Context->preference in Koha/Schema/Result/Item.pm
Jonathan Druart [Fri, 4 Mar 2016 13:21:39 +0000 (13:21 +0000)]
Bug 11998: Use C4::Context->preference in Koha/Schema/Result/Item.pm

Otherwise some tests won't pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: Use t::lib::Mocks::mock_preference in tests
Jonathan Druart [Fri, 4 Mar 2016 13:14:59 +0000 (13:14 +0000)]
Bug 11998: Use t::lib::Mocks::mock_preference in tests

Unless in t/db_dependent/Context.t where we want to test the cache
behaviors.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 11998: Use Koha::Cache to cache sysprefs
Jonathan Druart [Thu, 3 Mar 2016 16:54:30 +0000 (16:54 +0000)]
Bug 11998: Use Koha::Cache to cache sysprefs

At the moment, the sysprefs are only cache in the thread memory
executing the processus
When using Plack, that means we need to clear the syspref cache on each
page.
To avoid that, we can use Koha::Cache to cache the sysprefs correctly.

A big part of the authorship of this patch goes to Robin Sheat.

Test plan:
1/ Add/Update/Delete local use prefs
2/ Update pref values and confirm that the changes are correctly taken
into account

Signed-off-by: Chris <chrisc@catalyst.net.nz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Tested with plack with syspref cache enabled, there is some time between setting the syspref and applying it, but it takes just one reload of page, it shouldn't be problem, should it?
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Tested with CGI and CGI + memcache; some small issues still remain,
but it would be better to deal with them in separate bug reports
if necessary

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15111: Do not include the antiClickjack legacy browser trick for greybox
Jonathan Druart [Mon, 22 Feb 2016 09:24:29 +0000 (09:24 +0000)]
Bug 15111: Do not include the antiClickjack legacy browser trick for greybox

Most of the scripts called via greybox (which uses iframe) don't include
doc-head-close. But some do.
This patch adds a popup parameter for these templates, not to include
the legacy browser trick and avoid the replacement of the location.

Test plan:
1/ Export patroncard and label
2/ translate itemtypes
3/ click on a idref link at the OPAC

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>