@@ -, +, @@ - when enabling EnhancedMessagingPreferences, the staff client if able to set the messaging preferences for the patrons categories, and then for the patron (normally the messaging preferences are the same for everyone) - when enabling EnhancedMessagingPreferences, the patrons can set in the OPAC their messaging preferences, which can be against the library rules - enabling EnhancedMessagingPreferences, should allow the the staff client to set the patrons messaging preferences - enabling EnhancedMessagingPreferences, should't allow patrons to set their messaging preferences (the link doesn't appear in the usermenu.inc) - should be another preference to allow the patrons to set their messaging preferences. - apply the patch - enable EnhancedMessagingPreferences, the messaging page should appear in OPAC - disable OPACEnhancedMessagingPreferences, the messaging page shouldn't appear in OPAC - disable EnhancedMessagingPreferences, the messaging page shouldn't appear in OPAC --- C4/Auth.pm | 1 + installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/patrons.pref | 8 +++++++- koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc | 2 +- 5 files changed, 17 insertions(+), 2 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -315,6 +315,7 @@ sub get_template_and_user { $template->param( "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'), + OPACEnhancedMessagingPreferences => C4::Context->preference('OPACEnhancedMessagingPreferences'), GoogleJackets => C4::Context->preference("GoogleJackets"), OpenLibraryCovers => C4::Context->preference("OpenLibraryCovers"), KohaAdminEmailAddress => "" . C4::Context->preference("KohaAdminEmailAddress"), --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -400,3 +400,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice'); 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'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6309,6 +6309,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($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')"); + print "Upgrade to $DBversion done (Bug 9254: Problem with EnhancedMessagingPreferences) \n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -60,7 +60,13 @@ Patrons: choices: yes: Allow no: "Don't allow" - - patrons to choose which notices they receive and when they receive them. Note that this only applies to certain kinds of notices. + - patrons to receive notices. Note that this only applies to certain kinds of notices. + - + - pref: OPACEnhancedMessagingPreferences + choices: + yes: Allow + no: "Don't allow" + - patrons to choose which notices they receive and when they receive them in the OPAC. Note that this only works if EnhancedMessagingPreferences is active. - - pref: ExtendedPatronAttributes choices: --- a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc +++ a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc @@ -26,7 +26,7 @@ [% IF ( suggestionsview ) %]
  • [% ELSE %]
  • [% END %]my purchase suggestions
  • [% END %] [% END %] - [% IF ( EnhancedMessagingPreferences ) %] + [% IF ( EnhancedMessagingPreferences && OPACEnhancedMessagingPreferences ) %] [% IF ( messagingview ) %]
  • [% ELSE %]
  • [% END %]my messaging
  • [% END %] [% IF ( virtualshelves ) %] --