Bug 18980: Show distinction between shared and private lists in staff
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 22 Jun 2017 08:14:29 +0000 (10:14 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 10 Aug 2017 16:20:31 +0000 (13:20 -0300)
Just as we show this distinction in OPAC, this patch adds a type column
in the Your lists tab that displays Private or Shared. It always contains
Public in the other tab.

Test plan:
[1] Check if you see Shared for a private lists with shares in staff.
[2] Run t/db_dependent/Utils/Datatables_Virtualshelves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Utils/DataTables/VirtualShelves.pm
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt

index 28f579f..156b68c 100644 (file)
@@ -122,6 +122,7 @@ sub search {
         my $s = Koha::Virtualshelves->find( $shelf->{shelfnumber} );
         $shelf->{can_manage_shelf} = $s->can_be_managed( $loggedinuser );
         $shelf->{can_delete_shelf} = $s->can_be_deleted( $loggedinuser );
+        $shelf->{is_shared} = $s->is_shared;
     }
     return {
         iTotalRecords => $iTotalRecords,
index f26acd4..9dd7ea4 100644 (file)
@@ -92,6 +92,7 @@ $(document).ready(function(){
             { 'mDataProp': 'dt_type' },
             { 'mDataProp': 'dt_shelfname' },
             { 'mDataProp': 'dt_count' },
+            { 'mDataProp': 'dt_is_shared' },
             { 'mDataProp': 'dt_owner' },
             { 'mDataProp': 'dt_sortby' },
             { 'mDataProp': 'dt_created_on' },
@@ -638,6 +639,7 @@ function AdjustRemark() {
                         <th class="NoVisible">Type</th>
                         <th>List name</th>
                         <th>Contents</th>
+                        <th>Type</th>
                         <th>Owner</th>
                         <th>Sort by</th>
                         <th>Creation date</th>
@@ -648,6 +650,7 @@ function AdjustRemark() {
                         <th></th>
                         <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
                         <th></th>
+                        <th></th>
                         <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
                         <th>
                             <select class="filter text_filter" id="searchsortby_filter">
index bf1305a..2593a7a 100644 (file)
@@ -13,6 +13,8 @@
                     "<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% data.shelfnumber %]'>[% data.shelfname | html%]</a>",
                 "dt_count":
                     "[% data.count %] item(s)",
+                "dt_is_shared":
+                    "[% IF data.type == 2 %]Public[% ELSIF data.is_shared %]Shared[% ELSE %]Private[% END %]",
                 "dt_owner":
                     "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner %]'>[% data.firstname %] [% data.surname %]</a>",
                 "dt_sortby":