From 00c76ec15151607b7bf0c5a86e12dd49dfb38bfd Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 21 Dec 2012 11:11:56 -0500 Subject: [PATCH] Bug 9254 - Problem with EnhancedMessagingPreferences - Followup - Rename pref to EnhancedMessagingPreferencesOPAC If the new pref is named EnhancedMessagingPreferencesOPAC, it will show up adjacent to EnhancedMessagingPreferences Signed-off-by: Bernardo Gonzalez Kriegel Comment: Works as described. But the patch only hides the link, not disable the feature. If you refresh OPAC after unset EnhancedMessagingPreferencesOPAC, you can still change your messaging preferences. --- C4/Auth.pm | 2 +- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 2 +- koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 29bda39..16e13b6 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -317,7 +317,7 @@ sub get_template_and_user { $template->param( "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'), - OPACEnhancedMessagingPreferences => C4::Context->preference('OPACEnhancedMessagingPreferences'), + EnhancedMessagingPreferencesOPAC => C4::Context->preference('EnhancedMessagingPreferencesOPAC'), GoogleJackets => C4::Context->preference("GoogleJackets"), OpenLibraryCovers => C4::Context->preference("OpenLibraryCovers"), KohaAdminEmailAddress => "" . C4::Context->preference("KohaAdminEmailAddress"), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 7284d98..b233e3a 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -417,4 +417,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UNIMARCField100Language', 'fre','UNIMARC field 100 default language',NULL,'short'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('Persona',0,'Use Mozilla Persona for login','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalSendNotices','0', NULL, '', 'YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACEnhancedMessagingPreferences',1, 'Show the patrons messaging preferences page in the OPAC', NULL, 'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('EnhancedMessagingPreferencesOPAC',1, 'Show the patrons messaging preferences page in the OPAC', NULL, 'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 95d4cff..f9fa41b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6439,7 +6439,7 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.11.00.XXX"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACEnhancedMessagingPreferences',1, 'Show the patrons messaging preferences page in the OPAC', NULL, 'YesNo')"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('EnhancedMessagingPreferencesOPAC',1, 'Show the patrons messaging preferences page in the OPAC', NULL, 'YesNo')"); print "Upgrade to $DBversion done (Bug 9254: Problem with EnhancedMessagingPreferences) \n"; SetVersion ($DBversion); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index c914dae..2d16a08 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -62,7 +62,7 @@ Patrons: no: "Don't allow" - patrons to receive notices. Note that this only applies to certain kinds of notices. - - - pref: OPACEnhancedMessagingPreferences + - pref: EnhancedMessagingPreferencesOPAC choices: yes: Allow no: "Don't allow" diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc index b48db08..b475d16 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc @@ -26,7 +26,7 @@ [% IF ( suggestionsview ) %]
  • [% ELSE %]
  • [% END %]my purchase suggestions
  • [% END %] [% END %] - [% IF ( EnhancedMessagingPreferences && OPACEnhancedMessagingPreferences ) %] + [% IF ( EnhancedMessagingPreferences && EnhancedMessagingPreferencesOPAC ) %] [% IF ( messagingview ) %]
  • [% ELSE %]
  • [% END %]my messaging
  • [% END %] [% IF ( virtualshelves ) %] -- 1.7.9.5