Bug 8307: Set a value for subfields when receiving

If items are created when ordering, this patch allows to add a value for
some items subfields.

Test plan:
Define status for items.notforloan (mapping 995$o in unimarc), for
example 4:On order, 5:On treatment

Set the Syspref AcqCreateItem on "ordering".

ACQ framework : set default value = 4 for 995$o (in unimarc)

Syspref AcqItemSetSubfieldsWhenReceived : set "o=5|b='foo bar'"

When ordering the item, default status will be 4 ; when receiving the
item, status will be changed from 4 to 5. The subfield b have to contain
'foo bar'

Signed-off-by: Frederic Durand <frederic.durand@unilim.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 8307: QA Followup for finishreceive.pl

Only split the expression a=b on the first = sign.
Tested with the very unlikely z=x=1 :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 9044: (follow-up) fix merge conflict typo that broke this script

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8307: DBrev 3.13.00.041

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9218: fix intranet cart email for non english templates

This patch adapts the method from OPAC to the staff interface (cf bug 8062).

Test plan:
- add somes notices to the cart
- try to send the cart by email
- the email should be the same as before
- translate templates and retry with another language. Before this patch,
  the email was empty. With this patch, it contains the list of records
  and items.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Passes all tests and QA script.
Fixes quite a bad translation problem, tested with German templates
and umlauts in the message and records.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9780: restrict the ability to delete a bib record associated with an order

Currently, anyone can delete a record used in an order.

With this patch, only librarians with managing order permission
can delete it if it is used in an active or a deleted order.

This patch also add a specific warning informing that deleting a record
used in an active order is dangerous.

To test :
A. test what can do and see a librarian with order managing rights
0) Connect to Koha with a borrower with order managing rights
1) in a basket, create 2 orders A & B from new records
2) delete order B
3) in the catalogue, try to delete
- record used for order A : you should see a specific warning
   informing you the record is used in 1 order, and that deleting it
   is dangerous
- record used for order B : you should see a specific warning informing
  you the record is used in 1 deleted order
- a record not used in any order : you should see no specific warning

B. test what can do and see a librarian without order managing rights
4) Connect to Koha with a borrower without order managing rights
5) in a basket, create 2 orders A & B from new records
6) delete order B
7) in the catalogue, try to delete
- record used for order A : you should see a specific warning informing you that
   you need specific rights to delete the record
- record used for order B : idem
- a record not used in any order : you should see no specific warning

Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9780: (follow-up) suppress line feeds in javascript

This patch suppress \n in javascript, in order to keep Pootle quiet.

String patch, no need to test I think.
But if you want to test, replay the test plan of main patch, and check
the messages in javascript alert are displaying the right way.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9374: Only 0.00 prices must have class error in basket.tt

A regexp '^0' in basket.tt is used to give the class "error" to null prices.
It is wrong, because it matches prices like "0.15". It should only match "0.00".

To test :
- apply the patch
- display a basket with an order with a price between 0 and 1 (like "0.50") and an order with a price stricty null ("0.00")
- only the "0.00" price should be displayed in red

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9374: The color should manage all zero format.

The format of prices in Koha is discuted in some bugs (e.g. 9410).
The good way will be to introduce a syspref in order to deal with the
number of decimal.
The previous patch is too restrictive, we should deal with other zero
format.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9374: (follow-up) add FIXME suggesting that use of a regexp is not the long-term solution

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7684: multiple fixes for inventory

* when a file was uploaded and the comparison with catalogue range
 requested, the comparison was wrong: the logic was wrong
* items that were not supposed to be scanned (ie: supposed to be on another shelf)
  didn't had the author and title, it was hard to retrieve them on the shelved
* some useful fields were missing, like homebranch, location, status
* the CSV export contained all the item information. It should contain the same
   informations as the screen

Behaviour now:
   * scan a list of barcode & select a range of location
   * if a barcode has been scanned and should not be (misplaced item),
       the information is displayed
   * if you choose "compare barcodes list to result option", the
     resulting list contains all items that have been scanned and those
     that were supposed to be. Any item not in both list appears with a
     specific message on the last column

Signed-off-by: Leila <koha.aixmarseille@gmail.com>
Signed-off-by: Koha Team Amu <koha.aixmarseille@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7684: QA Followup and bugfixes

This followup fixes some QA issues:
- replace the MySQLism SQL_CALC_FOUND_ROWS
- use Koha::DateUtils instead of C4::Dates
- replace "branch" and "location" with "library"
- fixe wrong capitalisation on "Clear all" and "Select all"

and fixes some behaviors:
- the inventory tools can be used without barcode file (fixed for the
  csv export too).
- mark as not scanned a non scanned item.
- update the datelastseen 1 time per biblio (and fixes the displayed
  count)

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Koha Team Amu <koha.aixmarseille@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7684: (follow-up) fix crash when generating the CSV

The cgi argument in missing for routine
C4::Reports::Guided::_get_column_defs. It causes a crash on generating
the CSV file.

Signed-off-by: Koha Team Amu <koha.aixmarseille@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7684: (follow-up) use datatables.inc

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7684: (follow-up) fix UTF-8 encoding problems in CSV export

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10720: fix issue that prevented use of HTML tags in overdue notices

Substitution term in overdue notices shouldn't be removed if they don't match.
It prevents use of HTML in notices to use with CSS.

Test plan :
- define an overdue notice containing some valid substitution terms + some valid html tags (<strong> or <div class="my class" to use with a css
- find a borrower with overdues that trigger this notice
- run overdue_notices.pl -html <directory>

Without patch, your html tags are missing in your html file
With the patch, they are present and can be used with a css to generate a formatted pdf file.

If you add some invalid substitution term, with the patch, they are still in the final letter, but the warn in the log helps you to correct your notice template.

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>
Bug 11033: Make Save button and Cancel link always visible on basketgroup page

This patch suppresses the first CSS declaration in basketgroup.tt. It was
unneeded, and was the cause of the Save button and Cancel link not
being visible if the bar for changing language was activated.

To test :
1. activate the "language" syspref, with at least 2 languages
2. open a basketgroup : the 'Save' button and 'Cancel' link are now visible
   at the bottom of basketgroup page
3. Check you can use the basketgroup as before : put a basket in it, cancel, save etc.

Signed-off-by: Koha Team Amu <koha.aixmarseille@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11132: don't clear the results list upon adding a biblio to a list

A "busc" param is cleared if the template name is not opac-.*detail.tt.
So if a user adds a biblio to a list, he cannot continue to browse
results.

Test plan:
- launch a search at the OPAC (opac-search.pl).
- click on a result and browse results (using previous/next links).
- a title attract your attention and you add it to a list
  ("Save to yours lists" link on the right).
- save the list.
- browse again results.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan, also checked some other pages and actions
accessible from the detail page.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8307: (follow-up) fix discrepancy in name of the new syspref

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10403: (follow-up) fix test to use vendor created earlier during test

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