koha.git
8 years agoBug 15656: Move guarantor/guarantees code - GetGuarantees
Jonathan Druart [Mon, 25 Jan 2016 13:25:42 +0000 (13:25 +0000)]
Bug 15656: Move guarantor/guarantees code - GetGuarantees

2 subroutines of C4::Members deal with guarantor/guarantees:
GetGuarantees and GetMemberRelatives.
Since we already have a Koha::Patron->guarantor method, it makes sense
to move these 2 subroutines to this module.

This first patch deals with GetGuarantees.

Test plan for the entire patch set:
1/ Create 5 patrons A (adult), B (child), C (child), D (child), E
(child), F (adult)
2/ Add relation between them: A is father of B, C and D.
E does not have a guarantor
F does not have guarantees
3/ Check some items out for all of these patrons
4/ On the "Check out" and "Details" tabs, you should not see any
differences with these patch applied : The "Relatives' checkouts" tabs
should list all of the guarantor/guarantee/siblings checkouts

Note:
$template->param('C' => 1);
I have not found any reference of this 'C' in the template.
It seems it's an old c/p from members/memberentrygen.tt

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15653: Remove unused C4::Members::UpdateGuarantees subroutine
Jonathan Druart [Mon, 25 Jan 2016 12:37:58 +0000 (12:37 +0000)]
Bug 15653: Remove unused C4::Members::UpdateGuarantees subroutine

Looking at the code, there is some broken with the guarantees code.
It seems that the expected behavior would be to update address, fax,
B_city, mobile, city and phone info of the guarantees when a guarantor
is modified.
But the code in C4::Members::ModMember is broken:

 668         my $borrowercategory= GetBorrowercategory(
$data{'category_type'} );
 669         if ( exists  $borrowercategory->{'category_type'} &&
$borrowercategory->{'category_type'} eq ('A' || 'S') ) {
 670             # is adult check guarantees;
 671             UpdateGuarantees(%data);
 672         }

First, GetBorrowerCategory expects a categorycode, not a category_type.
Then UpdateGuarantees retrieves the param like:

 989 sub UpdateGuarantees {
 990     my %data = shift;

Which means that %data will always be something like ( a_key => undef )
And nothing more.

The updateguarantees subroutine (It has been renamed) has been introduced by

commit 56825e415fc232e38f0a874dc9a81fa2169ef06b
Date:   Mon Aug 30 13:48:58 2004 +0000
    modularizing (with Members.pm) members management
    (beginning of...)

And the `%data = shift` already existed...

This code has never worked and could be removed.

See http://lists.koha-community.org/pipermail/koha-devel/2016-January/042241.html

Test plan:
Confirm the previous assertions.

Note that I have found this bug working on bug 15631, see patch "Bug
15631: Koha::Cities - remove getidcity and GetCities"

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15886 - Revise layout and behavior of audio alerts management
Owen Leonard [Tue, 23 Feb 2016 17:07:17 +0000 (12:07 -0500)]
Bug 15886 - Revise layout and behavior of audio alerts management

This patch changes the behavior of the audio alerts management page so
that sections of the page are shown or hidden based on what the current
task is. Other changes include:

- Moving JavaScript to a separate file
- Adding a toolbar with a "New alert" button.
- Enabling or disabling the "play sound" button based on the value of
  the sound file field.
- Enabling or disabling the "delete" button based on whether there are
  checkboxes checked.
- Switching the patron category administration header search form for
  the "generic" catalog search one.
- Adding "Required" classes to required fields so that the staff
  client's built-in JS validation library can be used.
- Styling the add/edit form in a way which is consistent with other
  interfaces in Koha.
- Removing the invalid "border" attribute from images.
- Adding better alt attributes to images.

To test, the AudioAlerts system preference must be enabled. Apply the
patch and go to Administration -> Audio alerts.

- Confirm that the add/edit form is hidden initially. A toolbar with a
  "New" button should appear with existing audio alerts in a table
  below.
- Confirm that the "New alert" button works:
  - The table should be hidden and an empty "add" form displayed.
  - Confirm that an empty form cannot be submitted.
  - Confirm that typing or selecting a sound enables the "Play sound"
    button and that it works to play the sound.
  - Confirm that adding valid data works.
  - Confirm that clicking the "Cancel" button hides the form and
    redisplays the table.
- Test the "edit" button for an existing sound:
  - Confirm that the edit form is displayed and populated with the
    correct data.
  - Confirm that edits are saved correctly.
- When viewing the table of existing alerts, confirm that checking one
  of the checkboxes "enables" the delete button.
- With one or more checkboxes checked, test that clicking the delete
  button triggers a deletion confirmation. Test both confirm and cancel
  operations.
- With no checkboxes checked, test that clicking the delete button
  triggers an alert that checkboxes must be checked.
- Ponder whether all this is an improvement or not.

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 15960: Use Font Awesome icons for classification filing rule deletion error
Owen Leonard [Wed, 2 Mar 2016 16:54:02 +0000 (11:54 -0500)]
Bug 15960: Use Font Awesome icons for classification filing rule deletion error

When deletion of a classification filing rule is impossible, the dialog
saying so should be styled with Font Awesome icons. This patch corrects
this omission from the patch for Bug 15785.

Also changed: The dialog is now an "alert" style dialog instead of a
"message" one.

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

- Locate a classification filing rule which is in use by a
  classification source.
- Click the "Delete" link for that rule and verify that the resulting
  dialog is correctly styled.
- Click the "OK" button and confirm that you are correctly redirected.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15963: Use Font Awesome icons for confirmation after deleting MARC tag
Owen Leonard [Wed, 2 Mar 2016 19:25:30 +0000 (14:25 -0500)]
Bug 15963: Use Font Awesome icons for confirmation after deleting MARC tag

This patch revises the dialog which appears after you have deleted a
MARC tag.

To test, apply the patch and go to Administration -> MARC frameworks ->
MARC sturcture -> Delete.

- Confirm that you want to delete a MARC tag.
- Verify that the confirmation dialog you are shown is styled correctly.
- Verify that clicking "OK" redirects you to the right place.

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 Gallagher brendan@bywatersolutions.com
8 years agoBug 15966: Move MARC frameworks actions into a drop down menu
Aleisha [Sun, 6 Mar 2016 21:35:04 +0000 (21:35 +0000)]
Bug 15966: Move MARC frameworks actions into a drop down menu

EDIT: Switching icons for Export and Import. What I had initially was what I intended because export is like downloading and import is like upload, but it seems to make more sense reversed.
EDIT2: Fixing Import problem

To test:

1) Go to Administration -> MARC bibliographic framework (admin/biblio_framework.pl)
2) Confirm that all actions have now been moved into drop down menus.
  a) For Default framework, actions available are 'MARC structure', 'Export' and 'Import'.
  b) Confirm these buttons all work as expected.
  c) For all other frameworks, actions available are 'MARC structure', 'Edit', 'Delete', 'Export' and 'Import'.
  d) Confirm these buttons all work as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15978: Use Font Awesome icons for guided reports error dialog
Owen Leonard [Fri, 4 Mar 2016 13:27:43 +0000 (08:27 -0500)]
Bug 15978: Use Font Awesome icons for guided reports error dialog

If you try to save an SQL report with an invalid authorized value
placeholder you will be presented with a confirmation dialog. This patch
updates it to use Font Awesome icons.

Also fixed: Validation error found in testing: Duplicated <form> tag and
series of redundant inputs. Each input cut had an exact duplicate in the
same form.

To test, apply the patch and go to Reports -> Create from SQL.

- Create a new SQL report and fill in as many fields as possible to
  verify correct operation.
- Try to save your report with an invalid authorized value
  placeholder, for example: SELECT * FROM items WHERE items.itype =
  <<foo|bar>>
- Confirm that the confirmation dialog is styled correctly.
- Test the operation of the "Edit SQL" button. You should be sent back a
  page.
- Test the operation of the "Save anyway" button and confirm that your
  report was saved.
- Repeat these steps when editing an existing report.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15980: Use Font Awesome icons in subscription frequency deletion confirmation...
Owen Leonard [Fri, 4 Mar 2016 16:37:42 +0000 (11:37 -0500)]
Bug 15980: Use Font Awesome icons in subscription frequency deletion confirmation dialog

If you try to delete a subscription frequency which is in use by an
existing subscription you will be shown a confirmation dialog. This
dialog should use Font Awesome icons.

Other minor changes:

- Added "action" attributes to <form>s to fix validation errors.
- Added "alert" class to confirmation dialog so that it is correctly
  styled.

To test, apply the patch and go to Serials -> Frequencies.

- Click "Delete" on a frequency which is in use by a subscription.
- Verify that the confirmation dialog is styled correctly.
- Test that the "No, do not delete" button works correctly.
- Test that the "Yes, delete" button deletes the correct frequency.

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 Gallagher brendan@bywatersolutions.com
8 years agoBug 15983: Use Font Awesome icons in serial numbering pattern deletion confirmation...
Owen Leonard [Fri, 4 Mar 2016 17:29:03 +0000 (12:29 -0500)]
Bug 15983: Use Font Awesome icons in serial numbering pattern deletion confirmation dialog

If you try to delete a serial numbering pattern which is in use by an
existing subscription you will be shown a confirmation dialog. This
dialog should use Font Awesome icons.

Other minor changes:

- Added "action" attributes to <form>s to fix validation errors.
- Added "alert" class to confirmation dialogs so that they correctly
  styled.

To test, apply the patch and go to Serials -> Numbering patterns.

- Click "Delete" on a numbering pattern which is in use by a
  subscription.
- Verify that the confirmation dialog is styled correctly.
- Test that the "No, do not delete" button works correctly.
- Test that the "Yes, delete" button deletes the correct numbering
  pattern.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15991: Moving OAI sets actions into a drop-down menu
Aleisha [Sun, 6 Mar 2016 22:27:08 +0000 (22:27 +0000)]
Bug 15991: Moving OAI sets actions into a drop-down menu

To test:

1) Apply Bug 16014 first
2) Go to Administration -> OAI sets
3) Confirm that the actions 'Modify', 'Delete' and 'Define mappings' have been moved into a drop-down menu and buttons behave as expected.
4) Confirm you are asked to confirm on 'Delete' as per Bug 16014

Sponsored-by: Catalyst IT
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15992: Renaming 'Operations' column heading to 'Actions'
Aleisha [Thu, 10 Mar 2016 02:02:48 +0000 (02:02 +0000)]
Bug 15992: Renaming 'Operations' column heading to 'Actions'

to be consistent with other Administration tables
These actions were already made into buttons so will just make this small string change

To test:

1) Go to Admin -> Item search fields
2) Confirm column heading now reads 'Actions'

Sponsored-by: Catalyst IT
NOTE: Trivial string change, screen refresh confirms change.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 16021 - Use Font Awesome icons on automatic item modifications by age page
Owen Leonard [Wed, 9 Mar 2016 14:33:00 +0000 (09:33 -0500)]
Bug 16021 - Use Font Awesome icons on automatic item modifications by age page

This patch revises the automatic item modifications by age page to use
Font Awesome icons instead of Glyphicons.

To test, apply the patch and go to Tools -> Automatic item modifications
by age.

- Confirm that the "Edit" toolbar button uses a "pencil" icon instead of
  a "plus." (Edit -> Pencil; Add -> Plus).
- Confirm that the icons associated with adding, editing, or removing
  rules look correct and work correctly.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years ago Bug 16048 [Follow-up] Making notices actions buttons
Owen Leonard [Fri, 11 Mar 2016 13:06:30 +0000 (08:06 -0500)]
 Bug 16048 [Follow-up] Making notices actions buttons

This followup adds a "td.actions" style with "white-space:nowrap" and
replaces the inline styles. Also modified is the way non-sorting table
columns are defined. This corrects a problem with non-sortable columns
introducted by the previous patch's column changes.

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

- Go to Tools -> Notices and confirm that even at narrow browser widths
  the "Edit" and "Delete" buttons stay side by side.
- Confirm that all columns are sortable except "Copy notice" and
  "Actions."

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16048: Making notices actions buttons
Aleisha [Thu, 10 Mar 2016 22:45:25 +0000 (22:45 +0000)]
 Bug 16048: Making notices actions buttons

EDIT: Adding no wrap class to Actions column for when libraries with longer names mess up formatting

To test:
1) Go to Tools -> Notices and slips (tools/letter.pl)
2) Confirm that all actions (Copy, Edit and Delete) now show as font awesome buttons and work as expected

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I have a couple of corrections in a follow-up.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16024 - Use Font Awesome icons on item types administration page
Owen Leonard [Wed, 9 Mar 2016 15:14:58 +0000 (10:14 -0500)]
 Bug 16024 - Use Font Awesome icons on item types administration page

When editing an item type, a Glyphicon is used for the "translate" link.
It should use a Font Awesome icon instead. This patch corrects it.

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

- Edit an existing item type.
- Confirm that the icon associated with the "Translate into other
  languages" link is correct.

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 16026 - Use Font Awesome icons on cataloging home page
Owen Leonard [Wed, 9 Mar 2016 15:43:52 +0000 (10:43 -0500)]
 Bug 16026 - Use Font Awesome icons on cataloging home page

The cataloging home page has one instance of a Glyphicon. This patch
replaces it with a Font Awesome icon.

To test you must have the EnableAdvancedCatalogingEditor preference
enabled.

- Apply the patch and go to the Cataloging home page.
- Confirm that the "Advanced editor" button uses the "pencil" icon and
  that it still works correctly.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.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 15694: Add aliases for date/time last modified
Nicole C Engard [Thu, 28 Jan 2016 17:24:31 +0000 (17:24 +0000)]
 Bug 15694: Add aliases for date/time last modified

This patch will add indexes for Date/time-last-modified.

To test:

1. apply patch
2. reindex
3. search for dtlm:DATE and date-time-last-modified:DATE
4. confirm that you get results

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

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  I confirm Hector signing-off. A simple Zebra server restart suffice to get
  working the searches on date-time-last-modified and dtlm.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15955: Tuning function 'New child record' for Unimarc 205$a -> 461$e
Zeno Tajoli [Wed, 2 Mar 2016 12:01:22 +0000 (13:01 +0100)]
 Bug 15955: Tuning function 'New child record' for Unimarc 205$a -> 461$e

Now the sYstem tries to insert value of 205$a into 461$a when a child is
created from the father record.  In UNIMARC 46x tags there is not
present a subfield for ediction value (205$a in UNIMARC).

To Test:
1) Check to have EasyAnalyticalRecords on 'off'
2) Check to use UNIMARC
3) Create a record with data in 200$a (title), 205$a (ediction), 700
   (author) 215$a(Place), 215$d(date)
4) From those record create a child using 'New'->'New child record'
5) See the values in 461 tag: You can see that in 461$a there is the
   value of 205$a from father This is wrong, you need to have the value
   of 700 $a and $b from father record, and 205$a in 461$e.
6) Appy the patch
7) Redo 4-5
8) Now 461 is good

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I have not checked the doc but trusting author and signoffer.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16022 - Use Font Awesome icons on patron lists page
Owen Leonard [Wed, 9 Mar 2016 14:41:32 +0000 (09:41 -0500)]
 Bug 16022 - Use Font Awesome icons on patron lists page

The patron lists page had one stray instance of a Glyphicon class
instead of Font Awesome. This patch corrects it.

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

In the list of patron lists, confirm that the "Actions" menu displays
the correct icon for "Print patron cards" and that the function of the
menu item is correct.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.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 16014: Display a warning on deleting OAI sets
Jonathan Druart [Wed, 9 Mar 2016 11:57:47 +0000 (11:57 +0000)]
 Bug 16014: Display a warning on deleting OAI sets

A JavaScript alert should ask the user to confirm deletion of a OAI set.

Test plan:
Define a OAI set
Delete it
=> With this patch you should get a warning

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16031: (followup) Fix documentation
Tomas Cohen Arazi [Wed, 9 Mar 2016 18:46:46 +0000 (15:46 -0300)]
 Bug 16031: (followup) Fix documentation

This followup fixes a tiny mistake in the script POD.

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 16031: sitemap.pl shouldn't append protocol to OPACBaseURL
Tomas Cohen Arazi [Wed, 9 Mar 2016 18:41:02 +0000 (15:41 -0300)]
 Bug 16031: sitemap.pl shouldn't append protocol to OPACBaseURL

Since bug 5010 was pushed, OPACBaseURL already contains the protocol. The
sitemap.pl script was written before this was pushed, and thus still concatenates
http:// in front of OPACBaseURL.

This patch removes this behaviour.

To test:
- Have OPACBaseURL set to (say) http://myopac.com
- Run the sitemap.pl script without specifying the --url param
=> FAIL: Notice URLs look like http://http://myopac.com/bib... in the sitemap files.
- Apply the patch
- Run the sitemap.pl script without specifying the --url param
=> SUCCESS: Notice URLs look correctly like http://myopac.com/bib...
- Sign off :-D

Regards

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 16033 - Quotes upload preview broken for 973 days
Owen Leonard [Wed, 9 Mar 2016 19:49:40 +0000 (14:49 -0500)]
 Bug 16033 - Quotes upload preview broken for 973 days

A missing snippet of DataTable configuration means that when you upload
a CSV of quotes to the Quotes of the Day feature the table previewing
your import is not visible. This patch corrects it.

To test, apply the patch and go to Tools -> Quote editor -> Import
quotes.

- Upload a CSV file containing data in two columns, "source","text"
- When your upload completes you should see a DataTable previewing the
  data from your CSV.
- Check that deletion of individual quotes works from the preview.
- Check that quotes are correctly imported.
- Ponder the long 2.66 years during which this page was broken.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Quote of the day: Serenity of mind comes with patience.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16042 - Missing closing quote in checkin template
Owen Leonard [Thu, 10 Mar 2016 15:04:35 +0000 (10:04 -0500)]
 Bug 16042 - Missing closing quote in checkin template

A missing quotation mark breaks the display of multiple messages during
checking. This patch adds the missing quote.

To test, apply the patch and locate an item which is on hold and is not
checked out.

 - Check in the item.
 - Confirm that both the hold notification and the "Not checked out"
   alert look correct.
 - For extra credit, validate the page and confirm that there are no
   errors related to broken markup.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 16009: fix GetMember() search on NULL/undef values
Galen Charlton [Wed, 9 Mar 2016 01:41:33 +0000 (01:41 +0000)]
 Bug 16009: fix GetMember() search on NULL/undef values

This patch fixes a bug whereby GetMember(searchfield => undef)
(i.e., searching for patron records where 'searchfield' is NULL)
would crash.

This fixes a regression introduced by bug 15344 that in turn
exposed a long-standing bug in GetMember().

To test:

[1] Import some offline circulation transactions that include at
    least one return.
[2] Attempt to view the list of pending transactions; a crash
    will occur.
[3] Apply the patch and view the list of pending transactions again;
    this time, it should work.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15994: Adding font awesome icons to Funds actions
Aleisha [Sun, 6 Mar 2016 22:45:54 +0000 (22:45 +0000)]
 Bug 15994: Adding font awesome icons to Funds actions

To test:

1) Go to Administration -> Funds
2) Confirm that appropriate Font Awesome icons now appear to each action in drop down menu

Sponsored-by: Catalyst IT
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.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 15981 - Serials frequencies can be deleted without warning
Owen Leonard [Fri, 4 Mar 2016 16:52:25 +0000 (11:52 -0500)]
 Bug 15981 - Serials frequencies can be deleted without warning

A JavaScript alert should ask the user to confirm deletion of a serial
frequency. This patch adds this to the template.

To test, apply the patch and go to Serials -> Manage frequencies

- In the list of frequencies, click any "Delete" link.
- Verify that a JavaScript alert is triggered.
- Test that cancelling the alert cancels the deletion operation.
- Test that confirming the alert allows the deletion to complete.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.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 15982 - Serials numbering patterns can be deleted without warning
Owen Leonard [Fri, 4 Mar 2016 17:07:44 +0000 (12:07 -0500)]
 Bug 15982 - Serials numbering patterns can be deleted without warning

A JavaScript alert should ask the user to confirm deletion of a serial
numbering pattern. This patch adds this to the template.

To test, apply the patch and go to Serials -> Manage numbering patterns.

- In the list of patterns, click any "Delete" link.
- Verify that a JavaScript alert is triggered.
- Test that cancelling the alert cancels the deletion operation.
- Test that confirming the alert allows the deletion to complete.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.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 15979 - Use Font Awesome icons subscription deletion confirmation dialog
Owen Leonard [Fri, 4 Mar 2016 16:17:50 +0000 (11:17 -0500)]
 Bug 15979 - Use Font Awesome icons subscription deletion confirmation dialog

When deleting a subscription which has not expired or which has linked
issues or items, a dialog asks for confirmation. This patch updates the
dialog to use Font Awesome icons.

Other minor change: Corrected capitalization in dialog heading.

To test, apply the patch and go to Serials.

- Locate a subscription which can be deleted and which has not expired,
  has linked items, or has linked issues.
- View the detail page for that subscription.
- Choose "Delete subscription" from the "Edit" menu.
- Verify that the confirmation dialog is correctly styled.
- Verify that the "No, don't delete" button works correctly.
- Verify that the "Yes, delete" button deletes the subscription.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.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 15988: Moving authority types actions into a drop-down menu
Aleisha [Sun, 6 Mar 2016 21:48:23 +0000 (21:48 +0000)]
 Bug 15988: Moving authority types actions into a drop-down menu

To test:

1) Go to Administration -> Authority types
2) Confirm all actions ('MARC Structure', Edit', 'Delete') have been moved into a drop down menu for each auth type, and each action behaves as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years agoBug 15084 - Update schema files
Kyle M Hall [Wed, 9 Mar 2016 15:15:33 +0000 (15:15 +0000)]
Bug 15084 - Update schema files

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years ago DBRev Bug 15084 - Move the currency related code to
Brendan A Gallagher [Wed, 9 Mar 2016 15:14:48 +0000 (15:14 +0000)]
 DBRev Bug 15084 - Move the currency related code to
Koha::Acquisition::Currenc[y|ies]

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15084: [QA Follow-up] Correct field length of currency
Marcel de Rooy [Wed, 9 Mar 2016 12:29:08 +0000 (13:29 +0100)]
 Bug 15084: [QA Follow-up] Correct field length of currency

Bug 15084 added a FK constraint while the fields in the database are not
in sync as to length. This will produce errors when using currency codes
longer than three characters. Probably you won't, but nobody stopped
users from entering EURO or DOLLAR etc. Not to speak about TestBuilder
too.

This patch corrects the database revision for aqorders in updatedatabase,
because we need to change the field length before adding the FK constraint.
It also updates other currency fields < 10 chars (via atomicupdate).
RM: So please add that dbrev too in updatedatabase.

Note that another report should deal with adding missing constraints on
the currency code in suggestions and aqbooksellers.
Also note that the aqorder fields listprice and invoiceprice refer to
currency. Imo these are very poor names for currency codes; you should
never call something a price when you mean a currency code!

Similar changes are applied to kohastructure.

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15084: [QA Follow-up] Update kohastructure
Marcel de Rooy [Tue, 8 Mar 2016 13:51:42 +0000 (14:51 +0100)]
 Bug 15084: [QA Follow-up] Update kohastructure

Adds two db revs to kohastructure

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15084: typo currency vs currency_code
Jonathan Druart [Tue, 8 Mar 2016 10:15:32 +0000 (10:15 +0000)]
 Bug 15084: typo currency vs currency_code

The DB column is currency.currency not currency.currency_code.

Test plan:
Delete a currency
Without this patch, you will get a warning in the logs:
No method currency_code! at
/home/koha/src/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt
line 148.
And the currency won't be deleted.

With this patch, it will!

It also changes the value of the delete op.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15936 - Revise layout and behavior of SMS cellular providers management
Owen Leonard [Sat, 20 Feb 2016 01:24:46 +0000 (20:24 -0500)]
 Bug 15936 - Revise layout and behavior of SMS cellular providers management

This patch changes the behavior of the SMS cellular providers management
page so that sections of the page are shown or hidden based on what the
current task is. Other changes include:

- Moving JavaScript to a separate file
- Adding a toolbar with a "New SMS provider" button.
- Adding the "generic" catalog search header form to the top of the
  page.
- Adding "Required" classes to required fields so that the staff
  client's built-in JS validation library can be used.

To test, the  SMSSendDriver system preference must be set to "Email."
Apply the patch and go to Administration -> SMS cellular providers.

- Confirm that the add/edit form is hidden initially. A toolbar with a
  "New SMS provider" button should appear with existing SMS cellular
  providers in a table below. If there are no existing providers a
  message dialog should say so.
- Confirm that the "New SMS provider" button works:
  - The table should be hidden and an empty "add" form displayed.
  - Confirm that an empty form cannot be submitted.
  - Confirm that submitting valid data works.
  - Confirm that clicking the "Cancel" button hides the form and
    redisplays the table.
- Test the "edit" button for an existing provider:
  - Confirm that the edit form is displayed and populated with the
    correct data.
  - Confirm that edits are saved correctly.
- When viewing the table of existing providers, confirm that clicking
  the "Delete" button triggers a confirmation dialog. Test both
  cancelling and confirming that dialog.
- Ponder whether all this is an improvement or not.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15445 DateUtils.t fails on Jenkins due to server sluggishness
Frédéric Demians [Wed, 30 Dec 2015 15:29:03 +0000 (16:29 +0100)]
 Bug 15445 DateUtils.t fails on Jenkins due to server sluggishness

Jenkins server is abnormally slow to perform a task done in less than
1s elsewhere. The test stay valid by giving just a bit more time to Jenkins
server.

TO TEST:
- Confirm that the two test hasn't changed. They the just get 4s to
  perform
- Push the patch to master and observe that DateUtils.t doesn't fail
  anymore.

NOTE: Also passed koha qa test tools too.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended: Changed to 2s, should be enough

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years agoBug 14694 [QA Followup] - Update Koha::Borrower references to Koha::Patron
Kyle M Hall [Tue, 8 Mar 2016 16:21:17 +0000 (16:21 +0000)]
Bug 14694 [QA Followup] - Update Koha::Borrower references to Koha::Patron

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years ago Bug 15735: Audio Alerts editor broken by use of of single quotes in editor
Kyle M Hall [Wed, 3 Feb 2016 19:05:19 +0000 (19:05 +0000)]
 Bug 15735: Audio Alerts editor broken by use of of single quotes in editor

Single quotes audio selector break ability to edit an alert

Test Plan:
1) Enable audio alerts
2) Add new a alert with a select containing single quotes such as: input[name*='test']
3) Note you cannot edit the alert
4) Apply this patch
5) Reload the page
6) You should now be able to edit the alert

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Bug 15734 applied on top. 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 15941 - The template for cloning circulation and fine rules says "issuing rules"
Owen Leonard [Mon, 29 Feb 2016 19:39:30 +0000 (14:39 -0500)]
 Bug 15941 - The template for cloning circulation and fine rules says "issuing rules"

The template for cloning circulation and fine rules should use the
phrase "circulation and fine rules" instead of "issuing rules."

Also changed: Added "Cancel" link to return the user to the circulation
and fine rules page.

To test, navigate directly to /cgi-bin/koha/admin/clone-rules.pl.

The page title, breadcrumbs, and heading should all use the phrase
"circulation and fine rules."

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 A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 14306: Remove call to GetMarcNotes from sendshelf
Marcel de Rooy [Thu, 27 Aug 2015 08:01:53 +0000 (10:01 +0200)]
 Bug 14306: Remove call to GetMarcNotes from sendshelf

Just as mentioned in the first patch for sendbasket, I discovered that
the call of GetMarcNotes is not really used in sendshelf. The array is
passed to the template, but the template does not use it. (It uses the
information from GetBiblioData.)

Test plan:
[1] Send a list that includes a record with some notes (opac and staff).

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 14306: Changes for basket and detail templates
Marcel de Rooy [Thu, 27 Aug 2015 07:49:40 +0000 (09:49 +0200)]
 Bug 14306: Changes for basket and detail templates

A simple regex is added to the basket and detail templates to select the
URLs passed separately from MARC21 555$u by GetMarcNotes. Note that the
regex tests if a note starts with http:// or https:// and does not contain
any whitespace in order to be considered as a url.
These URLs are put in an anchor tag.

This touches four places:
[1] opac detail, tab title notes
[2] catalogue detail, tab Descriptions
[3] opac basket, more details, notes
[4] staff basket, more details, notes

Test plan:
[1] Edit a record. Add a 500$a, 555$a and a URL in 555$u.
    Put "http://this is not a url" in the 500$a (whitespace!).
[2] Check opac-detail, tab Title Notes. Check the URL.
[3] Do the same for catalogue/detail.
[4] Add record to cart in OPAC. Open basket. Check More details.
[5] Repeat previous step in staff.

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 14306: Follow-up for URLs in 555$u
Marcel de Rooy [Wed, 26 Aug 2015 14:35:38 +0000 (16:35 +0200)]
 Bug 14306: Follow-up for URLs in 555$u

This patch removes the code for inserting the <a> anchor tags around
URLs in GetMarcNotes (as added originally).
The URLs are placed in separate array elements; the template should take
care of further handling.
The unit test has been adjusted accordingly.

Test plan:
Run the unit test.

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 14306: Show URL from MARC21 field 555$u under Title Notes/Descriptions
Marcel de Rooy [Mon, 1 Jun 2015 10:58:25 +0000 (12:58 +0200)]
 Bug 14306: Show URL from MARC21 field 555$u under Title Notes/Descriptions

This patch includes:
[1] Add some logic to GetMarcNotes to embed the contents of MARC21 field
    555$u in a html anchor tag.
[2] Add a unit test for GetMarcNotes in Biblio.t
[3] Remove calls to GetMarcNotes from sendbasket.pl (opac and staff).
    A closer look revealed that the data was not used; the notes in the
    mail of sendbasket are taken from GetBiblioData.

Test plan:
[1] Edit a record. Add one or two URLS in 555$u. Add something in 500$a too.
[2] Check if you can click the URLs in opac and staff detail tab Notes or
    Descriptions.
[3] Run the unit test t/db../Biblio.t
[4] Add something in the cart. Click More Details and send the cart.
    Verify that you have something in Notes (from 500$a).

Signed-off-by: Marc Veron <veron@veron.ch>
Followed test plan. Works as expected. QA tools OK.

Tested with all patches together, works 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 A Gallagher <brendan@bywatersolutions.com>
8 years agoDBREV Bug 14694 - Make decreaseloanHighHolds more flexible
Brendan A Gallagher [Mon, 7 Mar 2016 17:56:24 +0000 (17:56 +0000)]
DBREV Bug 14694 - Make decreaseloanHighHolds more flexible

8 years ago Bug 14694: Create data the tests need
Jonathan Druart [Tue, 19 Jan 2016 13:30:56 +0000 (13:30 +0000)]
 Bug 14694: Create data the tests need

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 14694 [QA Followup] - Fix syspref order
Kyle M Hall [Sun, 25 Oct 2015 12:02:10 +0000 (08:02 -0400)]
 Bug 14694 [QA Followup] - Fix syspref order

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 14694 [QA Followup] - Fix typos
Kyle M Hall [Thu, 22 Oct 2015 13:28:38 +0000 (09:28 -0400)]
 Bug 14694 [QA Followup] - Fix typos

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 14694 [QA Followup] - Fix unit tests
Kyle M Hall [Thu, 22 Oct 2015 12:12:10 +0000 (08:12 -0400)]
 Bug 14694 [QA Followup] - Fix unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 14694 - Make decreaseloanHighHolds more flexible
Kyle M Hall [Tue, 29 Sep 2015 17:24:29 +0000 (13:24 -0400)]
 Bug 14694 - Make decreaseloanHighHolds more flexible

This patch allows for more flexibility for determining when the number
of holds a record has should trigger the reduction of the loan length
for items on that record.

This patch adds a new system preference decreaseLoanHighHoldsControl,
which defaults to 'static', the original behavior of the feature.
It also has a new behavior 'dynamic' which makes the feature only
decrease the loan length if the number of holds on the record exceeds
the number of holdable items + decreaseLoanHighHoldsValue.

It also allows items to be filtered from the list of items based
on the damaged, lost, not for loan, and withdrawn values even if
those values would have allowed holds ( i.e. values < 0 )

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Set decreaseLoanHighHolds to Enable
4) Set decreaseLoanHighHoldsControl to "over the number of items on the record"
5) Set decreaseLoanHighHoldsDuration to 1
6) Set decreaseLoanHighHoldsValue to 3
7) Create a record with 5 items
8) Please 8 or more holds on the record
9) Check out one of the items to a patron
10) Note the loan length is reduced to 1 day
11) Set decreaseLoanHighHoldsValue to 3 to 2
12) Check out one of the items to a patron
13) Note the loan length is *not* reduced
14) Enbale all the filters possible in decreaseLoanHighHoldsIgnoreStatuses
15) Set one item to be damaged
16) Note the loan length is reduced
17) Unset the damaged status
18) Repeat steps 15 - 17 for lost, not for loan, and withdrawn

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.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 15961 - Use Font Awesome icons for confirmation of currency deletion
Owen Leonard [Wed, 2 Mar 2016 17:35:56 +0000 (12:35 -0500)]
 Bug 15961 - Use Font Awesome icons for confirmation of currency deletion

When deleting a currency, the confirmation and error dialogs should use
Font Awesome icons. This patch makes this change.

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

- Click the "delete" link next to any currency.
- Verify that the confirmation dialog is correctly styled.
  - Test the both cancel and confirm operations.
  - Verify that the deletion confirmation dialog is correctly styled.

Bug 15962 prevents testing the error dialog which should appear if you
try to delete a currency which is use (defined as a currency in a vendor
record). To test this error you could manually enter a currency code
into aqbooksellers.currency and then try to delete that currency.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15965: Select default value ('biblio') if needed
Jonathan Druart [Mon, 7 Mar 2016 10:05:36 +0000 (10:05 +0000)]
 Bug 15965: Select default value ('biblio') if needed

It will prevent wrong value to be selected when the back button of the
browser is used.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15965: Koha to MARC mapping - table changes with selection of drop down menu
Aleisha [Thu, 3 Mar 2016 02:20:47 +0000 (02:20 +0000)]
 Bug 15965: Koha to MARC mapping - table changes with selection of drop down menu

EDIT: Removing JS line

To test:

1) Go to Admin -> Koha to MARC Mapping
2) Test selecting biblio / biblioitems / items
3) Confirm the table content changes and behaves as it should which each
   selection

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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 5404: [QA Follow-up] Add test descriptions
Marcel de Rooy [Fri, 4 Mar 2016 10:54:07 +0000 (11:54 +0100)]
 Bug 5404: [QA Follow-up] Add test descriptions

Adding descriptions for changes in t/db_dependent/Biblio.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 5404: Move the test to a new IsMarcStructureInternal sub
Jonathan Druart [Mon, 29 Feb 2016 10:04:51 +0000 (10:04 +0000)]
 Bug 5404: Move the test to a new IsMarcStructureInternal sub

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 5404: C4::Koha - remove subfield_is_koha_internal_p
Jonathan Druart [Fri, 12 Feb 2016 12:36:16 +0000 (12:36 +0000)]
 Bug 5404: C4::Koha - remove subfield_is_koha_internal_p

The commit b5ecefd485a75d54a5fa26fff5a0cc890541e2c3
Date:   Mon Feb 3 18:46:00 2003 +0000

had a funny description:
Added function to check if a MARC subfield name is "koha-internal"
(instead of checking it for 'lib' and 'tag' everywhere); temporarily
added to Koha.pm

"Temporarily", since 2003, everything is relative, isn't it? :)

The thing is that GetMarcStructure returns hash like

field_200 => {
    subfield_a => {
        %attributes_of_subfield_a
    },
    %attributes_of_field_200
}

The attributes for field_200 can be 'repeatable', 'mandatory', 'tag', 'lib'.
We don't want to loop on these values when looping on subfields.
Since there are just { k => v } with v is a scalar (string), it's easier
to test if we are processing a subfield testing the reference.

At some places, we don't need to test that, we are looping on values
from MARC::Field->subfields which are always valid subfields.

Test plan:
1/ Edit items using the batch item mod tool
2/ display and edit items via the cataloguing module.

You should not see any changes between before and after the patch
applied.

Tech notes:
We need to check what we are processing when we loop on 'subfields' from
GetMarcStructure, not from MARC::Field->subfields.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 13871: [QA Follow-up] Add $server for FID_SCREEN_MSG
Marcel de Rooy [Fri, 4 Mar 2016 10:25:27 +0000 (11:25 +0100)]
 Bug 13871: [QA Follow-up] Add $server for FID_SCREEN_MSG

When you are ready, you still see that small detail.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 13871: [QA Follow-up] Adjust Patron Info Request
Marcel de Rooy [Sat, 27 Feb 2016 13:40:44 +0000 (14:40 +0100)]
 Bug 13871: [QA Follow-up] Adjust Patron Info Request

Conform QA comment, Patron Info request is slightly adjusted to be
consistent with changes to Patron Status request.

If the cardnumber is ok and the password is wrong, BL=N is reported but
also add 'Invalid password' in AF.
Additionally, an invalid card number is reported in AF.

Test plan:
[1] Send patron info request for invalid card.
[2] Idem for valid card, no password.
[3] Idem for valid card, good password.
[4] Idem for valid card, wrong password.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified by telnetting SIP server.
And tested additionally with the new unit test of bug 15956.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 13871: [QA Follow-up] Adjust Patron Status Request
Marcel de Rooy [Sat, 27 Feb 2016 13:26:51 +0000 (14:26 +0100)]
 Bug 13871: [QA Follow-up] Adjust Patron Status Request

Conform QA comment on Bugzilla, we do this:

[1] Attribute for overdrive mode/invalid credentials is not really needed.
    We can always pass a screen message that card or password is invalid.
[2] If the cardnumber is correct and the password is wrong, we should
    still honour the request. The bad password is recognized by BLN and
    an additional message in AF.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified by telnetting SIP server.
And tested additionally with the new unit test of bug 15956.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 13871 - OverDrive message when user authentication fails
Mason James [Sun, 22 Mar 2015 23:06:27 +0000 (12:06 +1300)]
 Bug 13871 - OverDrive message when user authentication fails

NOTE: apply this patch after the additional perltidy patch

this patch is basically a small work-around to fix some confusing login text,
when users enter incorrect auth details via Overdrive's website

with this option disabled (default) there is no change to SIP's behaviour

to test...

1/ configure your overdrive account to talk to your Koha's SIP service

2/ start Koha's SIP

3/ enter a correct username and correct password in overdrive
see overdrive display '(1) Greetings from Koha' (good)

4/ enter a correct username and *incorrect* password in overdrive
see overdrive display '(1) Greetings from Koha' (bad)

5/ enter an incorrect username in overdrive
see overdrive display '(1)' (badder)

6/ apply patch, enable 'overdrive-mode' in Koha's SIPConfig.xml

example...
---------------------
<accounts>
<login id="kohasip" password="xxxxx" delimiter="|"
error-detect="enabled" institution="YYY" overdrive-mode="1" />
</accounts>
---------------------

7/ restart SIP

8/ enter a correct username and correct password
see overdrive display '(1) Greetings from Koha'

9/ enter a correct username and *incorrect* password
see overdrive display '(1) Invalid patron or patron password'

10/ enter an incorrect username and incorrect password
see overdrive display '(1) Invalid patron or patron password'

http://bugs.koha-community.org/show_bug.cgi?id=1387

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 13871: [TITLE_AMENDED] Additional changes
Mason James [Mon, 23 Mar 2015 01:30:26 +0000 (14:30 +1300)]
 Bug 13871: [TITLE_AMENDED] Additional changes

The original perltidy patch from Mason has been amended.

The perltidy itself has been moved to a separate patch with the current
perltidyrc applied.

As noted on Bugzilla, the original perltidy patch included some extra
changes:
[1] You prefix timestamp with Sip
    This is not actually needed (it is imported), but if we should prefix it,
    we should prefix now with C4::SIP::Sip. But you only changed two
    occurrences (out of 26). So I remove these two changes.
[2] You remove the $server parameter from two calls of maybe_add:
    A closer look at the remaining code tells me that $server is always
    passed to maybe_add for FID_SCREEN_MSG. So this only left me the
    current whitespace change.
But at least we documented what we did or did not, and why..

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 13871: Adjusted perl tidy on MsgType.pm
Marcel de Rooy [Fri, 26 Feb 2016 08:42:13 +0000 (09:42 +0100)]
 Bug 13871: Adjusted perl tidy on MsgType.pm

Run perltidy pro=xt/perltidyrc on the file.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15968: Unnecessary loop in C4::Templates
Jonathan Druart [Thu, 3 Mar 2016 11:35:14 +0000 (11:35 +0000)]
 Bug 15968: Unnecessary loop in C4::Templates

From C4::Templates::output

     # add variables set via param to $vars for processing
     for my $k ( keys %{ $self->{VARS} } ) {
         $vars->{$k} = $self->{VARS}->{$k};
     }

This loop is not necessary, we could do the same with

     $vars = { %$vars, %{ $self->{VARS} } };

After a quick benchmark, it gains 100 microseconds when we pass 170 vars
to the template.

Test plan:
Do some clicks on the interface, everything should be ok.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Perl idiosyncratic way of merging hash, clearer, if not quicker (not
  verified)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years agoBug 15084 [QA Followup] - Fix new uses of GetCurrency
Kyle M Hall [Mon, 7 Mar 2016 13:33:43 +0000 (13:33 +0000)]
Bug 15084 [QA Followup] - Fix new uses of GetCurrency

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15084 [QA Followup] - Update Schema files
Kyle M Hall [Fri, 4 Mar 2016 19:41:21 +0000 (19:41 +0000)]
Bug 15084 [QA Followup] - Update Schema files

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15635 [QA Followup] - Fix number of unit tests
Kyle M Hall [Fri, 19 Feb 2016 14:55:53 +0000 (14:55 +0000)]
Bug 15635 [QA Followup] - Fix number of unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15635: Change method type to _type for bug 15446
Jonathan Druart [Tue, 16 Feb 2016 11:14:55 +0000 (11:14 +0000)]
Bug 15635: Change method type to _type for bug 15446

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15635: Koha::Patron::Images - Remove GetPatronImage
Jonathan Druart [Thu, 21 Jan 2016 13:04:09 +0000 (13:04 +0000)]
Bug 15635: Koha::Patron::Images - Remove GetPatronImage

To retrieve a patron image, we can call Koha::Patron::Images->find or
Koha::Patrons->find->image
Both will return a Koha::Patron::Image object.

Test plan:
1/ From the patron/member module, open all tabs on the left (Checkouts,
detail, fines, etc.)
The image should be correctly displayed.
2/ At the OPAC, on the patron details page (opac-memberentry.pl) the
image should be displayed as well.
3/ Same on the sco module.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15635: Koha::Patron::Images - Remove RmPatronImage
Jonathan Druart [Thu, 21 Jan 2016 12:37:41 +0000 (12:37 +0000)]
Bug 15635: Koha::Patron::Images - Remove RmPatronImage

The C4::Members::RmPatronImage just removed a row in patronimage.
This can be accomplished using the delete method of Koha::Patron::Image.

Test plan:
From the patron defail page, try to delete the image of a patron.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15635: Koha::Patron::Images - Remove PutPatronImage
Jonathan Druart [Thu, 21 Jan 2016 12:32:28 +0000 (12:32 +0000)]
Bug 15635: Koha::Patron::Images - Remove PutPatronImage

The C4::Members::PutPatronImage inserted/updated the image of a patron.
This can be done easily with ->find->set->store or ->new->store

Test plan:
1/ Modify the image of a patron from the patron detail page
2/ Add an image to a new patron
3/ Use the "Upload patron images" tools (tools/picture-upload.pl) to add
or modify the image of a patron
4/ Use the "Upload patron images" tools (tools/picture-upload.pl) to add
or modify the image of several patrons, using a zip file.
Stress the script trying to get as many errors as possible (wrong
cardnumber, wrong mimetype, file does not exist, etc.)
With this patch, if the cardnumber does not exist, you will get a
specific error "Image not imported because this patron does not exist in
the database"

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15635: Koha::Patron::Images - Add new classes
Jonathan Druart [Thu, 21 Jan 2016 12:33:25 +0000 (12:33 +0000)]
Bug 15635: Koha::Patron::Images - Add new classes

There are 3 subroutines in C4::Members to get, add and delete patron
images:
- GetPatronImage
- PutPatronImage
- RmPatronImage

By creating these 2 Koha::Patron::Image[s] classes, we could remove them easily.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years ago Bug 15950: Use Font Awesome icons for acquisitions basket close confirmation
Owen Leonard [Tue, 1 Mar 2016 18:23:52 +0000 (13:23 -0500)]
 Bug 15950: Use Font Awesome icons for acquisitions basket close confirmation

When closing a basket in Acquisitions the confirmation dialog should be
styled using Font Awesome icons. This patch adds them.

The cancel button has been moved into its own form so that we can get
rid of several problematic JavaScript issues: The use of the
"javascript:" pseudo-protocol, the use of an "onclick" attribute, and
the use of a JS redirect where a GET action will do.

To test, apply the patch and locate an open basket in Acquisitions which
can be closed.

- Click the 'Close this basket' button and confirm that the icons in the
  dialog look correct.
- Test the cancel operation to make sure you are redirected back to the
  page showing the basket details.
- Test the confirm operation and verify that the basket is closed.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Please note that the confirmation message display depends on
BasketConfirmations.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15951: Use Font Awesome icons for acquisitions order cancellation confirmation
Owen Leonard [Tue, 1 Mar 2016 19:48:45 +0000 (14:48 -0500)]
 Bug 15951: Use Font Awesome icons for acquisitions order cancellation confirmation

In Acquisitions, when you delete (cancel) an order, a dialog asks you to
confirm. This dialog should be styled with Font Awesome icons.

Other minor edit: Changing page grid style for centered main content
area.

To test, apply the patch and locate a basket in Acquisitions with an
order.

- View the details for the basket.
- Click the 'Delete' link next to the order you want to delete.
- Confirm that the dialog is correctly styled.
- Test the cancel operation and verify that you are correctly redirected
  back to where you were.
- Test the confirmation operation and verify that your order is deleted.
- Also test the deletion process from Acquisitions -> Vendor -> Invoices
-> Invoice -> Go to receipt page -> Delete order.

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 A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15959: Use Font Awesome icons for attach item confirmations
Owen Leonard [Wed, 2 Mar 2016 16:37:09 +0000 (11:37 -0500)]
 Bug 15959: Use Font Awesome icons for attach item confirmations

When attaching an existing item to a record, the confirmation and error
dialogs should be styled using Font Awesome icons. This patch revises
the buttons and revises the global CSS file.

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

- Locate a record in the catalog to which you can attach an item.
- Select "Attach item" from the "Edit" menu.
- Submit a barcode for an exising item.
- Verify that the confirmation dialog is correctly styled.
  - Test the operation of both the "OK" and the "Attach another item"
    buttons.
- Submit an invalid barcode.
- Verify that the error dialog is correctly styled.
  - Test the operation of both the "OK" and the "Try again"
    buttons.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15925 [Revised] Correct some markup issues with patron lists pages
Owen Leonard [Fri, 26 Feb 2016 14:17:52 +0000 (09:17 -0500)]
 Bug 15925 [Revised] Correct some markup issues with patron lists pages

This patch makes some markup changes to the patron lists interface in
order to make them more consistent with other areas of Koha.

Change to look for when testing:

Tools -> Patron lists:

- Wrap "New patron list" button in standard <div id="toolbar">
- Place toolbar above page heading.

Tools -> Patron lists -> New patron list:

- Use built-in form validation for required fields
- Clarify page title and breadcrumbs on list add and edit

Validation errors have been corrected on all three templates, including
removal of an extra </div>.

Revision: I was wrong about the frequency of use of "Modify." There's no
clear-cut reason to replace it with "Edit" so I have undone that change.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Works as expected. No regression. Better texts. Consistent validation.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15940 - Remove unused JavaScript from authorities MARC subfield structure
Owen Leonard [Mon, 29 Feb 2016 18:39:16 +0000 (13:39 -0500)]
 Bug 15940 - Remove unused JavaScript from authorities MARC subfield structure

The authorities MARC subfield structure template contains some unused
JavaScript, "function displayMoreConstraint()" This patch removes it.

To test, apply the patch and go to Administration -> Authority types ->
MARC structure -> Subfields -> Edit subfields and confirm that there are
no JavaScript errors and tab switching works correctly.

A search of the source code should show no instances of
"displayMoreConstraint."

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  No regression, no JS warning.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15755: Display default item type as "All" in circ rules
Jonathan Druart [Mon, 8 Feb 2016 13:00:37 +0000 (13:00 +0000)]
 Bug 15755: Display default item type as "All" in circ rules

Bug 15354 did not fix correctly the issue with the item type display.
The default item type '*' should be "All", at the moment nothing is
displayed in the column.

Test plan:
1/ Define a rule for default item types (All/*) and for specific item
types.
2/ Translate some item type descriptions used in previous step
3/ Default item type should be "All" and correct translations should be
displayed.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15864 - SMS cellular providers link missing from administration sidebar menu
Owen Leonard [Mon, 29 Feb 2016 16:04:37 +0000 (11:04 -0500)]
 Bug 15864 - SMS cellular providers link missing from administration sidebar menu

When the SMSSendDriver system preference is set to "Email" a link to the
SMS cellular providers management page should appear in the left-hand
sidebar menu on Administration pages. This patch adds the link to
admin-menu.inc.

To test, apply the patch set your SMSSendDriver system preference to
"Email." View various Administration pages which show the left-hand
sidebar menu and confirm that "SMS cellular providers" is in the list.

Empty the SMSSendDriver preference and confirm that the link no longer
appears.

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15669: Add a test for GetModificationTemplates
Jonathan Druart [Thu, 3 Mar 2016 10:28:56 +0000 (10:28 +0000)]
 Bug 15669: Add a test for GetModificationTemplates

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15669: Alphabetize marc modification templates
Nick Clemens [Thu, 18 Feb 2016 16:40:47 +0000 (16:40 +0000)]
 Bug 15669: Alphabetize marc modification templates

This patch sorts the modification templates when getting them from the
database  This affects the pages below:

  tools/batch_record_modification.pl
  tools/marc_modification.pl
  tools/stage-marc-import.pl

To test:

1 - Add some marc modification templates in a non alpha order (Shoes,
    Hats, Cats)
2 - visit the pages above and note the templates are in order
    added
3 - apply patch
4 - visit the three pages and note correct order
5 - verify all tools continue to work as expected

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 A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15871: Improve PerlCritic level for t/RecordProcessor.t
Mark Tompsett [Fri, 19 Feb 2016 20:49:02 +0000 (15:49 -0500)]
 Bug 15871: Improve PerlCritic level for t/RecordProcessor.t

perlcritic -5 failed.
Attempt to clean up to a higher level:
-- use English to address use of $@ variable
-- perltidy on the code
-- substitute q{} for ''
-- expand out single line hacky goodness (... s/\.pm$//) to more code
-- remove parenthesis on functions that don't need it
-- add x, s, and m as needed to regexps
-- change double quotes to single quotes where no variable involved
-- tweaked eval destroy test to check return value and use $EVAL_ERROR
-- renamed $processor to $record_processor in the subtest to avoid
   lexical warnings

TEST PLAN
---------

$ perlcritic -5 t/RecordProcessor.t
Don't modify $_ in list functions at line 43, column 25.  See page 114 of PBP.  (Severity: 5)

$ perlcritic -2 t/RecordProcessor.t
No package-scoped "$VERSION" variable found at line 1, column 1.  See page 404 of PBP.  (Severity: 2)
Quotes used with a string containing no non-whitespace characters at line 34, column 36.  See page 53 of PBP.  (Severity: 2)
Quotes used with a string containing no non-whitespace characters at line 34, column 39.  See page 53 of PBP.  (Severity: 2)
Quotes used with a string containing no non-whitespace characters at line 36, column 33.  See page 53 of PBP.  (Severity: 2)
Quotes used with a string containing no non-whitespace characters at line 36, column 36.  See page 53 of PBP.  (Severity: 2)
Don't modify $_ in list functions at line 43, column 25.  See page 114 of PBP.  (Severity: 5)
Regular expression without "/s" flag at line 43, column 33.  See pages 240,241 of PBP.  (Severity: 2)
Regular expression without "/x" flag at line 43, column 33.  See page 236 of PBP.  (Severity: 3)
Regular expression without "/m" flag at line 43, column 33.  See page 237 of PBP.  (Severity: 2)
Regular expression without "/s" flag at line 43, column 66.  See pages 240,241 of PBP.  (Severity: 2)
Regular expression without "/x" flag at line 43, column 66.  See page 236 of PBP.  (Severity: 3)
Regular expression without "/m" flag at line 43, column 66.  See page 237 of PBP.  (Severity: 2)
Expression form of "grep" at line 47, column 8.  See page 169 of PBP.  (Severity: 4)
Expression form of "grep" at line 50, column 20.  See page 169 of PBP.  (Severity: 4)
Regular expression without "/s" flag at line 50, column 26.  See pages 240,241 of PBP.  (Severity: 2)
Regular expression without "/m" flag at line 50, column 26.  See page 237 of PBP.  (Severity: 2)
Return value of eval not tested at line 73, column 1.  You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed.  (Severity: 3)
Magic punctuation variable $@ used at line 78, column 5.  See page 79 of PBP.  (Severity: 2)
Reused variable name in lexical scope: $processor at line 84, column 5.  Invent unique variable names.  (Severity: 3)
Subroutine "new" called using indirect syntax at line 87, column 18.  See page 349 of PBP.  (Severity: 4)
Subroutine "new" called using indirect syntax at line 93, column 18.  See page 349 of PBP.  (Severity: 4)
Quotes used with a string containing no non-whitespace characters at line 96, column 40.  See page 53 of PBP.  (Severity: 2)
Subroutine "new" called using indirect syntax at line 99, column 18.  See page 349 of PBP.  (Severity: 4)
Subroutine "new" called using indirect syntax at line 106, column 18.  See page 349 of PBP.  (Severity: 4)
$ prove -v t/RecordProcessor.t
t/RecordProcessor.t .. ok
All tests successful.
Files=1, Tests=13,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.22 cusr  0.02 csys =  0.25 CPU)
Result: PASS

$ prove -v t/RecordProcessor.t
...
$ git bz apply 15871

Repeat perlcritic level 2, and only $VERSION warning should exist.
Retest with the prove.
Run koha qa test tools.

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

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
I don't really care about perlcritic as long as it involves changing '' into qw{} (WTF?)
Anyway, I'd do this kind of things as we go, for example, if we were adding more tests. In that
case it would just be a followup for this, after you provided a patch for an enh/bugfix.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years agoBug 15548 [QA Followup] - More new uses of Koha::Borrower
Kyle M Hall [Sun, 14 Feb 2016 12:55:08 +0000 (12:55 +0000)]
Bug 15548 [QA Followup] - More new uses of Koha::Borrower

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15548 [QA Followup] - Catch a couple new Koha::Borrower uses
Kyle M Hall [Fri, 15 Jan 2016 18:38:03 +0000 (18:38 +0000)]
Bug 15548 [QA Followup] - Catch a couple new Koha::Borrower uses

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15548: Move new patron related code to Patron*
Jonathan Druart [Mon, 11 Jan 2016 15:57:59 +0000 (15:57 +0000)]
Bug 15548: Move new patron related code to Patron*

The 'borrower' should not be used anymore, especially for new code.
This patch move files and rename variables newly pushed (i.e. in the Koha
namespace).

Test plan:
1/
  git grep Koha::Borrower
should not return code in use.

2/
Prove the different modified test files

3/ Do some clicks in the member^Wpatron module to be sure there is not
an obvious error.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. Tested with Circulation, Members/Patrons, Discharge,
Restrictions modules and the must common functionalities

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years ago Bug 15632 [QA Followup] - Change method type to _type for bug 15446
Kyle M Hall [Thu, 11 Feb 2016 10:05:21 +0000 (10:05 +0000)]
 Bug 15632 [QA Followup] - Change method type to _type for bug 15446

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632 [QA Followup] - Undo changes needed for Bug 13618 which was reverted
Kyle M Hall [Thu, 11 Feb 2016 09:38:33 +0000 (09:38 +0000)]
 Bug 15632 [QA Followup] - Undo changes needed for Bug 13618 which was reverted

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632 [QA Followup] - Get rid of use of uninitialized value errors for unit...
Kyle M Hall [Thu, 11 Feb 2016 08:09:03 +0000 (08:09 +0000)]
 Bug 15632 [QA Followup] - Get rid of use of uninitialized value errors for unit tests

* Set $user to "" if not passed
* Tidy sub

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632: Koha::Patron::Messages - (follow-up) Remove AddMessage
Jonathan Druart [Mon, 1 Feb 2016 17:20:21 +0000 (17:20 +0000)]
 Bug 15632: Koha::Patron::Messages - (follow-up) Remove AddMessage

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632: Koha::Patron::Messages - Remove tests
Jonathan Druart [Wed, 20 Jan 2016 18:28:40 +0000 (18:28 +0000)]
 Bug 15632: Koha::Patron::Messages - Remove tests

The messages related tests in t/db_dependent/Members.t are not
deprecated and can be removed.

Test plan:
  git grep AddMessage
  git grep DeleteMessage
  git grep GetMessagesCount
  git grep GetMessages
should not return any result.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632: Koha::Patron::Messages - Remove GetMessages
Jonathan Druart [Wed, 20 Jan 2016 18:28:55 +0000 (18:28 +0000)]
 Bug 15632: Koha::Patron::Messages - Remove GetMessages

This subroutine just retrieved the messages given some parameters.
Some job should not have been done in this subroutine.
It was called only 3 times, in circ/circulation.pl and opac-user.pl.
Basically it was used to retrieved the message to displaye for a given
patron ($borrowernumber) at the OPAC (B) or Staff (L).

For the 3 calls, the 2 parameters $borrowernumber and $type
(message_type) were passed, the "%" trick at the beginning of the
subroutine was useless.
Moreover, the date formatting should be done on the TT side, not in
subroutine.
The can_delete flag was set if the branchcode given in parameter was the
same as the one of the message. This has been delegated to the template.
Indeed the can_delete was not valid, since it must depend on the
AllowAllMessageDeletion pref.
The test is now:
  IF message.branchcode == branch OR
  Koha.Preference('AllowAllMessageDeletion'')

There is not specific test plan for this patch, the changes have already
been tested in previous patches.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632: Koha::Patron::Messages - Remove GetMessagesCount
Jonathan Druart [Wed, 20 Jan 2016 17:58:45 +0000 (17:58 +0000)]
 Bug 15632: Koha::Patron::Messages - Remove GetMessagesCount

The GetMessageCount subroutine was only used once, in opac-user.pl, to
know if some messages will be displayed.

Test plan:
1/ Create messages to display at the OPAC for a patron
2/ Logged this patron in at the OPAC, you should see the messages
displayed.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632: Koha::Patron::Messages - Remove DeleteMessage
Jonathan Druart [Wed, 20 Jan 2016 17:57:55 +0000 (17:57 +0000)]
 Bug 15632: Koha::Patron::Messages - Remove DeleteMessage

The DeleteMessage just deleted and logged if needed.
This is now be done by Koha::Patron::Message->delete.

Test plan:
1/ Go on the "check out" page of a patron
2/ Delete some messages

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632: Koha::Patron::Messages - Remove AddMessage
Jonathan Druart [Wed, 20 Jan 2016 17:56:58 +0000 (17:56 +0000)]
 Bug 15632: Koha::Patron::Messages - Remove AddMessage

The AddMessage subroutine just
1. checked if all the parameters were passed
2. inserted the message in the DB
3. logged the action if needed

These 3 jobs are now done by the overloaded store method of
Koha::Patron::Message.

Test plan:
1/ Go on the "check out" page of a patron
2/ Add different new messages

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632: Koha::Patron::Messages - Be sure add and delete will log
Jonathan Druart [Wed, 20 Jan 2016 17:56:07 +0000 (17:56 +0000)]
 Bug 15632: Koha::Patron::Messages - Be sure add and delete will log

If the pref BorrowersLog is on, the store and delete method should log
into the action_logs table.
Easy to do by overloading them.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15632: Koha::Patron::Messages - Add new classes
Jonathan Druart [Wed, 20 Jan 2016 17:31:50 +0000 (17:31 +0000)]
 Bug 15632: Koha::Patron::Messages - Add new classes

The following 4 CRUD subroutines in C4::Members:
- AddMessage
- DeleteMessage
- GetMessagesCount
- GetMessages

could be replaced with a new package based on Koha::Objets.
This patchset will add the 2 Koha::Patron::Message[s] classes, then use
it to replace the different calls to these subroutine.
It will slightly reduce the size of C4::Members

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years agoDBRev Bug 15084 - Move the currency related code to
Brendan A Gallagher [Thu, 3 Mar 2016 21:15:14 +0000 (21:15 +0000)]
DBRev Bug 15084 - Move the currency related code to
Koha::Acquisition::Currenc[y|ies]

8 years ago Bug 15084: Fix conflict with bug 15446 (type vs _type)
Jonathan Druart [Thu, 3 Mar 2016 08:41:38 +0000 (08:41 +0000)]
 Bug 15084: Fix conflict with bug 15446 (type vs _type)

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15084 [QA Followup] - Clean up test currencies after unit tests
Kyle M Hall [Fri, 22 Jan 2016 18:23:59 +0000 (18:23 +0000)]
 Bug 15084 [QA Followup] - Clean up test currencies after unit tests

Test currency left behind will cuase next run of the unit test to fail
as well as leaving db cruft.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15084: DBIx::Class - Shema changes
Jonathan Druart [Thu, 17 Dec 2015 10:57:48 +0000 (10:57 +0000)]
 Bug 15084: DBIx::Class - Shema changes

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years ago Bug 15084: DB Changes - add currency.archived and FK on aqorders.currency
Jonathan Druart [Thu, 29 Oct 2015 14:55:23 +0000 (14:55 +0000)]
 Bug 15084: DB Changes - add currency.archived and FK on aqorders.currency

See the comment for details.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>