Bug 12068: (rm followup) remove useless newline introduced on merging

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13085: bugfix to allow call of export.pl in commandline without id_list_file parameter

Test plan
1/ run ./tools/export.pl
2/ notice an error like cannot open 0: No such file or directory at ./tools/export.pl line 209.
3/ apply patch
4/ run again
5/ no errors

Signed-off-by: Chris <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, adding an additional check.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11812 - Add missing "required" indicator to fields which are required

Form fields in the staff client which are required should be configured
to be so by doing several things:

- Add a class "required" to the field's <label>
- Add a class "required" to the form field
- Add 'required="required"' to the form field
- Apppend a <span class="required">Required</span> after the form field.

Several places in the templates are missing the <span>. This patch adds
them.

To test, apply the patch and view the following pages to confirm that
the "Required" text appears:

- Acquisitions -> Add an order to a basket from a new (empty) record.
  Title, quantity, and fund should indicate they are required.

- Administration -> Authority types ->  New authority type. The
  authority type and description fields should indicate they are
  required.

- Administration -> Authority types -> MARC structure -> New tag. The
  tag field should indicate it is required.

- Patron types and categories -> New category. Category code,
  description, and category type should indicate that they are required.
  FIXME: Enrollment period is required but the user must choose one. I'm
  not sure how to handle that clearly.

- Tools -> CSV profiles. Profile name, profile type, and profile MARC
  fields should indicate they are required on both the new and edit
  forms.

- Administration -> Manage MARC modification templates. Under "Create a
  new template" the name field should indicate that it is required.

- Tools -> Batch patron modification -> Submit a batch for editing. Any
  fields which are required according to your BorrowerMandatoryField
  system preference should indicate that they are required.

Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

QA Edits: Re-worded the "required" not on the batch patron edit form,
added a missing word to the help text on that page. On the csv-profiles
page I removed an unnecessary "javascript:" protocol from the markup.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works and passes QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9859: fix nsb_clean side effect

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
This sub was causing 2 bugs :
- tools/exports.pl --clean was removing Â
- authority search plugin used in cataloging was removing Â in suggested authorities displayed dynamicly (using ajax)
After applying the patch,
- NSB/NSE are still removed by nsb_clean
- tools/exports.pl --clean is no more removing Â
- authority search plugins is no more removing Â

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9859: Follow-up - Adding a simple unit test for nsb_clean

This tests uses the example given on the perl file on the
bug report.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12884: Get rid of redefined subroutine warnings in dateaccessioned.pl

Instead of removing all warnings, we should remove warnings about the
redefined subroutines.

Test plan:
- link the dateaccessioned plugin with one of your biblio field
- edit an item
- verify they are no warnings in the Koha log file.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12005 : Creating a new zebra connection for each time we need one

Zebra is not designed to have persistent connections, under cgi this
didn't matter the scripts would get a new connection each time, but
under plack we try to use dead connections

This patch changes it so plack works the same way that cgi did.

To test:
Apply this patch
Do some searches
Check everything still works

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13104 - Changing date or time format on a production server will create duplicate fines!

The system preference TimeFormat decides if times are formatted in 24
hour or 12 hour format. The issue at hand is that this changes the time
description for fines. Let us assume the time format is currently 24
hour, and there are overdue items with accruing fines. When the format
is changed to 12 hour, and fines.pl is run, it will begin looking for
fines with a 12 hour format. Since there are no, it will create a new
fine and you will now have two fines for the same item!

There are solutions which require database manipulation:
1) Update all existing fines from 24 hour to 12 hour format
2) Delete all existing accruing fines so they are all regenerated the
following night

The same situation applies to DateFormat.

The accounts rewrite ( Bug 6427 ) will resolve this issue, as it does
not look for existing fines based on the description.

I believe the best course of action until bug 6427 is pushed to master
is to add a warning to the system preference to not alter it on a
production server with existing fines.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Adds some documentation to warn about the problem.
Tested the new addition shows up in po files.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9368 [ALTERNATE] - specific behavior of yr and acqdate indexes

This patch fixes the "Publication date" and "Acquisition date"
searches when using non-QueryParser and QueryParser searches.

It adds structure attributes to the template, which is consistent
with how phrase searching is currently handled.

It removes unnecessary code from Search.pm, adds some necessary
code which is consistent with existing code, and adds a lot of
explanatory comments.

_TEST PLAN_

Before applying:
0) Turn off QueryParser
1) Try a "Publication date" or "Acquisition date" search from the
staff client advanced search.
2) Note that even though the description on the result page makes
it seem like you're doing an index-specific search, you're actually
doing a keyword search. You can verify this by checking the 008
from positions 7 to 10 for "Publication date" or "Date accessioned"
on items for "Acquisition date".

3) Turn on QueryParser
4) Try doing the searches from Step 1.
5) A "Publication date" search should probably produce zero results

After applying patch:
6) Keep QueryParser on
7) Try doing the searches from Step 1.
8) Notice that you're actually getting results consistent with
your search (ie the 008/7-10 shows the date you searched for,
and there is a "Date accessioned" in items which matches your
search)

9) Turn off QueryParser
10) Note that your results are exactly the same as step 8
(N.B. this is because QueryParser is falling back to non-QP mode
instead of producing a bad query.)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: Render community koha statistic usages

Goals:
- Collecting Koha usage statistics
- Rendering stats on a community website
- Having a big bicture of how koha is used

3 parts in the project:
- this patch in koha
- hea-ws which collects data
- hea-app which renders data

Installation:
1/ Fill systempreferences:
UsageStatsLastUpdateTime UsageStatsID UsageStatsShare UsageStatsLibraryName
2/ Setup a cron in your crontab (ex: at 3:00 every first of the month):
0 3 1 * * export KOHA_CONF=/home/koha/etc/koha-conf.xml; export PERL5LIB=/home/koha/src; perl /home/koha/src/C4/UsageStats.pm

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: Package updates

* POD doc
* hardcoding hea.koha-community.org as the URL where the stats must
be sent
* fixing some typos
* adding all sysprefs we want to upload.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: URI-encode data sent to statistics server

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: Add a cronjob

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: Add new sysprefs and fix encoding issues

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: Add the items table

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: DB changes

This patch adds the syspref in the database.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: Follow-up - remove SearchEngine pref / fix POD

Patch set reintroduced the formerly removed system preference,
just removing it again.

Also fixes complaints of the QA script about POD in the new module.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: Follow-up - Fix new cronjob's file permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926 [Follow-up] HEA - Render community koha statistic usages

This follow-up makes some language and spelling corrections to the
system preference descriptions. I have updated the preferences heading
to read "Share anonymous usage statistics" in order to emphasize the
anonymous aspect.

I have also updated the main preference name from "UsageStatsShare" to
"UsageStats" so that it is alphabetized first in the list of
"UsageStats*" preferences. I think this will make it clearer to the Koha
administrator what feature they are configuring.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11926: DBRev 3.17.00.030

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>