View | Details | Raw Unified | Return to bug 26070
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug-26070-remove-google-transliteration.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # Remove from the systempreferences table
4
    $dbh->do("DELETE FROM systempreferences WHERE variable = 'GoogleIndicTransliteration'");
5
6
    # Always end with this (adjust the bug info)
7
    NewVersion( $DBversion, 26070, "Remove references to deprecated Google Transliterate API");
8
}
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 206-212 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
206
('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
206
('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
207
('GDPR_Policy','','Enforced|Permissive|Disabled','General Data Protection Regulation - policy', 'Choice'),
207
('GDPR_Policy','','Enforced|Permissive|Disabled','General Data Protection Regulation - policy', 'Choice'),
208
('gist','0','','Default Goods and Services tax rate NOT in %, but in numeric form (0.12 for 12%), set to 0 to disable GST','Integer'),
208
('gist','0','','Default Goods and Services tax rate NOT in %, but in numeric form (0.12 for 12%), set to 0 to disable GST','Integer'),
209
('GoogleIndicTransliteration','0','','GoogleIndicTransliteration on the OPAC.','YesNo'),
210
('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'),
209
('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'),
211
('GoogleOpenIDConnect', '0', NULL, 'if ON, allows the use of Google OpenID Connect for login', 'YesNo'),
210
('GoogleOpenIDConnect', '0', NULL, 'if ON, allows the use of Google OpenID Connect for login', 'YesNo'),
212
('GoogleOAuth2ClientID', '', NULL, 'Client ID for the web app registered with Google', 'Free'),
211
('GoogleOAuth2ClientID', '', NULL, 'Client ID for the web app registered with Google', 'Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-7 lines)
Lines 197-209 OPAC: Link Here
197
                  no: "Don't show"
197
                  no: "Don't show"
198
            - a link to recent comments in the OPAC masthead.
198
            - a link to recent comments in the OPAC masthead.
199
        -
199
        -
200
            - pref: GoogleIndicTransliteration
201
              default: 0
202
              choices:
203
                  yes: Show
204
                  no: "Don't show"
205
            - GoogleIndicTransliteration on the OPAC.
206
        -
207
            - pref: OpacHighlightedWords
200
            - pref: OpacHighlightedWords
208
              choices:
201
              choices:
209
                  yes: Highlight
202
                  yes: Highlight
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-4 lines)
Lines 274-283 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
274
        //]]>
274
        //]]>
275
    </script>
275
    </script>
276
[% END %]
276
[% END %]
277
[% IF ( GoogleIndicTransliteration ) %]
278
    <script src="https://www.google.com/jsapi"></script>
279
    [% Asset.js("js/googleindictransliteration.js") | $raw %]
280
[% END %]
281
277
282
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
278
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
283
<script>
279
<script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/googleindictransliteration.js (-27 lines)
Lines 1-27 Link Here
1
      // Load the Google Transliteration API
2
      google.load("elements", "1", {
3
            packages: "transliteration"
4
          });
5
6
	function onLoad() {
7
        var options = {
8
          sourceLanguage: 'en',
9
          destinationLanguage: ['hi','kn','ml','ta','te'],
10
          shortcutKey: 'ctrl+g',
11
          transliterationEnabled: false
12
        };
13
14
        // Create an instance on TransliterationControl with the required
15
        // options.
16
        var control =
17
            new google.elements.transliteration.TransliterationControl(options);
18
19
        // Enable transliteration in the textfields with the given ids.
20
        var ids = [ "translControl1" ];
21
        control.makeTransliteratable(ids);
22
23
        // Show the transliteration control which can be used to toggle between
24
        // English and Hindi and also choose other destination language.
25
        control.showControl('translControl');
26
      }
27
      google.setOnLoadCallback(onLoad);
(-)a/opac/opac-main.pl (-5 lines)
Lines 105-113 $template->param( Link Here
105
    daily_quote         => $quote,
105
    daily_quote         => $quote,
106
);
106
);
107
107
108
# If GoogleIndicTransliteration system preference is On Set parameter to load Google's javascript in OPAC search screens
109
if (C4::Context->preference('GoogleIndicTransliteration')) {
110
        $template->param('GoogleIndicTransliteration' => 1);
111
}
112
113
output_html_with_http_headers $input, $cookie, $template->output;
108
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/opac/opac-search.pl (-6 lines)
Lines 1012-1022 $template->param( Link Here
1012
1012
1013
my $content_type = ($format eq 'rss' or $format eq 'atom' or $format eq 'opensearchdescription') ? $format : 'html';
1013
my $content_type = ($format eq 'rss' or $format eq 'atom' or $format eq 'opensearchdescription') ? $format : 'html';
1014
1014
1015
# If GoogleIndicTransliteration system preference is On Set parameter to load Google's javascript in OPAC search screens
1016
if (C4::Context->preference('GoogleIndicTransliteration')) {
1017
        $template->param('GoogleIndicTransliteration' => 1);
1018
}
1019
1020
$template->{VARS}->{DidYouMean} =
1015
$template->{VARS}->{DidYouMean} =
1021
  ( defined C4::Context->preference('OPACdidyoumean')
1016
  ( defined C4::Context->preference('OPACdidyoumean')
1022
      && C4::Context->preference('OPACdidyoumean') =~ m/enable/ );
1017
      && C4::Context->preference('OPACdidyoumean') =~ m/enable/ );
1023
- 

Return to bug 26070