]> git.koha-community.org Git - koha.git/log
koha.git
10 years agoBug 7180: (followup) fix case where discount was divided by 100 twice.
Jonathan Druart [Fri, 27 Sep 2013 14:42:44 +0000 (16:42 +0200)]
Bug 7180: (followup) fix case where discount was divided by 100 twice.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: (follow-up) remove useless rrp variable
Jonathan Druart [Mon, 16 Sep 2013 10:45:52 +0000 (12:45 +0200)]
Bug 7180: (follow-up) remove useless rrp variable

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: (follow-up) restore the "Add order" link
Jonathan Druart [Thu, 12 Sep 2013 12:59:56 +0000 (14:59 +0200)]
Bug 7180: (follow-up) restore the "Add order" link

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: (follow-up) correct minor language issues
Kyle M Hall [Thu, 12 Sep 2013 12:35:41 +0000 (08:35 -0400)]
Bug 7180: (follow-up) correct minor language issues

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: QA followup
Jonathan Druart [Thu, 12 Sep 2013 09:44:25 +0000 (11:44 +0200)]
Bug 7180: QA followup

- fix unit tests (use a transaction).
- add 3 tabs on the page in order to be more understandable.
- fix a warn in logs

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: (follow-up) update license version
Jonathan Druart [Wed, 11 Sep 2013 07:35:16 +0000 (09:35 +0200)]
Bug 7180: (follow-up) update license version

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: make neworderempty code use getAuthValueDropbox.
Jonathan Druart [Tue, 10 Sep 2013 08:31:11 +0000 (10:31 +0200)]
Bug 7180: make neworderempty code use getAuthValueDropbox.

The js function fetchSortDropbox has been deleted in previous patch.
The new function is getAuthValueDropbox.

Test plan:
- link authorized values to some funds
- open an existing order and verify value are correctly filled in the
  sort1 and sort2 values
- create a new order and verify behavior is the same as before

Note: This patch generates 2 ajax queries (max) if the budget is linked
to 2 av categories for sort1 and sort2. This could be improved using a
template plugin for values display on load.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: (follow-up) change syspref description
Jonathan Druart [Tue, 10 Sep 2013 08:30:25 +0000 (10:30 +0200)]
Bug 7180: (follow-up) change syspref description

- the blank line is now useless
- add an example for the syspref value

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: (follow-up) fix minor issues
Katrin Fischer [Mon, 9 Sep 2013 20:53:49 +0000 (22:53 +0200)]
Bug 7180: (follow-up) fix minor issues

- Fixed some labels from Budget to Fund
- Added the system preference to sysprefs.sql
- Fixed some untranslatable Javascript strings

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: (follow-up) ensure that the default quantity is 1
Jonathan Druart [Mon, 15 Jul 2013 08:05:06 +0000 (10:05 +0200)]
Bug 7180: (follow-up) ensure that the default quantity is 1

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: QA followup
Jonathan Druart [Mon, 1 Jul 2013 13:59:14 +0000 (15:59 +0200)]
Bug 7180: QA followup

Ergonomic improvements:
- Remove the green color the selected record.
- Use fieldset.rows (and legend).
- Use the required css class for quantity inputs.
- Replace "budget" with "fund".
- fix the "undefined" string
- Add a "show MARC" link
- replace "no_match" with a text.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: Add UT for C4::Budgets::GetBudgetByCode
Jonathan Druart [Thu, 21 Mar 2013 12:27:39 +0000 (13:27 +0100)]
Bug 7180: Add UT for C4::Budgets::GetBudgetByCode

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: (follow-up) fix getAuthValueDropbox should display the selected value
Jonathan Druart [Wed, 20 Mar 2013 11:32:07 +0000 (12:32 +0100)]
Bug 7180: (follow-up) fix getAuthValueDropbox should display the selected value

If the no AV match the name/category or if no category is defined, the
input field should contain the value.

Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7180: Order from staged file improvements
Jonathan Druart [Thu, 8 Mar 2012 16:25:06 +0000 (17:25 +0100)]
Bug 7180: Order from staged file improvements

This patch adds:
- 1 syspref MarcFieldsToOrder
- 1 Ajax script acqui/ajax-getauthvaluedropbox.pl
- 1 routine C4::Budgets::GetBudgetByCode

Before this patch you were not able to order 1 or all the records from
your staged file. You were allowed to specify some information ("Import
All" and "Accounting details" areas) for the order.

With this patch, the previous behaviour still exists.
But now you can *select* which records you want to ordered.
For these ones you can specify independently quantity,
price, budget, sort1 and sort2.

The cherry on the cake is that you can pre-fill these fields  with
values from the MARC record.

Test plan:
1. Fill the new syspref MarcFieldsToOrder with something like:
==BEGIN==
price: 947$c
quantity: 969$h
budget_code: 922$a
rrp: 010$d
discount: 969$d
sort1: 923$a
sort2: 924$a

==END==
The empty line at the end is mandatory!
The budget (corresponding to your budget_code) can be filled with
authorized value categories (statistic 1 and 2).
The sort1 and sort2 values can be filled with the an authorized value
(of the category previously selected)

2. Choose randomly one or more biblio(s) and fill fields with what is
   relevant.

3. Export the biblio and import it (with the "Stage MARC records for
   import" tool).

4. Go on a basket and add an order from a staged file. Select your
   staged file.

5. Well. Now you can see your biblio (or biblios if your had exported
   more than one). For each one, fields should be pre-filled with the
   biblio values. The budget should be selected on the budget
   corresponding to the budget_code (in the field 922$a) and the
   "planning values" too (with fields 923$a and 924$a).
   You can modify these values (or not) and choose a default value for
   budget and planning values (in the "Accounting details" area).

6. Save and check the prices values. Modify the order and check that
   budget and sort* are good

Prices are calculated following some parameters:
if there is no price => listprice = 0
else =>
  - the gstrate value for your order is the gstrate value of the bookseller
  - discount = if filled : the discount value / 100
               else: the discount value of the bookseller
  - if the bookseller includes tax( List item price includes tax: Yes )
        if a discount exists:
            ecost = price
            rrp   = ecost / ( 1 - discount )
        else: # a discount does not exist
            ecost = price * ( 1 - discount )
            rrp   = price
    else # the bookseller does not include tax
        if a discount exists:
            ecost = price / ( 1 + gstrate )
            rrp   = ecost / ( 1 - discount )
        else: # a discount does not exist
            rrp   = price / ( 1 + gstrate )
            ecost = rrp * ( 1 - discount )
  - in all cases:
        listprice = rrp / currency rate
        unitprice = ecost
        total = ecost * quantity

7. Retry with different parameters

8. Check the 'Import all' action still works

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10613: (follow-up) fix QA issues
Jonathan Druart [Mon, 24 Mar 2014 09:11:47 +0000 (10:11 +0100)]
Bug 10613: (follow-up) fix QA issues

This patch fixes the following QA issue:

 FAIL    acqui/invoice.pl
   FAIL      valid
        Useless use of private variable in void context

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch passes all tests and QA script. Specifically checked
the t/db_depenedent/Acq* tests.

A test plan could be:
0) Add a value in the gist pref (0.1 or 0.25 or something else easy).
1)
  a) Create a supplier "10613 0 0" with
    List item price includes tax: No
    Invoice item price includes tax: No
    Tax: 10%
  b) Create a supplier "10613 0 1" with
    List item price includes tax: No
    Invoice item price includes tax: Yes
    Tax: 10%
  c) Create a supplier "10613 1 0" with
    List item price includes tax: Yes
    Invoice item price includes tax: No
    Tax: 10%
  d) Create a supplier "10613 1 1" with
    List item price includes tax: Yes
    Invoice item price includes tax: Yes
    Tax: 10%
2) Create a basket for each supplier
  a) 00 List price: 10.00 (11.00 with 10% taxes)
  b) 01 List price: 10.00 (11.00 with 10% taxes)
  c) 10 List price: 10.00 (9.09 without taxes)
  d) 11 List price: 10.00 (9.09 without taxes)
  Note: Information on the basket page is shown correctly.
  If you look at the list of ordered items for the fund,
  the list price is used.
3) Create 1+ order(s) with 1+ item(s) for each basket with
   a discount and a gst value.
4) Close the baskets
5) Receive the items
   Left actual price as suggested:
   a) 00 Actual cost: 10.00
   b) 01 Actual cost: 11.00
   c) 10 Actual cost:  9.09
   d) 11 Actual cost: 10.00
   Calculations on the invoice page now all appear to be correct.
   Note: When you take a look at the 'ordered' list for the fund,
   the actual price is used as entered.
6) Go on acqui/invoice.pl?invoiceid=XX acqui/basket.pl?basketno=YY for
   each basket/invoice, click on the "Show all details" checkbox
   and verify that the values are all correct.

Calculations are exactly the same for tax registered yes and no.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10613: (follow-up) fix typo supplierid vs booksellerid
Jonathan Druart [Fri, 25 Oct 2013 11:51:03 +0000 (13:51 +0200)]
Bug 10613: (follow-up) fix typo supplierid vs booksellerid

GetInvoiceDetails returns a hashref with a key named booksellerid, not
supplierid.
The bookseller was not retrieved from the DB and the listincgst value
was always false.

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10613: calculate the GST rate correctly on the invoice page.
Jonathan Druart [Fri, 19 Jul 2013 09:44:51 +0000 (11:44 +0200)]
Bug 10613: calculate the GST rate correctly on the invoice page.

Test plan:
Defined a GST rate on creating an order, receive it and check that all
prices are correctly calculated.
/!\ Behavior change function of supplier parameters (Include/Don't
include tax for list prices and invoice prices)

Notes: patch tested with Bug 11755 applied first; confirmed that:
- price calculations are correct for all combinations of
  listincgst/invoiceincgst settings in the vendor record
- unitprice (aka "Actual cost") is taken into account on the
  invoice page instead of rrp/ecost, like it should.

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11665: (follow-up) simplify code
Galen Charlton [Sun, 4 May 2014 19:13:44 +0000 (19:13 +0000)]
Bug 11665: (follow-up) simplify code

This patch replaces some of the logic with more direct
Boolean expressions.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11665: An ability to place orders directly from hold ratios list
Jacek Ablewicz [Sun, 2 Feb 2014 17:04:00 +0000 (18:04 +0100)]
Bug 11665: An ability to place orders directly from hold ratios list

This enhancement introduces a possibility to place orders
from hold ratios list:

- new option "Add order to basket" -> "From titles w/ highest hold ratios";
(user gets redirected from acqusition to "hold ratios" list in circulation)

- "N to order" in "Items needed" column now becomes a link - when clicked,
user gets redirected back to acquisition, directly to order form for
a choosen title (suggested quantity "N to order" is being preserved)

- in the "Items needed" column, there is an additional indication if
there are any pending (not yet received) orders for a given title

This solution is not exactly ideal.. most important drawback: to use
it librarian needs both acquisition & circulation priviledges; if not
having both - new options will not show / wouldn't be active. But it
requires relatively small amount of changes in the code.

To test:
- apply patch,
- test new functions (try to place some orders using an newly added
option, examine resulting order records etc.)
- check modified hold ratios list for possible problems (for user
with only circulation priviledges, additional information regarding
pending orders should be still visible, but not the link
to order form)
- ensure the two following existing options for adding orders to basket
("From an existing record", "From a new (empty) record") a still working
properly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Minor edit in signoff: Changed "w/" to "with"

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works nicely in my tests, neat new addition.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11763: (follow-up) do not display anything in actions column if user cannot manag...
Galen Charlton [Sun, 4 May 2014 18:41:33 +0000 (18:41 +0000)]
Bug 11763: (follow-up) do not display anything in actions column if user cannot manage a budget

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 12019: ensure that it is optional to define an owner if a fund is restricted
Jonathan Druart [Mon, 14 Apr 2014 11:11:12 +0000 (13:11 +0200)]
Bug 12019: ensure that it is optional to define an owner if a fund is restricted

Before this patch, the C4::Budgets::CanUserUseBudget assumed that
budget_owner_id was set if a restriction (budget_permission) exists.
see
        && $budget->{budget_owner_id}
        && $budget->{budget_owner_id} != $borrower->{borrowernumber}

Actually a restriction could exists on users and/or library without
being forced to define an owner.

Test plan:
Create a fund A without restriction
Create a fund B restricted to an owner
Create a fund C restricted to a non defined owner
Create a fund D restricted to owner and users (try defining/no
defining an owner and/or users)
Create a fund E restricted to owner, users and library (try
defining/no defined an owner and/or users)

With different logged in users, try to show/edit these differents funds.
The restriction should be correctly applied.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested various permission combinatons, visibility of funds is now ok.
- not superlibrarian, no buget_manage_all,
  no owner, no users, no library, no restrictions on the fund
  = visible
- changed: library = staff patron library,
  restriction = Owner, users and library
  = visible
- changed: library = not staff patron library
  = invisible
- changed: budget_manage_all
  = visible
- changed: owner = staff patron
  no budget_manage_all
  = visible
- changed: no owner, user = staff patron
  = visible
- changed: no user, owner = another user, restriction = owner
  = invisible
- changed: budget_manage_all
  = visible
- changed: no budget_manage_all but superlibrarian
  = visible
...

Passes tests and QA script, also t/Budgets/*

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 12019: FIX budget_owner_id node is duplicated
Jonathan Druart [Wed, 2 Apr 2014 11:27:08 +0000 (13:27 +0200)]
Bug 12019: FIX budget_owner_id node is duplicated

The input witht the budget_owner_id id is duplicated.
It breaks the jQuery selector
  $('#budget_owner_id').val('');

Signed-off-by: marjorie barry-vila <marjorie.barry-vila@ccsr.qc.ca>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11763 - Consolidate fund action links into menu
Owen Leonard [Fri, 14 Feb 2014 14:53:41 +0000 (09:53 -0500)]
Bug 11763 - Consolidate fund action links into menu

This patch moves the fund Edit/Delete/Add child links on the fund view
into a pop-up menu, allow the table to be more compact and the links to
be more distinct.

To test you must apply the patches on Bug 11578 if necessary.

Apply the patch and view the funds list page (Administration -> Funds).
For each line there should be an "Actions" menu containing the
Edit/Delete/Add cihld links. Each should function correctly. Test with
inactive budgets shown and hidden.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
It is unusual to open the action list above the button, but it works.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: (follow-up) fix JavaScript error
Galen Charlton [Sat, 3 May 2014 18:32:34 +0000 (18:32 +0000)]
Bug 11578: (follow-up) fix JavaScript error

Fix error that can occur when using the DataTable filter
to filter the table down to just one fund.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: (follow-up) fix budgets grouping
Jonathan Druart [Wed, 30 Apr 2014 10:34:08 +0000 (12:34 +0200)]
Bug 11578: (follow-up) fix budgets grouping

If 2 budgets (budget periods) have the same description, the funds will
be grouped into the same "block".
This patch adds a distinction adding the id of the budget next to the
description.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: (follow-up) fix funds grouping
Jonathan Druart [Wed, 30 Apr 2014 10:12:07 +0000 (12:12 +0200)]
Bug 11578: (follow-up) fix funds grouping

The datatables sort options were wrong.
The funds for a budget could be ungrouped.
To reproduce:
- Create 3 budgets A, B, C.
- Create 1 or more funds for A, B, C
- Mark B and C as inactive.
- Create another fund for A
- Go on the fund list view, click on "show inactive funds"
=> The last fund is not grouped without other funds of budget A.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: (follow-up) fix show inactive link
Jonathan Druart [Wed, 30 Apr 2014 09:54:29 +0000 (11:54 +0200)]
Bug 11578: (follow-up) fix show inactive link

Before this patch, the inactive funds were displayed by default.
The active funds should be displayed by default.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: QA follow-up
Jonathan Druart [Mon, 28 Apr 2014 17:52:29 +0000 (19:52 +0200)]
Bug 11578: QA follow-up

This patch removes the error raised by tt_valid
 FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt
   FAIL   tt_valid
                lines 310

Actually, it fails because translate script does not match strings in
attribute value. In this case, we don't want to translate. This fix is
not necessary.

This patch also adds the licence for the new jQuery treetable plugin.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: (follow-up) hide filters if a budget (budgetperiod) is chosen
Jonathan Druart [Tue, 22 Apr 2014 14:03:33 +0000 (16:03 +0200)]
Bug 11578: (follow-up) hide filters if a budget (budgetperiod) is chosen

If a budget_period_id is given, the filters should not be displayed.
Moreover, it does not make sense to display the links for
displaying/hiding inactive budgets in this case.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: (follow-up) align budget names
Jonathan Druart [Fri, 14 Feb 2014 09:39:41 +0000 (10:39 +0100)]
Bug 11578: (follow-up) align budget names

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: (follow-up) hide inactive budgets by default
Jonathan Druart [Fri, 14 Feb 2014 09:38:35 +0000 (10:38 +0100)]
Bug 11578: (follow-up) hide inactive budgets by default

This patch hides inactive budgets by default.
They can be shown/hidden using 2 new links "Hide/Show inactive budgets".

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: (follow-up) add some CSS
Jonathan Druart [Fri, 17 Jan 2014 14:35:09 +0000 (15:35 +0100)]
Bug 11578: (follow-up) add some CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: Improve the funds list view
Jonathan Druart [Fri, 17 Jan 2014 14:29:18 +0000 (15:29 +0100)]
Bug 11578: Improve the funds list view

The current funds list view does not allow to search in the table and
the ergonomics of the page is quite bad.

This patch add the datatables plugin combined to the treetable plugin in
order to offer a better view of the budgets/funds.

Test plan:
- Verify there is no regression on this page: try to add/modify/delete a
fund and a budget.
- Verify the funds hierarchy is correctly displayed.
- Filter the funds using the branch and the budget filters.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11578: Upgrade the treetable jquery plugin
Jonathan Druart [Fri, 17 Jan 2014 14:24:37 +0000 (15:24 +0100)]
Bug 11578: Upgrade the treetable jquery plugin

This patch upgrade the treetable jquery plugin to the last version
(3.1.0).
It is only used on the funds list view.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11369: (follow-up) generate searchid in browser.js
Fridolin Somers [Wed, 26 Feb 2014 16:14:04 +0000 (17:14 +0100)]
Bug 11369: (follow-up) generate searchid in browser.js

The search browser feature uses nearly only the browser.js file.
That is why I propose to move the searchid generation from search.pl
to browser.js.
We then use Date.getTime() to use current timestamp as searchid,
prefixed by 'scs_' like before.

Test by using test plan of main patch :
Too many search cursor cookies overflow HTTP-header size, when
making multiple searches in the staff client

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Tested the browse functionality in staff by using the different
options (back to results, next, previous, etc) and the batch
modifications for items. An old cookie can cause a Javascript error,
but after restarting the browser/deleting cookies it all works
correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11369: (follow-up) Correct usage of me.searchid in browser.js
Fridolin Somers [Wed, 26 Feb 2014 16:03:13 +0000 (17:03 +0100)]
Bug 11369: (follow-up) Correct usage of me.searchid in browser.js

In browser.js, at creation of browser, the searchid is transmited to
JS object into me.searchid.
To be consistant, me.searchid should always be use, never searchid alone.
In browseRecords function, setting searchid as parameter is useless
because it is defined in me.searchid.

Test with test plan of Bug 10404

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11369: fix issue that can cause staff client searches to stop working
Olli-Antti Kivilahti [Wed, 11 Dec 2013 12:28:53 +0000 (14:28 +0200)]
Bug 11369: fix issue that can cause staff client searches to stop working

This patch fixes an issue where too many search cursor cookies overflow
the HTTP-header size after making multiple searches in the staff client.

To replicate this issue, make multiple searches in catalogue/search.pl.
50+ Should be enough to cause the HTTP-request header to overgrow.
One can verify this issue by observing the searchCookie growth in
browser's stored cookies.

-------------
- TEST PLAN -
-------------

Keep making searches.
One should never have more than 10 searchCookies. Browser might display
only 9, because for some reason the newest js-generated cookie is not
included in Firefox's cookies listing.

------------
- DRAWBACK -
------------

Removing these cookies disables the search cursor for traversing search
results (next/previous) for the removed cookie. This maybe be problematic
in some cases,
(for ex when multiple search tabs need to be open and they need to be
 traversed)
One easy solution is to grow the amount of stored searchCookies from 10 to
20, but 10 is chosen so there will be plenty of room for other cookies as
well.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11369 - Updating the jquery.cookie.js-plugin
Olli-Antti Kivilahti [Tue, 10 Dec 2013 17:12:01 +0000 (19:12 +0200)]
Bug 11369 - Updating the jquery.cookie.js-plugin

The current jquery.cookie-plugin crashes when trying to fetch
all cookies using $.cookie();
Downloaded the newest plugin version and minified it.
Now works as intended.

Encountered an issue with the plugin now returning null when
no cookies are found, and applied a fix in browser.js.

-------------
- Test plan -
-------------
Plugin is used in browser.js and batchMod.js so testing both

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10694: (follow-up) display the note about restricted patrons consistently
Galen Charlton [Fri, 2 May 2014 22:48:02 +0000 (22:48 +0000)]
Bug 10694: (follow-up) display the note about restricted patrons consistently

This patch ensures that the note displayed when checking in a loan
to a restricted patron (and setting the return date) is displayed
whether or not the circulation staffer has chosen the make the return
date override sticky.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10694: (follow-up) fix problems with the new Borrowers plugin
Galen Charlton [Fri, 2 May 2014 22:46:23 +0000 (22:46 +0000)]
Bug 10694: (follow-up) fix problems with the new Borrowers plugin

TT plugins should *not* be duplicating business logic found
in other modules.  This patch replaces the copy-and-paste of the
old IsDebarred logic with a call to the appropriate routine and
updates the POD.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10694: (follow-up) remove truncate table from test case
Galen Charlton [Fri, 2 May 2014 22:00:45 +0000 (22:00 +0000)]
Bug 10694: (follow-up) remove truncate table from test case

Doing a truncate of a table in MySQL causes an implicit commit.
Consequently, they should not be used in DB-dependent test cases,
as they will cause the changes to NOT be rolled back.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10694: DBrev 3.15.00.042
Galen Charlton [Fri, 2 May 2014 21:48:14 +0000 (21:48 +0000)]
Bug 10694: DBrev 3.15.00.042

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10694: (follow-up) add unit tests, improve AddReturn POD
Kyle M Hall [Wed, 23 Apr 2014 11:38:11 +0000 (07:38 -0400)]
Bug 10694: (follow-up) add unit tests, improve AddReturn POD

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10694: (follow-up) fix various issues
Kyle M Hall [Sun, 20 Oct 2013 22:39:15 +0000 (18:39 -0400)]
Bug 10694: (follow-up) fix various issues

- new TT plugin for Borrowers, that at present supplies
  a method for determining if the patron is restricted
- setting the default value of SpecifyReturnDate to false
  during upgrade to avoid an unwelcome surprise
- validate the return date on the client side before
  allowing the form to be submitted.

Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10694 - Allow arbitrary backdating of returns
Kyle M Hall [Fri, 13 Sep 2013 15:26:30 +0000 (11:26 -0400)]
Bug 10694 - Allow arbitrary backdating of returns

Sometimes libraries need to backdate returns further back in time than
Koha's dropbox mode will allow. The returns backdating will check in an
item as if it had been returned on the specified date, and will reduce
any fine accordingly.

This feature is activated by a new system preference, SpecifyReturnDate.

Test Plan:
1) Apply this patch
2) Check out an item, and backdate the due date by 1 month or so
   * This issue needs to generate a fine
3) Run fines.pl to generate the fine
4) Browse to returns.pl
5) Specify a return date of the day after the specified due date
6) Check the borrowers issue history, you should see the backdated
   return date, rather than today's date
7) Check the fine, it should be reduced to a fine for a single day
   overdue, rather than the previous larger fine.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Barbara Knibbs <BKnibbs@farmingtonlibraries.org>
Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) standardize case of message transport type columns
Galen Charlton [Fri, 2 May 2014 21:17:49 +0000 (21:17 +0000)]
Bug 9016: (follow-up) standardize case of message transport type columns

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) treat missing transports for overdue notices as warnings
Galen Charlton [Fri, 2 May 2014 21:11:30 +0000 (21:11 +0000)]
Bug 9016: (follow-up) treat missing transports for overdue notices as warnings

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) treat missing transports for predue and item due notices as...
Galen Charlton [Fri, 2 May 2014 21:01:45 +0000 (21:01 +0000)]
Bug 9016: (follow-up) treat missing transports for predue and item due notices as warnings, not fatal errors

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) treat missing transports for hold available notices as warnings...
Galen Charlton [Fri, 2 May 2014 20:54:55 +0000 (20:54 +0000)]
Bug 9016: (follow-up) treat missing transports for hold available notices as warnings, not fatal errors

This patch fixes a situation where a patron that has preferences
set for transport of a notice via a method that is not supported
for that notice type can result in a failure.  Rather than
make it a fatal error during checkin, simply log a warning and skip.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) move insertAtCaret plugin out of language-specific directory
Galen Charlton [Fri, 2 May 2014 19:40:42 +0000 (19:40 +0000)]
Bug 9016: (follow-up) move insertAtCaret plugin out of language-specific directory

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11696: ensure that print overdue notices use the print template
Jonathan Druart [Thu, 6 Feb 2014 10:41:35 +0000 (11:41 +0100)]
Bug 11696: ensure that print overdue notices use the print template

This reordering avoids the case where a print notice is sent with an
email or sms template is no email or SMS is defined.

Test plan:
Check print, sms and email for an overdue rule
Don't define an email address and generate an overdue for a user
Define 3 templates for the notice used
Launch the cronjob script and verify the print notice is generated using
the print template.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 3.15.00.041: DBrev 11867
Galen Charlton [Fri, 2 May 2014 19:30:51 +0000 (19:30 +0000)]
Bug 3.15.00.041: DBrev 11867

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11867: (follow-up) Change the sql query in order to win beauty prices
Jonathan Druart [Fri, 2 May 2014 15:03:56 +0000 (17:03 +0200)]
Bug 11867: (follow-up) Change the sql query in order to win beauty prices

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11867: MTT: Manage *_PHONE notices
Jonathan Druart [Thu, 27 Feb 2014 13:57:55 +0000 (14:57 +0100)]
Bug 11867: MTT: Manage *_PHONE notices

The *_PHONE notices (HOLD_PHONE, PREDUE_PHONE and OVERDUE_PHONE) should
be "merged" into the main code (i.e. HOLD, PREDUE and OVERDUE).

Test plan:
1/ Make sure you have HOLD_PHONE, PREDUE_PHONE and OVERDUE_PHONE notices
2/ Execute the update DB entry
3/ Verify the 3 notices have been merged into "phone" template of the
HOLD, PREDUE and OVERDUE notices
4/ Verify there is no regression in the Talking Tech feature (how?)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No koha-qa errors

Verified that notices are merged
TalkingTech_itiva_outbound.pl runs without problem... but can't produce
any output, may be not correctly configured (my setup), no warnings
nor log messages

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10833: (follow-up) add message transport type to a warning message
Olli-Antti Kivilahti [Fri, 3 Jan 2014 13:29:48 +0000 (15:29 +0200)]
Bug 10833: (follow-up) add message transport type to a warning message

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10833: Multi transport types for advanced notices
Jonathan Druart [Fri, 6 Sep 2013 09:39:51 +0000 (11:39 +0200)]
Bug 10833: Multi transport types for advanced notices

Test plan:
- Choose 2 patrons P1 and P2
- Edit "Patron messaging preferences" and
check SMS + email with 2 days in advance for P1
check email with 5 days in advance for P2
- defined a message for the letter code PREDUE for sms and email
  (tools/letters.pl).
- select 2 barcodes (B1, B2).
    * checkout B1 to P1 with a due date = NOW - 2 days
    * checkout B2 to P2 with a due date = NOW - 5 days
- into the mysql cli, note the value of unsent message:
  select count(*) from message_queue where status != "send";
- launch the cronjob:
  perl misc/cronjobs/advance_notices.pl -c
- retry the previous sql query, you should have X + 3 unsent messages
  (depending of current checkouts in your DB!).
- view all unsent message:
  select borrowernumber, letter_code, message_transport_type, content
  from message_queue where status != "send";
  You should see:
    2 messages for P1, 1 for sms, 1 for email and the letter code PREDUE
    1 message for P2, email and the letter code PREDUE

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10832: (follow-up) add the transport type in the warning message
Jonathan Druart [Wed, 23 Apr 2014 15:35:33 +0000 (17:35 +0200)]
Bug 10832: (follow-up) add the transport type in the warning message

If no template is defined for a letter and the needed MTT, we
should display the MTT.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10832: (follow-up) fix case where some print overdue notices were not being sent
Jonathan Druart [Thu, 13 Feb 2014 13:54:45 +0000 (14:54 +0100)]
Bug 10832: (follow-up) fix case where some print overdue notices were not being sent

If overdues should be sent to some patron (on the same branch), only the
first one was notified.

This patch fixes this issue.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10832: Multi transport types for overdue notices
Jonathan Druart [Fri, 6 Sep 2013 09:23:44 +0000 (11:23 +0200)]
Bug 10832: Multi transport types for overdue notices

Test plan:
- define some complex overdue rules (tools/overduerules.pl).
For example:
First overdue from 2 to 5 days by sms and email with letter code L1
Second overdue from 5 to 15 days by email with letter code L2
Third overdue from 15 days by print with letter code L3
- define a message for each transport type selected (tools/letters.pl).
- select 3 patrons (P1, P2, P3) and 3 barcodes (B1, B2, B3).
    * checkout B1 to P1 with a due date = NOW + 3 days
    * checkout B2 to P2 with a due date = NOW + 10 days
    * checkout B3 to P3 with a due date = NOW + 20 days
- into the mysql cli, note the value of unsent message:
  select count(*) from message_queue where status != "send";
- launch the cronjob:
  perl misc/cronjobs/overdue_notices.pl
- retry the previous sql query, you should have X + 4 unsent messages
  (depending of current checkouts in your DB!).
- view all unsent message:
  select borrowernumber, letter_code, message_transport_type, content
  from message_queue where status != "send";
  You should see:
    2 messages for P1, 1 for sms, 1 for email and the letter code L1
    1 message for P2, 1 for email and the letter code L2
    1 message for P3, 1 for print and the letter code L3

- Specific case: If a user don't have a smsalertnumber and a sms is
  required or if a user don't have an email defined and an email is
  required, a print notice is generated.
  A print notice is generated only 1 time per borrower and per level.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11561: restore previous behavior of generation of hold print notices
Olli-Antti Kivilahti [Wed, 15 Jan 2014 14:25:17 +0000 (16:25 +0200)]
Bug 11561: restore previous behavior of generation of hold print notices

This patch prevents duplicate hold available print notices from being
sent and enforces making a print notice if no other transports can be
used.

-------------------------
- REPLICATING THE ISSUE -
-------------------------

1. Set a Patrons "Hold filled"-messaging preference to SMS + Email
2. Remove the SMS number (sms notification number) and all email
   addresses.
3. Make a reservation for this Patron.
4. Check-in the reserved Item.
5. message_queue-table has two generated print notices for the
   Hold_filled event.
   One for both failed message transport types, email and sms.

1. Set a Patrons "Hold filled"-messaging preference to empty, remove all
   checks from boxes.
2. Make a reservation for this Patron
3. Check-in the reserved Item.
4. message_queue-table has no message for the Hold-filled event. This is
   problematic because a Patron should get some kind of a notification
   for a filled Hold.

-----------------------------
- AFTER APPLYING THIS PATCH -
-----------------------------

If all message transport types for "Hold filled" fail, a print notice is
queued in the message_queue table. Only one print message is queued even
if many transports attempts fail.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10845: (follow-up) update how a test case counts print hold available notices
Galen Charlton [Fri, 2 May 2014 19:01:37 +0000 (19:01 +0000)]
Bug 10845: (follow-up) update how a test case counts print hold available notices

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10845: DBrev 3.15.00.040
Galen Charlton [Fri, 2 May 2014 19:01:07 +0000 (19:01 +0000)]
Bug 10845: DBrev 3.15.00.040

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10845: (follow-up) fix message_transport_type parameter for Itiva cronjob
Jonathan Druart [Thu, 1 May 2014 13:41:31 +0000 (15:41 +0200)]
Bug 10845: (follow-up) fix message_transport_type parameter for Itiva cronjob

The message_transport_type param should passed to GetPreparedLetter, not
part of the "tables" parameter.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10845: (follow-up) add the MTT in the die message
Jonathan Druart [Wed, 23 Apr 2014 14:48:54 +0000 (16:48 +0200)]
Bug 10845: (follow-up) add the MTT in the die message

If no template is defined for the HOLD letter and the needed MTT, we
should display the MTT.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10845: Multi transport types for holds
Jonathan Druart [Mon, 9 Sep 2013 14:58:22 +0000 (16:58 +0200)]
Bug 10845: Multi transport types for holds

The HOLD_PRINT and HOLD_PHONE notices become useless.
This patch modifies existing notices in order to group them into the
main notice type 'HOLD', with any pre-existing print and phone
templates in the appropriate places.

Test plan:
- Apply the patch and execute the update database entry.
- Verify that your previous HOLD_PHONE and HOLD_PRINT are displayed
  when editing the HOLD notice (under phone and print).
- Choose a patron and check SMS, email, phone for "Hold filled"
  (on the patron messaging preferences).
- Place a hold.
- Check the item in and confirm the hold.
- If the patron has an email *and* a SMS number, 2 new messages are put
  into the  message_queue table: 1 sms and 1 email.
  If the patron does not have 1 of them, there are 2 new messages: 1
  sms/email and 1 print.
  If the user has neither of them, there is 1 new message: 1 print.
- The generated messages should correspond with the notices defined,
  depending the message transport type.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Just noting that if email and SMS are disabled in the msg prefs, the user
will not have a print message.
And if the SMS driver fails, the record status in message_queue is 'failed',
but staff may not be aware of that.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10845: Remove the notice code HOLD_PRINT in seed data
Jonathan Druart [Mon, 9 Sep 2013 15:12:21 +0000 (17:12 +0200)]
Bug 10845: Remove the notice code HOLD_PRINT in seed data

This patch converts the HOLD_PRINT notice to a HOLD notice
with a message transport type of 'print'.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11868: (follow-up) correct case of "SMS"
Galen Charlton [Fri, 2 May 2014 18:32:02 +0000 (18:32 +0000)]
Bug 11868: (follow-up) correct case of "SMS"

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11868: MTT: disable SMS and phone if not in use
Jonathan Druart [Thu, 27 Feb 2014 13:30:50 +0000 (14:30 +0100)]
Bug 11868: MTT: disable SMS and phone if not in use

On both pages "Notices and slips" and "Overdue rules", it would be great
to disable SMS and phone if there are not in use.  This patch implements
this.

Test plan:
1/ Edit a notice
2/ Enable/disable the SMSSendDriver pref and verify the sms block is
enabled/disabled.
3/ Enable/disable the TalkingTechItivaPhoneNotification pref and verify
the phone block is enabled/disabled.

4/ Go on tools/overdues.pl
5/ Enable/disable the SMSSendDriver pref and verify the sms checkboxes
are enabled/disabled.
6/ Enable/disable the TalkingTechItivaPhoneNotification pref and verify
the phone checkboxes are enabled/disabled.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
---------------
Testing report:
---------------
Followed the test plan. Reviewed the code modifications.
Feature works as expected.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) update DBIC schema classes
Galen Charlton [Fri, 2 May 2014 18:05:09 +0000 (18:05 +0000)]
Bug 9016: (follow-up) update DBIC schema classes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: DBRev 3.15.00.039
Galen Charlton [Fri, 2 May 2014 18:03:37 +0000 (18:03 +0000)]
Bug 9016: DBRev 3.15.00.039

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (QA Follow-up) Remove warning from content.length test
Marcel de Rooy [Fri, 28 Mar 2014 08:50:11 +0000 (09:50 +0100)]
Bug 9016: (QA Follow-up) Remove warning from content.length test

If the letter.content is undef, the content.length test in the letter
template will trigger warning:

    Argument "" isn't numeric in numeric gt (>).

This patch eliminates that warning.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) Improve number of characters display when mtt=sms
Jonathan Druart [Thu, 27 Mar 2014 15:18:07 +0000 (16:18 +0100)]
Bug 9016: (follow-up) Improve number of characters display when mtt=sms

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) Add some validation on the letter form
Jonathan Druart [Thu, 27 Mar 2014 15:01:22 +0000 (16:01 +0100)]
Bug 9016: (follow-up) Add some validation on the letter form

1/ Code and Name are mandatory.
2/ At least 1 template should be filled on saving.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) FIX letter name is not displayed on editing a letter
Jonathan Druart [Thu, 27 Mar 2014 15:00:57 +0000 (16:00 +0100)]
Bug 9016: (follow-up) FIX letter name is not displayed on editing a letter

If the name is not in email, the name is not correctly retrieved.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) letter name is not displayed on editing a letter
Jonathan Druart [Thu, 13 Mar 2014 08:30:22 +0000 (09:30 +0100)]
Bug 9016: (follow-up) letter name is not displayed on editing a letter

On editing a letter, the letter name is not displayed. So if you save
it, the letter name is erased with an empty string.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Tested by setting the "Name"-field in letter.pl, saving, re-editing and verifying
that the email is present in the letter's "Name"-field.
The letter "Name" is replicated for each template in the DB, but that doesn't
incur any performance penalty.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) additional mtt's name should be displayed in header
Jonathan Druart [Wed, 12 Mar 2014 17:42:40 +0000 (18:42 +0100)]
Bug 9016: (follow-up) additional mtt's name should be displayed in header

If you insert a new line in your message_transport_types table, the
overdues configuration table did not displayed an header.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) make GetLetters return all letters
Jonathan Druart [Thu, 6 Mar 2014 14:18:12 +0000 (15:18 +0100)]
Bug 9016: (follow-up) make GetLetters return all letters

GetLetters only returns letters with a mtt = email. It should return all
letter codes in the DB.

The message_transport_type parameter is never used.

To reproduce the issue:
Create a notice with a sms template and no email template.
Go on the overdue rules configucation page.
The notice does not appear in the notice list.

Signed-off-by: Olli-Antti Kivilahti <kivilahtio@ProBook6570b>
---------------
Testing report:
---------------
Testing this subroutine from a test stub. Calling the method without arguments
and with argument 'circulation' and 'circulat'.
Works as supposed to.
Related Bug 11931 discovered but not within the scope of this featureset.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) various fixes
Jonathan Druart [Mon, 24 Feb 2014 15:13:35 +0000 (16:13 +0100)]
Bug 9016: (follow-up) various fixes

* Fixes POD of GetMessageTransportTypes.
* Removes the useless map in GetMessageTransportTypes.
* Textual: "You must specify a title and a content" ->
           "Please specify title and content".
* Reintroduces << and >> around the field name.
* Change message for the update DB entry.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) add insertAtCaret library to about page
Kyle M Hall [Fri, 7 Feb 2014 13:54:24 +0000 (08:54 -0500)]
Bug 9016: (follow-up) add insertAtCaret library to about page

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) fix some translate issues
Jonathan Druart [Mon, 3 Feb 2014 13:15:38 +0000 (14:15 +0100)]
Bug 9016: (follow-up) fix some translate issues

On tools/letter.pl and tools/overduerules.pl, some strings were not
translatable. This patch should fix that.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) fix tab characters and POD.
Jonathan Druart [Mon, 16 Dec 2013 08:48:39 +0000 (09:48 +0100)]
Bug 9016: (follow-up) fix tab characters and POD.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) fix unit tests
Jonathan Druart [Fri, 8 Nov 2013 12:40:07 +0000 (13:40 +0100)]
Bug 9016: (follow-up) fix unit tests

The unit tests should insert overdue rules.
+ Fix the doc for GetOverdueMessageTransportTypes

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: DB changes: new table overduerules_transport_types
Jonathan Druart [Fri, 6 Sep 2013 07:36:42 +0000 (09:36 +0200)]
Bug 9016: DB changes: new table overduerules_transport_types

This patch adds:
- a new table overduerules_transport_types.
- a new column letter.message_transport_type.
- a new primary key for letter.
- fill the new table with existing values.

Test plan:
After applying this patch and executing the updatedatabase entry, verify
that the overduerules_transport_types table contains a row for each
entry in the overduerules table.
The message_transport_type column should contain 'email'.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: (follow-up) GetMessageTransportTypes returns an arrayref, not hashref
Jonathan Druart [Mon, 9 Sep 2013 14:52:29 +0000 (16:52 +0200)]
Bug 9016: (follow-up) GetMessageTransportTypes returns an arrayref, not hashref

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: Define different transport types for overdues
Jonathan Druart [Fri, 6 Sep 2013 08:28:39 +0000 (10:28 +0200)]
Bug 9016: Define different transport types for overdues

This patch adds:
- a new routine C4::Overdues::GetOverdueMessageTransportTypes.
- the ability to define one or more transport types for an overdue
  level.

Test plan:
- go on tools/overduerules.pl.
- verify that previous rules still exist and that the 'email' checkboxes
  is checked if a rule is defined.
- redefined rules at different levels and check the transport type
  needed. Currently, only email, sms and print are relevant
- Save the changes.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9016: Create a message for each transport type.
Jonathan Druart [Fri, 6 Sep 2013 08:27:04 +0000 (10:27 +0200)]
Bug 9016: Create a message for each transport type.

This patch adds:
- a new jquery plugin : insertatcaret.
- the ability to define a notice template for each transport type.
- a new routine C4::Letters::GetMessageTransportTypes.

Test plan:
- Go on tools/letter.pl and check that all existing notices are still
  there.
- Modify one. A new empty message is present for sms, print, etc. The
  email message is filled with the existant value.
- Add a message for sms for example (don't forget the subject) and save.
- edit again and verify the sms message has been saved.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11182: (follow-up) fix regression where session branch wasn't initialized
Galen Charlton [Fri, 2 May 2014 20:25:22 +0000 (20:25 +0000)]
Bug 11182: (follow-up) fix regression where session branch wasn't initialized

C4::Context->userenv() won't return a valid value until the
user session set up, e.g., via get_template_and_user().  Consequently,
the change introduced by a previous commit for bug 11182 ended
up making it appear that when checking an item that fills a hold
that it always needs to be transferred.

This patch fixes the regression and moves the "no-branch-set" check
to where it belongs.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6273: (follow-up) fix various issues
Galen Charlton [Wed, 30 Apr 2014 17:11:58 +0000 (17:11 +0000)]
Bug 6273: (follow-up) fix various issues

This patch fixes various issues that prevented the account
type from being set correctly when recording SIP2 payments:

- the fixed fields in the fee paid message were not getting
  parsed correclty
- accountlines.accounttype is only five characters wide, so
  SIP2 payments are now records as 'Pay00', 'Pay02', etc. rather
  than 'Pay-00'.
- removed regression on bug 2546 and made the new payment types
  translatable

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6273: add support for recording type of payment made via SIP2
Ian Walls [Fri, 2 Dec 2011 15:49:07 +0000 (10:49 -0500)]
Bug 6273: add support for recording type of payment made via SIP2

Adds support for recording in Koha accountlines a different accounttype
depending on how the fee was paid at the SIP2 station (cash, credit,
etc.)

Adds a new param to recordpayment(), $sip_paytype, which is appended to
the 'Pay' type if present.  The payment description is also appended
with " (via SIP2)" if this is present.

In order for other scripts to keep working as expected, "eq 'Pay'"
needed to be replaced with a regex comparison "=~ /^Pay/", so that 'Pay'
and 'Pay-##' would continue to group together.

To test:
1.  Make a payment over a SIP2 connection
2.  Check the patron record in the staff client; you should see the
    modified description
3.  Attempt to print a invoice or a reciept for the borrower; the
    payment should show up where expected

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9865 (follow-up) give better usage examples in example SIPconfig.xml
Kyle M Hall [Fri, 10 Jan 2014 13:36:28 +0000 (08:36 -0500)]
Bug 9865 (follow-up) give better usage examples in example SIPconfig.xml

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9865: make SIP msg encoding configurable via SIPconfig.xml
Adrien Saurat [Fri, 8 Nov 2013 10:49:56 +0000 (11:49 +0100)]
Bug 9865: make SIP msg encoding configurable via SIPconfig.xml

The accounts->login tag in SIPconfig.xml can now accept a new
parameter, "encoding". It will be mostly used to encode to utf8.

For this, simply add the parameter: encoding="utf8"

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Works as advertised, does nothing if encoding is not set.
Blows up all the machines that can't handled utf8 if it is set :) But
that's not Koha's fault. :)

Patch rebased by Christophe Croullebois  <christophe.croullebois@biblibre.com>

Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com>
But now I did it the right way! And I can confirm that this patch solves
all issues with mangled characters in SIP messages. Confirmed that it
looks good with Norwegian characters in patron name and in book titles.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11334: (follow-up) teach the search tests to mock the DisplayLibraryFacets syspref
Galen Charlton [Wed, 30 Apr 2014 03:29:46 +0000 (03:29 +0000)]
Bug 11334: (follow-up) teach the search tests to mock the DisplayLibraryFacets syspref

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7844: (follow-up) don't test koha.psgi for ability to compile (yet)
Galen Charlton [Tue, 29 Apr 2014 19:34:23 +0000 (19:34 +0000)]
Bug 7844: (follow-up) don't test koha.psgi for ability to compile (yet)

Given the experimental nature of Plack support, for now we're
excluding koha.psgi from the Perl compilation tests.  This should be
changed as we get closer to making Plack support a first-class option.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11182: (QA followup) fix warning if itemBarcodeFallbackSearch set
Tomas Cohen Arazi [Fri, 31 Jan 2014 16:00:18 +0000 (13:00 -0300)]
Bug 11182: (QA followup) fix warning if itemBarcodeFallbackSearch set

To reproduce:
- On top of the previous patches, if you enable the
  itemBarcodeFallbackSearch syspref and do a search for a term that
  returns at least one result, there will be warnings for each result
  without items attached.

To test:

- In the checkout form enter a term that should return results (some of
  them without items attached)
=> There are warnings on the logs regarding a split of undef variable
- Apply the patch
- Repeat the first step
=> No warnings

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11182: get rid of some warnings in circulation
Srdjan [Fri, 1 Nov 2013 07:17:40 +0000 (20:17 +1300)]
Bug 11182: get rid of some warnings in circulation

TEST PLAN
---------
 1) Log into staff client
 2) Koha administration
 3) Global system preferences
 4) Circulation
 5) Make sure FineNotifyAtCheckin is set to Notify.
 6) Check out tab
 7) Type patron's name and click 'Submit'
 8) Select patron if required
 9) Check out an item, but set the due date to be overdue.
10) Check in the overdue item.
11) Check the error log
     $ cat ~/koha-dev/var/log/koha-error_log
     NOTE: only the warnings from lines 269 and 540 in returns.pl
           are the ones to note.
12) Apply this patch
13) Repeat steps 6 through 11, there should no new
    warnings related to lines 269 or 540 from returns.pl.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11182: (follow-up) improve initialization of the $waiting_holds variable
Galen Charlton [Tue, 29 Apr 2014 17:55:01 +0000 (17:55 +0000)]
Bug 11182: (follow-up) improve initialization of the $waiting_holds variable

Rather than check whether it's defined, since its holding an
integer, simply initialize it to 0.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11182: remove another warning in circulation
Mark Tompsett [Fri, 10 Jan 2014 19:45:17 +0000 (14:45 -0500)]
Bug 11182: remove another warning in circulation

This deals with the warning when Circulation system preference
'WaitingNotifyAtCheckin' is set to 'Notify' and an overdue item
is checked in.

TEST PLAN
---------
 0) Feel free to backup your koha-error_log file, and then toast it.
     $ echo > ~/koha-dev/var/log/koha-error_log
 1) Log into staff client
 2) Koha administration
 3) Global system preferences
 4) Circulation
 5) Make sure WaitingNotifyAtCheckin is set to Notify.
 6) Check out tab
 7) Type patron's name
 8) Select patron if required
 9) Check out an item, but set the due date to be overdue.
10) Check in the overdue item.
11) Check the error log
     $ cat ~/koha-dev/var/log/koha-error_log | grep 284
     NOTE: the returns.pl one that will be fixed by this.
12) Apply this patch
13) Repeat steps 6 through 7, there should no new line 284 entries.

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11182: remove spurious logged warnings in circulation
Mark Tompsett [Fri, 10 Jan 2014 18:07:10 +0000 (13:07 -0500)]
Bug 11182: remove spurious logged warnings in circulation

TEST PLAN
---------
 1) Log into staff client
 2) Click 'Circulation'
 3) Click 'Check out'
 4a) Type a patron name, click 'Submit'
 4b) If necessary, select which one, and click 'Select'
 5) Check the error logs, new warnings
 6) Apply patch
 7) Click 'Circulation'
 8) Click 'Check out'
 9a) Type a patron name, click 'Submit'
 9b) If necessary, select which one, and click 'Select'
10) Check the error logs, no new warnings
11) Click the 'Restrictions' tab
12) Click 'Add manual restriction'
13) Add a dummy restriction
14) Click the 'Restrictions' tab
15) Click 'Remove'
16) Click 'OK'
17) Confirm that no additional error log entries were added
     and adding/deleting restrictions hasn't broken.

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11334: DBRev 3.15.00.038
Galen Charlton [Tue, 29 Apr 2014 16:03:07 +0000 (16:03 +0000)]
Bug 11334: DBRev 3.15.00.038

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 11334: (follow-up) add spans for new facets
Galen Charlton [Tue, 29 Apr 2014 16:01:51 +0000 (16:01 +0000)]
Bug 11334: (follow-up) add spans for new facets

Signed-off-by: Galen Charlton <gmc@esilibrary.com>