Bug 7813: Ability to delete local cover images

This patch adds the ability to delete local cover images from the
detail page. It adds an 'X' button to trigger the deletion. It occurs
using a new SVC script called cover_images that accepts the following
parameters:

 - action
 - biblionumber (used for checking imagenumber validity)
 - imagenumber (repeatable)

It then deletes all valid images passed and returns a JSON object
containing the imagenumbers and the deletion status (1/0). The operation
is triggered using jQuery.ajax, and with the response the corresponding
images get deleted.

Note: currently one image is deleted at a time, but the code is there to
be used.

To test:
- Open the detail page fr a biblionumber containing one or more cover
  images, go to its images tab.
- Apply the patch, reload the page, go to the images tab.
- Thumbnails should look better than before ;-)
- An 'X' button should show below each cover.
- Clicking the 'X' button should trigger an alert message asking for
  confirmation.
 a) Cancel: nothing happens, reload the page and check nothing got
    deleted.
 b) Accept: the deleted image should be gone, reload the page to check
    it doesn't exist anymore and is not a browser/DOM manipulation trick.
- Signoff

Note: check having more cover images than those that fit the width and
see it wraps fine.

P.S. I chose not to implement every possible action on the svc script, but
another bug could be filled for more improvements.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ab362b93a710bddcd385a6a468af6ff682673367)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7813: (follow-up) improvements for deleting local cover images

This patch:
- displays a js alert if a problem occurred on deleting the
  image on the server.
- adds a class for the new span (in order to avoid future problem, if
  someone adds a new span).
- adds a title for the [X] link.
- deal with the upload_local_cover_images permission (don't display the
  delete link if the logged in user does not have it).
- changes the license version.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
I like the ehancements to the original patch and work as expected.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1dc7d421bc87e3cf027161b08fbb44875c778f49)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7813: (follow-up) use descriptive text for delete link

This patch replaces the "times" symbol for the local cover image
deletion link with more descriptive text.  This was done because
the original "X" was small, is not necessarily going to be universally
understood to signify the deletion action, and because "&times;"
does not give much context to translators.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit fe3628070a7affddb691ee589ec0e63639d0a36a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10888: Don't hide authorities module from users who lack permission to edit authorities

It should be possible for staff client users to search and view
authority records even if they don't have permission to edit them.

To test, apply the patch and view the staff client as a user with and
without "editauthorities" permission.

With "editauthorities" permission, authority search results should show
both an edit and delete link. Viewing the details of an authority
record, one should see a toolbar with edit/delete/new options.

The detail view has been altered to use the term "record" in place of
"biblio" ("Used in X record(s)).

Without "editauthorities" permission, authority search results should
show no edit or delete link. Viewing the details of an authority, the
only option shown in the toolbar should be "Save."

On the staff client home page and in the header's "More" menu the link
to the authorities module should now appear with and without permission
to edit authorities.

This patch also corrects the permissions in the authority export script
to allow saving of authority records by users who do not have permission
to edit.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 9bd3a44944e6a0cb7920c3c53a88c11a8986b146)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10305 - _increment_barcode is called twice

For some reason, _increment_barcode is called twice in succession in
cataloguing/additem.pl

Test Plan:
1) Enable autobarcode = incremental
2) Catalog an item, not the barcode
3) Apply this patch
4) Catalog another item, the barcode should be the next in line
   as previously. No change should be noted.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 449fc4e168368cc3b1991152f32a2862b578a04c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10847: Open link to vendor's website in new window

To test:
- Create a new vendor or edit an existing one
- Make sure you have entered a valid URL for the website
- Click the link from the vendor summary page and verify it opens
  in a new window/tab (depending on your browser configuration)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d67ef01814fb4ba1519d66d9ad749dfa64e62a76)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10465: remove useless reference to fields 780 and 785 in UNIMARC XSLT files

UNIMARCslim2OPACDetail.xsl and UNIMARCslim2intranetDetail.xsl contained
references to 780 and 785 fields, that exist in MARC21 but not in UNIMARC.

This patch remove the code related to 780 and 785 fields. No effect should
be visible.

To test : in a UNIMARC Koha
1. Be sure that OPACXSLTDetailsDisplay, OPACXSLTResultsDisplay,
   XSLTDetailsDisplay and XSLTResultsDisplay sysprefs are set to "default"
2. Apply the patch
3. Search some records in staff interface : the list view and the detail
   view must be exacty the same as before you apply the patch.
4. search some records in OPAC : the list view and the detail view must
   be exactly the same as before you apply the patch.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: No diplay change, no koha-qa errors.
Removes what can't be displayed.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Checked detail pages in OPAC and intranet still display correctly
and without errors.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 54befcf59ed85be0041d72760eb1771bcce0492e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10911: fix invalid links when displaying records that have 880 fields

Koha intranet search results using XSLT for records with 880 fields have
the details link created by a code path that incorrectly links to some
opac pages.

Test Plan:
1) Enable XSLT for intranet search results
2) Upload or create a record with at least one 880 field
3) Search for the item ( must have multiple hits to avoid redirection )
4) Click the title link, note it is broken
5) Apply this patch
6) Click the title link, note it is correct

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

Test
1) imported two times sample record
2) reindex
3) search, find example record, broken links
4) applied patch
5) refresh, good links

NOTE: A similar (invalid references) problem is present on
UNIMARC and NORMAC files
I'll file a new bug for those cases.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, tested with a different set of sample
records with Hebrew 880 fields.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 115a3e6b60cab0e5000483575ca69736bb40ee2c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10924: fix updating contact note from OPAC

If you update your "Contact note" via the OPAC that change doesn't
appear in the staff client's "Update patron records" interface. The
field is missing from members-update.tt

To test, log in to the OPAC and update your details
(opac-memberentry.pl), modifying the "Contact note" in the "Alternate
address" section.

In the staff client, view "Patrons requesting modifications"
(members/memgers-update.pl). The changed contact note field should
appear in the list of field awaiting approval for that patron.

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
One line change - contact note now updates perfectly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4713a27280b9ee0956c4f2d9ee0e63b12260db01)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10803: make "Make payment" in circ easier to translate

To test:
- Choose a patron account
- Add a fine to it
- Switch to the checkout tab of the patron account
- Check for the "Make payment" link. Make is not a link, but payment is.
- Apply patch
- Check again, now both words are linked.

In translation this string is divided into:
. %s Make
payment

Because of this it's difficult to translate it grammatically.
The patch moves 'Make' into the link text, so that both words
will show up together in translation.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Works as described. No koha-qa errors.
Not only improves translatability,
also corrects capitalization.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 39c435e36fec65dbba795214bdde79932bb4edcf)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10687: Delete erroneous tags 68a and 68b on default MARC21 auth framework

This patch deletes information for default
MARC21 auth framework on tags 68a and 68b.
Also added update for current installs.

RM note: The 68a and 68b fields were defined in an attempt to include
both MARC21 classification and MARC21 authority records in the same
default framework, but I don't think this has turned out to be useful,
as to my knowledge nobody tries to use MARC21 classification records
in Koha, and if one were to want to, a distinct record type (or at
least auth_type) would be a better way to do it.

To test with current authorities_normal_marc21.sql loaded

1) apply the patch
2) run updatedatabase
3) check on database that there are no more
references to tags 68a and 68b

To test for new installs
1) remove auth frameworks
2) load authorities_normal_marc21.sql
3) check that load without problem
4) check on database that there are no more
references to tags 68a and 68b

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 15f28461e09cffe2917f424b8b7e84cd722b1246)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10687: (follow-up) remove authority 68a/68b tags from translated MARC21 framework scripts

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a1c5d280f67a632ab9e1fdd32cf4967c3de6fdd6)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10687: DBRev 3.12.06.001

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10663: (3.12.x followup) Rewrite some calls as unit tests rely on newer API

Some tests fail in t/db_dependent/Circulation.t because of API difference.
This patch is a followup for 3.12.x.

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Bug 9299: fix LDAP login breakage when ExtendedPatronAttributes is on

To test:
- Configure an LDAP server and $KOHA_CONF, etc.
- Make sure ExtendedPatronAttributes is defined and that
  there is no attribute defined that is specified to be
  a unique ID.
- Try to log in using an account originating from the
  LDAP directory.
- You will got a software error:
  Can't use an undefined value as an ARRAY reference at
  /home/koha/src/C4/Auth_with_ldap.pm line 183.
- Apply the patch.
- Try to log in again; this time it should work.

Signed-off-by: Nuño López Ansótegui <nunyo@masmedios.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4d75243e27cab93cd84ee6bbfd71362326569c21)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10925: fix LDAP auth failing if DEBUG is enabled

To reproduce:
1/ Edit your apache virtual host and set the DEBUG environment variable
(SetEnv DEBUG 1).
2/ Try to login with an ldap user
3/ You will be redirected to the 500 error page.
The Koha logs contains:
malformed header from script. Bad header=------------------------------: mainpage.pl

The hashdump routine directly prints to STDOUT (!) and breaks the
headers.
It appears Net::LDAP::?->dump does the same thing.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Maybe we can kill C4::Utils after getting rid of this

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 561107bb5b348eaa14054e3470f39ff9cf080d22)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10967: fix minor POD error

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

No koha-qa errors.
Fixes problem, but I think is better to remove
=back than to add nother =over 4, but I'm not
a POD expert

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 520244503eaf42636e13cf8a44789c7cadd0445e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 5645: improve converting simple search to Z39.50 search

This patch builds on the patch for bug 10742 by ensuring
that when a search initiated from the staff interface simple
search returns results, if you click on the Z39.50 search
button, the search form is populated with the search string
without "kw,wrdl".

To test:

[1] Perform a search in the staff interface that will return
    results.
[2] Click the Z39.50 search button.
[3] Observe that the search string appears in the title
    field in the Z39.50 search form, but with a prefix of
    "kw,wrdl".
[4] Apply the patch.
[5] Repeat steps 1-2.  This time, the search string appears
    without the index prefix.  This will make the Z39.50 search
    much more likely to work.
[6] Repeat steps 1-2, but with a search that does *not* return
    any hits in the Koha database.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f791dd4770e84a82e15823b055707b15b461d24b)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10948: make reference labels translatable in OPAC auth results

For some reason the translator script was not picking up the see also
and used for/see from labels on the OPAC. This patch fixes the problem.

To test:
1) Apply patch.
2) Generate PO files.
3) Note that "see from" and "used for/see from" appear.
4) Sign off.

Signed-off-by: Nuño López Ansótegui <nunyo@masmedios.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, thx for the fix.
Tested by updating the German po files, translating the
strings and installing the templates.
Verified strings show up in German in the authority
result list.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit bd5aec76494a10b6c908924b3a421f7ce08224f1)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7764: rework the INSTALL.ubuntu instructions

This is a major rework. Key improvements include:
- Removed confusing multiple versions for Ubuntu leaving only one set
  of instructions.
- The packages koha-deps and koha-perldeps are used.
- License has been updated to reflect GPL3.
- More wiki reference links have been included.
- It is aimed to be based on source, not just tarball or just git.
- Sample output has been cut as much as possible.
- Almost cut-and-paste easy, making it friendlier than INSTALL.debian.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed a tiny typo: seperate
Makes all sense to me - only wondering a bit about the recommendation
of using lynx for the web installer.
Quite an improvement, so passing QA.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c63770d81581080a9c714172fd36ceb86c08062d)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>