koha.git
8 years agoBug 14634: Warns when placing hold on record with no items
Aleisha [Mon, 3 Aug 2015 02:23:29 +0000 (02:23 +0000)]
Bug 14634: Warns when placing hold on record with no items

To test:

1) Create a new record in Cataloguing
2) When done, instead of adding an item to the record, click on the Holds tab in the left nav
3) Notice warns
4) Apply patch and refresh page
5) Click on Holds tab again
6) Notice warns are gone and page still works

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Warns disappear; note that the display of the error message is still ugly.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13791: (RM followup) Add new dependencies for packaging
Tomas Cohen Arazi [Thu, 27 Aug 2015 16:13:38 +0000 (13:13 -0300)]
Bug 13791: (RM followup) Add new dependencies for packaging

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 11190: sitemap.pl -- Generate a Catalog sitemap
Frédéric Demians [Sun, 3 Nov 2013 16:05:38 +0000 (17:05 +0100)]
Bug 11190: sitemap.pl -- Generate a Catalog sitemap

Add a script sitemap.pl to process all biblio records from a Koha
instance and generate Sitemap files complying with this protocol as
described on http://sitemaps.org. The goal of this script is to be able
to provide to search engines direct access to biblio records. It avoid
leaving search engine browsing Koha OPAC and so generating a lot of
traffic, and workload, for a bad result.

Thanks Magnus for testing, and helping to improve the script design.

[2015.04.16] Switch from Moose to Moo.

[2015.08.20] Add complete (more) UT.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
All options to the script work as expected and the output looks
good. Nice enhancement!

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
I signed-of my own patch after fixing various QA errors.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: replace tabs with spaces.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14557: Add holds count to holds tab
Kyle M Hall [Fri, 17 Jul 2015 11:37:33 +0000 (07:37 -0400)]
Bug 14557: Add holds count to holds tab

Some librarians have expressed that it would be helpful if the holds tab
displayed the count of holds for a record.

Test Plan:
1) Apply this patch
2) Note the Holds tab for a record now displays the number of holds for that record

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14557: Clean up biblio-view-menu.inc
Kyle M Hall [Fri, 17 Jul 2015 11:35:28 +0000 (07:35 -0400)]
Bug 14557: Clean up biblio-view-menu.inc

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14714: Add tab-completion to koha-mysql command
Tomas Cohen Arazi [Mon, 24 Aug 2015 18:44:22 +0000 (15:44 -0300)]
Bug 14714: Add tab-completion to koha-mysql command

This patch introduces tab-completion in bash to the koha-mysql
command. It completes using valid instance names. It stops completing
once an instance name is chosen (i.e. it respects the fact that
koha-mysql accepts only one instance name as parameter).

To test:
- Have a packages install (kohadevbox works)
- Run:
  $ . debian/koha-common.bash-completion
- Type
  koha-mysql <tab>
=> SUCCESS: You are prompted valid instance names for completion.
- Sign off :-D

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14361: koha-restart-zebra fails and probably breaks upgrade
Benjamin Rokseth [Mon, 8 Jun 2015 09:12:03 +0000 (11:12 +0200)]
Bug 14361: koha-restart-zebra fails and probably breaks upgrade

This patch fixes the koha-restart-zebra and koha-stop-zebra scripts
by adding pidfiles folder to the test is_zebra_running.
It also adds pidfiles to the test is_indexer_running so that
koha-rebuild-zebra will work properly.

Test plan:
1) check if zebrasrv is running, get pid of zebrasrv
   ps ax | grep zebrasrv
2) In my case, there was also a warning on the about.pl page on a fresh
   install: Error message from Zebra: 1011 (bad credentials)
3) try to restart zebra
   koha-restart-zebra instancename
   You will get a msg :
   Zebra does not appear to have been running for instancename
   Starting Zebra server for instancename
4) check again if zebrasrv is running
    ps ax | grep zebrasrv
   and see that pid has not changed, thus it is not restarted
5) Apply patch
6) repeat 4) and watch now how pid has changed
   If there was a warning on about.pl it should now be gone

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Good catch Benjamin! It works as expected with the patch.

8 years agoBug 12632: (regression tests) Unit Tests
Kyle M Hall [Wed, 14 Jan 2015 16:42:29 +0000 (11:42 -0500)]
Bug 12632: (regression tests) Unit Tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 12632: Hold limits ignored for record level holds with item level itemtypes
Kyle M Hall [Fri, 22 Aug 2014 17:29:28 +0000 (13:29 -0400)]
Bug 12632: Hold limits ignored for record level holds with item level itemtypes

The crux of the issue is that if you are using item level itemtypes, but
are allowing biblio levels holds, those holds do not have items.

So, in CanItemBeReserved, when Koha counts the number of holds to
compare against the given rule, it will always give 0 ( except of course
for found holds, and the occasional item-level hold ).

So the query is saying "link each of these reserves to the reserved
item, and count the number of reserves this patron where the itemtype is
DVD". However, since these are all record level reserves, there are no
items to link to, and so when it looks for all reserves this and item
whose itemtype is DVD, it finds zero reserves!

This patch solves the problem by looking first at the item level
itemtype, and if it does not exist, then it looks at the record
level itemtype. For installations using record level itemtypes, the
behavior remains unchanged.

Test plan:
1) Enable item level itemtypes
2) Create two records with one item each of a given itemtype
3) Create a single issuing rule and limit the holds allowed for that
   itemtype to 1
4) Place a record level hold on your first record
5) Attempt to place a record level hold for the same patron on your
   second record. You should not be able to but you can!
6) Apply this patch
7) Repeat step 5, note you can no longer place the hold!

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 7143: Add Benjamin Rokseth to the projects history file and about page
Tomas Cohen Arazi [Tue, 25 Aug 2015 14:32:11 +0000 (11:32 -0300)]
Bug 7143: Add Benjamin Rokseth to the projects history file and about page

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 years agoBug 7143: spaces in history.txt instead of tabs break display on website
Liz Rea [Mon, 3 Aug 2015 22:18:22 +0000 (10:18 +1200)]
Bug 7143: spaces in history.txt instead of tabs break display on website

This may be the only place in koha where a tab should be a tab and not 4 spaces.

I'll try to fix the script that does the conversion for the website to handle 4 spaces instead of tabs, but for now can we have this?

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 years agoBug 9809: DBRev 3.21.00.19
Tomas Cohen Arazi [Wed, 26 Aug 2015 13:37:17 +0000 (10:37 -0300)]
Bug 9809: DBRev 3.21.00.19

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: Remove one more occurrence of reserveconstraints
Jonathan Druart [Tue, 25 Aug 2015 11:31:09 +0000 (12:31 +0100)]
Bug 9809: Remove one more occurrence of reserveconstraints

This file is not updated, but no need to keep on occurrence of an
nonexistent table in it.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: Fix pod errors
Jonathan Druart [Tue, 25 Aug 2015 11:28:09 +0000 (12:28 +0100)]
Bug 9809: Fix pod errors

 FAIL   C4/Reserves.pm
   FAIL   pod
                 in file C4/Reserves.pm
                *** ERROR:
                Spurious =cut command

Test plan:
perl -e "use Pod::Checker;podchecker('C4/Reserves.pm');"
Should not return any errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: [QA Follow-up] Still found some remains
Marcel de Rooy [Mon, 24 Aug 2015 11:50:08 +0000 (13:50 +0200)]
Bug 9809: [QA Follow-up] Still found some remains

In the staff client we had still some remains referring to the
constraint types.
Also touched one comment line from SIP.

Test plan:
Add a hold in the staff client.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: [QA Follow-up] Remove constrainttype from 14464 tests
Marcel de Rooy [Mon, 24 Aug 2015 06:54:39 +0000 (08:54 +0200)]
Bug 9809: [QA Follow-up] Remove constrainttype from 14464 tests

Some additional unit tests of bug 14464 still included a constraint
in the AddReserve calls.

Test plan:
Run Reserves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: [QA Follow-up] Remove an erroneous call to GetReserveFee
Marcel de Rooy [Fri, 21 Aug 2015 08:47:19 +0000 (10:47 +0200)]
Bug 9809: [QA Follow-up] Remove an erroneous call to GetReserveFee

The call to GetReserveFee in opac-reserve.pl is useless in its current
form. The first parameter undef takes care of receiving 0.
But note that the user is warned correctly for the charge via param
variable RESERVE_CHARGE on the opac form.

When the hold is placed, AddReserve calls GetReserveFee. So if the routine
would work correctly, we would not need this extra call in opac-reserve
in the whole place. Unfortunately, the routine is not working correctly.

I will submit a fix for GetReserveFee under a new report (14702).

Test plan:
[1] Add a hold fee to some category.
[2] Check the warn for placing a hold on such a book in OPAC.
[3] Observe that the actual fee is not charged. This is a current bug and
    it will be addressed on report 14702.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: [QA Follow-up] Remove warnings from Hold.pm
Marcel de Rooy [Fri, 21 Aug 2015 07:23:53 +0000 (09:23 +0200)]
Bug 9809: [QA Follow-up] Remove warnings from Hold.pm

Resolves two warnings on a uninitialized found column:
holds: Use of uninitialized value in string eq at /home/koha/testclone/Koha/Hold.pm line 53., referer: http://test.rijkskoha.nl:28080/cgi-bin/koha/circ/circulation.pl?borrowernumber=152
holds: Use of uninitialized value in string eq at /home/koha/testclone/Koha/Hold.pm line 74., referer: http://test.rijkskoha.nl:28080/cgi-bin/koha/circ/circulation.pl?borrowernumber=152

Test plan:
Run t/db_dependent/Hold.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: Update AddReserve prototype to remove constraint parameter
Kyle M Hall [Tue, 30 Jun 2015 12:19:29 +0000 (08:19 -0400)]
Bug 9809: Update AddReserve prototype to remove constraint parameter

Test Plan:
1) Apply this patch set
2) prove t/db_dependent/Circulation.t
3) prove t/db_dependent/Holds.t
4) prove t/db_dependent/Holds/LocalHoldsPriority.t
5) prove t/db_dependent/Holds/RevertWaitingStatus.t
6) prove t/db_dependent/HoldsQueue.t
7) prove t/db_dependent/Reserves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
AMENDED: An else branch in reserve/placerequest.pl was removed. This had
the effect of making it no longer possible to place an any hold in the
staff client.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified placing a biblio level and an item level hold.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: Remove reserveconstraints references from C4::Reserves
Kyle M Hall [Tue, 30 Jun 2015 11:30:32 +0000 (07:30 -0400)]
Bug 9809: Remove reserveconstraints references from C4::Reserves

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: Update unit tests
Kyle M Hall [Tue, 30 Jun 2015 12:25:29 +0000 (08:25 -0400)]
Bug 9809: Update unit tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: Remove DBIC module for reserveconstraints
Kyle M Hall [Tue, 30 Jun 2015 11:32:56 +0000 (07:32 -0400)]
Bug 9809: Remove DBIC module for reserveconstraints

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: Update Schema files
Kyle M Hall [Tue, 30 Jun 2015 12:51:55 +0000 (08:51 -0400)]
Bug 9809: Update Schema files

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 9809: DB Updates
Kyle M Hall [Tue, 30 Jun 2015 11:34:35 +0000 (07:34 -0400)]
Bug 9809: DB Updates

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 12372: Updated man pages for koha-mysql
Barton Chittenden [Thu, 30 Jul 2015 22:17:02 +0000 (15:17 -0700)]
Bug 12372: Updated man pages for koha-mysql

http://bugs.koha-community.org/show_bug.cgi?id=12372
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12372: (QA followup) Standardized argument parsing for koha-mysql.
Barton Chittenden [Tue, 23 Jun 2015 14:02:10 +0000 (07:02 -0700)]
Bug 12372: (QA followup) Standardized argument parsing for koha-mysql.

http://bugs.koha-community.org/show_bug.cgi?id=12372
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12372: koha-mysql: process any mysql args
Barton Chittenden [Mon, 1 Jun 2015 22:29:14 +0000 (15:29 -0700)]
Bug 12372: koha-mysql: process any mysql args

Signed-off-by: Ian Bays <ian.bays@ptfs-europe.com>
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13791: (QA followup) Plack support requires Apache 2.4.8+
Tomas Cohen Arazi [Mon, 24 Aug 2015 16:03:05 +0000 (13:03 -0300)]
Bug 13791: (QA followup) Plack support requires Apache 2.4.8+

The Apache 2.4 documentation says UDS support for ProxyPass has been
introduced in Apache 2.4.7. That's what is shipped by Koha's supported
Debian / Ubuntu versions.
But it is not true, empiric tests and even the changelog for the apache
project says the feature got introduced in 2.4.8. So to avoid breakages
I raised the version number test on the apache files to 2.4.8.

New bugs will be filled for dealing with this if we find it necessary.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13791: tab-completion for koha-plack in bash
Tomas Cohen Arazi [Fri, 14 Aug 2015 21:24:20 +0000 (18:24 -0300)]
Bug 13791: tab-completion for koha-plack in bash

This patch adds tab-completion in bash for the koha-plack command.

After the --start, --stop, --restart and --disable switches it only offers
plack-enabled instances.  And disabled instances to --enable.

--help and -h just finish end the completion.

--quiet and -q are trickier to implement. They will work (be offered)
only before the action switches.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13791: make koha-common init script aware of plack
Tomas Cohen Arazi [Thu, 13 Aug 2015 17:54:58 +0000 (14:54 -0300)]
Bug 13791: make koha-common init script aware of plack

This patch makes the packages' koha-common script aware of plack.
It does so by relying on koha-list --plack to know which instances
have Plack configured, and uses the koha-plack script to manage
the running daemons.

It also introduces a plack_status function to check the status of
the Plack daemon when called:

   $ servive koha-common status

Regards

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13791: make koha-list aware of plack
Tomas Cohen Arazi [Thu, 13 Aug 2015 17:49:01 +0000 (14:49 -0300)]
Bug 13791: make koha-list aware of plack

This patch adds the --plack and --noplack option switches to koha-list
for filtering instances to be listed.

This is particularly important for init scripts and cronjobs.

To test:
- Play with koha-list --plack and koha-plack --enable/--disable and verify that
koha-list returns the expected results.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13791: koha-plack documentation
Tomas Cohen Arazi [Thu, 13 Aug 2015 17:13:19 +0000 (14:13 -0300)]
Bug 13791: koha-plack documentation

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13791: Apache configuration files
Tomas Cohen Arazi [Thu, 13 Aug 2015 17:02:42 +0000 (14:02 -0300)]
Bug 13791: Apache configuration files

This patch adds an include to each VirtualHost definition (OPAC and Intranet)
and a variable definition, taking advantage of Apache 2.4.x features.

The instance name is reused inside the includes providing a simple way of
dealing with the apache <-> plack configuration.

A check for the right apache version is introduced, in the for of an IfVersion block:

<IfVersion >= 2.4>
  --- Plack configuration here ---
</IfVersion>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13791: Plack out-of-the-box support on packages
Tomás Cohen Arazi [Tue, 3 Mar 2015 23:19:40 +0000 (00:19 +0100)]
Bug 13791: Plack out-of-the-box support on packages

This patch introduces a koha-plack script that controls running Plack
processes for each instance. They are run using 'starman', listening
on a Unix Domain Socket (UDS):

  /var/run/koha/<instancename>/plack.sock

The plack configuration file[1] is expected to be on:

  /etc/koha/plack.psgi

and is installed by the package.

It also adds the following helper functions to koha-functions.sh:

 - is_plack_enabled
 - is_plack_running

Done:
- koha-plack script
- suitable psgi file

To test this patches you will need to install
- starman
- libplack-middleware-reverseproxy-perl

[1] Yeah, a single file. Because we will be relying on multiple mount
points for each "app" (i.e. 'opac' and 'intranet', and 'api' ;-) )

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14566: Fix permissions in patronimage.pl
Jonathan Druart [Wed, 19 Aug 2015 14:42:10 +0000 (15:42 +0100)]
Bug 14566: Fix permissions in patronimage.pl

There is no permission needed to access the patronimage.pl script.
This means anybody cans access to the patron's images.

Test plan:
Add an image to borrowernumber 42 and call
/cgi-bin/koha/members/patronimage.pl?borrowernumber=42

If you are logged in with borrowers permissions, you will see the image,
otherwise you will get a blank page with a 403 header.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13387: Uniform titles (130 / 240 / 730) Display in XSLT
Winona Salesky [Wed, 29 Apr 2015 01:41:52 +0000 (21:41 -0400)]
Bug 13387: Uniform titles (130 / 240 / 730) Display in XSLT

Test Plan:
1) Apply this patch
2) Ensure you are using the default XSLT setting for the staff and opac record details
3) Find or create a record with MARC tags 130/240/730
4) Perform an opac search that would show the record in the search results.
5) Click title to review record.
6) Fields show subfields a,d,f,g,h,k,l,m,n,o,p,r,s,t with multiple fields separated by span class=separator |
7) Repeat steps 4 - 6 for the staff interface

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14693: Contract.t should generate dates based on current date
Tomas Cohen Arazi [Wed, 19 Aug 2015 14:01:32 +0000 (11:01 -0300)]
Bug 14693: Contract.t should generate dates based on current date

The current test for still-active contracts fails because it was written
with fixed dates, which already passed :-D

This patch calculates the current date, and uses it to generate a future
one, so the tests serve their purpose no matter what the current date is.

To test:
- Run:
  $ prove t/db_dependent/Contract.t
=> FAIL: activeonly compares contractenddate with now(), and fails
         because a fixed 2015-07-31 is writteng on the test data
- Apply the patch
- Run:
  $ prove t/db_dependent/Contract.t
=> SUCCESS: the sample data has been calculated using the current date
            and the tests pass.
- Sign off :-D

Edit: added missing use DateTime::Duration,

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14588: Simplify merge_ajax.pl
Marcel de Rooy [Wed, 22 Jul 2015 12:19:09 +0000 (14:19 +0200)]
Bug 14588: Simplify merge_ajax.pl

This script does not need a few modules:
    IO::File; CGI::Session; C4::UploadedFile.
Warnings can be enabled (with Modern::Perl).
Indirect object syntax replaced for CGI and CGI::Cookie.
Moved the $reply line upwards (not needed twice anymore).

Test plan:
[1] Log in as staff user. Run the URL cataloguing/merge_ajax.pl.
    You should see the JSON reponse in the browser.
[2] Logout. Run the URL again. Blank screen.
[3] Go to addbooks.pl (Cataloging Search). Search something, select two
    biblios and click Merge selected, etc.

Signed-off-by: Joonas Kylmala <j.kylmala@gmail.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14031: Itemnumber should be a numeric search in ccl.properties
David Cook [Tue, 21 Apr 2015 00:34:52 +0000 (10:34 +1000)]
Bug 14031: Itemnumber should be a numeric search in ccl.properties

This patch changes the "itemnumber" alias so that it acts like
"itemnumber,st-numeric". That is, it always does a numeric search.

_TEST PLAN_

The best way to test this patch is to apply the patch and then run
"make upgrade", I suspect. As this will refresh your "ccl.properties".

However, this patch is actually really small, so you can just apply
it manually to an existing "ccl.properties" if you rather save time.

Basically, you just need to do the following steps:

0) Do a search for "itemnumber:<insert real indexed itemnumber here>"
1) Note that you can't retrieve any results
2) Change your ccl.properties to say "itemnumber 1=8010 4=109"
3) Repeat the search for "itemnumber:<X>"
4) Note that you now retrieve your result

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested on a gitified package install. Made the change to
/etc/koha/zebradb/ccl.properties manually. After this change
I can successfully search for "itemnumber:1".

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14652: Change one more occurrence of N/A.
Jonathan Druart [Wed, 19 Aug 2015 07:45:00 +0000 (08:45 +0100)]
Bug 14652: Change one more occurrence of N/A.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14652: change gender specification from "N/A" to "None specified"
Liz Rea [Wed, 5 Aug 2015 23:03:43 +0000 (11:03 +1200)]
Bug 14652: change gender specification from "N/A" to "None specified"

To test:

Edit a patron in the intranet, note that the gender options are "Female," "Male," and "None specified"

Setting "None specified" should result in the gender not being shown on the patron detail page (unchanged functionality)

In the opac, log in and click the "your personal details" tab, and note that the gender options are "Female," "Male," and "None specified"

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13734: RDA: Display 33xs
Winona Salesky [Wed, 29 Apr 2015 02:11:57 +0000 (22:11 -0400)]
Bug 13734: RDA: Display 33xs

    Test Plan:
    1) Apply this patch
    2) Ensure you are using the default XSLT setting for the staff and opac search results and record details
    3) Find or create a record with MARC tags 336,337,338
    4) Perform an opac search that would show the record in the search results.
    5) Click title to review record.
    6) Adds fields 336, 337 and 338 to staff and opac details. Adds comma between multiple subfields and | with class='separator' between multiple datafields (e.g. two 336 fields)
    7) Repeat steps 4 - 6 for the staff interface

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14661: space needed in added to staff side cart message, if items added are alrea...
Kyle M Hall [Fri, 7 Aug 2015 15:39:19 +0000 (08:39 -0700)]
Bug 14661: space needed in added to staff side cart message, if items added are already in cart

There is a missing space in the "added to cart" message on the staff side, when you are adding 2 or more items to the cart, where 1+ is already in the cart and 1+ is not in the cart. I verified that this is not an issue in the OPAC cart function.

Test:

1. Search for records in your system.
2. In search results, select the first two records and choose Add to Cart.
3. Message returned, "2 item(s) added to your cart", as expected.
4. Keep those 2 records selected, and select 2 additional records (so 4 total records selected), and choose Add to Cart again.
5. Message returned, "2 item(s) added to your cart2 already in your cart".
6. Apply this patch
7. Repeat steps 1 through 4
8. Note the two phrases are on separate lines

Signed-off-by: Heather Braum <hbraum@nekls.org>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: (QA followup) fix templates
Tomas Cohen Arazi [Fri, 21 Aug 2015 12:47:08 +0000 (09:47 -0300)]
Bug 6874: (QA followup) fix templates

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14464: (QA followup) add unit tests
Jesse Weaver [Tue, 7 Jul 2015 19:02:18 +0000 (13:02 -0600)]
Bug 14464: (QA followup) add unit tests

This followup adds several tests to t/db_dependent/Reserves.t.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14464: Add ability to cancel waiting holds from checkin screen
Jesse Weaver [Tue, 9 Jun 2015 22:22:05 +0000 (16:22 -0600)]
Bug 14464: Add ability to cancel waiting holds from checkin screen

Test plan:

    1. Ensure that ExpireReservesMaxPickUpDelayCharge is set to 0.
    2. Place a hold (doesn't matter whether it's a bib/item-level hold),
       then confirm the hold by checking it in.
    3. Check in the item again, and hit Cancel.
    4. The reserve in question should be cancelled.
    5. Repeat steps 2-4 twice, once after setting
       ExpireReservesMaxPickUpDelayCharge to a nonzero value and again
       after clicking the "Forgive fees for manually expired holds"
       checkbox.

A fine should only be applied when the syspref is enabled and the
checkbox is not checked. Also, the checkbox should only appear after
enabling the syspref. And finally, the checkbox should remember whether
it is checked across multiple checkins, same as the "Forgive overdue
charges" and "Book drop mode" checkboxes.

Signed-off-by: Jason Burds <jburds@dubuque.lib.ia.us>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Removed 2 debugging lines.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14181: MARC21 773 -- Display when ind1 = 0 or blank
Winona Salesky [Mon, 11 May 2015 14:47:36 +0000 (10:47 -0400)]
Bug 14181: MARC21 773 -- Display when ind1 = 0 or blank

Display 773 in opac and staff details when ind1 !=1

Test plan
=========

1/ Add a new record which uses the 773 field to an instance running
   master code. (the selected MARC framework should have the 773's
   relevant sub-fields enabled and visible on staff client, opac and
   the editor).
2/ Set ind1 as '0' (zero). The note should be displayed both on OPAC
   as well as the staff client.
3/ Reset ind1 with a non-zero value or leave it blank. The display
   note should no longer be visible from either client or opac.
4/ Apply the patch.
5/ Repeat step #1 and #2. The note is displayed on staff and opac.
6/ Repeat step #3. The display note should be visible on both staff
   and opac.
7/ run koha-qa.pl -c 1 -v 2

Note : For #1 above, the following LoC record was used:
       http://www.loc.gov/marc/bibliographic/examples.html#monographic

       The patch applied cleanly and performed as expected.

       The koha-qa.pl gave OK as results.

Signed-off-by: Indranil Das Gupta <indradg@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14484: warns when changing patron pw
Aleisha [Wed, 12 Aug 2015 00:00:35 +0000 (00:00 +0000)]
Bug 14484: warns when changing patron pw

To test:
1) Go to any patron's page, click Change password
2) Notice warns in error log
3) Apply patch, reload page
4) Click Change password
5) Notice warns are gone and page still works correctly

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14646: Koha::RecordProcessor should accept more than one filter
Tomas Cohen Arazi [Wed, 5 Aug 2015 19:10:19 +0000 (16:10 -0300)]
Bug 14646: Koha::RecordProcessor should accept more than one filter

The docs say that Koha::RecordProcessor accepts more than one filter
at a time. But as the regression tests show it doesn't.

This is really important to extend its usage in record processing
(either to enforce policy, transform, etc).

This patch makes ->new evaluate the reference type of the passed filters
and builds an array with a single item if a scalar has been passed. The
loop now explicitly casts the filters as an array.

To test:
- Apply the test patch
- Run
  $ prove t/RecordProcessor.t
=> FAIL: tests fail because Koha::RecordProcessor doesn't hanlde
         more than one filter at a time.
- Apply this patch
- Run
  $ prove t/RecordProcessor.t
=> SUCCESS: tests now pass
- Easy, right? Sign off :-D

NOTE: Read code. Don't like the ? operator logic, but it is
      functional despite readability issues.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14646: (regression test) Koha::RecordProcessor only accepts one filter at a time
Tomas Cohen Arazi [Tue, 4 Aug 2015 21:43:01 +0000 (18:43 -0300)]
Bug 14646: (regression test) Koha::RecordProcessor only accepts one filter at a time

This patch introduces new tests to t/RecordProcessor.t so it tests for
creating processors with more than one filter. It does so by running

    my $processor = new Koha::RecordProcessor({
                            filters => ['Null','Dummy']
                        });

and testing the results.

To test:
- Apply the patch
- Run:
  $ prove t/RecordProcessor.t
=> FAIL: tests related to multiple filters fail.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 3333: Confusing item status for not-for-loans
Marcel de Rooy [Mon, 1 Jun 2015 13:21:32 +0000 (15:21 +0200)]
Bug 3333: Confusing item status for not-for-loans

This patch makes a tiny change in C4::Search::searchResults as to the
handling of not-for-loans. This should make the display of status and
availability of items more consistent in opac and staff.

Additionally, a Place hold link should disappear in the opac, when it is
not possible to place a hold on any item of one biblio.

The following spots need special attention; the display should be
corrected by this patch:
[A] Location column showing number of available items in catalogue/search.
[B] Location column of Cataloging Search (addbooks.pl)
[C] OPAC Search results list in non-XSLT view.

NOTE
The forms opac-MARCdetail and MARCdetail also include an Items table with
column Not for loan. The information in this column might still be somewhat
confusing but is actually correct. The column only contains Not for loan if
the item field is set. So it is empty when only the item type is nfl.
Since a correction here is arguable, I am not including it on this report.

Test plan:
[1] Have at least two item types. Mark one item type (X) as not for loan.
[2] Use at least two biblios with two items each. Mark one item of the first
    biblio as not for loan at item level (via item editor).
    Change one item of the second biblio to the item type of step 1 (X).
[3] Set pref item-level_itypes==item and set all four xslt prefs (for opac
    and staff, results and detail) to default.
[4] Check spots A, B and C as mentioned above. Also check:
    [D] OPAC Detail, Holdings table, Status column
    [E] Staff Detail, Holdings, Status.
[5] Make all four xslt prefs now empty. Check spots A to E again.
    Especially observe C here.
[6] Set pref item-level_itypes==biblio. Change your second biblio to item
    type of step 1 (X) in the cataloguing editor (MARC 942c).
    Check spots A to E again.
[7] Set all four xslt prefs again to default. Check spots A to E again.
[8] Run the unit test t/db_dependent/Search.t.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14675: Don't update details if no changes made
Martin Stenberg [Tue, 18 Aug 2015 14:41:42 +0000 (16:41 +0200)]
Bug 14675: Don't update details if no changes made

if no changes has been made for personal details, bring user back to details
page and inform them that no changes has been made.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14498: uri_escape error triggered by duplicate accountno's for patron
Kyle M Hall [Mon, 6 Jul 2015 15:00:38 +0000 (11:00 -0400)]
Bug 14498: uri_escape error triggered by duplicate accountno's for patron

If a patron has duplicate accountno's for two different fines in Koha this will trigger the error
usi_escape: Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ])/ at (eval 133) line 1.
upon attempt to pay. How those accountno's get duplicated is unknown, but considering accountno
is somewhat vestigial at this point in time, it would be much more sensible to use accountlines_id
which is has guaranteed uniqueness at the database level.

Test Plan:
1) Create a patron with 2 fines
2) Edit the accountno's for those fines and set them to 0
3) Attempt to pay one, note the error
4) Apply this patch
5) Refesh the page
6) Attempt to pay one, no error this time!
7) Test Pay, Write off, Pay amount, Write off all, and Pay selected

Signed-off-by: Deborah Duce <deborah.duce@huntsvillelibrary.ca>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14660: Fix 3 other cataloguing plugins
Jonathan Druart [Wed, 19 Aug 2015 08:12:04 +0000 (09:12 +0100)]
Bug 14660: Fix 3 other cataloguing plugins

These 3 should use C4::Output not to explode.

Test plan:
Link the plugins with the correct fields
They should not log an error when calling them

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14660: Fix stocknumberam123.pl cataloguing plugin
Katrin Fischer [Thu, 6 Aug 2015 22:33:54 +0000 (00:33 +0200)]
Bug 14660: Fix stocknumberam123.pl cataloguing plugin

The cataloguing plugin stocknumberam123.pl is broken and no
longer generating numbers - this patch fixes it.

To test:
 - Link a subfield to the plugin - usually it's 952$i or the UNIMARC
   equivalent in your MARC frameworks
 - Create a new item, set the inventory number to: A 0000000002
 - Start to catalog another item, enter A into inventory and
 - Enter A as stocknumber and activate the plugin by clicking on
   ... at the end of the field
 - The number will not get added - Firebug shows an error:
   Undefined subroutine CGI::output_html_with_http_headers
 - Apply patch
 - Verify numbers are now generated and no errors are shown

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14660: Fix stocknumberAV.pl cataloguing plugin
Katrin Fischer [Thu, 6 Aug 2015 22:20:09 +0000 (00:20 +0200)]
Bug 14660: Fix stocknumberAV.pl cataloguing plugin

The cataloguing plugin stocknumberAV.pl is broken and no
longer generating numbers - this patch fixes it.

To test:
- Link a subfield to the plugin - usually it's 952$i or the UNIMARC
  equivalent in your MARC frameworks
- Set up a new authorised value INVENTORY, the code is an uppercase
  prefix - "B"
- The Descriptions is your starting number - 1
- The OPAC description remains empty
- Catalalog an item
- Enter B as stocknumber and activate the plugin by clicking on
  ... at the end of the field
- The number will not get added - Firebug shows an error:
  Undefined subroutine CGI::output_html_with_http_headers
- Apply patch
- Verify numbers are now generated and no errors are shown

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14644: unbreak SIP2 terminal login when using telnet transport
Galen Charlton [Tue, 4 Aug 2015 15:59:39 +0000 (15:59 +0000)]
Bug 14644: unbreak SIP2 terminal login when using telnet transport

This patch fixes breakage introduced by the patch for bug 13506
that prevented SIP2 clients from authenticating themselves over
the telnet transport. Attempts to do so would manifest by the
SIPServer backend crashing and the connection getting closed.

To test:

[1] Use the stock SIPServer config, etc/SIPconfig.xml, and ensure
    that the database contains a staff user whose username is 'term1'
    and password is 'term1' that has the circulate permission.
[2] Start SIPServer, telnet to port 8023, and attempt to log in.  The
    connection will be aborted:

    $ telnet localhost 8023
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    login: term1
    password: term1
    Connection closed by foreign host.

[3] Apply the patch and restart SIPSever, then repeat step 2.  This time,
    the login should succeed:

    $ telnet localhost 8023
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    login: term1
    password: term1
    Login OK.  Initiating SIP

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14574: Fixing error messages on staff client so they make more sense
Aleisha [Tue, 21 Jul 2015 00:29:52 +0000 (00:29 +0000)]
Bug 14574: Fixing error messages on staff client so they make more sense

To test:
1) Go to cgi-bin/koha/errors/errornumber.pl to see the error messages which currently don't make sense (ie cgi-bin/koha/errors/401.pl etc). Have only made changes to 401, 403 and 404
2) Apply patch
3) Go to cgi-bin/koha/errors/401.pl --> Check that it now says "This error means that you aren't authorized to view this page." and "Please log in and try again.". Check that 'log in' redirects to the log in page (mainpage.pl).
4) Go to cgi-bin/koha/errors/403.pl --> Check that it now says "This error means that you are forbidden to view this page."
5) Go to cgi-bin/koha/errors/404.pl --> This page should be very different. Check that the 'Error 404' is now in italics and not bold. Check that the page gives a list of reasons the user may have been given this error and some options for their next step.

Signed-off-by: Catherine <cnorthcott.work@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: replace tab with 4 spaces.
Note: I am not sure the em tag is useful here.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14517: List shelves list is broken for translated interfaces
Jonathan Druart [Tue, 14 Jul 2015 15:26:36 +0000 (16:26 +0100)]
Bug 14517: List shelves list is broken for translated interfaces

The translation script adds quotes ("") around translated string (Edit
for instance).
Which breaks the json structure.

Example:
"dt_action": "<a style=\"cursor:pointer\"><form action='shelves.pl'
method='get'><input class="editshelf" value="Editar" type="submit"
/></form></a>"

Test plan:
1/ On the staff interface create a private list
2/ Go to More > Lists ('Your lists' tab)
3/ Translate the templates to any language like:
  $ cd misc/translator/
  $ perl translate install es-ES
4/ Enable the translated templates on the sysprefs
5/ Switch to the translated language
6/ Go to the lists page (Mas > Listas in es-ES)
The list should be displayed correctly.

Note: There is a limitation. If a translated string contains a simple
quote ('), it will also break the json.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14529: The new list permission is 'lists', not 'shelves'
Jonathan Druart [Tue, 18 Aug 2015 11:43:27 +0000 (12:43 +0100)]
Bug 14529: The new list permission is 'lists', not 'shelves'

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14529: Allow user to delete lists
Jonathan Druart [Mon, 13 Jul 2015 16:53:06 +0000 (17:53 +0100)]
Bug 14529: Allow user to delete lists

Bug 13417 allows a librarian to delete any lists if he has the
permission (delete_public_lists).

There is a mismatch in the perm check.
A user can delete a list with the ability to edit (manage) it.

Test plan:
1/ Create a list A with user A
2/ Create a list B with user B
3/ A should be able to manage and delete the list A.
He cans delete B only if he is superlibrarian or has the
delete_public_lists permission.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11229: Make the tests pass even if issues exist in the DB
Jonathan Druart [Tue, 18 Aug 2015 15:51:19 +0000 (16:51 +0100)]
Bug 11229: Make the tests pass even if issues exist in the DB

This is not introduced by the previous patches of this patchset.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11229: (followup) makepartialpayment fix
Tomas Cohen Arazi [Thu, 13 Aug 2015 15:03:15 +0000 (12:03 -0300)]
Bug 11229: (followup) makepartialpayment fix

makepartialpayment() wasn't logging the branch either. This patch
fixes that too.

To test:
- Run (with the regression tests applied)
  $ prove t/db_dependent/Accounts.t
=> FAIL: tests fail because makepartialpayment is not logging the branch code
- Apply the patch
- Run
  $ prove t/db_dependent/Accounts.t
=> SUCCESS: tests pass
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11229: makepayment doesn't log branch in statistics correctly
Katrin Fischer [Mon, 8 Jun 2015 01:51:02 +0000 (03:51 +0200)]
Bug 11229: makepayment doesn't log branch in statistics correctly

This patch fixes makepayment() so it correctly logs the branch code
to the statistics table.

To test:
- Run (with the regression tests applied)
  $ prove t/db_dependent/Accounts.t
=> FAIL: makepayment() tests fail because logging is wrong
- Apply the patch
- Run
  $ prove t/db_dependent/Accounts.t
=> SUCCESS: tests for makepayment now pass
(Note: makepartialpayment tests still fail as they need the next patch)

Original commit message relying on the UI to test:

There are several ways of paying fines, not all of them
recorded the branch the payment was made at correctly:

1) Pay button next to an individual fine
2) Checkbox + pay amount
3) Checkbox + pay selected

For each of those, check if the payment registered in
the table statistics contains the branchcode before
and after the patch.

The patch should fix 1).
2) and 3) are ok with and without the patch.

Important: Don't change the amount, pay individual fines.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Note: i fixed the commit message, because this is a fix for makepayment

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11229: (regression tests) makepayment and makepartialpayment should log correctly
Tomas Cohen Arazi [Thu, 13 Aug 2015 14:32:49 +0000 (11:32 -0300)]
Bug 11229: (regression tests) makepayment and makepartialpayment should log correctly

This patch introduces tests for makepayment and makepartialpayment to check
they are correctly logging to the statistics table.

To test:
- Run
  $ prove t/db_dependent/Accounts.t
=> FAIL: tests fail because statistics are not correctly logged.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14592: Export data bad encoding
Frédéric Demians [Thu, 23 Jul 2015 07:47:15 +0000 (09:47 +0200)]
Bug 14592: Export data bad encoding

Tools > Export data produces a file badly encoded, when marc/xml file
format is chosen. It works with CSV.

To test:

1. Tools > Export data
2. Choose a limited interval of biblionumber
3. Export in marc/xml/csv.
4. Check files exported at 3: csv file is ok. marc/xml files are
   corrupted, ie badly encoded.
5. Apply the patch
6. Repeat steps 3&4, and confirm that all file formats are valid.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13485: DBRev 3.21.00.018
Tomas Cohen Arazi [Tue, 11 Aug 2015 18:09:54 +0000 (15:09 -0300)]
Bug 13485: DBRev 3.21.00.018

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13485: Use the Koha template plugin to access syspref values
Jonathan Druart [Wed, 5 Aug 2015 11:52:12 +0000 (12:52 +0100)]
Bug 13485: Use the Koha template plugin to access syspref values

And remove the useless use of the KohaDates plugin

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13485: Add a page to display links to restricted sites
Simith D'Oliveira [Fri, 19 Dec 2014 19:44:48 +0000 (14:44 -0500)]
Bug 13485: Add a page to display links to restricted sites

To test:

I) Apply the patch
II) Run updatedatabase.pl

scenario I)

1) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)
3) Validate cgi-bin/koha/opac-proxypage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents.

scenario II)

1) Logout opac page
2) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
3) Add other ip that your machine ip.
4) Validate: cgi-bin/koha/opac-proxypage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-proxypage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents after login.

Followed both scenarios, works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 13485 [QA Followup]

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 13485 - Atomic Update + Rename Proxy page to Restricted page

Test plan:

I) Apply the patch
II) Run updatedatabase.pl

scenario I)

1) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)
3) Validate cgi-bin/koha/opac-restrictedpage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents.

scenario II)

1) Logout opac page
2) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
3) Add a diffrent ip.
4) Validate: cgi-bin/koha/opac-restrictedpage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-restrictedpage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents after login.

new file:   installer/data/mysql/atomicupdate/Bug13485_RestrictedSitesPage.sql
modified:   installer/data/mysql/sysprefs.sql
modified:   koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
renamed:    koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-proxypage.tt -> koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-restrictedpage.tt
renamed:    opac/opac-proxypage.pl -> opac/opac-restrictedpage.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13853: (follow-up) unit tests
Jonathan Druart [Thu, 2 Jul 2015 09:20:13 +0000 (10:20 +0100)]
Bug 13853: (follow-up) unit tests

Specify the reference, we should receive Koha::Object.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13853: (QA followup) Add unit tests for branch getting methods
Kyle M Hall [Thu, 25 Jun 2015 18:56:18 +0000 (14:56 -0400)]
Bug 13853: (QA followup) Add unit tests for branch getting methods

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13853: Add tests for is_waiting
Jonathan Druart [Fri, 19 Jun 2015 16:16:27 +0000 (18:16 +0200)]
Bug 13853: Add tests for is_waiting

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13853: Show waiting hold expiration date for waiting holds in holds ajax datatable
Kyle M Hall [Tue, 17 Mar 2015 14:09:28 +0000 (10:09 -0400)]
Bug 13853: Show waiting hold expiration date for waiting holds in holds ajax datatable

We should show the expiration date for waiting holds in the holds
datatable that appears in circulation.pl and moremember.pl

Test Plan:
1) Ensure ReservesMaxPickUpDelay is set
2) Place a hold on a record
3) Place a second hold and set it to waiting by checking it in
4) Place a third hold with an expiration date
5) View the holds tab on circulation.pl and moremember.pl
6) Note the first hold has no expiration date
7) Note the second hold has an expiration date of today + ReservesMaxPickUpDelay days
8) Note the thrid hold has an expiration date of whatever you set it to

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us>
Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13030: Remove the unnecessary double call
Jonathan Druart [Fri, 19 Jun 2015 16:05:37 +0000 (18:05 +0200)]
Bug 13030: Remove the unnecessary double call

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13030: Show waiting hold expiration date for waiting holds on circulation.pl
Kyle M Hall [Wed, 8 Oct 2014 16:04:35 +0000 (12:04 -0400)]
Bug 13030: Show waiting hold expiration date for waiting holds on circulation.pl

We should show the date a waiting hold is set to expire for each hold in
the list of waiting holds in circulation.pl

Test Plan:
1) Apply this patch
2) Find a waiting hold for a patron, browser to circulation.pl
   for that patron
3) Set system preference ReservesMaxPickUpDelay to 5
4) Refresh circulation.pl, note the waiting holds now display a
   "waiting until" part with the waiting date plus 5 days
5) Set system preference ReservesMaxPickUpDelay to 0 ( or empty
   string )
6) Refresh circulation.pl, note the waiting hols no longer have a
   "waiting until" line.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Followed test plan successfully. Automated tests successful.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us>
Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org>
Bug 13030 [QA Followup] - Fix unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11325: Focus not on "Add Item" in Lists
Fridolin Somers [Tue, 16 Jun 2015 07:40:41 +0000 (09:40 +0200)]
Bug 11325: Focus not on "Add Item" in Lists

When viewing a list, the focus/cursor is no longer on the "add items" field below the list.

This patch moves the "Add Item" form at left part of page so that it is always shown (usefull when there are a lot of items). And adds focus to barcode input so you can enter several items with a barcode scanner.

Test instructions:
1. Create a list
2. Make sure you have an object with an assigned barcode
3. Go to the list
=> The barcode entry interface should be at left and has the focus
4. Enter the barcode and press enter (or use a scanner)
=> The item is added to the list

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
I like the new position.
Works well, focus on input box
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: DBRev 3.21.00.017
Tomás Cohen Arazi [Fri, 7 Aug 2015 19:04:46 +0000 (16:04 -0300)]
Bug 6874: DBRev 3.21.00.017

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: (RM followup) DBIx updates
Tomas Cohen Arazi [Fri, 7 Aug 2015 19:07:08 +0000 (16:07 -0300)]
Bug 6874: (RM followup) DBIx updates

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 6874: (QA followup) upload_path missing in koha-conf.xml.in
Tomas Cohen Arazi [Tue, 11 Aug 2015 13:54:18 +0000 (10:54 -0300)]
Bug 6874: (QA followup) upload_path missing in koha-conf.xml.in

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: (QA followup) Warnings in about page
Tomas Cohen Arazi [Fri, 7 Aug 2015 19:22:22 +0000 (16:22 -0300)]
Bug 6874: (QA followup) Warnings in about page

This patch introduces checks on the about.pl page so the user is warned
for a deficient configuration.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: [QA Follow-up] Last adjustments for future developments
Marcel de Rooy [Thu, 28 May 2015 09:54:56 +0000 (11:54 +0200)]
Bug 6874: [QA Follow-up] Last adjustments for future developments

This patch does:

[1] Some trivial template changes. Modified some comments (POD lines).
[2] Converted plugin to new style.
[3] Table updates: renames id to hashvalue, adds a autoincrement id,
    adds filesize, timestamp, owner and category.
    RM: This db rev is in a separate sql file in atomicupdate.
[4] Code references to computed hash renamed to hashvalue instead of id.
[5] Removed some code pertaining to exposing upload dir structure. The user
    now may choose a category; the uploader takes care of storage.
    The list of upload categories is now taken from authorised values; this
    might become a separate table in the future. (If there are none,
    the upload process creates one default fallback.)
    We can add e.g. permissions later, subdir structure, etc. (So dir will
    not necessarily be category anymore.)

Test plan:
[1] Run the db revision.
[2] Upload new file. Check the record in the table. Delete it again; check.
[3] Run t/db../UploadedFiles.t.
[4] Run t/db../FrameworkPlugins.t -incl cataloguing/value_builder/upload.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: [QA Follow-up] Adjustments for opac-retrieve
Marcel de Rooy [Wed, 27 May 2015 11:52:25 +0000 (13:52 +0200)]
Bug 6874: [QA Follow-up] Adjustments for opac-retrieve

Adds httpheaders sub to UploadedFiles; this will be extended on a new
report. (Idea is to add configurable headers for file extensions.)
Trivial unit test added.
Small cosmetic changes to opac-retrieve-file.

Test plan:
Run test UploadedFiles.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Catch warnings for clean tests.
Mark Tompsett [Sun, 12 Apr 2015 03:57:43 +0000 (23:57 -0400)]
Bug 6874: Catch warnings for clean tests.

I hate noisy tests, so I cleaned them up.

MEGA TEST PLAN
--------------
git checkout -b bug_6874 origin/master
git bz apply 6874
-- yes, it should all apply smoothly.
I intentionally restored an old backup from a couple months ago to force the upgrade.
staff client:
-- upgrade
-- login
Koha administration
MARC Bibliographic framework
MARC structure (for BKS)
Search for 856
Subfields
Edit (for u)
Other options
Plugin: upload.pl
Save changes
Search the catalog tab
{choose a word, any word. I used fancy, because I knew we had a cookbook}
click first link
Edit
Edit record
8 (that's the tab name)
click the name for 856
scroll down to u and click the plugin icon
-- Correctly got a configuration error message.

At a command prompt:
vi ~/koha-dev/etc/koha-conf.xml
/enable_plug
-- add in:
<upload_path>{appropriate path. I used /home/mtompset/uploads}</upload_path>
:wq
mkdir {appropriate path used}
-- I even added some subdirectories
sudo chown -R -v www-data.www-data {appropriate path used}

Back in staff client:
click the plugin icon again
-- this time an upload screen pops up
click the 'Upload file' button
-- message about no file or destination
browse for a file, select one
click the 'Upload file' button
-- message about no destination
click the 'Cancel' button
click the plugin icon
click a destination radio button
click the 'Upload file' button
-- message about no file
browse for a file, select one
click the 'Upload file' button
-- message about success
click the 'close' button.
-- the text box has been filled in with a nice URL
click the plugin icon
click cancel
click the plugin icon
click delete
-- the test box should be blanked, and a success message given
click Close
-- reupload a file properly
click the plugin icon
click delete
click upload file
browse for a file, select a destination, click upload file
click close on success message
click 'Clone this subfield'
click the second plugin icon
click delete
click close
click the first plugin icon
-- Nice error message about a URL which points to nothing.
click cancel
In the second 856$u type in a URL (eg. www.google.com)
click the second plugin icon
-- this jumps immediately to the upload screen, but does not give an error message, because the URL does not have opac-retrieve-file in it.
click save (we need to save the bibliographic record)

In OPAC:
search for the same word (I used fancy)
find the entry you just updated with links
click the two links. The dangling entry should give you a 500 error, and the other link should work just fine.
get back to the detail page

In staff client:
edit
edit record
8
change the 856$u to a valid file in the first link.
save

In OPAC:
refresh the detail page, and click the first link again
this time it should get downloaded nicely.

From a command line:
prove -v t/db_dependent/UploadedFiles.t
perldoc C4::Biblio
perldoc C4::UploadedFiles

One more round of tests tomorrow, and this should be ready. :)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested on top of 5010

Followed mostly mega test plan, seems to work :)
Can upload, delete, modify, etc
Test runs Ok
No koha-qa errors

I view this as valuable addition, dangling since 2011!
As with 5010, I consider this can be pushed (for 3.22)
and we can fix anything wrong later.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: id based on contents, filename, and directory.
Mark Tompsett [Thu, 17 Apr 2014 00:49:02 +0000 (20:49 -0400)]
Bug 6874: id based on contents, filename, and directory.

This patch corrects the inability to upload the same file to a
different directory, or even a renamed file to the same
directory. By including the filename and directory as part of
the $id SHA generation, only identical files in the same
directory with the same file name will generate the same $id.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Clean up file URL generation
Mark Tompsett [Wed, 16 Apr 2014 04:23:40 +0000 (00:23 -0400)]
Bug 6874: Clean up file URL generation

This adds a dependency on bug 5010, in that the protocol is
assumed in the OpacBaseURL system preference. It also adds
improved error handling.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: License Text Update
Mark Tompsett [Tue, 15 Apr 2014 03:54:07 +0000 (23:54 -0400)]
Bug 6874: License Text Update

This updates the license text for
- C4/UploadedFiles.pm
- cataloguing/value_builder/upload.pl
- opac/opac-retrieve-file.pl
to GPL v3 as per the
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence
text.

TEST PLAN
---------
1) Don't apply this patch as part of 6874.
2) Run the koha qa test tool.
   -- It will FAIL for those three file.
3) Apply this patch
4) Run the koha qa test tool.
   -- License problem is corrected, no FAILs.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: kohastructure.sql, jquery.js, refocus, and more
Mark Tompsett [Thu, 26 Sep 2013 15:45:19 +0000 (11:45 -0400)]
Bug 6874: kohastructure.sql, jquery.js, refocus, and more

Two problems were discovered while doing a fresh install
of Koha. These problems in the kohastructure.sql file are
addressed with this patch.

Clicking the plug-in icon should cause the popup window
to refocus.  This adds the refocus code to the upload.pl file.

The path to the jquery.js script was wrong in the
upload_delete_file.tt file. Changed [% themelang %] to
[% interface %].

If a user clones 856$u after uploading a file, deletes the file,
and then clicks the plugin icon on the first 856$u, this will go
immediately to the upload screen with an informative error
message.

After some validation was added, it was extended to include
other cases. This serves to patch 6874 to a state where sign
off should be possible.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Force user to select a directory
Julian Maurice [Mon, 30 Sep 2013 07:34:01 +0000 (09:34 +0200)]
Bug 6874: Force user to select a directory

This patch adds a javascript and a server-side checks

Test plan:
1/ Choose a file, leave the radios not selected and submit
2/ You have a javascript alert which prevents form to be submitted
3/ Disable javascript and repeat step 1
4/ Form is submitted but form is redisplayed with an error message
telling you to choose a directory.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: (QA followup) Attach files to bibliographic records
Kyle M Hall [Wed, 25 Sep 2013 07:07:44 +0000 (09:07 +0200)]
Bug 6874: (QA followup) Attach files to bibliographic records

* Renames uploadPath to upload_path to follow the standard naming
  conventions in koha-conf which use underscores rather than camel case
* Remove reference to intranet-tmpl and replace with [% interface %]
  required to pass qa

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Move uploadPath syspref to koha-conf.xml
Julian Maurice [Wed, 12 Jun 2013 13:12:51 +0000 (13:12 +0000)]
Bug 6874: Move uploadPath syspref to koha-conf.xml

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Add unit tests for C4::UploadedFiles
Julian Maurice [Thu, 11 Apr 2013 12:36:27 +0000 (12:36 +0000)]
Bug 6874: Add unit tests for C4::UploadedFiles

Add unit tests for C4::UploadedFiles and move a variable
declaration at subroutine level instead of file level.
Add dependency to Test::CGI::Multipart

Still works, and the newly-provided unit tests have good test
coverage:
C4/UploadedFiles.pm 90.7    65.0    66.7    100.0   100.0    0.2    86.4

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: QA follow-up
Paul Poulain [Tue, 19 Mar 2013 09:48:08 +0000 (10:48 +0100)]
Bug 6874: QA follow-up

Squash of the following commits:
  return with explicit undef removed
  Follow-up for PBP fixes
  follow-up fix POD syntax
  follow-up jquery has moved

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: removed POD changes in Biblio.pm while rebasing.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Attach files to bibliographic records
Julian Maurice [Wed, 18 Jul 2012 14:47:54 +0000 (16:47 +0200)]
Bug 6874: Attach files to bibliographic records

New cataloging plugin upload.pl and new system preference 'uploadPath'.

upload.pl provide a way to upload files on the server and store a link
(url) to it in MARC
uploadPath is the absolute path on the server where the files will be
stored. It's possible to have a hierarchy of directories under this path
and the plugin will allow to choose in which directory to store the
file.
Stored value in MARC subfield looks like this:
<OPACBaseURL>/cgi-bin/koha/opac-retrieve-file.pl?id=<SHA-1 of the file>
So both 'uploadPath' and 'OPACBaseURL' sysprefs have to be set for this
plugin to work correctly

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Slightly amended/simplified the patch during QA: The changes to
GetMarcUrls are not really needed, and would have needed some
attention. Another link text can be supplied by the plugin too.

This also reduces the need for changes in basket.pl,
MARCdetail.pl, detail.pl, opac-basket.pl and opac-detail.pl.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Edit: more meaninfull commit subject

8 years agoBug 14534: Stop overdue_notices.pl from issuing the warning: Use of uninitialized...
Ulrich Kleiber [Wed, 15 Jul 2015 06:35:13 +0000 (08:35 +0200)]
Bug 14534: Stop overdue_notices.pl from issuing the warning: Use of uninitialized value $borrowernumber

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
To test:

1/ Run the overdue_notices.pl script (don't do this on production
obviously :))
2/ Notice the warns
3/ Apply patch
4/ Run again
5/ Notice no warns, but notices are still generated ok

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13663: (followup) fixes tab char QA test fails
Indranil Das Gupta [Sun, 14 Jun 2015 09:22:04 +0000 (14:52 +0530)]
Bug 13663: (followup) fixes tab char QA test fails

Fixes the tab char qa test suite fails in the following files:

1/ tools/upload-file-progress.pl
2/ tools/upload-file.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: tidy whitespaces
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13663: Fix permissions in upload-file.pl and upload-file-progress.pl
Alex Arnaud [Thu, 11 Jun 2015 08:55:35 +0000 (10:55 +0200)]
Bug 13663: Fix permissions in upload-file.pl and upload-file-progress.pl

Test plan:
Verify that the circulate_remaining_permissions perm is enough to upload
.koc file.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14548: Typo in help file for 3.20 (batch_record_modification.tt)
Hector Castro [Thu, 16 Jul 2015 21:40:14 +0000 (15:40 -0600)]
Bug 14548: Typo in help file for 3.20 (batch_record_modification.tt)

Typo found in batch_record_modification.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/batch_record_modification.tt:20' and check the typo "critera" or go to Tools › Batch record modification, open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14547: Typo in help file for 3.20 (basket.tt)
Hector Castro [Thu, 16 Jul 2015 20:35:52 +0000 (14:35 -0600)]
Bug 14547: Typo in help file for 3.20 (basket.tt)

Typo found in basket.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt:24' and check the typo "susbscription" or go to Acqusitions > create or view an existing basket, open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 7143: New developers
Chris Cormack [Sun, 26 Jul 2015 07:07:19 +0000 (19:07 +1200)]
Bug 7143: New developers

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 7143: Add missing people to history.txt
Tomas Cohen Arazi [Wed, 27 May 2015 17:49:09 +0000 (14:49 -0300)]
Bug 7143: Add missing people to history.txt

Indranil Das Gupta needs to be included. Emmanuele Somma was
missed a while back, so adding ad shifting numbers for people after her.

Some tab fixes too, I don't have the time to fix them all.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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@theke.io>