Bug 11866: do not require special permissions to view course reserves in staff interface
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 27 Feb 2014 13:55:22 +0000 (08:55 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 10 Mar 2014 14:46:44 +0000 (14:46 +0000)
A librarian with no course reserves permissions cannot view course
reserves from the staff intranet, yet can from the OPAC. This doesn't
make much sense. Librarians should not require any course reserves
permissions to view courses and reserves from the staff intranet.

Test Plan:
1) Log into staff intranet as a librarian with no course reserves
   permissions
2) Note you cannot view course reserves
3) Apply this patch
4) Note you can now view course reserves
5) Verify you cannot modify courses or course reserves

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Bug 11866 [Follow-up] Staff side course reserves too restrictive

This follow-up patch adds a check for the "UseCourseReserves" system
preference to the display of the Course reserves menu item in the
header.

To test, view the "More" menu with the "UseCourseReserves" system
preference on and off. The menu item should appear and disappear
accordingly.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
course_reserves/course-reserves.pl
koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt

index b81bc94..4aa982a 100755 (executable)
@@ -35,7 +35,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $cgi,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { coursereserves => '*' },
     }
 );
 
index b6bc660..30c431b 100644 (file)
@@ -22,7 +22,7 @@
                             [% IF ( CAN_user_serials ) %]
                             <li><a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a></li>
                             [% END %]
-                            [% IF ( CAN_user_coursereserves ) %]
+                            [% IF ( UseCourseReserves ) %]
                             <li><a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a></li>
                             [% END %]
                             [% IF ( CAN_user_reports ) %]
index 5e69702..ea58136 100644 (file)
@@ -17,7 +17,7 @@
             "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
             "iDisplayLength": 20,
             "aoColumnDefs": [
-                { 'bSortable': false, 'aTargets': [ 9, 10, 11 ] }
+                { 'bSortable': false, 'aTargets': [ 'NoSort' ] }
             ]
         }));
 
@@ -82,9 +82,9 @@
                         <th>Library</th>
                         <th>Staff note</th>
                         <th>Public note</th>
-                        [% IF CAN_user_coursereserves_add_reserves %]<th>&nbsp;<!-- Edit --></th>[% END %]
-                        [% IF CAN_user_coursereserves_delete_reserves %]<th>&nbsp;<!-- Remove --></th>[% END %]
-                        <th>Other course reserves</th>
+                        [% IF CAN_user_coursereserves_add_reserves %]<th class="NoSort">&nbsp;<!-- Edit --></th>[% END %]
+                        [% IF CAN_user_coursereserves_delete_reserves %]<th class="NoSort">&nbsp;<!-- Remove --></th>[% END %]
+                        <th class="NoSort">Other course reserves</th>
                     </tr>
                 </thead>