Bug 7934: generate separate PO files for help pages

This patch modifies LangInstaller.pm to enable separation
of translation for Staff UI and Staff Help files.

It's a move that make sense, Help strings accounts for
44% of total word count for Staff, and as stated on
Comment #1, it could enable a different workflow on
translation work.

It's more a hack than an elegant solution, but it works.
Feel free to suggest another approach.

To test:

We need to test complete functionality, i.e. create and update
translation files and install translation, and verify that no
string is missing.

1) Before applying the patch, we need some data from staff file.
Pick your language, say de_DE, and

cd misc/translator/
perl translate update de-DE
msginit -i po/de-DE-i-staff-t-prog-v-3006000.po -o de-old.po --no-translator --no-wrap --locale=de_DE
egrep ^msgid de-old.po | sort | tee s-old | wc -l > number-old

We have the file s-old with all strings, and the number of strings on number-old

2) Apply the patch

3) New help file is called de-DE-staff-help.po, so create one
cp'ing old staff on new help

cp po/de-DE-i-staff-t-prog-v-3006000.po po/de-DE-staff-help.po

4) Make a new update, and analize

perl translate update de-DE
msginit -i po/de-DE-i-staff-t-prog-v-3006000.po -o de-new.po --no-translator --no-wrap --locale=de_DE
msginit -i po/de-DE-staff-help.po -o de-help.po --no-translator --no-wrap --locale=de_DE
egrep ^msgid de-new.po | sort | tee s-new | wc -l > number-new
egrep ^msgid de-help.po | sort | tee s-help | wc -l > number-help
cat s-new s-help | sort | uniq | tee s-all | wc -l > number-all
cat s-new s-help | sort | uniq -d | tee s-dup | wc -l > number-dup

Ideally what we need to found is:

diff s-old s-all = zero lines (old strings vs new strings)

In my test I got one line, but it's a false positive (the string "• " is present on new staff)

On numbers,

number-old - number-new - nummber-help + number-dup = 0
or
number-old - number-all = 0

(in my test again I have 1 as result, same string. Also there are 137
repeated lines between new staff and help)

All this tells me that all string to translate are preserved

5) Install translation

perl translate install de-DE

Enable language on staff, and check that help files are translated

6) Finally, create translation files

rm po/de-DE-*
perl translate create de-DE

verify that all files are created. Tests of 4) can be repeated.

7) Verify that no strings from help are present on staff UI file

egrep help po/de-DE-i-staff-t-prog-v-3006000.po

Only results came from help-top and bottom, and a few "help" on staff strings

Signed-off-by: Fridolyn SOMERS <fridolyn.somers@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan. Checked various pages in OPAC,
staff and intranet, translation was ok.
Passes QA script and tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11249: Add Db indexes on borrowers names

The borrowers search is by default on columns surname, firstname,
othernames and cardnumber.

(See C4::Members::_express_member_find).

Adding DB indexes will really increase the query speed.

This patch adds DB indexes on surname, firstname, othernames (cardnumber
has already an index).

Those indexes must be defined with a size because columns are mediumtext.

Test plan :
Test with mysql client :
mysql> explain select * from borrowers where surname like 'A%';
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
| id | select_type | table     | type  | possible_keys | key         | key_len | ref  | rows | Extra       |
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
|  1 | SIMPLE      | borrowers | range | surname_idx   | surname_idx | 767     | NULL |  395 | Using where |
+----+-------------+-----------+-------+---------------+-------------+---------+------+------+-------------+
=> key show the index is used

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, changes from updatedatabase and in kohastructure match.
I think deletedborrowers can be left out, as it's not queried when doing
patron searches. Patron deletes still work as expected.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11249: DBRev 3.15.00.006

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7518: regression test double-quote in search operand

Under certain circumstances, namely where QueryParser is off,
QueryWeightFields is on, and QueryFuzzy and QueryAutoTruncate are
off, a search with a double-quote embedded in it can fail: for
example

    web application

would return results where

    web "application

does not.

This patch adds an automated regression test.

To test:

[1] Apply this patch and run prove -v t/db_dependent/Search.t;
    two tests should fail.
[2] After applying the main patch that fixes the bug, the
    prove -v  t/db_dependent/Search.t should succeed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7518: certain searches with quotation marks don't work

Under certain circumstance, a search term without quotation marks
returns the expected results while the same search with a
double quote embedded in it would fail.

Koha should ignore the quotation marks and return results anyway.

This appears when  QueryWeightFields syspref is activated (and
QueryAutoTruncate is off), as field weighting builds a complex CCL
query using double quotes around search words.  This patch simply
replaces double quotes in search words by a space.

Test plan :
- Set QueryAutoTruncate off (you may also need to set QueryFuzzy to off)
- Set QueryWeightFields off
- Perform a serch on two words where you have results, like : centre "ville
=> you get results
- Set QueryWeightFields on
- Perform same serch
=> you get the same results

Signed-off-by: Leila <koha.aixmarseille@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9807 : Make it possible to view a basket group without reopening it

This patch make possible to view an individual closed basket group

without reopening it.
- It adds a new "View" button on closed basket group list
- It creates a view for closed basket groups, with 3 buttons (reopen,
  print, export)
- It adds a "delete" button on standard "edit" view (for open
  basket groups)

To test :
1/ regression test :
- create some empty basket groups
- create some basket groups by closing baskets
- in the list of basket groups closed and opened, check you can use
  the buttons that existed before the patch (close and print, delete,
  export, print, reopen)
- click on "Edit" to edit a opened basket group : check everything is
  like before :
-- change the billing and delivery places,
-- add a note,
-- put some new baskets  in the bg,
-- remove baskets from it
-- save it without checking "close" box => it should be saved but kept
   open
-- edit it again, and make other some changes (define a freetext
   delivery place for example)
-- save it with checking "close" => it should be saved but closed

2/ new feature test
- click on "view" button on top right column of some closed basket group
- check all the displayed informations are correct (places, free place,
  note, list of baskets)
- check you can not change anything
- click on "print" button => check a pdf is created
- click on "export" button => check a csv is created
- click on "reopen" button => you should stay on the same basket group, but
  it is now open and you can make some changes
- go back to the basket group list of the vendor. Check the reopened bg
   is in "open" tab
- click on "edit"
- click on new "delete" button => the bg should be deleted, and you are
  redirected to the bg list of the vendor.

Signed-off-by: cedric.vita@dracenie.com <cedric.vita@dracenie.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, t and xt. Works as advertised.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9807: (follow-up) fix variable name

Fixing closedbg name in template

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9807: (follow-up) reindent basketgroup.tt

Basketgroup.tt is very hard to read. This patch simply reindents it.
No visible changes expected

Regression test :
- check the list of opened and closed basketgroups for a vendor is
  displayed properly
- check an individual basketgroup (closed and opened) is displayed
  properly
- check you can edit a basketgroup and save changes
- check you can print and export a basketgroup
- check you can close and reopen a basketgroup

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9807: (follow-up) quell warning if invoice price not set

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Translation update - split staff UI and help files
Merge branch '3.16-help-split' of https://github.com/bgkriegel/koha-translate