Bug 21403: Add Indian Amazon Affiliate option to AmazonLocale setting
authorOwen Leonard <oleonard@myacpl.org>
Tue, 25 Sep 2018 13:16:09 +0000 (13:16 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 2 Oct 2018 00:03:03 +0000 (00:03 +0000)
This patch adds an "IN" option to the AmazonLocale setting, allowing
Indian libraries to use their Amazon Affiliate ID in Koha's links to
Amazon.

To test, apply the patch and run updatedatabase.

- Go to Administration -> System preferences -> Enhanced content.
- Enable the OPACAmazonCoverImages preference.
- Enter a dummy ID in the AmazonAssocTag preference.
- Confirm that you can select "Indian" for the AmazonLocale preference.
- Select "Indian" and save.
- Open a record in the OPAC and confirm that the cover image links to
  Amazon.in and includes the ID you entered in AmazonAssocTag.
- Do the same with a record in the staff client.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

C4/External/Amazon.pm
installer/data/mysql/atomicupdate/bug_21403-add_indian_amazon_domain.sql [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref

index a76ab86..644d3ba 100644 (file)
@@ -37,6 +37,7 @@ sub get_amazon_tld {
         CA => '.ca',
         DE => '.de',
         FR => '.fr',
+        IN => '.in',
         JP => '.jp',
         UK => '.co.uk',
         US => '.com',
diff --git a/installer/data/mysql/atomicupdate/bug_21403-add_indian_amazon_domain.sql b/installer/data/mysql/atomicupdate/bug_21403-add_indian_amazon_domain.sql
new file mode 100644 (file)
index 0000000..f9a6bac
--- /dev/null
@@ -0,0 +1 @@
+UPDATE `systempreferences` SET options = 'US|CA|DE|FR|IN|JP|UK' WHERE variable = 'AmazonLocale';
index 3151b4b..bc7af05 100644 (file)
@@ -44,7 +44,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('AlternateHoldingsSeparator','',NULL,'The string to use to separate subfields in alternate holdings displays.','free'),
 ('AmazonAssocTag','','','See:  http://aws.amazon.com','free'),
 ('AmazonCoverImages','0','','Display Cover Images in Staff Client from Amazon Web Services','YesNo'),
-('AmazonLocale','US','US|CA|DE|FR|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'),
+('AmazonLocale','US','US|CA|DE|FR|IN|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'),
 ('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
 ('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',''),
 ('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'),
index 671c166..2d283cc 100644 (file)
@@ -25,6 +25,7 @@ Enhanced Content:
                   CA: Canadian
                   DE: German
                   FR: French
+                  IN: Indian
                   JP: Japanese
                   UK: British
             - website.