Bug 11308: fix RSS page in bootstrap theme

To test:
1/ Do a search in the opac, click on the rss feed icon
2/ Notice the page renders, not like an rss feed should
3/ Apply the patch and refresh
4/ Page should now be (more) valid xml

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small change, big difference. With the patch the content of
the RSS feed renders like it does for the prog theme.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 71a3516d211600d35e4ddeef45f5403affc09598)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11283: make restriction type translatable

The new restrictions system has different types:
MANUAL, OVERDUES and SUSPENSION.

Those are shown in the interface and seem to come directly from the
database, so they are not translatable.

As they are hardcoded translations should be possible and be handled in
the template.

Test Plan:
1) Create a patron with one of each type of restriction
2) Apply this patch
3) Note you see the type with only the first letter capitialized,
   this indicates you are seeing the translatable string

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Strings now appear in
updated po files:
  msgid "%s %s Manual %s Overdues %s Suspension %s "

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3a76f4298c0fb298cca0db31b04c0d8d5c028531)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11304: fix display of detail page holdings tab in translated Bootstrap theme

Detail page tabs are not displayed properly because JavaScript is broken
in French. This is due to _(' JS string construction used in place of
_(".

This patch fixes:

  - opac-detail.tt page
  - xt/single_quotes to test bootstrap theme

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

Tested by applying the patch, running translate update, then translate
install. Saw no JavaScript error on the French detail page.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Switches from single to double quotes for translatatable strings.
Unit tests for xt/single_quotes passes now.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1b80e77f84dd864342220b89acd1210ac53a3f70)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11275: make deleteditems.materials be of type text

Bug 7278 has made items.materials of type text.
It must be the same in deleteditems column.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Tested:
- definition of materials now matches between items and deleteditems
- database update works correctly

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The only difference between tables items and deleteditems is
deleteditems.marc
Amended patch: Add a missing SetVersion in updatedb.pl

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8aa6e51b6f684f98077dd1c3df1f847bef8d40ba)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11275: DBRev 3.14.00.002

Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11275: (follow-up) update DBIC schema class files

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2f4b0a5064a97f775ada288d0269c4891589da4c)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11105: wrap places OPAC facet in a span

prog-only OPAC patch.

To test:
Verify places in the facets is wrapped in a span.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template change only, works as expected.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a9900b0d35bcd27483355f19985a9669e1c884e2)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11171: Display basket group name on the supplier list page

Test plan:

Search supplier and verify the basket group column is filled.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c9b873ff10694a9f36d15734bd2bb22e17c604c6)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11171: (follow-up) fix a javascript error

The previous patch adds an error on booksellers.pl:

TypeError: a.aoColumns[c] is undefined

It was caused by the add of the new column. The aoColumns DT parameter
should manage it.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d5281fd41ec4b2f0c497d75550e2c865d96183d8)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11286: fix bug preventing adding a new subfield to an authority framework

Bug 10602 introduces a bug when adding a new subfield to an authority
framework. A new parameter is added in a sql query but the placeholder
is missing.

Test plan:
- edit an authority framework
- add a new subfield
- save
- boom!
DBD::mysql::st execute failed: called with 16 bind variables when 15 are
needed at
/home/home/src/admin/auth_subfields_structure.pl line 454.
- apply the patch and try again

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. No koha-qa errors

Tested trying to add subfield to 100, 2 for example.
Without patch silently fails (but error is logged)
With patch subfield creation or elimination is fine

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
One line fix for a bad bug. Confirmed the bug on master and
the fix. Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3c50683e0d6412b29144962e7f5d539fec28da04)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11214: improve create/edit routing list links in serial collection page

When a subscription has no routing list yet, the page
serials/subscription-detail.pl shows in left menu : "Create routing list".
In serials/serials-collection.pl page, the link in table is always
"Edit routing list", even when there is no routing list.

This patch adds a conditionnal link "Edit routing list"/"Create routing
list" into serials/serials-collection.pl page.

Test plan :
- Create a subscription no. 1 without routing list and a subscription
  no. 2 with a routing list
- Go to serials/serials-collection.pl of subscription no. 1
=> You see "Create routing list" link
- Click on link
=> You see "Create routing list for"
- Go to serials/serials-collection.pl of subscription no. 2
=> You see "Edit routing list" link
- Click on link
=> You see "Edit routing list for ..."

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Functional and automated tests pass. Passes koha-qa.pl.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
With the patch applied the serial collection page shows the
right link depending on the existance of a routing list.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0c631934de5adf5c8d9d35aaaf94a19134f4a166)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 7484: keep selected values when changing search type on authority search form

1) I'm on the "Search authorities" tab. I select an authority type,
   then change the active tab. The type change is lost.
2) I'm on a tab and type a search pattern, then change tab, the string
   is lost.

This behaviour is logical, given the fact that we're using tabs, but it
would be more practical to keep the typed informations when the user
changes the search mode.

This patch add a few JQuery code to synchronise inputs between all
tabbed authorities search forms.

Test plan :
- Go to Authorities home page : cgi-bin/koha/authorities/authorities-home.pl
- In toolbar, "Search main heading" is selected
- Change all inputs : authotity type, operator, term, and sort order
- Click on "Search all headings" tab
=>  Inputs are the same has previous tab
- Click on "Keyword search" tab
=>  Inputs are the same has previous tab

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: Explicitly declare 2 new variables used.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Works as described, Firebug doesn't show any problems with
the Javascript.
Could be useful for other tabbed searches like the start page
as well.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 85642ededaf71b0a67805151937014f42deea2dd)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11183: get rid of some log noise from the OPAC

To test in OPAC:
* With the OPAC System Preference EnableOpacSearchHistory set
  to Keep, a simple search triggers the warning patched on
  line 626 of opac-search.pl
* Selecting a search result item with no Collection Code
  set triggers the warning patched on line 576 of opac-detail.pl
* Have an item with Collection Code. Check that the Collection
  Code shows.
* Collection Code is set by editing an item in the staff client
  (952$8)

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ec206d18980b2438cfe3da9e89455eda319dd8d7)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11242: fix opac-MARCdetail.pl display and warnings

This patch improves the public catalog MARC view display
of records that contain subfields that are not defined in
the framework used by the bib record.

To test:

(RM note: it may be easier to find or create a MARC record that
 contains a subfield not present in the default framework, then
 load it, rather than fiddle with the MARC frameworks in your
 test database.)

BACK UP YOUR DATABASE!
 1) Search for an item in OPAC
 2) Open OPAC detail
 3) Click 'MARC View' link
 4) Look for something with multiple lines (e.g. 260 or 942)
 5) In another tab, Go to staff client and log in
 6) Go to the staff client URL similar to:
     /cgi-bin/koha/catalogue/detail.pl?biblionumber=##### page
    where ##### is the biblionumber.
 7) Edit -> record
 8) Note the framework used.
 9) More -> Administration
10) MARC bibliographic frameworks
11) Click 'MARC structure' for the framework used by the item
     shown in OPAC.
12) Find the tag (e.g. 260 or 942) and click 'Subfields'
13) Delete of the matching subfields (e.g. 260$b) shown in the
     OPAC tab
14) Clear your opac error log.
15) Refresh OPAC tab. The tag subfields are split.
16) There are opac-MARCdetail.pl warnings.
17) Apply patch
18) Clear your opac error log.
19) Refresh OPAC tab. The tag subfields are no longer split strangely.
20) There are no opac-MARCdetail.pl warnings.
RESTORE YOUR DATABASE.

This also silences a series of warnings triggered by catching
undef hash references.

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 38503e18a38116646c9746b13f013b3c11fe55c1)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11059: fix date sorting of import batches in basket add form

This patch improves the sorting of staged import batches by date,
particularly when the dateformat system preference is set to anything
other than YYYY-MM-DD.

Adds title-string sorting type to enable this.

To test:

[1] Ensure that there are at least three staged
    bib import batches, with upload timestamps such that
    date sorting errors would be apparent.
[2] Set the dateformat system preference to either DD/MM/YYYY
    or MM/DD/YYYY.
[3] Create a new basket in acquisitions, then chose to add
    a new order line from a staged record batch.
[4] In the list of batches, click on the 'staged' column
    heading to sort by date.
[5] Observe that dates are sorted in alphanumeric order, not date
    order.
[6] Apply the patch and refresh.  This time, dates should sort
    correctly.

Signed-off-by: Fridolyn SOMERS <fridolyn.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 097a92b3188d62e9797d18313715c35d9dc186b4)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 11059: (follow-up) restore time in staged dates in addorderiso2709.tt

Follow-up patch to restore the display of time in
acqui/addorderiso2709.tt in staged date.
Simply uses an option of KohaDates TT plugin.
This time may be useful if there where several imports in the same day.

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 cfa0dc1aedf3a280f98b9a1728853a6041f59af5)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 2693: add ability to filter by reviewer name on tag review page

If you want to filter results on the tags management page by the
reviewer you have to know their borrowernumber. It would be better to be
able to search by name, but in the meantime this patch adds an
autocomplete widget to the form field so that you can do a name search
and populate the field with the borrowernumber.

To test you must have approved or rejected tags. From the tags review
page (tags/review.pl), view all, approved, or rejected tags. Type a name
in the "reviewer" form field in the left sidebar filter. You should get
an autocomplete dropdown with names matching your search. When you
select one the form field should be populated by the borrowernumber.

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

Patch works as described. I'm not sure whether or not it would be better
to be able to search by name, as that would involve either choosing
between names after applying the filter or showing any possible matches,
so this seems fine.

--

Owen and I did observe that we were able to cause AJAX errors while
using this autocomplete, but we are not 100% sure how we caused the error.
In my case, I was able to occasionally cause it by typing in a name
then backspacing rapidly. The ajaxError method is attached to every
element in the DOM (yikes) so it's tough to say what exactly is the
source of the error (which is signalled by a pop-up window that can be
cancelled).

The error is quite rare so I don't think it's necessarily a problem
for us.

One idea that Owen had was to remove the current error message, which
is very unhelpful and replace it with an error like "Something went
wrong. Try again."

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d536ed92fa6488a37a5e6325acb2b9b12f89ddaf)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 7791: add ability to delete records when deleting a basket

Currently, when a basket is deleted, all the orders are deleted (there
is a foreign key in aqorders table on basketno).

This could be dangerous, and there is no warning.
After the deletion, unused biblios are left in the catalogue.

This patch
- adds a more detailed message describing the consequences of deletion
- give the choice of also deleting biblio records if possible

To test :
Test A :
1. create a basket with 4 orders:
- an order from a new record A
- an order from a record B which has already an item
- an order from a record C used in a subscription
- an order from a record D used in an other order
2. note the biblionumbers of the records used (or open them in other
   tabs in your browser)
3. click on "Delete basket"
4. choose button "Delete basket and orders"
5. check the catalogue : records A,B,C,D should still be there
Test B:
1. create a basket with 4 orders:
- an order from a new record A
- an order from a record B which has already an item
- an order from a record C used in a subscription
- an order from a record D used in an other order
2. note the biblionumbers of the records used (or open them in other
   tabs in your browser)
3. click on "Delete basket"
4. choose button "Delete basket, orders and records"
5. check the catalogue : records B,C,D should still be there. Record A
   should be deleted

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 09953f836de01a68a3117227965719b74f543844)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 7791: (follow-up) tidy up some cruft in the main patch

This patch
- delete warns
- add a missing }
- add a condition in template of avoiding asking to delete orders or
  records if the basket is empty

To test :
1. Make the same tests as defined in test plan of main patch. It should
   behave the same way
2. Try to delete a basket with no records inside. You will only have a
   "Delete basket" button, with fewer warnings

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2c307f3e92d6e4051a37f19bb17f60f45fded9d9)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
Bug 7791: (follow-up) add warning after deletion if some records were not deleted

This followup add some warnings after deletion if some items were not
deleted.

4 types of messages are possible :
- x item(s) attached.
- x subscription(s) attached.
- x order(s) attached.
- Unknown error.

To test :
test a
1. create a basket with
- an order using a record A which has already an item, which is used in
   a subscription, and in other order (in an other basket)
- an order using a record B used nowhere elese
2. click on "Delete basket"
3. choose button "Delete basket, orders and records"
4. you should see a page anouncing basket deletion, and that record A was
   not deleted because of its item, subscription and order.
5. check the link around the title of record B takes you to the record
6. check the link under the warning box ("Click here to go back to
   booksellers page") takes you to booksellers page
5. check record B is deleted

test b
1. suppress the subscription linked with record A
2. create an other basket using record A
3. delete the basket on the same way as for test a
4. you should see a page anouncing basket deletion, and that record A was
   not deleted because of its item and order

test c
1. suppress the item attached under record A
2. create an other basket using record A
3. delete the basket on the same way as for test a
4. you should see a page anouncing basket deletion, and that record A
   was not deleted because of its orderBug 7791 Followup: add warning
    after deletion if some records were not deleted

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit de2bfb6799f718a75eb338490b1cee8f8145b6a8)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>