Bug 10907: Optionally show the staff member's name who managed a suggestion in OPAC
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Mon, 9 Dec 2013 17:40:33 +0000 (18:40 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 23 Jan 2014 18:23:25 +0000 (18:23 +0000)
The name of a staff member who managed a suggestion is shown in the
the OPAC if the new system preference OpacSuggestionManagedBy is set to
'Show'. This is also the default.

If the preference is set to 'Don't show' the staff members name
is not displayed and the column 'Managed by' in the table of
suggestions in the patron account is not displayed.

To test:
- Create a one or more suggestions
- 'Manage' them by accecpting or rejecting
- Go to your patron account and check that the staff member name is
  shown for your suggestions
- Apply patch, run database update
- Check the name is still shown
- Switch the preference to 'Don't show'
- Check the name is no longer shown and the table still displays
  correctly, but without the 'Managed by' column
- Repeat those tests for both bootstrap and prog theme!

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Works as advertised, the only little nitpick is you could just do
[% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]

However you are following the custom in that file already, so that's
fine

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt

index 1ef029b..1668d37 100644 (file)
@@ -272,6 +272,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('OPACShowUnusedAuthorities','1','','Show authorities that are not being used in the OPAC.','YesNo'),
 ('opacsmallimage','','','Enter a complete URL to an image to replace the default Koha logo','free'),
 ('OpacStarRatings','all','disable|all|details',NULL,'Choice'),
+('OpacSuggestionManagedBy',1,'','Show the name of the staff member who managed a suggestion in OPAC','YesNo'),
 ('OpacSuppression','0','','Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details','YesNo'),
 ('OpacSuppressionByIPRange','','','Restrict the suppression to IP adresses outside of the IP range','free'),
 ('opacthemes','bootstrap','','Define the current theme for the OPAC interface.','Themes'),
index fb91869..0a86eb2 100755 (executable)
@@ -7937,6 +7937,13 @@ if (CheckVersion($DBversion)) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.15.00.XXX";
+if (CheckVersion($DBversion)) {
+    $dbh->do("INSERT INTO systempreferences ( variable, value, options, explanation, type ) VALUES
+        ('OpacSuggestionManagedBy',1,'','Show the name of the staff member who managed a suggestion in OPAC','YesNo');");
+    print "Upgrade to $DBversion done (Bug 10907: Add OpacSuggestionManagedBy system preference)\n";
+    SetVersion($DBversion);
+}
 
 =head1 FUNCTIONS
 
index a75c7ef..1364ff1 100644 (file)
@@ -280,6 +280,12 @@ OPAC:
                 homebranch: 'home library'
                 holdingbranch: 'holding library'
             - "is the logged in user's library. The second tab will contain all other items."
+        -
+            - pref: OpacSuggestionManagedBy
+              choices:
+                  yes: Show
+                  no: Don't show
+            - "the name of the staff member who managed a suggestion in OPAC."
     Features:
         -
             - pref: opacuserlogin
index 0ba0412..fa89078 100644 (file)
                                                 <th>Summary</th>
                                                 <th>Note</th>
                                                 [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]<th>Suggested for</th>[% END %]
-                                                <th>Managed by</th>
+                                                [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) == 1 %]<th>Managed by</th>[% END %]
                                                 <th>Status</th>
                                             </tr>
                                         </thead>
                                                             [% END %]
                                                         </td>
                                                     [% END %]
+                                                    [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) == 1 %]
                                                     <td>
                                                         [% IF ( suggestions_loo.surnamemanagedby ) %]
                                                             <span class="tdlabel">Managed by:</span>
                                                             [% END %]
                                                         [% END %]
                                                     </td>
+                                                    [% END %]
                                                     <td>
                                                         <span class="tdlabel">Status:</span>
                                                         [% IF ( suggestions_loo.ASKED ) %]Requested
index 5e52d84..61de641 100644 (file)
             <th>Summary</th>
             <th>Note</th>
             [% IF ( OPACViewOthersSuggestions ) %]<th>Suggested for</th>[% END %]
-            <th>Managed by</th>
+            [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) == 1 %]<th>Managed by</th>[% END %]
             <th>Status</th>
         </tr></thead>
         <tbody>[% FOREACH suggestions_loo IN suggestions_loop %]
                 [% IF ( OPACViewOthersSuggestions ) %]<td>
                     [% IF ( suggestions_loo.branchcodesuggestedby ) %][% suggestions_loo.branchcodesuggestedby %][% ELSE %]&nbsp;[% END %]
                 </td>[% END %]
+                [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) == 1 %]
                 <td>
                                        [% IF ( suggestions_loo.surnamemanagedby ) %][% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %],[% END %] [% suggestions_loo.firstnamemanagedby %][% ELSE %]&nbsp;[% END %]
                 </td>
+                [% END %]
                 <td>
                     [% IF    ( suggestions_loo.ASKED ) %]Requested
                     [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library