bug 2394: regression test for canreservefromotherbranches

If IndependentBranches is ON and canreservefromotherbranches is OFF,
a patron is not permittedo to request an item whose homebranch (i.e.,
owner of the item) is different from the patron's own library.
However, if canreservefromotherbranches is turned ON, the patron can
create such hold requests.

Note that canreservefromotherbranches has no effect if
IndependentBranches is OFF.

To test, run prove -v t/db_dependent/Holds.t.  Without the bugfix
patch for bug 2394, the last two tests should fail.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 23e302071efabd824f0a6c69bc68dee4cfc13e5b)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The Holds.t file was introduced by 9394 which refactors several lines of code and thus i'm not cherry-picking in the stable branch.
I'm just cherry-picking Galen's regression tests.
Bug 2394: Use syspref canreservefromotherbranches in CanItemBeReserved

If IndependentBranches is ON, patrons are not allowed to place
hold requests on items whose owning library is different from
the patron's home library, *unless* the canreservefromotherbranches
system preference is also ON.

The patch implements the intended behavior; without it, IndependentBranches
and canreservefromotherbranches were not consulted during the
item holdability check.

To test:

[1] Have IndependentBranches ON and canreservefromotherbranches
    OFF.  Make sure that the circulation rules are set up to
    permit patrons to place hold requests in general.
[2] In the OPAC, log in as a patron from library A, and try placing
    a hold on an item from library B.  The patron will be able to
    place the request.
[3] Cancel the request.
[4] Apply the patch.
[5] Try placing the same hold request.  This time, the request should
    be forbidden.
[6] Turn on canreservefromotherbranches.
[7] Try placing the hold request.  This time, it should go through.
[8] Cancel the request.
[9] Turn off IndependentBranches.
[10] Try placing the hold request and verify that it is permitted.
[10]

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 2cbc47a871efc60ae663ecfedf59ec77dda718f4)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected.
Note: on my tests i first forgot to enable AllowOnShelfHolds to get this working. It is not mentioned on the test description.
Bug 10511: fix message preference form glitch concerning phone notifications

An error in the onclick for phone notices causes the "Do not notify"
checkbox to be checked when the phone checkbox is checked. Also,
checking "Do not notify" does not uncheck the phone checkbox.

Test plan:
1) Enable TalkingTechItivaPhoneNotification
2) Browse to the new patron screen ( memberentry.pl )
3) In the patron messaging preferences check the Phone checkbox
4) Not the "do not notify" checkbox is then checked
5) Uncheck the "do not notify" checkbox, and check the Email checkbox as well
6) Now check the "do not notify" checkbox, note the Phone checkbox remains checked
7) Apply this patch
8) Repeat steps 3-6, noting the odd behavior is no longer present

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e608f4d48c09e025fc10d47668bb40c0d3d686a7)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected. EnhancedMessagingPreferences needs to be set to reproduce.
Bug 10511: (follow-up) jQuery .removeAttr() has only one parameter

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7d6edc6f182009726e9675ae832385f37e16c4e0)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10614 - have add order form at top and bottom

If a basket has a lot of items it may be inconvenient to scroll to the
bottom of the patch to reach the "add to basket" form. This patch adds
as "Add to basket" button to the toolbar which uses JavaScript to copy
the form into a modal dialog for quick access.

To test, apply the patch and view an open basket. You should be able to
click the "Add to basket" button to trigger a modal dialog with the full
"Add to basket" list of options. All options in the list should function
normally.

If you view a closed basket the new button should not appear.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass and I love it :)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit fe193210815b33efbefbf518ccc13329f20eeefc)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 5262: make authority plugin copy indicators to bib record

With this patch Koha should correctly copy indicators
(and create $2 subfield in MARC 21 if need) from the chosen authority
record to the edited bibliographic record (according to discussion in
bugzilla). UNIMARC and MARC 21 flavors are covered.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: work as described, testing in comments 9 and 12.
No errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests. Tested functionality repeating
some of the tests noted by Bernardo - checking mostly 1xx, 490,
and 7xx.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 129c974fdde0dc62e568f7aa01c4a0796ae150ae)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10483: fix item uniqueness check on order form

When syspref "UniqueItemFields" is defined, the item uniqueness is
tested in acquisition by an AJAX call to check_uniqueness.pl.  This
patch fixes an issue where check_uniqueness.pl wasn't looking
at the correct CGI parameters.

Test plan :
- Select an existing item with barcode
- Add "barcode" to "UniqueItemFields" syspref (use space as separator
  for multiple values)
- Set "AcqCreateItem" syspref to "Create an item when placing an order"
- Go to an acquisition basket
- Create a new order from empty
- Enter existing barcode in item form and save
=> You get an alert that barcode already exists and order is not saved
- Enter a non-existing barcode in item form and save
=> Order and item are created

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 1c9135262b9233f59fd05e34c90980e7dc8be338)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8712: change "New list" to "Create new list" in OPAC masthead

This makes it clear for screen reader users.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Note that you should delete all your private lists to see this change.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f0280dabe0db3e27e0e56a025a61bd41f206de57)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8712: add 'and' label for inputs in OPAC "fewer options" advanced search page

The "and" label not only improves the accessibility but also gives the
user an idea that the operation between multiple search fields is a
boolean "AND" by default.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Actually only adds a label and an id to the select.
Note that the boxes do not exactly align anymore now (with fewer options).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 98bd9de54aa7cab6fe3dec8e7cd88378a06e8684)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10715 - MARC21 007 Plugin Editor doesn't load position 01

This patch changes the MARC21 007 plugin editor so that it uses
1 character instead of 4 characters for position 01.

TEST PLAN:

1) Create new record/edit an existing record
2) Using the tag editor for the 007 field, choose "Videorecording"
3) Click OK
4) Change the second character in the 007 from "c" to "d"
5) Open the tag editor again
6) Note that position 01 will still say "c - Videocartridge" rather
than "d - Videodisc".
7) Exit tag editor

8) Apply patch

9) Reload the page (Shift + Refresh is always useful)
10) Open the tag editor again
11) Note that position 01 will now say "d - Videodisc"

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 73ac970f734b0f04fff5561aa35bb9d9d47aa943)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Fix worked as expected.
Bug 10703: Add db documentation for biblioimages table

This patch adds db documentation to the biblioimages table.

To test:

Apply patch
Review kohastructure.sql to be sure that the documentation is there

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 801d8237d80d7079f3355da18ef18c60b7f37325)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10703: Document quotes table

Add db documentation for the quotes table

To test:

apply patch
review kohastructure.sql to be sure documentation is there

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6823c745371a115d5bec98beb9d10b59e188c9fe)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10703: Document borrower_files table

Add db documentation to borrower_files table.

To test:

apply
review kohastructure.sql to be sure documentation is there

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: No errors. Tested loading on new database.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 09e802c7933073cd98040155b02898ab79739b3a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10716: fix JavaScript error on basket groups page

To test:

Go on acqui/basketgroup.tt and verify a js error occurred
(ReferenceError: CONFIG_EXCLUDE_ARTICLES_FROM_SORT is not defined).
Apply the patch and verify the error does not appear anymore.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a4d8144efdcbbf30d649264495f151e8b6fd7594)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10481: FIX No enrollment fee when changing patron category.

When a patron changes to a category with enrollment fee, they
are not generated.

Test plan:
- Choose a category without fee (e.g. Kid)
- Add an enrollment fee for another category (e.g. Young adult)
- Choose a kid and change his category to "Young adult".
- Note the warning message "Fees & Charges: Patron has Outstanding fees
  & charges of XX" on the check out page.

This patch also moves all instances of adding the enrollment fee
to a new routine in C4::Members, AddEnrolmentFeeIfNeeded(), so
additional tests include:

- Register a new patron and give it a category that has
  an enrollment fee.  Verify that the fee is charged.
- Renew the patron.  Verify that the additional fee is charged.
- Register a new patron with a child patron category.
- Use the 'update child to adult' menu option to change the
  patron's category to one that is fee-bearing.  Verify that the
  enrollment fee was charged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f8eb19163bd4e59e99b6dae90a5712b6a7be52f6)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded

prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t
t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. ok
All tests successful.
Files=1, Tests=3,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.38 cusr
0.01 csys =  0.41 CPU)
Result: PASS

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 1c8efaf3f9b14caf5f6512149d5fcd957bd3e487)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10481: (follow-up) fix typo in POD

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1e84b1217afc74f490423538b7b8808e3d34513a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10653: add unit tests for C4::RotatingCollections.pm

The tests are wrap in a database transaction.

Test plan:
prove t/db_dependent/RotatingCollections.t
t/db_dependent/RotatingCollections.t .. ok
All tests successful.
Files=1, Tests=41, 20 wallclock secs ( 0.02 usr  0.01 sys +  0.41 cusr  0.02 csys =  0.46 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 12061f44beb46709e03d09f7ff61551fa9297b2e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10653: (follow-up) minor tweaks to RotatingCollections tests

- remove unnecessary module import
- use parentheses for all C4 function calls

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 40aa42f31f10acad92da5f2c57319f049fba9289)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9238 - make fund pull down say 'select fund', not 'select budget'

When adding a new order to a basket the fund selection field is labeled
"Fund:" but the default option is "Select a budget." This patch changes
this string to "Select a fund" and also corrects the associated
JavaScript error message text displayed when one doesn't choose a fund.

To test, add an order to basket. The "New order" form should show
"Select a fund" as the default option for "Fund" in the "Accounting
details" section. If you submit the form without selecting a fund the
error message should read "You must select a fund."

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
tests pass

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
String updates only, passes koha-qa.pl

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dbe233a0e5d86975c28918d8b7023b70bdd29d38)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>