Bug 10514: improve visibility of Add item link on new order form

This patch converts the "Add" and "Clear" links
to the standard "submit/cancel" format inside a fieldset. This gives
them a little more visual weight.

Based on the changes made by Liz Rea and Jonathan Druart.

To test:

- create a basket
- add a record to it
- scroll down - the link to add item and cancel should both be more
  prominent now.
- Click "Add item" - it should add an item.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
I still feel weird about the button, but as two people have said they'd rather have the button, I'm alright with it I guess.
Really what I want is people to notice it's there and click it at the appropriate time. I hope this will help that issue.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Leaves the translation problems, but that needs more work and is
out of the scope of this bug.
Tested Add and Update functionality works correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 275f405c8b3920634907e5e1f2ef8ccecf497868)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7143: Updating history and about page

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d647090a4ab9b53577c1959dcdb0642a29fcbe6d)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10448: can now change framework after duplicating bib record

Changing the framework in the MARC editor immediately after duplicating
a bib record no longer clears the fields.

This patch changes the Changefwk Javascript function so that it passes
the "op" value and the "biblionumberdata" (as the biblionumber) from
addbiblio.pl back to itself, when submitting the form in order to
change the framework.

The reason we need to do this is because the form in addbiblio.tt
is hard-coded to always submit an "op" value of "addbiblio". Currently,
we need to have it hard-coded to "addbiblio", because all the magic
happens in addbiblio.pl when there is an "op" of "addbiblio". If we
always passed the "actual" "op" value, such as "duplicate", nothing
would ever happen when we clicked "save". It seems to me that this
is a flaw in the design of addbiblio.pl.

If we pass the "op" and "biblionumber" when changing frameworks, we're
able to tell addbiblio.pl that we're still wanting to "duplicate" this
"X" biblionumber. However, by having the form still hard-coded to
"addbiblio", when we hit save, the form will do the magic, check if
it's a duplicate, and save the record (or prompt for action if it
is a duplicate).

--

I also noticed that if you make changes to a record, then change
the framework before saving, your changes get cleared (since the
original record from the database is loaded when the page reloads).
It seems to me that this is a bug. Changing the framework should
change the layout while preserving the content. I think most users
would assume that when changing the framework.

This patch also introduces another hidden input into addbiblio.tt and
the Changefwk Javascript called "changed_framework". Basically, if
the Changefwk Javascript is run, it tells addbiblio.pl that the
framework is changed, and it uses the posted data from the form
(which we have been modifying) instead of reloading the record from
the database.

--

Test Plan:

A) Before Applying Patch:

To Show That Changing the Framework Erases All Fields When
Duplicating a Record:

1) Go to any bib record
2) Go to Edit > Edit as new (duplicate). You should see filled
in fields.
3) Change the framework to any other framework than the one
that is currently specified.
4) Note that every single field is now blank

To Show That Changing the Record then Changing the Framework
Ignores Changes, When Editing a Record

5) Go to any bib record
6) Go to Edit.
7) Change the title of the record to "I've changed the title".
8) Change the framework to any other framework than the one that is currently specified.
9) Look at the title. You'll notice it is the original title, and NOT "I've changed the title".

B) Apply the Patch

Also, clear your memcache and shift+refresh your screen. You don't want to use cached templates/javascript.

C) After Applying the Patch

Repeat Steps 1-3 and 5-8.

You should now notice that changing the framework when duplicating the item does not clear all the fields.

You should also notice that any changes you make prior to changing the framework will still exist after changing it.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ca33b7fc635d93b3029831da7496372fb34c798f)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected.
bug 10356: improve display of serial issue dates in staff bib details page

This patch adds the date published to the subscriptions tab in the staff
interface bib display and renames the former "Date" column to
"Date arrived".

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 97bbf04757227f2a26a6f5b1b216d2bab8efbdc9)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Good and simple usability improvement. Works as expected.
Bug 9770: test case for sorting of Dewey call numbers that contain prefixes

This adds a test for C4::ClassSortRoutine::Dewey to check that the
call number "JR DVD 800.1" sorts before "JR DVD 900"

To test:

[1] Apply just this patch.
[1] Run prove -v t/ClassSortRoutine_Dewey.t
[2] Test #7 should fail.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes test plan and QA script.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit bce45b4bf55e82345efed2850d9cb5fd77f3c483)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9770: fix sorting of Dewey call numbers that contain prefixes

C4::ClassSortRoutine::Dewey can pad the wrong part of a call number internally.

The subroutine get_class_sort_key tokenizes a call number string (splitting on
periods and whitespace) and counts the number of tokens that solely contain
digits.  If there is only one such digit group, a comment in the code states
that it will pad said digit group.  However, the bug is that the code assumes
said digit group is the first token, when this may not be the case.

In practice, this can cause poor sorting when used a call number is in the form
of PREFIX _space_ 3DIGITS.

To test:

[1] Create two item records whose class scheme is set to
    'ddc' (Dewey) and whose call numbers contain prefixes, e.g.,
    J DVD 700.1 ABC and J DVD 850 DEF.
[2] Use the inventory tool to produce a list of item items that include
    the two created in step 1.  Obsere that that items are sorted
    in the incorrect order, with "J DVD 850 DEF" coming before
    "J DVD 700.1 ABC".  Alternatively, run the following SQL
    to see the incorrect sort order:

    SELECT cn_sort, itemcallnumber
    FROM items
    WHERE itemcallnumber LIKE 'J DVD%'
    ORDER BY cn_sort;

[4] Apply this patch.
[5] Run misc/maintenance/touch_all_items.pl to force cn_sort to be
    recalculated.
[6] Repeat step 2 and verify that the call numbers are now sorted
    corrected.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dba36a7a1216238a260ea5fbe2218627487e9f19)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10258: fix permissions check for setting basket group for order basket

Improve the code that displays and allows staff to
set the basket group from the basket details page
for a closed basket.

Prior to this patch, a staff member who did not
have the group_manage acquisition permission would
still see a control to change the group that the
basket belongs to; attempting to change the group
would present with with a login page.

This patch also does some tidying of how basket group
details are passed to the template.

To test:

[1] Create an order basket and close it.  Do
    not assign it to a basket group.
[2] View the basket details while logged in as
    a staff user who has the order_manage acquisitions
    permission but not the group_manage.  The
    displayed basket group should be "No group".
[3] Switch to a staff user who also has the
    group_manage permission, then view the basket
    details again.  The basket group field should
    now be a select input that allows you to change
    the basket group.
[4] Change the basket group.  Verify that the basket group
    you selected is now displayed as the current group
    for that order basket.  The basket group delivery and
    billing place fields should also now be displayed.
[5] Close the basket group set in the previous step, then
    view the basket details again.  This time, the basket
    group name should be displayed with a suffix of " (closed)",
    and no input to change the group should be displayed.
[6] Swith to a staff user who does not have the group_manage
    permission, view the basket details, and verify that
    the basket name is displayed with a suffix of " (closed)".

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 44364db8d53bf5e3135ae2de6270a920e5c053c1)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10258: offer to create basket group only when staff user has correct permission

If the staff user does not have the group_manage acquisition permission,
do not offer to create a new basket group when closing an order basket.

This avoids a situation where if a staff member without that permission tries
to close a basket and chose the option to create a bakset group, they would
be redirected to the login page.

To test:

[1] Log in as a staff user that does not have
    the acquisition/group_manage permission.
[2] Create a new order basket, attach at least one
    order line to it, then close it.
[3] Verify that the confirmation page does not
    offer to create a basket group with the
    same name as the order basket.
[4] Log in as a staff user that has the
    acquisition/group_manage permission.
[5] Create and close an order basket.
[6] Verify that this time, the confirmation page
    *does* offer to create a basket group.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 14a1bd0e420fd895f989ba88e0cad927697b6173)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10189: Translate values in UNIMARC 128b/c cataloguing plugins to English

Cataloguing plugins for UNIMARC 128b and 128c fields are only in Ffrench.

This patch translates them.
Source : http://blue.lins.fju.edu.tw/mao/marc/unicon.htm
Note : 128b and 128c are deprecated in last version of UNIMARC Manual (field 145 used instread).
But they are still used in French Sudoc network.

To test : in a UNIMARC english Koha, edit a record and use 128b and 128c
cataloguing plugins. Check everything is in english.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Thx for translating those!
Verified new strings get parsed into the po files.
Templates still contain lots of tabs, those can be fixed separately.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 80ea8bf821ba83fd4506f5298f5a582051b44e06)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 6898: fix DB update that assigns the circulate/overdues_report permission

This patch fixes a bug that prevented the circulate/overdues_report
permission from being assigned to staff users during upgrade.  This
patch will not affect databases that are already running 3.12.x
or later.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This will only fix the permissions for updates done
after the patch has been applied. But I agree with
Fridolyn, that we can not safely update permissions for
existing installations.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c6bf2670502afbd12981aa5e913779c38c19bdc4)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10422 - Remove references to unused and non-existent wizard.css

doc-head-close.inc contains a reference to "wizard.css" which doesn't
exist. The option to include it never evaluates as true, and that
section can be removed from the template.

To test, apply the patch and view any page in the staff client.
Everything should be styled as before. A search of the Koha source
should return no references to "wizard.css" or a "wizard" variable.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
No occurrence of "wizard" in pl/pm files.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 986f7a24e8abe566d57a3488a8df87488ab3aeb6)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10527: remove disused routine C4::Branch::get_branch_code_from_name

This routine is not in used and does not make sense. It should not be
used later.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, not references to get_branch_code_from_name found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7d930649065663325de95c3f8ecdbcea3bddb3b5)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10504: Remove the unused C4::Acq::ModOrderItem routine

This routine has been introduced by commit 2d90fb22d43db986547bbaa945873d6dd78aab71.
The only call has been removed by commit 9eba7dc594fc0d4698da5e791d5f6f8682b2712a.

So now, this routine is useless.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 9f4f1ceafe218afcbc55d6dfb9ac1e32fc11803a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10575 : GetOrdersByBiblionumber.t needs a database transaction

Before this patch, the queries in GetOrdersByBiblionumber.t were commited in the database and have to be removed at the end.
This patch wraps tests in a database transaction.

Test Plan :
prove t/db_dependent/Acquisition/GetOrdersByBiblionumber.t
t/db_dependent/Acquisition/GetOrdersByBiblionumber.t .. ok
All tests successful.
Files=1, Tests=3,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.37 cusr  0.05 csys =  0.45 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 45fafb31ce03244011513a3a758e28f8db9615a4)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10499: VirtualShelves.t - wrap tests in a database transaction

Before this patch, the queries in VirtualShelves.t were committed in the
database and have to be removed at the end.

This patch wraps tests in a database transaction.

Test plan:
prove t/db_dependent/VirtualShelves.t
VirtualShelves.t .. ok
All tests successful.
Files=1, Tests=72,  1 wallclock secs ( 0.06 usr  0.00 sys +  0.72 cusr  0.06 csys =  0.84 CPU)
Result: PASS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d2a756128853e9d3a1e0b99f47a04c9e0f31de75)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10275: UT: OrderFromSubscription.t needs to create its own data

Try before the patch:
prove t/db_dependent/Acquisition/OrderFromSubscription.t

And after, it should produce:
  t/db_dependent/Acquisition/OrderFromSubscription.t .. ok
  All tests successful.
  Files=1, Tests=12,  2 wallclock secs ( 0.02 usr  0.00 sys +  0.46 cusr
  0.02 csys =  0.50 CPU)
  Result: PASS

And some warnings...

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests.
Assumes Dateformat is set to US dates as in the sample data.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8e442955247e925dacf303455f40522a89a349b2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10275: Use a transaction for OrderFromSubscription.t

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4f09ebfc8a4a04125777d6e90c36b73217bae888)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10274: UT: Acquisition.t needs to create its own data

Try before the patch:
prove t/db_dependent/Acquisition.t

And after, it should produce:
  t/db_dependent/Acquisition.t .. ok
  All tests successful.
  Files=1, Tests=41,  2 wallclock secs ( 0.03 usr  0.00 sys +  0.42 cusr
  0.02 csys =  0.47 CPU)
  Result: PASS

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tests pass and the bookseller is deleted.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f72e78f2bd4e3f208f38063f948365d9108e6d40)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Fixed a small conflict, tests pass and looks fine.
Bug 10274: Execute sql queries into a transaction

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit eab1812b7dcfb460378fb287a63c6a81b3c8d820)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
bug 10556: regression test for setting deliverytime when adding vendor

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 41baeafda9733caa69cd678b3f471976c6b27a7c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
I'm loving Galen's regression tests :-D