Bug 12513 - PROG/CCSR deprecation: Remove OpacShowLibrariesPulldownMobile system preference

With CCSR having been deprecated there is no longer a use for the
OpacShowLibrariesPulldownMobile system preference. This patch removes
it.

To test, apply the patch and run updatedatabase. Check that the
preference can no longer be found in system preferences.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Preference removed, no koha-qa errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12246 - PROG/CCSR deprecation: Remove OpacMainUserBlockMobile system preference

With CCSR having been deprecated there is no longer a use for the
OpacMainUserBlockMobile system preference. This patch removes it.

To test, apply the patch and run updatedatabase. Check that the
preference can no longer be found in system preferences.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Preference removed, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12245 - PROG/CCSR deprecation: Remove OPACMobileUserCSS system preference

With CCSR now deprecated there is no longer a need for the
OPACMobileUserCSS system preference. This patch removes it.

To test, apply the patch and run updatedatabase. Check that the
preference can no longer be found in system preferences.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Preference removed, no koha-qa errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12539: PROG/CCSR deprecation: Remove hardcoded theme from C4/Templates.pm

This patch removes hardcoded 'prog' from themelanguage on C4/Templates.pm
It adds a new syspref OPACFallback to hold the prefferred fallback
theme for new themes with minimal changes.

This does not brake CCSR if new syspref value is 'prog',
using 'bootstrap' works somehow, but with strange results.

To test:
1) Apply the patch
2) Run updatedatbase.pl
3) CCSR, prog & bootstrap must work as usual
4) Need to test theme/language fallback
 a) translate for your preferred language (xx-YY)
 b) enable language on opac
 c) go to opac, select that language
 d) login on opac, go to personal details
 e) remove koha-tmpl/opac-tmpl/bootstrap/xx-YY/modules/opac-memberentry.tt
 d) reload page, must load in English
 f) click other member options, must load on translated language
(can use other pages, ccsr, prog or bootstrap)
5) Do a similar test but for a staff page, enable lang, switch to it,
rm koha-tmpl/intranet-tmpl/prog/xx-YY/modules/admin/admin-home.tt,
any page must be translated except for admin home.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12539: Follow up to fix fallback theme

The is a problem in the logic, fallback must be:
1. Requested (theme, lang, tmpl)
a. return    (theme, lang, tmpl), if not
b. return    (fallback, lang, tmpl), if not
c. return    (theme, 'en', tmpl), if not as last resort
d. return    (fallback, 'en', tmpl)

Previous patch missed option 'c', worked for CCSR
but not bootstrap, sorry.

Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12657 - remove references to prog and ccsr from the packages

To test:
* Build a package and install it, and verify that there are no errors.
* Play around with koha-translate, listing, adding, and removing
  languages.

Note: one reference to prog and ccsr remains in koha-translate. This is
to allow it to remove any pre-existing translations on an upgrade.

Note 2: prog translations are still being installed, I think this is due
to the underlying translation system doing it.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12655 [Revised] PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT

Two XSL files in the bootstrap theme contain hard-coded paths to the
prog theme directory. This patch adds a query of the opacthemes system
preference and builds the path based on the returned value.

To test in a MARC21 system:

Create or locate a record which contains a subject which is linked to an
authority record. View the detail page for that record in the bootstrap
OPAC and confirm that there is a magnifying class icon next to the link
for that subject heading. Inspect or right-click the image and "View
image" [FF. "Open image in new tab" in Chrome] to verify that the image
being shown is from the bootstrap theme directory.

Also modified: The NORMARC XSL for the detail page which has been
changed in the same way. I did not test it in a NORMARC catalog.

Edit: Fixed copy-and-paste error causing duplicate image.
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 12653: PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in tests

This patch removes explicit references of themes from

  xt/author/icondirectories.t
  xt/author/translatable-templates.t
  xt/author/valid-templates.t
  xt/single_quotes.t
  xt/tt_valid.t

For xt/author/icondirectories.t it fixes a small difference on
two bootstrap files, previously unchecked, crystal-clear/_COPYING.txt
and crystal-clear/_README.txt

Some updates to license information

To test:
1. Apply the patch
2. Run each test, all must pass
prove xt/author/icondirectories.t xt/author/translatable-templates.t xt/author/valid-templates.t xt/single_quotes.t xt/tt_valid.t

3. Try to fail each test

a) xt/author/icondirectories.t
create a new file on any of icon dirs, e.g.
touch koha-tmpl/opac-tmpl/bootstrap/itemtypeimg/newfile.png
test must fail

b) xt/author/translatable-templates.t
change the name of 'en' dir on any theme opac or staff
test must fail

Add following line to any template file
<span [% IF ( value ) %]name="name"[% ELSE %] js="_('">TEST [% INCLUDE 'fail.inc' %]</span>

c) xt/author/valid-templates.t must fail
d) xt/single_quotes.t must fail
e) xt/tt_valid.t must fail

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 12653: Text file clean up

_README.txt has 4 newlines removed.
_COPYING.txt has 2 empty lines at the end of the file removed.
This was done by copying the smallest file in an existing theme
directory.

TEST PLAN
---------
1) Compare files.
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_COPYING.txt koha-tmpl/opac-tmpl/prog/itemtypeimg/crystal-clear/_COPYING.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_COPYING.txt koha-tmpl/opac-tmpl/ccsr/itemtypeimg/crystal-clear/_COPYING.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_COPYING.txt koha-tmpl/opac-tmpl/bootstrap/itemtypeimg/crystal-clear/_COPYING.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_README.txt koha-tmpl/opac-tmpl/prog/itemtypeimg/crystal-clear/_README.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_README.txt koha-tmpl/opac-tmpl/ccsr/itemtypeimg/crystal-clear/_README.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_README.txt koha-tmpl/opac-tmpl/bootstrap/itemtypeimg/crystal-clear/_README.txt
-- there will be differences.
2) Apply patch
3) Compare files again.
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_COPYING.txt koha-tmpl/opac-tmpl/prog/itemtypeimg/crystal-clear/_COPYING.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_COPYING.txt koha-tmpl/opac-tmpl/ccsr/itemtypeimg/crystal-clear/_COPYING.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_COPYING.txt koha-tmpl/opac-tmpl/bootstrap/itemtypeimg/crystal-clear/_COPYING.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_README.txt koha-tmpl/opac-tmpl/prog/itemtypeimg/crystal-clear/_README.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_README.txt koha-tmpl/opac-tmpl/ccsr/itemtypeimg/crystal-clear/_README.txt
diff koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/crystal-clear/_README.txt koha-tmpl/opac-tmpl/bootstrap/itemtypeimg/crystal-clear/_README.txt
-- there will be no differences.
4) git reset --hard origin/master
5) Apply the patch affecting the .t files.
6) Prove things.
prove xt/author/icondirectories.t xt/author/translatable-templates.t xt/author/valid-templates.t xt/single_quotes.t xt/tt_valid.t
-- expecting xt/author/icondirectories.t to fail
7) Apply this patch.
8) Prove things.
prove xt/author/icondirectories.t xt/author/translatable-templates.t xt/author/valid-templates.t xt/single_quotes.t xt/tt_valid.t
-- expecting success.

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

This patch fixes some issues with files on itemtypes dirs.
No koha-qa erros.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 12233: Remove the prog and ccsr themes files

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12233: change opacthemes syspref from {prog|ccsr} to bootstrap

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 12653: (RM followup) Fix the test count

Bug 12233 removed the prog and CCSR theme directories, so the number
of tests needs to be fixed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11346: DBRev 3.17.00.41 (deprecate the PROG and CCSR themes)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12535 - PROG/CCSR Deprecation: Make opac translation theme independent

This patch makes opac translation files theme independent
A side effect is that current prog translation file is
renamed.

But the renaming is not added, that gives a patch of ~60M!

Current list of languages are now obtained from pref files.

To test:
1) Apply the patch

2) For your preferred language, rename opac prog file
from 'xx-YY-i-opac-t-prog-v-3006000.po' to 'xx-YY-opac-prog.po'

3) Update that language, there must be no errors
cd misc/translation
./translate update xx-YY [-v]
Check updated po files

4) Install any language, there must be no errors
./translate install xx-YY
Check prog theme for that language

5) Create translation files. Remove a language or create new lang files
./translate create zz-WW
ls -l po/zz-WW*po
check there are 3 files (and *~) for opac

6) Check updated pod for LangInstaler.pm and translate script

When PROG/CCSR themes are removed, I'll add a Bug to remove
corresponding files.

Perhaps RM could add a followup to rename all files,
cd misc/translator/po
for old in $(ls *opac-t*); do
    new=$(echo $old | sed 's/-i-opac-t-prog-v-3006000/-opac-prog/');
    git mv $old $new;
done

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12494 - Remove yuipath system preference

With the OPAC prog template going away, the only remaining use of the
yuipath preference is on the basketgroups template. The yuipath
preference should be removed and the local path hard-coded.

This patch:
  - removes yuipath handling from C4/Templates.pm
  - removes the preference from sysprefs.sql
  - deletes the preference via updatedatabase.pl
  - removes the preference from the staff client preferences file
  - removes unused references to the YUI assets from the help file
    header include
  - adds the local YUI asset path to acqui/basketgroup.tt

To test, apply the patch and run the database update. View some online
help pages and confirm that they function correctly. View the
basketgroups page (Acquisition -> Vendor -> Basket groups), edit a
basket group, and confirm that basket drag and drop operations work
correctly.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Online help and basket group drag&drop functionality still work correctly.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10433 - colspan calculation done by opac/opac-reserve.pl should be moved to template

Since the bootstrap OPAC's place hold interface doesn't use tables
there is no use for the colspan calculation being done in the script.
This patch removes it.

To test, place one or more holds in the OPAC and confirm that there are
no display problems. The OPAC error logs should show no associated
error.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No display problems, no related errors on log, no koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script, no regressions found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12653: remaining prog reference in t/db_dependent/SuggestionEngine_ExplodedTerms.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13145 UNIMARC 610 tag isn't displayed in OPAC when there is no $9 subfield

On OPAC detail page, subject fields are not displayed when they are not linked
to authorities ($9 subfield). This is due to a misplelling in UNIMARC XSL
detail page.

TO TEST:

(1) On a Koha UNIMARC, find out a biblio record with a 610 field, without $9
    subfield. Something like:

    610 1 $a Aliment -- Approvisionnement -- Europe -- Histoire

    Or add such a field to an existing record.

(2) Check that OPACXSLTDetailsDisplay is set to 'default'

(3) See this record on OPAC detail page. You must see 'Subject: ' => nothing
    after the 'Subject' label. If your record contains several 610 fields
    without $9, the | character will appear, separating no content.

(4) Apply the patch.

(5) Reload the page seen at step (3): subject is displayed now.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, tested on a UNIMARC installation.
Small XSLT change.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13028: Resolve uninitialized value in string eq at cmp_sysprefs.pl line 194

If you use the restore option with a partial pref file not containing a version, you will have this error. Also the count of updated prefs will be one too high.

This is corrected by a better test of the hash value in the CheckVersionPref subroutine.

Test plan:
[1] Create a small pref file and remove the version pref (if present). You
could for instance do a pref backup and remove most lines.
[2] Use the restore option with and without this patch.
    So, something like:
        maintclone/misc/maintenance/cmp_sysprefs.pl -c r -f 9999crucial.pref
[3] Check on the error message and the pref count.

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>