Bug 12409: Fix fields order on exporting to bibtex

The C4::Record::marc2bibtex subroutine supposes hashref keys are sorted
which is wrong with perl 5.18

Note that the t/db_dependent/Record.t fails without this patch.

Test plan (for perl >= 5.18 only):
1/ prove t/db_dependent/Record.t should return green
2/ Try to export a record to bibtex and verify the order is correct
(should be author, title, year, published, etc.).

http://bugs.koha-community.org/show_bug.cgi?id=12409

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

Wrong Bug number on heading.
Work as described, test pass, no koha-qa errors.

The problem is to think that a hash returns
keys in a particular order, that's not true
and no matter which perl version.

Code as was left is... misleading.
Comments talks about a hash, which is no more.
On array asignment "a => b" is equivalent to "a, b",
but the former is usually used on hashes, so a
replacement of '=>' by ',' could clarify what are we storing.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixing the comments in a follow-up patch.
Tests pass now without problems and records export ok.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12409: Follow up - Reflect from hash to array in comments

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12151: Remove uses of smartmatch operator in Search.pm and opac-search.pl

This patch removes the use of smartmatch operators in the search code.

Regards
To+

Edit: this revision uses 'grep' instead of Lists::MoreUtils::any

Sponsored-by: Universidad Nacional de Cordoba

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.
Tested search, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12151: Remove uses of smartmatch operator in report scripts

This patch removes the use of smartmatch operators in report scripts.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Acquisition and Patron statistics wizard tested, no regressions found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12151: Remove use of smartmatch operator in tools/batchMod.pl

The '~~' smartmatch operator is used to compare MARC::Field->subfield(code)
(i.e. a string) and the text element of each MARC::Field->subfields() which
is also plain text.

Substituting '~~' for 'eq' should be harmless then.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Tested batch modification of items, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12151: Remove uses of smartmatch operator from Koha/Solr/QueryBuilder.pm

Just that.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Could only verify by reading the code.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12499: adding units tests for C4::Letters

The tests for the subroutines : GetMessageTransportType, EnqueueLetter, SendQueuedMessages, GetQueuedMessages, GetLetters, getletter, addalert, getalert, delalert and GetPreparedLetter of the module C4::Letters have been added.

Test plan:
1) Apply the patch
2) Execute the unit tests by launching :
prove t/db_dependent/Letters.t
3) The result has to be a success without error or warning :
t/db_dependent/Letters.t .. ok
All tests successful.
Files=1, Tests=45,  2 wallclock secs ( 0.04 usr  0.01 sys +  1.44 cusr  0.08 csys =  1.57 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
All test pass, no errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12062: Untranslatable "Reserve not found"

This patch rewrites transfer slip code to make some
strings translatable.
Also simplifies some code and parameters.

To test:
1) Produce a transfer slip, no changes must be noted.

2) Update PO file, new strings
msgid "%s %s%s%sNo hold found%s %s %s "
msgid "%s%s%sNo hold found%s "
msgid "Koha &rsaquo; Circulation &rsaquo; Transfers"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12062: Follow up to fix more untraslatable cases

This patch modifies staff printslip.tt to take into account
caller. Also fixes similar problem on opac printslip.tt

To test:
staff
1. Print hold transfer slip
2. Print transfer slip
3. Print member slip
opac
4. Print self checkout slip

5. Update translation files, check new strings are present

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12062: Follow up - adds missing )

With this patch, patches pass QA script and unit tests.
Tested printing different slips successfully.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12511 - Novelist Select not using https in bootstrap

In prog we have:
[% IF ( NovelistSelectProfile ) %]
<script type="text/javascript"
src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
[% END %]

but in bootstrap we have
[% IF ( NovelistSelectProfile ) %]
<script type="text/javascript"
src="http://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
[% END %]

Because bootstrap isn't using https, we get an error like this:
[blocked] The page at
'https://koha.mylibrary.com/cgi-bin/koha/opac-detail.pl?biblionumber=105315&query_desc=kw%2Cwrdl%3A%20home'
was loaded over HTTPS, but ran insecure content from
'http://imageserver.ebscohost.com/novelistselect/ns2init.js': this
content should also be loaded over HTTPS.

Test plan would require having a subscription to Novelist Select.
I think this is trivial enough to go without.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Very small change, trusting Kyle and the sign-off here.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12495 - Include streetnumber in hold alert address

Steetnumber is not included in the addess in the hold alert add the
field to those displayed

To test this, place a hold on an item that is on-loan, having first made
sure that the requesting user has a value in the street number field of
his address. Check the item in, and an alert should appear giving the
name and address of the requesting user. This address should include the
contents of the street number address field.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

I was able to confirm three of the four template changes for the
following cases:

- Item placed on hold for a patron at the current library, not waiting
- Item placed on hold for a patron at the current library, already
  waiting
- Item placed on hold for a patron at another library, not waiting

I don't know how to trigger the case [% IF ( diffbranch ) %].

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Note: Maybe sample slip templates should also include street number?

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl

Under certain circumstances misc/link_bibs_to_authorities.pl creates
multiple authority with identical heading.

Test plan:
1. Have some (2-3) biblio records with some repeated headings
   Have BiblioAddsAuthorities = allow, AutoCreateAuthorities = generate
   Have no authority records
2. Run misc/link_bibs_to_authorities.pl script
3. You will get multiple authority records -- one for each occurence of a
   heading in biblio record.

4. Apply the patch.
5. Repeat 1-3 (remember to have "fresh" biblios, without $9, and no
   authorities).
6. The problem should be fixed.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as described.
Bug 12429 [staff client] patron seeing fines codes

Bug 2546 introduced translatable handling of Koha account type codes but
missed several codes. This patch adds handling of these codes to the
staff client.

This patch also corrects a couple of instances of incorrect
capitalization.

To test, apply the patch and view fines page (Patron details ->
Fines) and the pay fines page (Patron details -> Fines -> Pay fines).
You should not see any account type codes like CR, LR, or FU.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12429 [OPAC] patron seeing fines codes

Bug 2546 introduced translatable handling of Koha account type codes but
missed several codes. This patch adds handling of these codes to the
bootstrap OPAC.

This patch also corrects a couple of instances of incorrect
capitalization.

To test, apply the patch and log in to the OPAC as a user who has
existing fines and charges. View the "Your fines" page. You should not
see any account type codes like CR, LR, or FU.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11030 : add fields 947,969,359 in unimarc_complete french framework

This patch must be tested on top of bug 11021

This patch adds 3 fields to unimarc_complete french framework
- 359 (2-a-b-c-d-e-f-g-h-i-p-u-v) used by Sudoc network, to be displayed in tab 3
- 947 (c) used by Electre
- 969 (a-h) used by Electre
I don't know the difference between 969a and 969h so I gave them quite the same name

To test :
1) take a fresh Koha with unimarc marcflavor
2) in web installer, select french language, unimarc marflavor and "Grilles de catalogage complètes".
3) check default framework in Administration > MARC Frameworks : it should contains 359/947/969 fields

Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11030 - Add 359, 947 and 969 fields in french unimarc_complete framework - followup

Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
9245 Fixes visual bux with fines tab not highlighting

This patch makes shure that mancredit.pl, maninvoice.pl and pay.pl passes the value "finesview=1" that makes the tab active.

Test plan:
1) Go to a library user and the fines tab. Note that the "Fines" tab loses it's highlight when you click "Pay fines", "Create manual invoice" and "Create manual credit".
2) Install the patch.
3) Redo the first step and make shure that the left menu tab "Fines" is now highlighted all the time.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as advertised, no regression found on the rest of the tabs.
Bug 12332: Fix for tab "Purchase suggestions" not lighting up

This patch changes the file purchase-suggestions.pl with "suggestionsview => 1" for the template parameter.
In circ-menu.inc i changed the condition from "suggestions" to "suggestionsview" since it seemed to conflict with the existing variable suggestions (and in that case only highlighting the tab when there were suggestions).

Please note that I fixed the troubles with the tab "Fines" in a separate patch 9245.

Test plan:
1) Verify that "Purchase suggestions" does not light up as it should when clicked.
2) Install the patch.
3) Verify that the tab "Purchase suggestions" now actually light up when clicked.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as advertised.
Bug 12508: adding an error message if a contract cannot be removed

If a contract cannot be removed, no errors is displayed. Now, it displays an dialog messag error and the list of contracts.

Test plan:
1) Log on with a superlibrarian permission
2) Go on the page acqui/supplier.pl (Acquisitions > Button "New vendor")
3) Record a vendor with a nonzero "name"
4) Go on the page admin/aqcontract.pl (click on the "Contracts" item in the menu)
5) Click on the button "New" > "Contract" and record a new one
6) Click on "New" > "Basket" and record a basket by selectioning the created contract
7) Click on the contract name, then click on the "Contracts" item in the left menu
8) Try to delete this contract, an error is displayed : "Contract has not been deleted. Maybe a basket linked to this contract exists."
9) Delete the basket linked to the contract
10) Delete the contract, no errors is displayed

Signed-off-by: Juhani Seppälä <jseppal@student.uef.fi>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script an tests.
Also tested adding, editing and deleting unused contracts.

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