koha.git
9 years agoBug 12583: DelItem prototype - Add unit tests
Jonathan Druart [Wed, 16 Jul 2014 12:07:33 +0000 (14:07 +0200)]
Bug 12583: DelItem prototype - Add unit tests

DelItem should return 1 if the item has been deleted, otherwise 0.

Test plan:
Verify that t/db_dependent/Items/DelItem.t returns green

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12583: DelItem prototype - prefer hashref
Jonathan Druart [Wed, 16 Jul 2014 11:44:39 +0000 (13:44 +0200)]
Bug 12583: DelItem prototype - prefer hashref

To delete an item, only the itemnumber should be mandatory. The DelItem
routine can retrieve the biblionumber from the itemnumber.

Test plan:
Verify that t/db_dependent/Items/DelItem.t passes

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12583: DelItem prototype - Remove $dbh
Jonathan Druart [Wed, 16 Jul 2014 11:39:07 +0000 (13:39 +0200)]
Bug 12583: DelItem prototype - Remove $dbh

Since C4::Context->dbh shares the DB handler, it's useless to pass it to
routines.

Test plan:
Try to remove an item from the Koha interface.
Verify that unit tests pass.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 9667 - Inventory scrolling to top with every click
Owen Leonard [Mon, 14 Jul 2014 13:05:05 +0000 (09:05 -0400)]
Bug 9667 - Inventory scrolling to top with every click

An "onclick" attribute on inventory results links causes the page to
scroll to the top each time. This patch updates the click handling to
use a progressive-enhancement method.

Unrelated changes: I added use of the Branches T:T plugin to output
library name instead of branchcode, and put a check around call number
to prevent output of empty [] in results.

To test, use the inventory tool to check a batch of items. On the
results page:

- Confirm that branch name is shown instead of code.
- Confirm that no [] shows for items without call numbers
- Confirm that clicking a title opens a pop-up window showing details
  for that title.
- Confirm that clicking a title opens a pop-up window whether you're on
  the first page of results or any subsequent page.

Signed-off-by: Ian Beardslee <ian@catalyst.net.nz>
Tested in Firefox and Chromium.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12639 - Z39.50 administration page should use "message" dialog for adds and updates
Owen Leonard [Wed, 23 Jul 2014 17:08:36 +0000 (13:08 -0400)]
Bug 12639 - Z39.50 administration page should use "message" dialog for adds and updates

This patch changes the style of a couple of message boxes to use the
"message" style instead of the "alert" style. This better reflects the
type and priority of the messages being displayed.

To test, got to Administration -> Z39.50 client targets and edit an
existing server. The confirmation message should be the blue "message"
type.

Test again by adding a new server. The confirmation message for this
operation should be of the same blue "message" type.

Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small template change, tested ok.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12572: (followup) Small style fix
Tomas Cohen Arazi [Fri, 25 Jul 2014 21:57:44 +0000 (18:57 -0300)]
Bug 12572: (followup) Small style fix

Boxes show a bit overlapped. This fixes that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12572 - Use jQueryUI Accordion to display message transport types
Owen Leonard [Mon, 14 Jul 2014 14:32:11 +0000 (10:32 -0400)]
Bug 12572 - Use jQueryUI Accordion to display message transport types

The notice edit view has separate sections for each of the various
message transport types. This patch groups them in a jQueryUI accordion
to simplify the view.

Also changed: Some label/id pairs have been changed to eliminate
duplicate ids.

To test, apply the patch an edit any notice under Tools -> Notices &
Slips.

- The message transport type fields for email, feed, phone, etc. should
  be correctly grouped in a collapsed accordion. The acccordion should
  look correct and work correctly.
- Clicking the label for any form field should correctly highlight the
  corresponding field.
- Submitting updates to the notice should work correctly for all message
  transport types.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works as described.
Something small: the top border of the uncollapsed/opened section
doesn't display correctly, but this is working a lot nicer than before,
as now changing a message requires a lot less scrolling.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12596: (followup) add reference to bug # and license note
Tomas Cohen Arazi [Fri, 25 Jul 2014 12:55:14 +0000 (09:55 -0300)]
Bug 12596: (followup) add reference to bug # and license note

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not...
Kyle M Hall [Thu, 17 Jul 2014 14:57:06 +0000 (10:57 -0400)]
Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue!

When using the backdating of returns feature, an item that is not
overdue is treated as being as many days overdue as it is *not* overdue.
This is due to the fact that _get_chargeable_units appears to return the
difference between the return date and the due date without
consideration the return date being earlier than the due date.

Test Plan:
1) Apply the unit test patch
2) prove t/db_dependent/Circulation.t
3) Note the failure
4) Apply the second patch
5) prove t/db_dependent/Circulation.t
6) Note there are no failures

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Fixes some badly named variables also

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
In order to test this, you need to activate SpecifyReturnDate.
I confirmed the problem and verified that the bug fixes it
by running the tests, but also by testing in staff.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12596 - Unit Test
Kyle M Hall [Thu, 17 Jul 2014 16:17:48 +0000 (12:17 -0400)]
Bug 12596 - Unit Test

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: (followup) keys expects a hash parameter
Tomas Cohen Arazi [Thu, 24 Jul 2014 18:40:32 +0000 (15:40 -0300)]
Bug 12164: (followup) keys expects a hash parameter

As of http://perldoc.perl.org/functions/keys.html we should avoid passing
a scalar parameter as it is not backwards compatible with squeezze's Perl
version (5.10).

Cite:
"Starting with Perl 5.14, keys can take a scalar EXPR, which must contain a
reference to an unblessed hash or array. The argument will be dereferenced
automatically. This aspect of keys is considered highly experimental. The
exact behaviour may change in a future version of Perl."

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: (followup) MoveOrders description corrected
Tomas Cohen Arazi [Thu, 24 Jul 2014 15:11:31 +0000 (12:11 -0300)]
Bug 12164: (followup) MoveOrders description corrected

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: Fix decimal number display
Jonathan Druart [Mon, 30 Jun 2014 10:05:46 +0000 (12:05 +0200)]
Bug 12164: Fix decimal number display

If the funds are not moved, the amount is display like 123.000000.
This patch hardcodes the number of decimal numbers to display (2).

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests, especially all acquisition tests.

New routines in Budgets.pm:
  - CloneBudgetPeriod
  - CloneBudgetHierarchy
  - MoveOrders

OK t/db_dependent/Budgets.t

Some of the tests done:

1) Duplicate an existing budget

- OK Existing budget is active, duplicate it and mark it inactive
- OK Existing budget is inactive, duplicate and mark it inactive

2) Close budget
- OK Budget was created without funds - no changes are made
- OK Budget was created with funds, all orders moved correctly
  - moving the available money to the new budget is optional
- OK Budget was created with funds, but one fund deleted,
     all orders moved correctly, one missing fund reported,
     orders unchanged

3) Partial receiced undone
- OK Partial receive from last budget is undone, order lines
     are correctly recombined and fund is set to the current budget

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: Fix some typos
Jonathan Druart [Mon, 30 Jun 2014 09:38:27 +0000 (11:38 +0200)]
Bug 12164: Fix some typos

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: follow-up: various fixes
Jonathan Druart [Fri, 6 Jun 2014 10:53:53 +0000 (12:53 +0200)]
Bug 12164: follow-up: various fixes

This follow-up fixes issues raised on bug 12164 comment 17.

1/ The unreceived orders columns should only display "pending" orders
2/ Fix some typo from_budget_period_id vs budget_period_id vs
to_budget_period_id

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: Add UI report
Jonathan Druart [Fri, 2 May 2014 08:00:11 +0000 (10:00 +0200)]
Bug 12164: Add UI report

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: On closing budget period, move unspent amount
Jonathan Druart [Mon, 2 Jun 2014 08:19:58 +0000 (10:19 +0200)]
Bug 12164: On closing budget period, move unspent amount

On closing a budget (budget period), the user will be presented with an
option to move remaining unspent funds from the previous budget to the
newly created one - adding to the amounts already entered in those
funds.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: Close a budget period (budget)
Jonathan Druart [Mon, 2 Jun 2014 08:18:04 +0000 (10:18 +0200)]
Bug 12164: Close a budget period (budget)

This is the main patch.

On closing a budget period, all unreceived orders are moved from the
old/previous fiscal year into the new fiscal year.

You can rollover funds unused in the previous fiscal year to the new
fiscal year.

This patch set is based on bug 12168 (bugfix) and can be tested on top
of bug 11578 (easier to see the fund structure).

The patch set is cut in 6 main patches:

- Move the budget period clone logic into C4::Budgets
  The code is moved from the pl to Budgets.pm and unit tests are provided.
  The original code should certainly be buggy since a typo existed.
- On cloning budget period, mark original budget as inactive
  Cloning a budget period is already possible in Koha, this patch adds a
  checkbox to mark as inactive the original budget. That avoids to edit
  the budget and click the "inactive" checkbox. Both do the same action.
- On cloning budget periods, add a "reset all funds" option
  Same as before, a new checkbox is added on cloning a budget period. If
  you check it, all fund amounts will be set to 0. Otherwise, no change
  compared to the existing behavior.
- Close a budget period (budget)
  The goal of this patch set is to move unreceived orders from a budget to
  another. This patch adds a C4::Budgets::MoveOrders routine which does
  this job.
  This action is only possible if the fund structure is the same for both
  budgets, the budget_code field should be the same.
- On closing budget period, move unspent amount
  Unspent amount will be move from the previous budget structure to the
  new one.
- Add UI report
  This patch only adds a report when closing a budget is done.

Test plan:
Wording: below, budget is a "budget period" and fund is a "budget".
Prerequisite: Having 1 active budget with some funds (with different
levels and different amounts). Order and receive some orders (not all).
1/ Go on the budgets administration page (admin/aqbudgetperiods.pl) and
duplicate the structure of this budget ("Duplicate" link in the
"Actions" column).
2/ Enter start and end date for this budget and mark the original budget
as inactive.
3/ Note that a new budget is created, with the same fund structures (and
same value) and that the old one is marked as inactive (see
admin/aqbudgets.pl page with patches from bug 11578).
4/ Try to close the new budget: it is not possible, there is no
unreceived orders for this budget.
5/ You can close the inactive budget ("Close" link in the "Actions"
column).
6/ Verify the number of "Unreceived orders" is correct and select the
new budget in the budget list. Click on the "Move remaining unspent
funds" if you want to move unspent amounts.
7/ A report view is displayed and show you the ordernumber which have
been impacted (grouped by fund).
8/ Try different configuration, depending on the selected checkboxes.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: On cloning budget periods, add a "reset all funds" option
Jonathan Druart [Mon, 2 Jun 2014 08:16:13 +0000 (10:16 +0200)]
Bug 12164: On cloning budget periods, add a "reset all funds" option

This patch adds a checkbox "reset all funds" (budgets).
If it is checked, the new created budgets (funds) will be reset.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: On cloning budget period, mark original budget as inactive
Jonathan Druart [Mon, 2 Jun 2014 08:14:52 +0000 (10:14 +0200)]
Bug 12164: On cloning budget period, mark original budget as inactive

This patch adds a checkbox "mark original budget as inactive" (budget
period).
If it is checked, the original budget will be marked as inactive.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12164: Move the budget period clone logic into C4::Budgets
Jonathan Druart [Mon, 2 Jun 2014 08:10:53 +0000 (10:10 +0200)]
Bug 12164: Move the budget period clone logic into C4::Budgets

Note the typo InsertInTable "aqcudgets", note sure about the existing
behavior before this patch!

This patch adds a link "Duplicate" in the action list for budget
periods (budgets).

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11347: DBRev 3.17.00.010
Tomas Cohen Arazi [Tue, 22 Jul 2014 14:32:49 +0000 (11:32 -0300)]
Bug 11347: DBRev 3.17.00.010

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11347 - PROG/CCSR deprecation: Remove opacsmallimage system-preference
Owen Leonard [Tue, 1 Jul 2014 16:43:44 +0000 (12:43 -0400)]
Bug 11347 - PROG/CCSR deprecation: Remove opacsmallimage system-preference

The opacsmallimage system preference is unused in the bootstrap theme.
It can be removed now that prog and ccsr are deprecated. This patch does
so.

To test, apply the patch and run updatedatabase. Confirm that the OPAC
works properly and the preference can no longer be found.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Preference removed, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 12519 - Convert OPAC list download pop-up to modal dialog
Owen Leonard [Wed, 2 Jul 2014 16:50:54 +0000 (12:50 -0400)]
Bug 12519 - Convert OPAC list download pop-up to modal dialog

This patch changes the OPAC list download process so that the download
link triggers a modal dialog instead of a pop-up window. This
streamlines the process a little bit and makes it work better on mobile
devices.

The download list page has been altered so that it works better as a
standalone page, as it might be seen if JavaScript is disabled. Simple
form validation has been added to help prevent submission of the form
without choosing a format.

To test the virtualshelves system preference must be enabled.

- View an existing list in the OPAC and click the "download list" link.
- A modal dialog should be displayed with the download form.
- Submitting the form without selecting a format should trigger either a
  browser-based form validation error (in HTML5-supporting browsers) or
  a JavaScript alert (if your browser doesn't support the "required"
  attribute.
- Choosing a download format and submitting the form should close
  the dialog and trigger the correct download.
- Clicking the "Cancel" link should close the dialog.

Test with JavaScript disabled:

- Clicking the "download list" link should take you to a page which
  contains the same form which appeared in the modal dialog.
- Submitting the form without selecting a format should trigger either a
  browser-based form validation error (in HTML5-supporting browsers) or
  a JavaScript alert (if your browser doesn't support the "required"
  attribute..
- Choosing a download format and submitting the form should result in
  the corect download.
- Clicking the "Cancel" link should return you to the correct list.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests, works as described.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 12595: (regression tests)
Tomas Cohen Arazi [Fri, 18 Jul 2014 15:02:41 +0000 (12:02 -0300)]
Bug 12595: (regression tests)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
9 years agoBug 12595: Search a patron by his/her firstname and surname
Jonathan Druart [Thu, 17 Jul 2014 11:26:46 +0000 (13:26 +0200)]
Bug 12595: Search a patron by his/her firstname and surname

Before bug 9811, if you searched for "John Doe" and only 1 patron with
this firstname/surname existed, the patron detail page was displayed.

Now the result lists all patrons with ( firstname=john or doe ) or (
surname=john or doe). Which is quite annoying when you expect only 1
result.

Test plan:
0/ Create some patrons like: "John Doe", "Jane Doe", "John Smith".
1/ Search for "John Doe" in the patron search box
2/ Verify you got 2 results
3/ Apply the patch
4/ Search for "John Doe" in the patron search box
5/ Verify you are redirected to the right patron detail page.

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12542: Tabs inconsistency in different circ-menu.inc uses
Owen Leonard [Mon, 14 Jul 2014 18:29:20 +0000 (14:29 -0400)]
Bug 12542: Tabs inconsistency in different circ-menu.inc uses

Differences between circ-menu.tt and circ-menu.inc always crop up when a
new menu item is added--usually only to circ-menu.inc as happened with
Bug 9261.

Other sidebar differences are present due to differences in the patron
data passed by various patron-related script to their templates. This
patch also irons out some of these inconsistencies.

To test, apply the patch and check out to a patron whose record has more
than just basic data: othername, country, patron attributes, street
number, road types, etc. View the following pages and compare the patron
data and visible tabs to confirm that they match:

circ/circulation.pl?borrowernumber=X
members/boraccount.pl?borrowernumber=X
members/files.pl?borrowernumber=X
members/mancredit.pl?borrowernumber=X
members/maninvoice.pl?borrowernumber=X
members/member-flags.pl?member=X
members/member-password.pl?member=X
members/moremember.pl?borrowernumber=X
members/notices.pl?borrowernumber=X
members/pay.pl?borrowernumber=X
members/paycollect.pl?borrowernumber=X
members/purchase-suggestions.pl?borrowernumber=X
members/readingrec.pl?borrowernumber=X
members/routing-lists.pl?borrowernumber=X
members/statistics.pl?borrowernumber=X
tools/viewlog.pl?do_it=1&modules=MEMBERS&modules=circulation&src=circ&object=X

The only difference I've found which is not fixed by this patch is the
display of extended patron attributes in the sidebar of moremember.pl.
This is a piecemeal fix for a problem which really deserves a
centralized solution, but at least it gets us back to consistency for
the moment.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Going through all tabs shows consistency is back. A mid term solution should
implement this in a centralized way. Great job Owen!
No koha-qa errors btw.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12559: Wrong message if all cover images deleted
Tomas Cohen Arazi [Fri, 11 Jul 2014 18:35:27 +0000 (15:35 -0300)]
Bug 12559: Wrong message if all cover images deleted

If a record contains a (one or more) local cover image and it is deleted, a wrong message is presented in the UI.

To reproduce:
 - Have LocalCoverImages set to "Display" and AllowMultipleCovers set to "Allow".
 - Go to the detail page of a record that has no images attached.
 - The 'Images' tab conveniently shows the following message:
   "No images have been uploaded..."
 - Use the "upload" link to add a local cover to the record
 - Complete the process, and "view final record".
 - The 'Images' tab shows the added cover.
 - Delete the cover image using the link below the cover.
=> FAIL: 'Click on an image...' message still shows instead of 'No images have been...'

To test:
 - Apply the patch
 - Repeat the previous steps
=> SUCCESS : 'No images have been...'

Bonus points: previous code didn't show a message at all if the user didn't have
permissions to upload local cover images. I've split the message  in two:
 - 'No images have been...' (for everyone)
 - 'Please upload (link)...' (for those with the right permissions :-D

Regards
To+

Edit: I used JavaScript to inject the 'No images...' message to aid localization.
It can be improved once we fix some stuff in the translation scripts to better support
placeholders/variables in the templates.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12593: search facets die with regex error if biblio has square brackets in fields
Dobrica Pavlinusic [Thu, 17 Jul 2014 10:27:55 +0000 (12:27 +0200)]
Bug 12593: search facets die with regex error if biblio has square brackets in fields

It's quite common to have [something] within facet data, and it produces following error:

Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE

This problem was intoduced in Bug 12151 but is trivial to fix.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Good catch.

To test:
- Created a bibliographic record, linked to an authority record (personal name). Did a search that returned the author as a facet.
- Added a [ symbol to the author name.
- Repeated the search
=> FAIL: "Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE"
- Apply the patch
- Retry the search
=> SUCCESS: No error, bracket shows correctly.

Passes koha-qa.pl too.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12592 - Minor correction for C4::DelBiblio documentation
Petter Goksoyr Asen [Thu, 17 Jul 2014 09:18:10 +0000 (11:18 +0200)]
Bug 12592 - Minor correction for C4::DelBiblio documentation

The function header says that DelBiblio checks to make sure there aren't
any issues on any of the items. What the code does, on the other hand,
is to check whether biblio has any items attached, and refuses to
delete biblio if it has any.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11349: (qa follow-up) Fix pod
Jonathan Druart [Thu, 17 Jul 2014 08:50:30 +0000 (10:50 +0200)]
Bug 11349: (qa follow-up) Fix pod

 FAIL   cataloguing/value_builder/unimarc_field_125.pl
   FAIL   pod
    *** ERROR: empty =head1  in file cataloguing/value_builder/unimarc_field_125.pl
    *** ERROR: Spurious text after =cut  in file cataloguing/value_builder/unimarc_field_125.pl

 FAIL   cataloguing/value_builder/unimarc_field_126b.pl
   FAIL   pod
    *** ERROR: empty =head1  in file cataloguing/value_builder/unimarc_field_126b.pl
    *** ERROR: Spurious text after =cut  in file cataloguing/value_builder/unimarc_field_126b.pl

 FAIL   cataloguing/value_builder/unimarc_field_225a.pl
   FAIL   pod
    *** ERROR: =over on line 40 without closing =back (at head1)  in file cataloguing/value_builder/unimarc_field_225a.pl
    *** ERROR: empty =head1  in file cataloguing/value_builder/unimarc_field_225a.pl

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11349: Make the QA script happy
Tomas Cohen Arazi [Wed, 9 Jul 2014 13:36:39 +0000 (10:36 -0300)]
Bug 11349: Make the QA script happy

This patch just adjusts several POD stuff, and in a few cases
reorganizes a hash definition in order to use spaces instead of tabs
for the QA script to be happy.

Nothing important, really. This patch series just changes '.tmpl' for
'.tt'.

Regards
To+

PS beware that running the koha-qa.pl script can take lots of time on this one
:-D

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11349: Remove unnecesary name translation
Tomas Cohen Arazi [Tue, 8 Jul 2014 14:41:11 +0000 (11:41 -0300)]
Bug 11349: Remove unnecesary name translation

Since all scripts use the '.tt' sufix for template names
there's no need for and regexp that changes from '.tmpl'
to '.tt'.

Regards
To+

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11349: Change .tmpl -> .tt in scripts using templates
Tomas Cohen Arazi [Tue, 8 Jul 2014 14:34:27 +0000 (11:34 -0300)]
Bug 11349: Change .tmpl -> .tt in scripts using templates

Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.

This patch changes the occurences of '.tmpl' in favour of '.tt'.

To test:
- Apply the patch
- Install koha, and verify that every page can be accesed

Regards
To+

P.S. a followup will remove the glue code.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12438 - Bad encoding in acquisition basket
Fridolin Somers [Tue, 17 Jun 2014 14:38:54 +0000 (16:38 +0200)]
Bug 12438 - Bad encoding in acquisition basket

We noticed a bad encoding (diacritics replaced by <?>) in acquisition basket when updating a server to Debian Wheezy.
We found it comes from a query containing biblio.title twice.
Maybe the mysql newer version creates this side-effect.

Test plan :
- Create an order on a record containing a diacritic in title
- Look at the basket : cgi-bin/koha/acqui/basket.pl?basketno=x
=> Without the patch the record title is bad encoded (with <?>)
=> With this patch the record title is well encoded
- Check also basket CSV export

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Good catch!
Works as expected, passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Duplicated biblio.title is a (minor) bug, and should be removed.

The side-effect of it solving an encoding problem might be seen
as problematic: it hides a real problem.
The efforts on 11944 actually solve this encoding problem (11944
merged into master actually fixes this), so I'm pushing it, for
a short term solution for stable, with the hope that we will soon
have 11944 pushed.
BTW, non-diacritic but non-ASCII characters are not broken either.

9 years agoBug 12263: Fix startup issues blocking response to HUP
Colin Campbell [Thu, 15 May 2014 11:24:57 +0000 (12:24 +0100)]
Bug 12263: Fix startup issues blocking response to HUP

If you do a kill -s HUP sipserver_pid the server process
should restart its children.
This was not happening although it was logging the commencement
of the process.

Removed traces of Exporter usage this was always incorrect
this program inherits from Net::Server 'use base' to make inheritance
clearer. Removed unnecessary begin block

made file executable so it can run

added a shebang line so OS knows to invoke perl to compile and run
the file.

I've removed the debug code dumping the config to STDOUT,
it should not have gone into the production version.
One of the first things this program does is close stdout etc and
reopens the sip sockets to them. Assuming you can print to them other
than as part of the sip dialogue is not always safe.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11575 - OPACBaseURL sometimes set by ENV variable and not system preference
David Cook [Mon, 20 Jan 2014 00:54:26 +0000 (11:54 +1100)]
Bug 11575 - OPACBaseURL sometimes set by ENV variable and not system preference

This patch changes how the OPACBaseURL parameter gets set in the subroutine
get_template_and_user in Auth.pm.

Currently, it's being set by the $ENV{'SERVER_NAME'} variable. In many
cases, this will probably match the URL that the user uses to access a
page. However, this causes problems with reverse proxies.

There are ways to compensate for proxy servers (such as inspecting
other variables set by the web server), but such a solution seems
a bit convoluted...especially since we already use the system preference
OPACBaseURL in many other parts of Koha.

We probably shouldn't be passing OPACBaseURL from Auth.pm at all, and
instead use the Koha TT plugin and using_https param to determine
protocol. However, that's outside the scope of this bug/patch.

This patch is just meant to fix an existing bug.

I did leave the $ENV{'SERVER_NAME'} as a full back if OPACBaseURL isn't
set, but that's it.

_TEST PLAN_

Before applying:

1) Clear your OPACBaseURL preference
2) Perform a search in the OPAC
3) Click on or hover over the orange RSS icon
4) Note that the URL used for the RSS links is either:
  a) The same URL you used to access Koha (no reverse proxy)
  b) The ServerName from your Koha apache conf which isn't the
  same URL you used to access Koha (reverse proxy)
5) Add an OPACBaseURL that isn't the same as the actual OPAC URL
6) Note that the OPACBaseURL system preference has no effect here

After applying the patch:

7) Refresh the page
8) Note that the URL you see now is actually the OPACBaseURL system
preference that you set
9) Clear your OPACBaseURL system preference
10) Refresh your search page
11) Note that the URL has reverted back to the URL that you saw before
(either the original Koha site URL or the Koha ServerName defined
in Apache and not the URL of the proxy)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12377 [QA Followup] - Remove readonly from input
Kyle M Hall [Fri, 11 Jul 2014 16:59:24 +0000 (12:59 -0400)]
Bug 12377 [QA Followup] - Remove readonly from input

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12377 - Add date pickers to serials-edit.pl
Kyle M Hall [Thu, 25 Oct 2012 11:48:15 +0000 (07:48 -0400)]
Bug 12377 - Add date pickers to serials-edit.pl

There are two date fields when receiving serials on serials-edit.pl,
these inputs should have a calendar widget like other date fields
in Koha.

Test Plan:
1) Apply this patch
2) Recieve a serial
3) Note when clicking on the "Published on" or "Expected on" fields
   you will now have a calendar popup. Note you can still manually
   edit the date if you wish to.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 10519: (followup) unit tests leave problematic cruft
Tomas Cohen Arazi [Mon, 14 Jul 2014 19:29:38 +0000 (16:29 -0300)]
Bug 10519: (followup) unit tests leave problematic cruft

On testing I've found that t/db_dependent/Suggestions.t leaves
cruft on the DB. Small followup for that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 10519: (followup) Fix context for evalyating $borrowernumber
Jacek Ablewicz [Fri, 13 Jun 2014 19:27:38 +0000 (21:27 +0200)]
Bug 10519: (followup) Fix context for evalyating $borrowernumber

Follow-up to fix additional suggestion statuses, which are not working
properly due to

   416:  borrowernumber           => $input->param('borrowernumber'),

being evaluated in list context inside $template->param() call arguments.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 10519: Suggestions: 'Organize by' and correct display of tab descriptions broken
Jacek Ablewicz [Wed, 11 Jun 2014 06:51:34 +0000 (08:51 +0200)]
Bug 10519: Suggestions: 'Organize by' and correct display of tab descriptions broken

The tabbed display in suggestions offers different options to organize
the tabs. The descriptions on the tabs and some of the search options were
not working correctly, displaying as "Unknown".

To test:
- Add several suggestions to your installation, make sure you have:
  - suggestions from different users
  - suggestions managed by different users
  - suggestions with different statuses
  - suggestions with different selected item types

Test all the 'organize by' options (except "Organize by: Library"
- see note below), make sure that the tabs and search options
have correct descriptions and do no longer display as "Unknown".

- Add 1 or 2 custom status to SUGGEST_STATUS authorized value.
  - Verify display is still correct and your new status are displayed.

Note: "Organize by: Library" option is currently severely broken
(and not easily fixable, especially for 'IndependentBranches'
enabled). But this turns out to be a separate issue, with a different
underlaying causes, and it's outside the scope of this patch.
This should be dealt with later, in it's own bug report.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11744: Add regression tests
Jonathan Druart [Wed, 19 Feb 2014 12:37:40 +0000 (13:37 +0100)]
Bug 11744: Add regression tests

Before the patch:
 prove t/db_dependent/Acquisition/CancelReceipt.t
returns 1 failure.
After the patch, the 2 tests pass.

Signed-off-by: marjorie barry-vila <marjorie.barry-vila@ccsr.qc.ca>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Yay! Regression tests!

9 years agoBug 11744: A receipt should not be cancelled if holds exist
Jonathan Druart [Wed, 19 Mar 2014 11:54:15 +0000 (12:54 +0100)]
Bug 11744: A receipt should not be cancelled if holds exist

Test plan:
1/ Set acqCreateItem pref to on receiving
2/ Receive 1 of 2 items ordered
3/ Place a hold on the record
4/ Verify you are not able to cancel the receipt.

This is not the best way to do that but it is the easy one.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11744: Cancel a receipt does not delete items created on receiving
Jonathan Druart [Wed, 19 Feb 2014 12:39:39 +0000 (13:39 +0100)]
Bug 11744: Cancel a receipt does not delete items created on receiving

If items is created on receiving, cancel a receipt should delete them.
The code only manage the case if the order is a child of another order
(partial).

To reproduce:
1/ Set AcqCreateItem to receiving
2/ Order one or more item(s)
3/ Receive the order and verify the item is created
4/ Cancel the receipt
5/ The item is not deleted

Test plan:
1/ Apply this patch and do again previous steps. The item should not be
deleted at step 5.
2/ Set AcqCreateItem to ordering and verify the item is not deleted.

Signed-off-by: marjorie barry-vila <marjorie.barry-vila@ccsr.qc.ca>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11226: subscription frequencies and numbering patterns should be editable with...
Jonathan Druart [Wed, 9 Jul 2014 07:49:19 +0000 (09:49 +0200)]
Bug 11226: subscription frequencies and numbering patterns should be editable with serials permissions

 Bug 7688 does now allow patrons with serials permissions to edit
 subscription frequencies/numbering patterns.

 Test plan:
 Try to access to serials/subscription-frequencies.pl and
 serials/subscription-numberpatterns.pl with the "serials" permissions.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
With patch and only serial permissions can now access
frequences and patterns.
No koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 8773 - Start per-instance koha-index-daemon in .deb setup
Tomas Cohen Arazi [Fri, 14 Sep 2012 18:26:12 +0000 (15:26 -0300)]
Bug 8773 - Start per-instance koha-index-daemon in .deb setup

Short:

Launch an indexing daemon (rebuild_zebra.pl -daemon) process for each
enabled instance. Enabling/disabling the use of the indexer is handled
by global configuration variables in /etc/default/koha-common.

Also provides command line tools to manage the running indexer daemons
for your instances.

Long:

Using an indexing daemon avoids launching a new interpreter each time
the cron triggers the indexing, and also allows sub-minute incremental
reindexing, a requirement from our librarians.[1]

Using the indexer daemon could remain "experimental" until it gets more
testing; so is disabled by default initially. To enable the use of the
indexer the user has to tweak the /etc/default/koha-common config file.
Specifically the USE_INDEXER_DAEMON variable, which is clearly explained
in the file.

Frecquency defaults to 5 sec, and can be changed by tweaking the
/etc/default/koha-common config file too.

This patch uses rebuild_zebra.pl in daemon mode, but it is crafted to
allow changing the indexing daemon and passing specific option switches
it might need.

Regards
To+

[1] This is the .deb version of http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8519

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12265: [QA Follow-up] - Improve usage of find
Kyle M Hall [Mon, 14 Jul 2014 11:36:07 +0000 (07:36 -0400)]
Bug 12265: [QA Follow-up] - Improve usage of find

When finding a row by its primary key, it is not necessary to
pass a hashref, only the primary key value itself is required.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12265: [QA Follow-up] Replace DBIx search by find
Marcel de Rooy [Mon, 14 Jul 2014 09:57:53 +0000 (11:57 +0200)]
Bug 12265: [QA Follow-up] Replace DBIx search by find

This patch replaces DBIx search by find at two places in z3950servers.pl.
Furthermore, it adds testing on the results of the find method, passing
a not-found-message to the template whenever needed.
The function ServerSearch is adjusted to use HashRefInflator instead of
manually mapping the columns of result objects.
An additional defined-test in _form_data_hashref prevents shifting of
names and values in the result hash.

Test plan:
List all servers. Edit, copy and delete a server.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12265: Improve Z39.50 servers administration
Marcel de Rooy [Mon, 12 May 2014 13:28:41 +0000 (15:28 +0200)]
Bug 12265: Improve Z39.50 servers administration

This patch makes a few tiny improvements on the form, does some
housekeeping/tidying up, and replaces SQL code by DBIC statements.
In detail:
- Adds an id parameter (more precise than searchfield).
- With the move from searchfield to id, you can rename a server now.
- A Copy button is added to clone a server.
- Confirming a delete is moved to javascript. No additional form anymore.
- A message about an insert, update or delete is shown in a div dialog
  alert above the table instead of a separate form.
- Remove offset parameter, Next/Prev button and associated logic.
- All SQL statements are replaced by DBIC.
- Function StringSearch is renamed to DBICified ServerSearch.
- Remove tabs from script and template. Adjust some indentation.

Test plan:
- Test adding, editing and deleting Z3950 servers.
- Test searching for a server with the top search box (not table).
- Add a server with quotes in the name. Search for it. Edit or delete.

Followed tet plan. Patch behaves as expected.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12534 - PROG/CCSR deprecation: Make getlanguages() theme independent for opac
Bernardo Gonzalez Kriegel [Sun, 6 Jul 2014 23:21:43 +0000 (20:21 -0300)]
Bug 12534 - PROG/CCSR deprecation: Make getlanguages() theme independent for opac

This patch removes a reference to prog theme on getlanguages()
when ENV var HTTP_ACCEPT_LANGUAGE is checked.

Changed to use sysprefs to find theme for opac and intranet

To test:
1) Apply the patch
2) Translate for a couple of languages: de-DE, fr-FR, es-ES, etc
3) Enable those languages for OPAC on I18N prefs
4) Using Firefox, clean all history/cookies
5) Change variable intl.accept_languages (will do several times)
 a) got to about:config
 b) search 'lang'
 c) look for the variable, double click, change to 'de-DE'
6) Go to opac page, must load in german
7) Repeat for each translated lang: clean > change val > reload opac
   On each case opac must load on configured language
8) Just to test, set variable on untranslated lang, opac page
must load on first value of list of enabled languages
9) prove t/Languages.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12470: (followup) License statement missing
Tomas Cohen Arazi [Mon, 14 Jul 2014 11:56:22 +0000 (08:56 -0300)]
Bug 12470: (followup) License statement missing

Adds the license statement to the new files.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12470: adding unit tests for the routines CheckValidBarCode and CheckIfIssuedToPa...
Yohann Dufour [Tue, 24 Jun 2014 12:27:21 +0000 (14:27 +0200)]
Bug 12470: adding unit tests for the routines CheckValidBarCode and CheckIfIssuedToPatron of the module C4::Circulation.pm

The routines CheckValidBarcode and CheckIfIssuedToPatron were not tested

Test plan:
1/ Apply the patch
2/ Execute : prove t/db_dependent/Circulation/CheckValidBarcode.t t/db_dependent/Circulation/CheckIfIssuedToPatron.t
3/ The result of the command has to be a success without error or warning :
t/db_dependent/Circulation/CheckValidBarcode.t ...... ok
t/db_dependent/Circulation/CheckIfIssuedToPatron.t .. ok
All tests successful.
Files=2, Tests=32,  3 wallclock secs ( 0.04 usr  0.01 sys +  2.88 cusr  0.17 csys =  3.10 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Patches squashed
Tests pass, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Tests pass using sample data provided with Koha

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12517 - Download and send list popups broken in bootstrap OPAC
Owen Leonard [Wed, 2 Jul 2014 13:10:33 +0000 (09:10 -0400)]
Bug 12517 - Download and send list popups broken in bootstrap OPAC

A JavaScript error prevents the download list and send list links in the
bootstrap OPAC from functioning correctly. A variable declaration was
removed from basket.js during the creation of the theme but
opac-shelves.tt was not changed accordingly. This patch corrects it.

To test, view an existing shelf in the bootstrap OPAC and test the
"download list" and "send list" links. They should each trigger popups
without any errors.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Popups pops again, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12522 - Fatal database error when viewing Holds for Bib with no Items
David Cook [Thu, 3 Jul 2014 06:32:57 +0000 (16:32 +1000)]
Bug 12522 - Fatal database error when viewing Holds for Bib with no Items

This patch fixes some potential SQL syntax errors, which can cause
fatal software errors in Koha when the environmental variable DEBUG
is on.

_TEST PLAN_

Before applying:

0) Ensure that you don't have "SetEnv DEBUG 1" in your Apache config
1) Create a new bib record
2) Click on the "Holds" tab before creating any items
3) Note the message "Cannot place hold: this record has no
items attached."

4) Add "SetEnv DEBUG 1" to your Apache config
5) Restart Apache
6) Refresh your page
7) Note the following Software Error: "DBD::mysql::st execute failed:
You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to
use near ')' at line 3 at /koha/lib/C4/Koha.pm line 835.

8) Apply the patch

9) Refresh your page
10) Note the message from Step 3

Thorough tester:

11) Remove "SetEnv DEBUG 1" from your Apache config, restart Apache,
and refresh your page. You should see the message from Step 3.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Error reproduced, patch fixes it.
Tested following test plan, no koha-qa errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12558: (follow-up) remove old versions of schema classes for two tables
Galen Charlton [Fri, 11 Jul 2014 19:13:27 +0000 (19:13 +0000)]
Bug 12558: (follow-up) remove old versions of schema classes for two tables

The newer version of DBIx::Class::Schema::Loader tweaks
how it maps plural table names to class names.  As a consequence,
two (currently-unused) classes are renamed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12558: Require DBIx::Schema::Loader v0.07039 or higher
Tomas Cohen Arazi [Fri, 11 Jul 2014 13:13:36 +0000 (10:13 -0300)]
Bug 12558: Require DBIx::Schema::Loader v0.07039 or higher

This patch shifts required DBIx::Schema::Loader to a newer
version to take advantage of improved smarts about foreign
key relationships.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Yohann Dufour <dufour.yohann@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
9 years agoBug 12558: DBIx::Class schema update 07/2014
Tomas Cohen Arazi [Fri, 11 Jul 2014 12:39:11 +0000 (09:39 -0300)]
Bug 12558: DBIx::Class schema update 07/2014

Update DBIx::Class schema classes to use a newer
version of DBIx::Class:Schema::Loader.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Yohann Dufour <dufour.yohann@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
9 years agoBug 12307: Catalog details page displaying incorrect status for items with itemtype...
Brendan Gallagher [Thu, 22 May 2014 10:37:16 +0000 (06:37 -0400)]
Bug 12307: Catalog details page displaying incorrect status for items with itemtype level notforloan status

The template markup that controls that status column for
the items table in catalogue/detail.pl does not account
for the itemtypes.notforloan flag.

Test Plan:
1) Find an item that is currently available
2) Go to the itemtype editor and mark that itemtype of that item
   as being not for loan
3) Browse to the catalog details page for that item's record
4) Note the item status is still "Available"
5) Apply this patch
6) Reload the catalog details page
7) Note the item status is now "Not for loan"

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Good catch! Works as described, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12417: adding the units tests of the module Koha::Borrower::Files.pm
Yohann Dufour [Mon, 16 Jun 2014 11:46:24 +0000 (13:46 +0200)]
Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm

The module Koha::Borrower::Files.pm was not tested

To test:
1/ Execute the command: prove t/db_dependent/Borrower_Files.t
2/ The command has to print:
t/db_dependent/Borrower_Files.t .. ok
All tests successful.
Files=1, Tests=23,  2 wallclock secs ( 0.04 usr  0.01 sys +  1.47 cusr  0.08 csys =  1.60 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Squashed patches.
Now test pass
No koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12508: Follow up - corrects capitalization
Katrin Fischer [Sun, 6 Jul 2014 16:41:43 +0000 (18:41 +0200)]
Bug 12508: Follow up - corrects capitalization

Corrects 2 strings:
- 'Delete this contract'
- 'Contract deleted'

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12508: adding an error message if a contract cannot be removed
Yohann Dufour [Tue, 1 Jul 2014 07:59:36 +0000 (09:59 +0200)]
Bug 12508: adding an error message if a contract cannot be removed

If a contract cannot be removed, no errors is displayed. Now, it displays an dialog messag error and the list of contracts.

Test plan:
1) Log on with a superlibrarian permission
2) Go on the page acqui/supplier.pl (Acquisitions > Button "New vendor")
3) Record a vendor with a nonzero "name"
4) Go on the page admin/aqcontract.pl (click on the "Contracts" item in the menu)
5) Click on the button "New" > "Contract" and record a new one
6) Click on "New" > "Basket" and record a basket by selectioning the created contract
7) Click on the contract name, then click on the "Contracts" item in the left menu
8) Try to delete this contract, an error is displayed : "Contract has not been deleted. Maybe a basket linked to this contract exists."
9) Delete the basket linked to the contract
10) Delete the contract, no errors is displayed

Signed-off-by: Juhani Seppälä <jseppal@student.uef.fi>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script an tests.
Also tested adding, editing and deleting unused contracts.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12332: Fix for tab "Purchase suggestions" not lighting up
Viktor Sarge [Mon, 16 Jun 2014 12:09:10 +0000 (13:09 +0100)]
Bug 12332: Fix for tab "Purchase suggestions" not lighting up

This patch changes the file purchase-suggestions.pl with "suggestionsview => 1" for the template parameter.
In circ-menu.inc i changed the condition from "suggestions" to "suggestionsview" since it seemed to conflict with the existing variable suggestions (and in that case only highlighting the tab when there were suggestions).

Please note that I fixed the troubles with the tab "Fines" in a separate patch 9245.

Test plan:
1) Verify that "Purchase suggestions" does not light up as it should when clicked.
2) Install the patch.
3) Verify that the tab "Purchase suggestions" now actually light up when clicked.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as advertised.

9 years ago9245 Fixes visual bux with fines tab not highlighting
Viktor Sarge [Mon, 16 Jun 2014 11:21:06 +0000 (12:21 +0100)]
9245 Fixes visual bux with fines tab not highlighting

This patch makes shure that mancredit.pl, maninvoice.pl and pay.pl passes the value "finesview=1" that makes the tab active.

Test plan:
1) Go to a library user and the fines tab. Note that the "Fines" tab loses it's highlight when you click "Pay fines", "Create manual invoice" and "Create manual credit".
2) Install the patch.
3) Redo the first step and make shure that the left menu tab "Fines" is now highlighted all the time.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as advertised, no regression found on the rest of the tabs.

9 years agoBug 11030 - Add 359, 947 and 969 fields in french unimarc_complete framework - followup
Gaetan Boisson [Tue, 1 Jul 2014 15:32:10 +0000 (17:32 +0200)]
Bug 11030 - Add 359, 947 and 969 fields in french unimarc_complete framework - followup

Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11030 : add fields 947,969,359 in unimarc_complete french framework
Mathieu Saby [Wed, 9 Oct 2013 18:28:27 +0000 (20:28 +0200)]
Bug 11030 : add fields 947,969,359 in unimarc_complete french framework

This patch must be tested on top of bug 11021

This patch adds 3 fields to unimarc_complete french framework
- 359 (2-a-b-c-d-e-f-g-h-i-p-u-v) used by Sudoc network, to be displayed in tab 3
- 947 (c) used by Electre
- 969 (a-h) used by Electre
I don't know the difference between 969a and 969h so I gave them quite the same name

To test :
1) take a fresh Koha with unimarc marcflavor
2) in web installer, select french language, unimarc marflavor and "Grilles de catalogage complètes".
3) check default framework in Administration > MARC Frameworks : it should contains 359/947/969 fields

Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12429 [OPAC] patron seeing fines codes
Owen Leonard [Mon, 30 Jun 2014 14:12:06 +0000 (10:12 -0400)]
Bug 12429 [OPAC] patron seeing fines codes

Bug 2546 introduced translatable handling of Koha account type codes but
missed several codes. This patch adds handling of these codes to the
bootstrap OPAC.

This patch also corrects a couple of instances of incorrect
capitalization.

To test, apply the patch and log in to the OPAC as a user who has
existing fines and charges. View the "Your fines" page. You should not
see any account type codes like CR, LR, or FU.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12429 [staff client] patron seeing fines codes
Owen Leonard [Fri, 27 Jun 2014 18:21:03 +0000 (14:21 -0400)]
Bug 12429 [staff client] patron seeing fines codes

Bug 2546 introduced translatable handling of Koha account type codes but
missed several codes. This patch adds handling of these codes to the
staff client.

This patch also corrects a couple of instances of incorrect
capitalization.

To test, apply the patch and view fines page (Patron details ->
Fines) and the pay fines page (Patron details -> Fines -> Pay fines).
You should not see any account type codes like CR, LR, or FU.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11650: multiplicated authorities after link_bibs_to_authorities.pl
Janusz Kaczmarek [Fri, 31 Jan 2014 14:09:07 +0000 (15:09 +0100)]
Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl

Under certain circumstances misc/link_bibs_to_authorities.pl creates
multiple authority with identical heading.

Test plan:
1. Have some (2-3) biblio records with some repeated headings
   Have BiblioAddsAuthorities = allow, AutoCreateAuthorities = generate
   Have no authority records
2. Run misc/link_bibs_to_authorities.pl script
3. You will get multiple authority records -- one for each occurence of a
   heading in biblio record.

4. Apply the patch.
5. Repeat 1-3 (remember to have "fresh" biblios, without $9, and no
   authorities).
6. The problem should be fixed.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as described.

9 years agoBug 12495 - Include streetnumber in hold alert address
David Roberts [Mon, 30 Jun 2014 11:22:46 +0000 (12:22 +0100)]
Bug 12495 - Include streetnumber in hold alert address

Steetnumber is not included in the addess in the hold alert add the
field to those displayed

To test this, place a hold on an item that is on-loan, having first made
sure that the requesting user has a value in the street number field of
his address. Check the item in, and an alert should appear giving the
name and address of the requesting user. This address should include the
contents of the street number address field.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I was able to confirm three of the four template changes for the
following cases:

- Item placed on hold for a patron at the current library, not waiting
- Item placed on hold for a patron at the current library, already
  waiting
- Item placed on hold for a patron at another library, not waiting

I don't know how to trigger the case [% IF ( diffbranch ) %].

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Note: Maybe sample slip templates should also include street number?

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12511 - Novelist Select not using https in bootstrap
Kyle M Hall [Tue, 1 Jul 2014 15:29:56 +0000 (11:29 -0400)]
Bug 12511 - Novelist Select not using https in bootstrap

In prog we have:
[% IF ( NovelistSelectProfile ) %]
<script type="text/javascript"
src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
[% END %]

but in bootstrap we have
[% IF ( NovelistSelectProfile ) %]
<script type="text/javascript"
src="http://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
[% END %]

Because bootstrap isn't using https, we get an error like this:
[blocked] The page at
'https://koha.mylibrary.com/cgi-bin/koha/opac-detail.pl?biblionumber=105315&query_desc=kw%2Cwrdl%3A%20home'
was loaded over HTTPS, but ran insecure content from
'http://imageserver.ebscohost.com/novelistselect/ns2init.js': this
content should also be loaded over HTTPS.

Test plan would require having a subscription to Novelist Select.
I think this is trivial enough to go without.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Very small change, trusting Kyle and the sign-off here.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12062: Follow up - adds missing )
Katrin Fischer [Sun, 6 Jul 2014 17:04:15 +0000 (19:04 +0200)]
Bug 12062: Follow up - adds missing )

With this patch, patches pass QA script and unit tests.
Tested printing different slips successfully.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12062: Follow up to fix more untraslatable cases
Bernardo Gonzalez Kriegel [Tue, 29 Apr 2014 19:31:15 +0000 (16:31 -0300)]
Bug 12062: Follow up to fix more untraslatable cases

This patch modifies staff printslip.tt to take into account
caller. Also fixes similar problem on opac printslip.tt

To test:
staff
1. Print hold transfer slip
2. Print transfer slip
3. Print member slip
opac
4. Print self checkout slip

5. Update translation files, check new strings are present

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12062: Untranslatable "Reserve not found"
Bernardo Gonzalez Kriegel [Tue, 22 Apr 2014 11:22:14 +0000 (08:22 -0300)]
Bug 12062: Untranslatable "Reserve not found"

This patch rewrites transfer slip code to make some
strings translatable.
Also simplifies some code and parameters.

To test:
1) Produce a transfer slip, no changes must be noted.

2) Update PO file, new strings
msgid "%s %s%s%sNo hold found%s %s %s "
msgid "%s%s%sNo hold found%s "
msgid "Koha &rsaquo; Circulation &rsaquo; Transfers"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12499: adding units tests for C4::Letters
Yohann Dufour [Wed, 2 Jul 2014 07:13:44 +0000 (09:13 +0200)]
Bug 12499: adding units tests for C4::Letters

The tests for the subroutines : GetMessageTransportType, EnqueueLetter, SendQueuedMessages, GetQueuedMessages, GetLetters, getletter, addalert, getalert, delalert and GetPreparedLetter of the module C4::Letters have been added.

Test plan:
1) Apply the patch
2) Execute the unit tests by launching :
prove t/db_dependent/Letters.t
3) The result has to be a success without error or warning :
t/db_dependent/Letters.t .. ok
All tests successful.
Files=1, Tests=45,  2 wallclock secs ( 0.04 usr  0.01 sys +  1.44 cusr  0.08 csys =  1.57 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
All test pass, no errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12151: Remove uses of smartmatch operator from Koha/Solr/QueryBuilder.pm
Tomas Cohen Arazi [Mon, 2 Jun 2014 14:14:11 +0000 (11:14 -0300)]
Bug 12151: Remove uses of smartmatch operator from Koha/Solr/QueryBuilder.pm

Just that.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Could only verify by reading the code.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12151: Remove use of smartmatch operator in tools/batchMod.pl
Tomas Cohen Arazi [Mon, 2 Jun 2014 14:30:48 +0000 (11:30 -0300)]
Bug 12151: Remove use of smartmatch operator in tools/batchMod.pl

The '~~' smartmatch operator is used to compare MARC::Field->subfield(code)
(i.e. a string) and the text element of each MARC::Field->subfields() which
is also plain text.

Substituting '~~' for 'eq' should be harmless then.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Tested batch modification of items, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12151: Remove uses of smartmatch operator in report scripts
Tomas Cohen Arazi [Sat, 31 May 2014 03:30:32 +0000 (00:30 -0300)]
Bug 12151: Remove uses of smartmatch operator in report scripts

This patch removes the use of smartmatch operators in report scripts.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Acquisition and Patron statistics wizard tested, no regressions found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12151: Remove uses of smartmatch operator in Search.pm and opac-search.pl
Tomas Cohen Arazi [Fri, 30 May 2014 23:54:10 +0000 (20:54 -0300)]
Bug 12151: Remove uses of smartmatch operator in Search.pm and opac-search.pl

This patch removes the use of smartmatch operators in the search code.

Regards
To+

Edit: this revision uses 'grep' instead of Lists::MoreUtils::any

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Tested search, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12409: Follow up - Reflect from hash to array in comments
Katrin Fischer [Sun, 6 Jul 2014 19:00:40 +0000 (21:00 +0200)]
Bug 12409: Follow up - Reflect from hash to array in comments

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12409: Fix fields order on exporting to bibtex
Jonathan Druart [Thu, 12 Jun 2014 09:06:58 +0000 (11:06 +0200)]
Bug 12409: Fix fields order on exporting to bibtex

The C4::Record::marc2bibtex subroutine supposes hashref keys are sorted
which is wrong with perl 5.18

Note that the t/db_dependent/Record.t fails without this patch.

Test plan (for perl >= 5.18 only):
1/ prove t/db_dependent/Record.t should return green
2/ Try to export a record to bibtex and verify the order is correct
(should be author, title, year, published, etc.).

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

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Wrong Bug number on heading.
Work as described, test pass, no koha-qa errors.

The problem is to think that a hash returns
keys in a particular order, that's not true
and no matter which perl version.

Code as was left is... misleading.
Comments talks about a hash, which is no more.
On array asignment "a => b" is equivalent to "a, b",
but the former is usually used on hashes, so a
replacement of '=>' by ',' could clarify what are we storing.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixing the comments in a follow-up patch.
Tests pass now without problems and records export ok.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoRevert "Bug 8567: Set output directory for fines.pl in cron config created by the...
Tomas Cohen Arazi [Fri, 4 Jul 2014 18:06:26 +0000 (15:06 -0300)]
Revert "Bug 8567: Set output directory for fines.pl in cron config created by the packages"

This reverts commit 0162453a1cf20f5037bdda1cdeb662283f05f5f0.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11638: Remove HTML from addbiblio.pl
Bernardo Gonzalez Kriegel [Fri, 2 May 2014 21:38:20 +0000 (18:38 -0300)]
Bug 11638: Remove HTML from addbiblio.pl

This patch extracts variables with HTML from addbiblio.pl
and an instance of CGI::scrolling_list

As it changes how MARC editor show input fields, I prefer
not add patches for other cases mentioned on Comment #1

To test:
1. Verify there are no regressions on MARC editor
Add/Edit records, modify values
2. Update translation file for a language,
check new string 'Tag editor'

About the error message on error when deleting biblio,
it must be localized but the script is not trying to
use a template file, only prints a basic html and aborts.
Perhaps a way of handling errors more gracefully is needed,
but again it need to be solved on it's own bug.

Updated test plan

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12482: (QA followup) coding guidelines for hashrefs
Tomas Cohen Arazi [Thu, 3 Jul 2014 17:36:25 +0000 (14:36 -0300)]
Bug 12482: (QA followup) coding guidelines for hashrefs

As of the public coding guidelines, $$variable{key} usage is discouraged. $variable->{key} should be used instead.

Btw, honour the "FIXME - Bug 2505" line :-D

Regards
To+

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12482 [QA Followup]
Kyle M Hall [Wed, 2 Jul 2014 18:49:01 +0000 (14:49 -0400)]
Bug 12482 [QA Followup]

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 12482: removing the use of the module C4::SQLHelper.pm, it is replaced by DBIx...
Yohann Dufour [Thu, 26 Jun 2014 12:28:58 +0000 (14:28 +0200)]
Bug 12482: removing the use of the module C4::SQLHelper.pm, it is replaced by DBIx::Class

This patch includes:
- removing the use of subroutines InsertInTable, UpdateInTable, SearchInTable replaced by subroutines of DBIx::Class in the subroutines AddBudget, ModBudget, GetBudgets, AddBudgetPeriods, ModBudgetPeriod and GetBudgetPeriods and admin/aqbudgetperiods.pl
- removing old database fields in OrderFromSubscription.t, Bookseller.t, Budgets.t, Serials.t, Serials_2.t
- improvement of unit tests in t/db_dependent/Budgets.t
- adaptation of calls to the subroutines AddBudget, ModBudget, GetBudgets, AddBudgetPeriods, ModBudgetPeriod and GetBudgetPeriods in order to match with the use of DBIx::Class

Test plan:

1) Execute the UT of all of files wich uses AddBudget, ModBudget, GetBudgets, AddBudgetPeriods, ModBudgetPeriod or GetBudgetPeriods by launching the command :
prove t/Budgets/ t/Budgets.t t/db_dependent/Budgets.t t/db_dependent/Acquisition.t t/db_dependent/Acquisition/ t/db_dependent/Bookseller.t t/db_dependent/Serials.t t/db_dependent/Serials_2.t

2) The result has to be a success :
t/Budgets/CanUserModifyBudget.t ........................... ok
t/Budgets/CanUserUseBudget.t .............................. ok
t/Budgets.t ............................................... ok
t/db_dependent/Budgets.t .................................. ok
t/db_dependent/Acquisition.t .............................. ok
t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t .. ok
t/db_dependent/Acquisition/GetOrdersByBiblionumber.t ...... ok
t/db_dependent/Acquisition/Invoices.t ..................... ok
t/db_dependent/Acquisition/OrderFromSubscription.t ........ ok
t/db_dependent/Acquisition/TransferOrder.t ................ 1/11 # Transfering order to basket2
t/db_dependent/Acquisition/TransferOrder.t ................ ok
t/db_dependent/Acquisition/close_reopen_basket.t .......... ok
t/db_dependent/Bookseller.t ............................... 16/72 WARNING: GetBooksellerWithLateOrders is called with a negative value at /home/yohann/koha/C4/Bookseller.pm line 135.
t/db_dependent/Bookseller.t ............................... ok
t/db_dependent/Serials.t .................................. ok
t/db_dependent/Serials_2.t ................................ ok
All tests successful.
Files=14, Tests=571, 22 wallclock secs ( 0.17 usr  0.03 sys + 20.26 cusr  1.10 csys = 21.56 CPU)
Result: PASS

3) Go on the page admin/aqbudgetperiods.pl : Koha Administration > Budgets
4) Click on the button "New Budget" and record a new budget with a "nonzero amount" and "make budget active"
5) Click on the button "New Budget" and record another budget without "make budget active"
6) Verify there is the firt budget displayed in "Active budgets" and the second budget in "Inactive budgets"
7) Edit a budget and verify the new values are updated
8) Click on the budget active name in order to go on the page admin/aqbudgets.pl
9) Click on the button "New fund for ..." and record a new fund
10) Click on the button "Edit" then "Duplicate budget ..." in order to duplicate the budget
11) Verify there are two budgets in "Active Budgets" and one in "Inactive Budgets"
12) Click on "Funds" in the menu and verify there are two identical funds and each is associated to a different budget.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11703: (followup) svc/holds invoked with trailing .pl
Tomas Cohen Arazi [Thu, 3 Jul 2014 16:58:30 +0000 (13:58 -0300)]
Bug 11703: (followup) svc/holds invoked with trailing .pl

On my followup I forgot to fix js/holds.js. This patch rectifies that.

Regards
To+

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11703: DBRev 3.17.00.009
Tomas Cohen Arazi [Thu, 3 Jul 2014 15:13:26 +0000 (12:13 -0300)]
Bug 11703: DBRev 3.17.00.009

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11703: (qa followup) consistency in svc
Tomas Cohen Arazi [Thu, 3 Jul 2014 15:26:23 +0000 (12:26 -0300)]
Bug 11703: (qa followup) consistency in svc

This patch removes the trailing .pl from the introduced svc scripts.
Also removes a leftover (wrong license text)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 11703 [QA Followup] - Change "No data available in table" to "Loading..."
Kyle M Hall [Wed, 2 Jul 2014 11:11:37 +0000 (07:11 -0400)]
Bug 11703 [QA Followup] - Change "No data available in table" to "Loading..."

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 11703 [QA Followup] - Allow keyboard navigation of tabs
Kyle M Hall [Tue, 1 Jul 2014 17:54:54 +0000 (13:54 -0400)]
Bug 11703 [QA Followup] - Allow keyboard navigation of tabs

Signed-off-by: Britta Cramer <britta.cramer@inm-gmbh.de>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 11703 [QA Followup] - Stop IE from caching ajax request
Kyle M Hall [Tue, 1 Jul 2014 17:12:54 +0000 (13:12 -0400)]
Bug 11703 [QA Followup] - Stop IE from caching ajax request

Signed-off-by: Britta Cramer <britta.cramer@inm-gmbh.de>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 11703: (qa-followup) fix update database entry
Jonathan Druart [Thu, 26 Jun 2014 13:41:39 +0000 (15:41 +0200)]
Bug 11703: (qa-followup) fix update database entry

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 11703 [QA Followup] - Restore showing earliest renewal date for 'too early' renewals
Kyle M Hall [Wed, 7 May 2014 15:17:38 +0000 (11:17 -0400)]
Bug 11703 [QA Followup] - Restore showing earliest renewal date for 'too early' renewals

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 11703 [QA Followup] - Use interface instead of themelang for checkboxes plugin
Kyle M Hall [Wed, 7 May 2014 14:56:52 +0000 (10:56 -0400)]
Bug 11703 [QA Followup] - Use interface instead of themelang for checkboxes plugin

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 11703 [QA Followup] - Use format instead of replace for string translation
Kyle M Hall [Wed, 7 May 2014 14:54:14 +0000 (10:54 -0400)]
Bug 11703 [QA Followup] - Use format instead of replace for string translation

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 11703 [QA Followup]
Kyle M Hall [Mon, 14 Apr 2014 17:45:22 +0000 (13:45 -0400)]
Bug 11703 [QA Followup]

* Bold record title, fix table width
* Change output_pref_due to output_pref
* Retain functionality of IssuesDefaultSortOrder system preferences
* Use datatables.inc in circulation.tt
* Fix up holds table details
* Add plugin to about
* fix relatives' checkouts
* add too_many string
* remove dead syspref from db
* Sort relatives' checkouts and holds tables client side
* Provide context for translation of strings
* Fix unterminated string literal, add missing paren
* Add replacement of _AUTHOR_ with title's author for holds
* Format prices correctly
* Format checkout dates correctly

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 11703 - Convert checkouts table to ajax datatable
Kyle M Hall [Tue, 4 Feb 2014 17:42:55 +0000 (12:42 -0500)]
Bug 11703 - Convert checkouts table to ajax datatable

When a patron has many checked out items, circulation.pl can take a very
long time to load ( on the order of minutes in some cases ). This is
primarily due to the processing of the previous checkouts list. If we
convert to this table to a datatable that fetches its data via ajax, we
can make circulation.pl far more responsive. The same should be done
with relative's checkouts as well.

Test Plan:
1) Apply this patch
2) Observe that the checkouts and relatives' checkouts tables
   are now loaded asynchronously
3) Observe and verify the renew and return actions are now
   ajax based and function in a manner equivilent to how they
   used to.

This bug had quite a few followups, so I squashed all of them into one
change so that code is easier to follow. Original commit messages are below:

Bug 11703 - Use the ajax datatables on patron details page

Bug 11703 - Convert holds tables to ajax datatables

Bug 11703 [QA Followup 1] - Center bProcessing message over table

Bug 11703 [QA Followup 2] - Remove icons from checkout and clear buttons

Bug 11703 [QA Followup 3] - Remove references to UseTablesortForCirc

Bug 11703 [QA Followup 4] - Add back in Today's checkouts/Previous checkouts rows

Bug 11703 [QA Followup 5]

Bug 11703 [QA Followup 6] - Move strings to an include file for translation purposes

Bug 11703 [QA Followup 7] - Fix issues spotted by koha-qa.pl

Bug 11703 [QA Followup 8] - Speed up api/checkouts.pl as much as possible

Bug 11703 [QA Followup 9] - Move scripts from api directory to svc directory

Bug 11703 [QA Followup 10] - Fix errors caused by rebase

Bug 11703 [QA Followup 11] - Prevent multiple fetchs from ajax source

Bug 11703 [QA Followup 12] - Fix problem detected by koha-qa.pl

Bug 11703 [QA Followup 13] - Removed uneccessary data from renewal box during renewal

Bug 11703 [QA Followup 14] - Fix table column span

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Test plan on bug report:
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11703#c98

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
9 years agoBug 12451 - circulation rule cant be edited if itemtype contains a space character
Fridolin Somers [Thu, 19 Jun 2014 08:17:53 +0000 (10:17 +0200)]
Bug 12451 - circulation rule cant be edited if itemtype contains a space character

When an itemtype description contains a space character like " Book"
(often used to set this itemtype as first in sorted lists), the edition
of an existing circulation rule does not work, it selects the default
itemtype. Same for patron category.

It's because the JavaScript code performs a trim on value existing in
table itm = itm.replace(/^\s*|\s*$/g,''); This patch adds trim on select
options in editing line.

Test plan :
- Create an itemtype with a leading or trailling space in description :
  ie " Book"
- Go to cgi-bin/koha/admin/smart-rules.pl
- Create a rule with this itemtype, Unit=hours and Hard due date=Exactly
  on 31/12/2015 (any date)
- Click on Edit on this rule line
  => Without this patch, the default itemtype is selected in edition
     line
  => With this patch, the correct itemtype is selected in edition line

Check others selects are ok :
  - Create a rule with Unit=hours and Hard due date=Exactly on
    31/12/2015 (any date)
  - Click on Edit on this rule line
    => The correct options are selected
Same tests with a patron category containing a leading or trailling space in description

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9 years agoBug 8567: Set output directory for fines.pl in cron config created by the packages
Reed Wade [Thu, 26 Jun 2014 20:38:58 +0000 (16:38 -0400)]
Bug 8567: Set output directory for fines.pl in cron config created by the packages

Modified debian/koha-common.cron.daily adding instance output dir option to
the fines.pl entry as described in the ticket.

Requires patch from Bug 8566 which provides the __instancename__ feature for
koha-foreach.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>