From 9bb21c3abd17ef659c0c1db59de94f3e6525bc67 Mon Sep 17 00:00:00 2001 From: Bouzid Fergani Date: Mon, 2 Nov 2015 16:45:45 -0500 Subject: [PATCH] Bug 12528 - Enable staff to deny message setting access to patrons on the OPAC - Change the preference Enhancedmessagingpreference description. - Enable default EnhancedMessagingPreferences and OPACEnhancedMessagingPreferences. - not sent e-mail it's necessary, when user call opac-messaging.pl directly.. Testing: I Apply the patch II Run updatedatabase.pl 0) Search OPACEnhancedMessagingPreferences preference; 1) Validate "OPACEnhancedMessagingPreferences show patron messaging setting on the OPAC (NOTE: EnhancedMessagingPreferences must be enabled)."; 2) Disable OPACEnhancedMessagingPreferences preference; 3) Enable EnhancedMessagingPreferences preference; 4) On the OPAC -> user's settings, validate "your messaging" is not showed. Signed-off-by: Frederic Demians Works as expected. With the new syspref, patrons can be forbidden to modify themselves their own messaging preferences. Signed-off-by: Chris Cormack Also, I like sysprefs http://www.quickmeme.com/img/d9/d99723bc544e8d33572dc92f242a6f6e2dbe0126a2e35fe3de073d30d62002e6.jpg Signed-off-by: Jonathan Druart --- installer/data/mysql/atomicupdate/sysprefs_Bug12528.sql | 4 ++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/patrons.pref | 9 ++++++++- koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc | 14 ++++++++------ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt | 6 +++++- 5 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/sysprefs_Bug12528.sql diff --git a/installer/data/mysql/atomicupdate/sysprefs_Bug12528.sql b/installer/data/mysql/atomicupdate/sysprefs_Bug12528.sql new file mode 100644 index 0000000..b711e47 --- /dev/null +++ b/installer/data/mysql/atomicupdate/sysprefs_Bug12528.sql @@ -0,0 +1,4 @@ +INSERT INTO systempreferences ( variable, value, options, explanation,type ) VALUES +('OPACEnhancedMessagingPreferences', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo') ON DUPLICATE KEY UPDATE value ='1'; +INSERT INTO systempreferences ( variable, value, options, explanation,type ) VALUES +('EnhancedMessagingPreferences', '1', NULL, 'If ON, allows patrons to select to receive additional messages about items due or nearly due.', 'YesNo') ON DUPLICATE KEY UPDATE value ='1'; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 277fc1d..eb0c39c 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -291,6 +291,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'), ('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), ('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'), +('OPACEnhancedMessagingPreferences', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'), ('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd','','Define export options available on OPAC detail page.','multiple'), ('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'), ('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'), 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 b4b2a1c..e5f8ec4 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 @@ -54,7 +54,7 @@ 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. + - "Staff to manage which notices patrons will receive and when they will receive them. Note: this only applies to courtesy notices. To manage if patrons have also access to these settings, use OPACEnhancedMessagingPreferences." - - pref: ExtendedPatronAttributes choices: @@ -159,6 +159,13 @@ Patrons: yes: Do no: "Don't" - charge a fee when a patron changes to a category with an enrollment fee. + - + - pref: OPACEnhancedMessagingPreferences + choices: + yes: Show + no: "Don't show" + - "patron messaging setting on the OPAC (NOTE: EnhancedMessagingPreferences must be enabled)." + "Norwegian patron database": - - pref: NorwegianPatronDBEnable diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc index d166b6e..a8b0a5e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc @@ -77,12 +77,14 @@ [% END %] [% IF ( EnhancedMessagingPreferences ) %] - [% IF ( messagingview ) %] -
  • - [% ELSE %] -
  • - [% END %] - your messaging
  • + [% IF Koha.Preference( 'OPACEnhancedMessagingPreferences' ) %] + [% IF ( messagingview ) %] +
  • + [% ELSE %] +
  • + [% END %] + your messaging
  • + [% END %] [% END %] [% IF Koha.Preference( 'virtualshelves' ) == 1 %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt index d1d30fa..1fc8d99 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -22,6 +22,7 @@
    + [% IF Koha.Preference( 'OPACEnhancedMessagingPreferences' ) %]

    Your messaging settings

    [% IF ( settings_updated ) %] @@ -150,7 +151,10 @@
    -
    + [% ELSE %] +

    You are not allowed to call this page directly

    + [% END %] + -- 2.7.0