Bug 10431 - Spanish Zebra character sorting file

This patch provides a definition file for Spanish (es) character
sorting in Zebra. It is based on the ideas from Hugo Agud <hagud@orex.es>
and Pablo Bianchi <pablo.bianchi@gmail.com>.

Makefile.PL is fixed to notice the existence of the 'es' language. The
docs for koha-create are touched too.

To test:
Tarball
=======
- Go through the install process, choosing 'es' for the Zebra's language step
- Koha should work as usual.
- Running this should show the lang definition is properly set.
$ grep -R "lang_defs/es" /etc/koha/*
(stuff like zebradb/zebra-biblios-dom.cfg:profilePath:...etc/koha/zebra/lang_defs/es... should show)
- This file should be present:
 /etc/koha/zebradb/lang_defs/es/sort-string-utf.chr

Packages
========
- Build your own package, it shouldn't break the packaging
- Try the new package, using koha-create to set an instance using --lang 'es'

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10431 - Redundant mappings removed

There were 5 redundant mappings left in the file. They are removed.
Its almost a QA followup as everything went fine anyway.

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10474: Translate some English strings in German sample notices

This translates 2 strings missed doing the initial translation in
ISSUESLIP.

To test:
- Run the web installer in German.
Altnernatively:
- Truncate your letters table and run the SQL against the database.

Check that the notices were added correctly, especially ISSUESLIP.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 5894: Display all titles when confirming copy of items from cart to list

Adds missing code that splits biblios before calling template.

To test:
- Add some items to cart
- Open cart, select some or all items
- Add to list; with patch, following window shold show something
  like "Add 3 items to a list:", followed by list of items

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9113: fix handling of certain characters by item batch modification tool

If you're using the batch modification tool and entering a call number
like "E+ 123 ABC", the tool removes the + and puts a space in its place,
e.g., "E  123 ABC"

This is because the form is posted via Ajax by background-job-progressbar.js.
Values are URI-encoded using escape(), but this method does not escape some
characters: * @ - _ + . /

Also, "+" is considered as a space in a URI.

This patch replaces escape() by encodeURIComponent() which encodes every character.

Test plan :
Perform an items batch modification by setting '* @ - _ + . /' in a field
(notes for example) and see that all characters are saved correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9533: batch item modification form now shows default field values only by request

This patch makes the pre-population of the fields for the batch
item editor with the default values from the default framework
optional and off by default.

Test Plan:
1) Apply patch
2) Add default values for cost and replacement cost to the
   default framework.
3) Browse to Tools / Batch item modification
4) Choose a file, or entire some barcodes in the text area
5) Ensure that the 'Populate fields with default values from default
   framework' is *not* checked
6) Click 'Continue'
7) Observe that the fields for cost and replacement cost are blank
8) Click the 'back' button on your browser
9) Check the checkbox to enable the default value
10) Click 'Continue'
11) Observe that the fields for cost and replacement cost now contain
    the default values you assigned them in the default MARC framework

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Switch works correctly, all tests and QA script pass.

Note: there is a bug with default values for all non text input
fields. Default values won't be applied for those fields as the
pull downs are not preselected correctly with the default values
defined in the framework.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10384: fall back to normal authentication if LDAP server is not available

This fixes a bug where, assuming LDAP authentication is enabled, if a user
tries to log in while the LDAP server is down, the following fatal error
is displayed:

Can't call method "bind" on an undefined value at C4/Auth_with_ldap.pm line 134, <DATA> line 558.

This patch catches this error to allow normal authentication when LDAP connexion fails.

Test plan :
- Configure LDAP connexion with a host not having LDAP. ie :
 <useldapserver>1</useldapserver>
 <ldapserver id="ldapserver">
    <hostname>localhost</hostname>
    <base>dc=test,dc=com</base>
    <user>cn=Manager,dc=test,dc=com</user>
    <pass>passwd</pass>
    <replicate>0</replicate>
    <update>0</update>
    <auth_by_bind>0</auth_by_bind>
    <mapping>
      <firstname    is="givenname"      ></firstname>
      <surname      is="sn"             ></surname>
      <branchcode   is="branch"         >MAIN</branchcode>
      <userid       is="uid"            ></userid>
      <password     is="userpassword"   ></password>
      <email        is="mail"           ></email>
      <categorycode is="employeetype"   >PT</categorycode>
    </mapping>
 </ldapserver>
- Try to connect with mysql user (defined in koha-conf.xml)
- Try to connect with a user defined in borrowers
You may try to connect with working LDAP connexion

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10317: improve display when order receiving page is given an invalid invoiceid

This patch fixes some things on the order receiving/parcel page.

1/ Removes dead code
2/ Displays an error message if invoiceid is unset or does not refer to an
invoice
3/ Fixes a bug in the note ("change note" and "add note" links)

Test plan:
1/ Try to call the invoice page with an existing invoiceid and check
that order results are consistent.
2/ Try without invoiceid or a bad invoiceid and check that an error
message is displayed.
3/ Add and change notes.

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely for all tests done.
- parcel.pl with invalid invoicenumber gives a nice error message
- parcel.pl with a valid invoicenumber looks normal
- changing and editing order notes works well

Passes QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10390: Add ability to delete empty invoices

There is currently no way to delete unused invoices (for example,
invoices created by mistake), and there really should be, since errors
and absent-mindedness can result in numerous empty invoices over the
course of years.

To test:
1) Apply patch.
2) Create three invoices in the Acquisitions module. For one of them,
   receive at least one item. For the other two, do not receive any
   items.
3) View one of the invoices that does not have any items on it.
4) Try to delete it. This should succeed.
5) View the invoice that has an item. There should not be any option
   to delete it.
6) Do an invoice search that brings up the other invoice with no items
   on it. Try to delete it from the results page. This should succeed.
7) Run the unit test:
   > prove t/Acquisition/Invoice.t
8) Sign off.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass. I also did another test:

I cancelled all receipts from an existing invoice and then could
successfully delete it in the last step.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10390: (follow-up) correct description of a test

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10366: Alert librarian if an invoice number is duplicated

Some vendors ship materials from the same invoice in multiple packages.
In those cases, it would be good to notify the librarian when they enter
a duplicate invoice number, so that they can continue receiving on the
previously-created invoice, rather than creating an invoice with a
duplicate number.

To test:
1) Apply patch and run database update.
2) Make sure that you have created at least one invoice on
   acqui/parcels.pl and take note of the invoice number.
3) Try to create an invoice with the same invoice number.
4) Note that without changing your configuration this works exactly
   the same as before.
5) Turn on the AcqWarnOnDuplicateInvoice system preference.
6) Try to create a new invoice with the same number as the one you
   noted earlier.
7) Make sure you get a warning about a duplicate invoice.
8) Choose to receive on the existing invoice.
9) Confirm that you are receiving on said existing invoice.
10) Start the receiving process over, and this time choose "Create new
    invoice anyway."
11) Confirm that you are now receiving on a new invoice.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

I have followed the test plan, but also checked some more things:
- Checking the duplicate check works when you have the entered
  invoice number in your database multiple times already.
- Checking that no duplicate message is shown if you enter the
  invoice number and it's already been used for an invoice from
  another vendor.

Looks all good. I think the only thing we could argue about here
is if this could be activated by default for new installations.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10366: DBRev 3.13.00.010 - add AcqWarnOnDuplicateInvoice syspref

Signed-off-by: Galen Charlton <gmc@esilibrary.com>