From ef3d4d9f79b28abee87863f2f19b4acc09e3ce89 Mon Sep 17 00:00:00 2001
From: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Date: Fri, 17 Nov 2023 11:18:27 +0000
Subject: [PATCH] Bug 35348: Remove cookie consents link from opac consents

The cookies details modal is now visible for all users from a footer
link, we no longer need it under the 'Consents' tab for logged in users.

Test plan
1) Enable CookieConsent and add a placholder tracker cookie to
   CookieConsentedJS preference
2) Log into the OPAC
3) Note that the 'Consents' link no longer appears in the users page.
4) Enable 'PrivacyPolicyConsent'
5) Note that the 'Consents' link now appears but on navigating to it
   there is no link for Cookie consents.
---
 koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss             | 4 ----
 koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc      | 2 +-
 .../opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt   | 6 ------
 koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js           | 2 +-
 4 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
index 233a1c13ac2..e858a847a61 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
@@ -2952,10 +2952,6 @@ $star-selected: #EDB867;
     }
 }
 
-#viewCookieConsents {
-    margin-top: 10px;
-}
-
 #patronconsents h2 {
     margin-top: 30px;
     font-size: 1.1rem;
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc
index 37ec40ffe01..87268831fc9 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc
@@ -25,7 +25,7 @@
             [% END %]
                 <a href="/cgi-bin/koha/opac-memberentry.pl">Personal details</a></li>
 
-            [% IF Koha.Preference('PrivacyPolicyConsent') || Koha.Preference('CookieConsent') || KohaPlugins.feature_enabled('patron_consent_type') %]
+            [% IF Koha.Preference('PrivacyPolicyConsent') || KohaPlugins.feature_enabled('patron_consent_type') %]
                 [% IF consentview %]<li class="active">[% ELSE %]<li>[% END %]
                     <a href="/cgi-bin/koha/opac-patron-consent.pl">Consents</a>
                 </li>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt
index 2552765ed19..878d76ebeb6 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt
@@ -77,12 +77,6 @@
                             <input id="saveconsent" type="submit" value="Save" class="btn btn-primary" />
                         </fieldset>
                     </form>
-
-                    [% IF Koha.Preference('CookieConsent') %]
-                        <h2>Cookies policy</h2>
-                        <button id="viewCookieConsents" type="button" class="btn btn-success">View your cookie consents</button>
-                    [% END %]
-
                 </div> <!-- / #patronconsents -->
             </div> <!-- / .col-lg-10 -->
         </div> <!-- / .row -->
diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js b/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js
index dab24fe1f04..0d44f11140d 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js
+++ b/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js
@@ -183,7 +183,7 @@
         });
 
         // "More information" handler
-        $('#consentMoreInfo, #cookieConsentFooter, #cookieConsentButton, #viewCookieConsents').on(
+        $('#consentMoreInfo, #cookieConsentFooter, #cookieConsentButton').on(
             'click',
             function (e) {
                 e.preventDefault();
-- 
2.42.0