Bug 11465: Show counts and amounts on OPAC 'your summary' tabs

This patch adds counts and amounts to the tabs in the 'your summary'
page of the OPAC patron account.

_TEST PLAN_

Before applying:
1) Choose a test patron
2) Place a few holds
3) Check in one of the holds so that it is waiting for the patron
4) Check out a few items
5) Check out another item that can generate fines (backdate it a few
   weeks/months)
6) Run fines.pl to generate fines (make sure your finesmode syspref
   is set to prod)
7) Check your OPAC patron account.
8) Note the tabs "Checked out, Fines, Holds, and Waiting"

Apply the patch
1) Switch your OPAC to the bootstrap theme
2) Refresh your browser for the OPAC patron account screen
3) Note that the applicable counts and amounts appear on the tabs

--

At the moment, I just have a Bootstrap patch. This is an easy patch
though, so I can duplicate to the other themes if necessary...

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

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
"Waiting" doesn't appear to work for me with and without the patch.
"Checkouts", "Holds" and "Fines" work fine.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10611: Use mysql_auto_reconnect instead of ping

DBD::Mysql provides a mysql_auto_reconnect flag. Using it avoids
the time required to do a $dbh->ping().

Benchmarks:

use Modern::Perl;
use C4::Context;
for ( 1 .. 1000 ) {
    $dbh = C4::Context->dbh;
}

* without this patch on a local DB:
perl t.pl  0,49s user 0,02s system 98% cpu 0,525 total
* without this patch on a remote DB:
perl t.pl  0,52s user 0,05s system 1% cpu 37,358 total
* with this patch on a local DB:
perl t.pl  0,46s user 0,04s system 99% cpu 0,509 total
* with this patch on a remote DB:
perl t.pl  0,49s user 0,02s system 56% cpu 0,892 total

Testing the auto reconnect:
use Modern::Perl;
use C4::Context;
my $ping = $dbh->ping;
say $ping;
$dbh->disconnect;
$ping = $dbh->ping;
say $ping;

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

prove t/db_dependent/Circulation_issuingrules.t produces no error
prove t/db_dependent/Context.t produces no error

Test
1) dumped Koha DB, load it on a non-local server
2) run sample script whit and without patch, local and remote

use Modern::Perl;
use C4::Context;
for ( 1 .. 100000 ) {
    my $dbh = C4::Context->dbh;
}

Main difference I note is with remote server
a) without patch
real    0m16.357s
user    0m2.592s
sys     0m2.132s

b) with patch
real    0m0.259s
user    0m0.240s
sys     0m0.012s

I think this could be good for DBs placed on
remote servers

Bug 10611: add a "new" parameter to C4::Context->dbh

When dbh->disconnect is called and the mysql_auto_reconnect flag is set,
the dbh is not recreated: the old one is used.

Adding a new flag, we can now force the C4::Context->dbh method to
return a new dbh.

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

Bug 10611: Followup: remove useless calls to dbh->disconnect

These 3 calls to disconnect are done at the end of the script, they are
useless.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10611: (follow-up) cache DBMS driver code in context object

Rather than use a package-level variable, use an object-level
one.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11731 - Fixed typo in message_transport_types.txt file.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
String change, all good.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11695 - Fixed typo in marc21_field_008.xml

"Tree-character alphabetic code", to "Three-character alphabetic code"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Trees are nice, but Three is better here.
String change, works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11918 : Fix typo on authorized values page

This is a small string patch. On Authorized values this patch fixes
the wording next to the library limit.

To test:

Visit Authorized Values
Click 'Add new' or 'Edit' next to a value
Make sure that the text next to the library filter is right

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Text change, works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10777: email HTML reports with the proper Content-Type

The misc/cronjobs/runreport.pl allows for sending html reports
via email. The problem is that the Content-Type isn't set to
text/html, which means that the generated html email isn't
displayed properly.

This patch set the Content-Type, and also adds a tiny bit of
CSS to potentially alternate row colours (just to make long
reports a bit easier on the eye!)

TEST PLAN
----------
1. Run the script similar to this:
    ./misc/cronjobs/runreport.pl --format=html --to=YOUREMAIL --subject="Bad Formatting!" REPORTNUMBER
2. Look at the email - the html code should by visible and ugly.
3. apply the patch
4. Run the script again.
5. Look at the email - the data should look nicer now.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10777: (follow-up) improve CSS3 for Zebra-striping report email output

This patch improves the CSS used to attempt to Zebra-stripe the
output of emailed reports.  This will work with some email clients,
but other email clients (e.g., Gmail) don't handle style elements in the
body or head element.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11751: remove dead code related to handling members of institution patrons

This patch removes some dead code concerning the handling of patrons
that are members of other, institutional patrons.  This code did not
work; removing it clears the field if somebody wants to do a better
implementation of such relationships between patrons.

This patch:

[1] Removes the memberofinstitution system preference.
[2] Removes the following routines:

    C4::Members::get_institutions()
    C4::Members::add_member_orgs() (and removing this routine
    removes a reference to a borrowers_to_borrowers table that
    does not exist).

There should be no changes whatsoever to system functionality with this
patch (with the trivial exception of the absence of the
memberofinstitution system preference).

Test plan:

[1] Look at the code and use grep, git grep, etc. verify this patch
    does not remove something in use.
[2] Verify that there are no regressions upon adding or editing
    a patron record.
[3] Verify that the memberofinstitution system preference has been
    removed

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11751: DBrev 3.15.00.022

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11170: make the pending order list only display orders to receive

The order status ordered is set when the basket is closed.
The parcel page should only display status "ordered" and "partial".

Test plan:
- create a basket.
- create an order.
- verify the order is not listed on the parcel page (i.e. you cannot
  receive it).
- close the basket.
- verify the order is listed on the parcel page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11170: (follow-up) fix typo 'occured' in parcels.tt

Found this typo while testing bug 11170.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11170: (follow-up) improve a bit of unnecessarily convoluted logic

This patch also adds POD and UT for the change in SearchOrders()

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11755: ensure that SearchOrders returns booksellerid

The SearchOrders routine should return the booksellerid and this
patch adds it.

This fixes several problems:

[1] The link to the vendor on the order receive page breadcrumbs
    was broken.
[2] The tax calculation in finishreceive.pl didn't run.
[3] The item booksellerid field never got updated during
    receipt.

Booksellerid was returned before bug 10723.

Quick test plan:
Go on orderreceive.pl and verify that the vendor link is correct.

Followed test plan. Vendor link is now correct.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10837: make it possible to export serial claims as CSV even when no notice defined

On the serial claims page, it is possible to export (using a CSV
profile) or claim 1+ serials.
The checkboxes are not shown if the claiming notice is not defined.
So it is not possible to export claims.

Test plan:
- delete your notice "claimissues"
- go on the serial claims page
- verify that you are able to export them as CSV

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works as described and enables use of the export
funtionality even if you are not using the email notifications.
Exporting the serials will also set the claim date.
Passes QA script and tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11675: check allocated total correctly when editing a fund that has a parent fund

The sth was created before the query.
The query was modified after the sth creation and an error was raised.

Test plan:
0/ Don't apply the patch
1/ Create a budget A (amount=1000)
2/ Create a fund A1 (amount=1000)
3/ Create a child fund A11 (amount=1000)
4/ Edit A11 and change the amount to 2000
You are able to do it, an error appears in the Koha log:
  "check_parent_total.pl: DBD::mysql::st execute failed: called with 2 bind
  variables when 1 are needed"
5/ Apply the patch, edit A11 and save. You get an error
6/ Edit A11 and change the amount to <=1000
7/ Verify that there is no regression on adding/removing/editing budgets
and funds.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Works as described, no regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11705 - change versioning of build-git-snapshot

This change makes the package versions conform to Debian requirements
for native packages.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10861: Add a check on cardnumber length

Some libraries would like to add a check on the cardnumber length.
This patch adds the ability to restrict the cardnumber to a specific
length (strictly equal to XX, or length > XX or min < length < max).
This restriction is checked on inserting/updating a patron or on importing
patrons.

This patch adds:
- 1 new syspref CardnumberLength. 2 formats: a number or a range
  (xx,yy).

- 1 new unit test file t/Members/checkcardnumber.t for the
C4::Members::checkcardnumber routine.

Test plan:
1/ Fill the pref CardnumberLength with '5,8'
2/ Create a new patron with an invalid cardnumber (123456789)
3/ Check that you cannot save
4/ With Firebug, replace the pattern attribute value (for the cardnumber
input) with ".{5,10}"
5/ You are allowed to save but an error occurred.
6/ Try the same steps for update.
7/ Go to the import borrowers tool.
8/ Play with the import borrowers tool. We must test add/update patrons
and the "record matching" field (cardnumber or a uniq patron attribute)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested adding, updating; importing and ran unit test.
Preliminary QA comments on Bugzilla

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10861: (follow-up) for typo in patrons.pref

I'd rather have a comma than a coma :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Then again, if the cookies are really, really good, a cookie-induced
coma would not be the worst thing.
Bug 10861: (follow-up) various refactoring

This patch refactors the previous code and moves the logic from the pl
to a new routine.

Same test plan as previous patch.

/!\ new unit test filename.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 10861: Reintroduced the cardnumber length check (client side)

Previous patches has removed the pattern attribute of the input, it was
not needed. This patch reintroduces it. It will only work for new
browser version.

Moreover, it manages with the ',XX' format (see UT).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Squashed the last two follow-ups. The pattern test did not work fully for me
in Firefox 26 (very recent). But I see the message when I clear the field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>