Bug 12184: fix typo "retricted" on checkin page

To test:

[1] Check an item that belongs to a restricted patron and
    specify a non-default return date.
[2] Verify that the warning message contains "restricted"
    rather than "retricted".

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
Patch applies and makes sense. (I have not checked the actual UI,
but that should not be necessary for such a simple typo correction.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12106: fix capitalization: "Patron Attributes" on tools/patron import

There are three instances of incorrectly-capitalized "Patron Attributes"
on the patron import page. This patch corrects them.

To test, view the patron import page (Tools -> Import patrons). Confirm
that instances of the phrase "patron attributes" in the bottom-most
fieldset are correctly capitalized.

Followed test plan, works
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12211: fix wrong home link in bootstrap public catalog login page

In bootstrap opac-auth.tt, the link to "Home" in breadcrumbs leads
to #, it should lead to opac-main.pl like in all other pages.

Test plan :
 - Use boostrap opac theme
 - Go to cgi-bin/koha/opac-user.pl when not logged
=> without patch, clicking on Home does not change the page
=> with patch, clicking on Home leads to opac-main.pl

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10936: remove duplicate 'Standard number' option in Advanced search

This patch removes the duplicate 'Standard number' option
under the more options of the OPAC advanced search correctly
following updates from Katrin.

TEST PLAN
---------
1) Set opacthemes system preference to bootstrap
2) In OPAC, click 'Advanced search'
3) Click 'More options'
4) Check the Keywords dropdown for duplicate 'Standard number'
5) Apply patch
6) Refresh page, and make sure 'More options' is clicked still
7) Check the Keywords dropdown for duplicate 'Standard number'
   -- it's not this time.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10936: (prog theme) remove duplicate 'Standard number' option in Advanced search

TEST PLAN
---------
1) Set opacthemes system preference to prog
2) In OPAC, click 'Advanced search'
3) Click 'More options'
4) Check the Keywords dropdown for duplicate 'Standard number'
5) Apply patch
6) Refresh page, and make sure 'More options' is clicked still
7) Check the Keywords dropdown for duplicate 'Standard number'
   -- it's not this time

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described on prog theme, no more duplicate.
No koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12023 - move InstallAuth.pm to be in C4

InstallAuth was in the installer directory, which meant that Plack was
unable to find it, and so running the webinstaller would fail. This
moves it into C4,

Test plan:
* Make sure the web installer runs under plack
* Make sure the web installer runs under non-plack

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12023: (follow-up) fix redirect to step 3

This patch fixes the redirection to step 3.

If you go on installer/install.pl and Koha is already installed,
you should be redirected to the step 3. Without this patch, the
script raised an internal error (500).

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12147: Convert action links on invoices pages to a menu

Prior to this patch, the column for displaying the action links
was too narrow, leading to an ugly display.  This patch groups
"action" links into a menu as was done with Bug 11763.

This patch also converts the date column sorting configuration to use
header class instead of an index.

This patch also corrects a couple of HTML markup errors: An
improperly-closed <input> and an improperly closed <option>.

To test, view the invoices page and confirm that the "Actions" menu
button works corectly. Test the functionality of each menu options:
Details, Close, Reopen, and Delete. Confirm that sorting by billing date
still works correctly.

Much nicer user interface. Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12165: Add descriptions of charges (bug 2546) to Bootstrap Opac theme

1) Create an account with lots of different charges, fines, fees, etc.
2) Look at the accounts tab in the prog OPAC theme
3) Compare the page to bootstrap theme
4) Verify display is now the same

In my tests I found some things that could still be improved,
but for the goal is to make all OPAC themes behave the same.

Signed-off-by: Marc Véron <veron@veron.ch>

Tested by changing accounttype in table accountlines to all possible
values like Pay, Pay00, Pay01 etc.  Both themes display the same values,
e.g. "Payment, thanks (cash via SIP2)" for Pay00

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12165: (follow-up) display record title

The code introduced by bug 2546 uses an undefined variable (line.title).
It should be ACCOUNT_LINE.title.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11856: Add confirm option to POD in advance_notices.pl

Also removes a commented line that changed the value of $confirm.
If it would default to 1, we do not need it at all.
I am not saying that we need it, but just documenting that we have it.

Signed-off-by: Marc Véron <veron@veron.ch>

Small change in documentation.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11365: make label card element title texts translatable

To test:

1) cd misc/translator
2) perl translate update xx-YY
3) check that there's no msgid that contains the patron card label
   element title texts in po/xx-YY-i-staff-t-prog-v-3006000.po
4) apply patch
5) perl translate update xx-YY
6) check po/xx-YY-i-staff-t-prog-v-3006000.po that it contains the
   msgid. (search for "BLOCK translate_card_element")

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. Tested updating po file, translating and installing
language, checked on tools page.
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11365: (follow-up) trim whitespace in the translate_card_element block

Trim leading and trailing whitespace in the text generated
by the translate_card_element block to avoid generating
unescaped multi-line strings, which breaks the JavaScript

To test:

[1] Test actions in the patron card creator that generate
    JavaScript alerts, such as hitting the delete button
    without first selecting a batch or profile.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11392: Allow translating the viewlog module and action names

When viewing the logs, the user can see module and action,
such as "SYSTEMPREFERENCE", "MEMBERS" or "CREATE", "MODIFY", etc.
These texts are not translatable.

This patch allows translating those. It also adds the missing "CREATE"
action to the pulldown.

To test:

1) Go browse the system logs. Note the contents of the "Action" and
"Module" -pulldowns, and the contents of those columns in the log table.
2) Apply patch
3) Go browse the system logs again. The pull-downs should work, and
show the same values as before (plus "Create" for Action), and the
Action and Module -columns in the log table should not be in ALL CAPS.
4) cd misc/translator
5) perl translate update xx-YY
6) Check that the po/xx-YY-i-staff-t-prog-v-3006000.po contains the
values for the pull-downs in it. (Look for eg. "System prefs")

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11392: (follow-up) fix syntax error in template

In the two FOREACH loops introduced by the patch, wrap
the module and action names with quotes.  This fixes a
problem where parsing the template crashes with the following
error:

  Template process failed: file error - parse error - .../viewlog.tt line 83: unexpected token (RETURN)
    [% FOREACH actx IN [ ADD DELETE MODIFY ISSUE RETURN CREATE ] %] at .../C4/Templates.pm line 132.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12207: fix TTparser's handling of TT directives that contain "]"

This piece of TT code:

  [% SWITCH lang %]
   [% CASE ['en', 'eng'] %]English
   [% CASE ['fr', 'fre'] %]French
   [% CASE ['it', 'ita'] %]Italian
    ...
   [% CASE %][% lang %]
  [% END %]

is parsed by the TTparser.pm wrong. In the po-files, it shows up as:

   ...

All the "CASE [ ... ]" codes are shown as "ERROR".
This happens if any TT statement contains a ']' in it - the TTParser
looks for anything that starts with [% and ends with ].

This patch fixes it so that it expects TT directives to end
with '%]'.

To test:

1)  cd misc/translator/
2)  perl translate update xx-YY
3)  for x in po/xx-YY-*.po; do cp "$x" "${x/.po/.po.bak}"; done
4)  apply patch
5)  perl translate update xx-YY
6)  for x in po/xx-YY-*.po; do diff -Nurd "$x" "${x/.po/.po.bak}"; done
      the only changed lines should be those that apply to msgid's with
      ERROR-parameters.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12229: when exporting MARC records (as ISO2709), refuse to output records that would be longer than the MARC limit

Test:
1. Edit a bib record, add 100.000 chars text to 500a
2. Go to Tools -> Export data (or run tools/export.pl on
   the command line)
3. Verify that exporting as XML includes the record
4. Verify that exporting as MARC does not include the record,
   and that you get the following warning:

export.pl: record (number 2025) length 102668 is larger than the MARC spec allows (99999 bytes) at...

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12312 - correctly upgrade under Apache 2.2

As the way we need to reference Apache instance names has now changed
between 2.2 and 2.4, we need to try it out both ways to make sure we get
it right.

This also allows koha-create/koha-disable to try the .conf version of
the name if the first one doesn't work.

To test:
* Create an instance on an Apache 2.2 system with koha < 3.16
* Upgrade to 3.16 with this patch, saying 'yes' to the renaming question
** Make sure you don't see the warning: Warning: problem enabling $site
   in Apache
* Do a 'service apache2 restart'
* Make sure you can still access the instance
* Make sure that /etc/apache2/sites-enabled/instance.conf exists as a link
  to /etc/apache2/sites-available/instance.conf
* Check that koha-create and koha-remove behave like you'd expect.

Note:
* If you need to make debconf forget that it asked you the question
  about renaming so that it'll do it again, then run:
  echo "unregister koha-common/rename-apache-vhost-files" | sudo debconf-communicate koha-common
* 'debconf-show koha-common' will show you the current debconf
  configuration.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12301: Remove warnings on translate scripts

Using perl v5.18, the following is warned on updating/installing
templates:
  Smartmatch is experimental at ./translate line 54.

Moreover, the following should exist with previous perl versions:

perlcritic xgettext
Subroutine prototypes used at line 29, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 44, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 60, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 72, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 89, column 1.  See page 194 of PBP.
(Severity: 5)
Variable declared in conditional statement at line 105, column 13.
Declare variables outside of the condition.  (Severity: 5)
Subroutine prototypes used at line 127, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 136, column 1.  See page 194 of PBP.
(Severity: 5)
Variable declared in conditional statement at line 190, column 7.
Declare variables outside of the condition.  (Severity: 5)
Subroutine prototypes used at line 237, column 1.  See page 194 of PBP.
(Severity: 5)
Bareword file handle opened at line 238, column 5.  See pages 202,204 of
PBP.  (Severity: 5)
Two-argument "open" used at line 238, column 5.  See page 207 of PBP.
(Severity: 5)
Subroutine prototypes used at line 277, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 311, column 1.  See page 194 of PBP.
(Severity: 5)
Bareword file handle opened at line 350, column 9.  See pages 202,204 of
PBP.  (Severity: 5)
Two-argument "open" used at line 350, column 9.  See page 207 of PBP.
(Severity: 5)
Bareword file handle opened at line 353, column 5.  See pages 202,204 of
PBP.  (Severity: 5)
Bareword file handle opened at line 359, column 5.  See pages 202,204 of
PBP.  (Severity: 5)
Two-argument "open" used at line 359, column 5.  See page 207 of PBP.
(Severity: 5)

perl -wc xgettext.pl
\1 better written as $1 at TmplTokenizer.pm line 474.
main::token_negligible_p() called too early to check prototype at
xgettext.pl line 52.
xgettext.pl syntax OK

Test plan:
Apply this patch and verify the warnings/errors does not appear anymore
and no regression is found on creating/updating/installing templates.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no koha-qa errros.
Tested with perl v5.18.2
No warnings, no problem detected on create/update/install i18n files

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11014 - Slip Print Problem in Chrome

Currently, slips cannot be printed in circulation, members, or the
self check out when using Chrome.

This patch adds a timer of 1ms which allows Chrome's custom code to
prevent "window.close" occuring before the user has dealt with the
print window.

This patch also allows admins to use the 'IntranetSlipPrinterJS'
system preference to override the slip printing code by centralizing
all the slip printing code in slip-print.inc, and including this JS
anywhere it's needed in the staff client.

I haven't used this include in the OPAC SCO but perhaps it would make
sense to do so as well (even if it isn't referred to in the syspref's
name).

_TEST PLAN_
1) Using Chrome on Windows (not sure if this is an issue on other OSes),
try to print a slip in the following locations:

Fines Tab -> Print button
koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt:

Details tab -> Print button -> Print slip || Print quick slip
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt:

Details tab -> Print button -> Print summary
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt:

Fines tab -> Accounts tab -> Print (Manual invoice of $5 sundry)
koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt:

Checkout tab -> Print button
koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt:

Finish button
koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/printslip.tt

2) Note that each time you try to print, a new print page is created
but closed before you have a chance to print.

3) Apply the patch

4) Repeat Step 1

5) Note that the print page now doesn't close until after you've
chosen to print or cancel.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>