Bug 12955: The "show my funds only" should be take into account

The "Show my funds only" is not take into account if the checkbox is not
checked.
So there is no way to show all funds.
This has been introduced by bug 11578.

The default is not "only mine". The default is "show all funds".

Test plan:
- Create fund where you are the owner and others where you are not.
- Go on the fund list view and verify the checkbox "show my funds only"
  is take into account.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.

Note: In order to test this make sure you have funds owned by
another staff user.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12956: Users are not linked to a fund

When creating a fund, if you add some users, they are not linked to the
fund.
Note that it works if you link them when editing the fund.

Test plan:
- Try to link users to a fund on creating it.
- On editing, you should see the linked user list.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12958: Set a fund owner to a fund hierarchy

This patch adds the ability to set an owner to a fund hierarchy
On editing a fund, if it has children, a new checkbox appears "Set this
owner to all children funds".
If checked, all the fund hierarchy will herit to this owner.
This will facilitate the fund owner modifications.

Test plan:
- Verify that the new checkbox only appears if the fund has at least a child.
- Create a consistent fund hierarchy, something like:
    fund1
      fund11
        fund111
      fund12
    fund2
      fund21
- Try to modify a fund owner without checking the checkbox. Verify the
  children have not been modified.
- Try to modify a fund owner with checking the checkbox. Verify all fund
  hierarchy has been modified.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

It works as announced.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12958 [Alt. label follow-up] Set a fund owner to a fund hierarchy

This alternate follow-up modifies the text of the label to
(hopefully) make it more clear. The markup has been revised someone to
make it more standard, and a warning has been added about overwriting
existing data.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

Looks good.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Works as described, passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11714 - GetBudgetHierarchy needs optimization

The method C4::Budgets::GetBudgetHierarchy() retreives from database budgets in an array containing a tree of budgets (parent -> children -> children, ...).
The code generating this tree with the SQL results needs optimization because when a lot of budgets exists, it can run during several minutes.

This patch rewites the code using a recurive method.

Test plan :
- Create a active budget "MyBudget" with 1000
- Click "Add found" on this budget
- Create a found "Parent" with 1000, set you has owner
- Click "Add child found" on found "Parent"
- Create a found "Child" with 100, set you has owner
- Click "Add child found" on found "Child"
- Create a found "Grand-child" with 10, set you has owner
|
- Create a new acquisition basket
- Add a new order with "Child budget"
- Select "Child" found and set all costs to 2
- Save order
- Add a new order with "Grand-Child budget"
- Select "Child" found and set all costs to 2
- Save order
- Close basket
- Perform the receive of the two orders
|
- Go to founds of "MyBudget"
=> You see a table with 3 founds
- in "Fund filters", select no library and uncheck "Show my funds only" and click on "Go"
=> You see a table with "Parent" found
- Click on small arrow left of the fund code of "Parent"
=> You see a new line with "Child" found
- Click on small arrow left of the fund code of "Child"
=> You see a new line with "Grand-Child" found
|
=> You see in "Grand-Child" row "Base-level spent" = 2 and "Total sublevels spent" = 2
=> You see in "Child" row "Base-level spent" = 2 and "Total sublevels spent" = 4
This confirms the founds are used in a hierarchie.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11714: A fund is a top-level fund if it does not have any parent

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13163: NORMARC DOM config missing <id> entry

This patch fixes the biblio-koha-indexdefs.xml for NORMARC, so
it includes the <id> element.

Because of how our DOM files work, the resulting biblio-zebra-indexdefs.xsl
for NORMARC picked the whole MARC record as ID, so every time the record
was edited, the id wouldn't match and a new record was created.

To test:
- Have a MARCXML record
- run:
  $ xsltproc etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl the_record | less
=> FAIL: verify the z:id property on the <z:record> line contains all subfields concatenated
- Apply the patch
- re-run the xsltproc line
=> SUCCESS: z:id contains the 999$c number
- Sign off :-D

Regards

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

Known bug with DOM: Without <z:id> indexing biblionumber Zebra hasn't it record
unique ID, and so fails to identify existing records. Works as described. 999$c
is linked to biblionumber in default Normarc framework.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>

I have applied the patch to my production server, and at least one customer has
confirmed that it fixes the problem with multiple copies of records in search
results.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script, fix matches what we have for the other MARC flavours.

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