Bug 11068: Update MARC21 es-ES default frameworks fields and translation

Rebased on top of Bug 3977

This patch updates the Spanish default frameworks for bibliographic records
and authorities using the files created from the po files on Pootle.

To test:
- Run the web installer, make sure all mandatory data is selected
- Verify there are no SQL errors
- Check cataloguing behaves normally
- Check adding authorities behaves normally

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Trusting Bernardo and Tomas as native speakers to get the Spanish right.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9530: Follow-up - Fix t/db_dependent/Branch.t

Tests need to learn about the new fields in the branches table.

To test:
prove t/db_dependent/Branch.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12571 - Add ability to customize SIP2 screen messages

We should add the ability to apply a regular expression to screen
messages for the SIP2 server. This would allow libraries to not only
customize the screen messages the patron sees, but can also allow screen
messages to be translated.

Test Plan:
1) Apply this patch
2) Inspect etc/SIPconfig.xml, note the new screen_msg_regex tags
   that can be nested inside a given login tag.
3) Add one or more screen_msg_regex tags to your own SIP config
   Recommendation: s/Greetings from Koha./Welcome to your library!/g
4) Restart your SIP2 server
5) Test with a SIP2 machine, or use /misc/sip_cli_emulator.pl
6) Note your new AF fields!

Signed-off-by: Jason Burds <jburds@dubuque.lib.ia.us>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11007: Drop column aqorders.cancelledby

It seems that this column has never been used.

Test plan:
1/ Execute the updatedatabase entry.
2/ git grep cancelledby should not return occurrence in the code (except
in Koha/Schema/*
3/ prove t/db_dependent/Acquisition.t should return green.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I couldn't find any trace of this column being used.
Passes tests and QA script, updates all necessary files.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11007: Update DBIx

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8837: Dewey cn_sort inaccurate

This patch fix the cn_sort sorting accurace described by Joy Nelson.

Testing:

I) Appy the bug 12424 patch

Before applying this patch:
0) Select 3 items.
1) Edit the items selected
2) Change "Full call number" option to 971/P23w/v.1-2/pt.8, 971.01/P23w/v.1-2/pt.6-7 and 971.01/P23w/v.1-2/pt.7
3) Save changes
4) Valide 971P23WV_12PT_8_000000000000000, 971_000000000000000_01P23WV_12PT_67 and 971_01P23WV_12PT_700000000000000  (table items - cn_sort column).

After applying this patch:
5) Edit again the item selected in 0
3) Save changes
4) Valide 971_000000000000000_P23W_V_12_PT_8, 971_010000000000000_P23W_V_12_PT_67, 971_010000000000000_P23W_V_12_PT_7 (table items - cn_sort column).

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8837 [QA Followup] - Add unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13083 - Hard-coded " by " in opac-tags.pl

The OPAC's list of a logged-in user's tagged titles displays title and
author, which for some reason are combined in the script into one
variable. I can't see any reason to do it this way.

This patch modifies the script so that title and author are passed as
separate variables. In addition, subtitle is now passed as well.

To test you must log into the OPAC as a user who has tagged multiple
titles, at least one of which should have an author and at least one
with a subtitle. View the list of tagged titles and confirm that this
information is being displayed correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11990 - Holds ratio report (circ/reserveratios.pl) sorts numeric values as text

This patch makes columns Holds, Items and "Hold ratio" to sort
numerically instead of lexicographically. Also changes default sorting
column from "Holds" to "Hold ratio" because this is a hold ratios
-report, not hold count report.

Also cleans up an excess aoColumn -definition, because aoColumns ==
aoColumnDefs without target operator. No point in defining columns
twice.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 5342: Serial claiming improvements: add a counter

This patch adds a new DB field serial.claims_count
This field already exists for late orders. It makes sense to introduce
it for serial.

Test plan:
0/
 a) Does not apply the patch.
 b) Remove all your claimissues notices and be sure you have some serial issues
    in late.
 c) remove email address for the vendor you will use.
 d) remove email address for the logged in user.
 e) Export claims using the csv export => The selected issues will be
 marked as claimed.
 f) logout/login (to update the email address).
1/ Apply the patch and execute the updatedb entry.
2/ Go on the Serials > Claims page
3/ Verify that you get a warning message 'No claimissue notice defined'
4/ Verify the vendor list is correct (with the number of serial in late.
You should not get any changes here.
5/ Select one vendor and verify that the issue which was claimed before
has a claim count set to 1.
6/ Verify that you are not able to send notification to the vendor.
7/ Create a claimissue notice.
Something like:
  <<LibrarianFirstname>>
  <<LibrarianSurname>>
  The following issues are in late:
  <order><<biblio.title>>, <<biblio.author>> (<<biblio.serial>>)</order>
8/ Go on the Serials > Claims page, the warning message does not appear
anymore.
9/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for this vendor).
10/ Add an email for the vendor.
11/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for your user).
12/ Add an email address to your user
logout/login
13/ Select issues. Select a notice. And "Send notification".
You should get a happy message: the email has been sent!
14/ The email will contain the order tags if bug 12851 is not
pushed/applied.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, some small issues fixed in a follow-up.
Note: If you change the email address of your staff user, you will
have to log out and back in to make the change take effect.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 5342: (qa-followup) FIX some issues

this patch:
- reintroduces the ISSN column
- fix a wording (already there before the main patch)
- fix the tests if a serial was already in late

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small change: Removed 2 tabs in claims.tt and fixed order
of ISSN/Issue number column descriptions as they were switched.

Note: The <order> tags are currently not stripped out of the
notice.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 5342: Update DBIx

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13149: for B 11926 (HEA - Render community koha statistic usages) introduces an column count error in sysprefs.sql

REPLICATE:

1. Create a new Koha database to your SQL Server. Set proper user permissions.
2. Change database data source definitions in koha-config.xml.
3. Run the web-installer to install a new Koha with defaults.
4. Run "SELECT * FROM systempreferences;" in your SQL Server and observe only
   3 systempreferences set.
 +--------------------------+
(( 5. mainpage.pl crashes!! ))
 +--------------------------+

AFTER THIS COMMIT:

0. Redo REPLICATE steps.
1. test phase 4 returns over 400 results.
2. test phase 5 doesn't crash.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13149: Fix sequence of fields in sysprefs.sql

The sequence of fields in the SQL statement didn't
match correctly.

Test plan:
- Run the web installer on an empty database
- Make sure no SQL errors are shown
- Check the systempreferences table in your database,
  especially all UsageStats*
- Make sure the explanations are in explanation etc.

Alternatively:
- Save your database
- truncate systempreferences;
- Load the sql file sysprefs.sql
- Verfiy as above

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

Tested creating new database, then loading kohastructure and sysprefs.sql
Without patch sysprefs fails to load, with patch loads Ok!
No koha-qa errors

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12573: Use correct comparison for comparing strings

Perl issues a warning when you try to do a numeric comparison on
non numeric values. While in 99% of the caeses numeric and string
comparison behave similarly when they dont tracking down resulting
bugs is hard. Also we dont want to be logging errors for normal
operations. replace numeric == with eq
(also switched to non-interpolating quotes so we dont generate
a warning from static code checkers like perlcritic)

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

I can get this warnings in log files. This patch make perfectly sense.
MARC subfield code should never be tested with Perl == operator, since
the code could be letter or a number. Perl eq operator do an implicit
string conversion for value which is a number, so it will work in any
case.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13112 - Add name of template file in html comment for each '.tt' file.

This patch adds the name of the .tt file as a HTML comment to OPAC and Staff client pages.

To test:
Apply patch
Open pages in OPAC and Staff client.
Make sure that a comment similar to the following appears in the source code:
<!-- TEMPLATE FILE: intranet-main.tt -->

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13095: An email will be sent shortly

This patch adjusts two instances where Koha says that an email has
been sent while it is just enqueued (put in the message queue). The
crontab example still suggests to run process_message_queue once an hour
and the manual even speaks about 1-4 hours.

In the process of selfregistration and sharing a shelf, I have adjusted
the text "has been sent" to "will be sent shortly". This covers imo
the one-hour frequency.

When writing this patch, I have examined all calls of EnqueueLetter;
I only found these two occurrences to be of interest.

Note: I would recommend to increase this frequency in the documentation,
but consider that for now to be outside the scope of this report.

Test plan:
[1] Self-register a new user with verification by email required. Look at
    the text when you submit your data.
[2] Share a list with someone else. Look at the text when you submit the
    invitation.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, small string change.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11593 - subtag_registry.sql files contain the same information for each language

This patch removes subtag_registry.sql from lang dirs,
and put it on a new mandatory dir

In that way we need to update only one file.
All similar files are removed.

To test:
1) Try a new install, or simply create a new database,
grant permissions on it, change koha-conf.xml to use
this database and go to staff page

2) Go step by step until all mandatory or optional sql
files are loaded. Check that subtag_registry.sql is
loaded.

3) Do it again but on other language. First install
translation and repeat 2), could use de-DE or fr-FR

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, tested with de-DE.
Thx!

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