From cc45a04942edad5f8ac8d0d901e7a512c776b403 Mon Sep 17 00:00:00 2001 From: Jane Wagner Date: Mon, 17 Aug 2009 11:09:08 -0400 Subject: [PATCH] Bug 3535 Add syspref to control My Messaging tab display in OPAC Content-Type: text/plain; charset="utf-8" Enhanced Messaging Preferences must be on for the system to be able to send hold email notices. However, if it's on, then the My Messaging tab automatically shows in the OPAC. I've added a syspref opacmsgtab. If it is turned off, then the My Messaging tab will not show in the OPAC user account. Also, the Items Borrowed Notifications and Items Returned Notifications section of the OPAC My Personal Details tab (with options for email and text message notifications) will not display. --- admin/systempreferences.pl | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 1 + .../ru-RU/mandatory/system_preferences_optimal.sql | 1 + installer/data/mysql/updatedatabase.pl | 8 ++++++++ koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc | 2 ++ .../opac-tmpl/prog/en/modules/opac-userupdate.tmpl | 4 ++++ opac/opac-user.pl | 4 ++++ opac/opac-userupdate.pl | 1 + 9 files changed, 23 insertions(+), 0 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index bb73d42..ff2cc3d 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -310,6 +310,7 @@ $tabsysprefs{URLLinkText} = "OPAC"; $tabsysprefs{OPACShelfBrowser} = "OPAC"; $tabsysprefs{OPACDisplayRequestPriority} = "OPAC"; $tabsysprefs{OPACAllowHoldDateInFuture} = "OPAC"; +$tabsysprefs{opacmsgtab} = "OPAC"; # OPAC $tabsysprefs{SearchMyLibraryFirst} = "OPAC"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 1921948..030f05d 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -250,3 +250,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('F INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example .', 'Textarea'); INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','See: http://aws.amazon.com. Note that this is required after 2009/08/15 in order to retrieve any enhanced content other than book covers from Amazon.','','free'); +INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('opacmsgtab', '1', '', 'If on, enables display of My Messaging tab in OPAC patron account and the email/text message settings in OPAC user update tab.', 'YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index d08415f..5206e00 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -252,3 +252,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('F INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example .', 'Textarea'); INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','Voir: http://aws.amazon.com. Notez que cela est nécessaire après le 15 Aout 2009 pour pouvoir utiliser les webservices Amazon autre que les couvertures de livre.','','free'); +INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('opacmsgtab', '1', '', 'Si activé, affiche l'onglet "Mes Messages" dans le compte de l'adhérent à l'OPAC, et la configuration de l'e-mail et du message dans les préférences de l'utilisateur à l'OPAC.', 'YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql index da8b906..bcdc859 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql @@ -237,3 +237,4 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'if ON, enables the librarian to choose when they want to check out a notForLoan regular item',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('opacmsgtab', '1', '', 'If on, enables display of My Messaging tab in OPAC patron account and the email/text message settings in OPAC user update tab.', 'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f81acaa..a92f120 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2503,6 +2503,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Upgrade to $DBversion done (added AWSPrivateKey syspref - note that if you use enhanced content from Amazon, this should be set right away.)"; } +$DBversion = '3.01.00.042'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('opacmsgtab', '1', '', 'If on, enables display of My Messaging tab in OPAC patron account and the email/text message settings in OPAC user update tab.', 'YesNo')"); + SetVersion ($DBversion); + print "Upgrade to $DBversion done (added opacmsgtab sysprefs)\n"; +} + + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc index 2efc1da..8a40e0c 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc @@ -19,8 +19,10 @@ +
  • my messaging
  • +
  • my lists
  • diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl index ad638e8..2435f07 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl @@ -41,6 +41,7 @@ +
    Items Borrowed Notifications
      @@ -62,7 +63,9 @@
    + +
    Items Returned Notifications
      @@ -84,6 +87,7 @@
    +
    diff --git a/opac/opac-user.pl b/opac/opac-user.pl index e1f5aaf..1426b3a 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -194,6 +194,7 @@ foreach my $res (@reserves) { $template->param( RESERVES => \@reserves ); $template->param( reserves_count => $#reserves+1 ); $template->param( showpriority=>1 ) if $OPACDisplayRequestPriority; +$template->param( opacmsgtab => C4::Context->preference('opacmsgtab') ); my @waiting; my $wcount = 0; @@ -259,6 +260,9 @@ if (C4::Context->preference("OPACAmazonCoverImages") or $template->param(JacketImages=>1); } + + + $template->param( waiting_count => $wcount, textmessaging => $borr->{textmessaging}, diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl index 8664316..699ee83 100755 --- a/opac/opac-userupdate.pl +++ b/opac/opac-userupdate.pl @@ -142,6 +142,7 @@ $borr->{'dateenrolled'} = format_date( $borr->{'dateenrolled'} ); $borr->{'dateexpiry'} = format_date( $borr->{'dateexpiry'} ); $borr->{'dateofbirth'} = format_date( $borr->{'dateofbirth'} ); $borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} ); +$template->param( opacmsgtab => C4::Context->preference('opacmsgtab') ); if (C4::Context->preference('ExtendedPatronAttributes')) { my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber, 'opac'); -- 1.5.6.5