Bug 6506: Followup add warning in the system information tab.
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 9 Apr 2013 10:08:56 +0000 (12:08 +0200)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Wed, 1 May 2013 12:44:11 +0000 (08:44 -0400)
Add a warning in the system information tab of the about page.

Test plan:
Set OPACPrivacy = 1 and AnonymousPatron = 0 and go on the about page,
tab 'system information'. Check that the warning appears.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

http://bugs.koha-community.org/show_bug.cgi?id=6509
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

about.pl
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index 96a8b5a..b9508c6 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -68,6 +68,10 @@ my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBibl
 my $prefEasyAnalyticalRecords  = C4::Context->preference('EasyAnalyticalRecords');
 my $prefUseControlNumber  = C4::Context->preference('UseControlNumber');
 my $warnPrefEasyAnalyticalRecords  = ( $prefEasyAnalyticalRecords  && $prefUseControlNumber );
+my $warnPrefAnonymousPatron = (
+    C4::Context->preference('OPACPrivacy')
+        and not C4::Context->preference('AnonymousPatron')
+);
 
 my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode();
 
@@ -86,6 +90,7 @@ $template->param(
     prefAutoCreateAuthorities => $prefAutoCreateAuthorities,
     warnPrefBiblioAddsAuthorities => $warnPrefBiblioAddsAuthorities,
     warnPrefEasyAnalyticalRecords  => $warnPrefEasyAnalyticalRecords,
+    warnPrefAnonymousPatron => $warnPrefAnonymousPatron,
     errZebraConnection => $errZebraConnection,
     warnIsRootUser => $warnIsRootUser,
 );
index 258c77a..42ecc6b 100644 (file)
             <p>Please log in instead with a regular staff account. To create a staff account, create a library, a patron category 'Staff' and add a new patron. Then give this patron permissions from 'More' in the toolbar.</p>
         [% END %]
             <h2>Warnings regarding the system configuration</h2>
-        [% IF ( (warnPrefBiblioAddsAuthorities) || warnPrefEasyAnalyticalRecords ) %]
+        [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron %]
         <table>
             <caption>Preferences</caption>
             [% IF (warnPrefBiblioAddsAuthorities) %]
             [% IF (warnPrefEasyAnalyticalRecords) %]
             <tr><th scope="row"><b>Warning</b> </th><td>System preference 'EasyAnalyticalRecords' set, but UseControlNumber preference is set to 'Use'. Set it to 'Don't use' or else the 'Show analytics' links in the staff client and the OPAC will be broken.</td></tr>
             [% END %]
+            [% IF warnPrefAnonymousPatron %]
+                <tr><th scope="row"><b>Warning</b> </th><td>System preference 'OPACPrivacy' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly.</td></tr>
+            [% END %]
         </table>
         [% ELSE %]
             <p>No warnings</p>