Bug 19719: (follow-up) Show description instead of code
authorKatrin Fischer <katrin.fischer.83@web.de>
Sat, 31 Mar 2018 08:13:57 +0000 (10:13 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 22 Aug 2018 13:22:18 +0000 (13:22 +0000)
This follow-up changes the display from collection code
to description, following the existing pattern for
location.

To test:
- Repeat test plan from first patch
- Verfiy now the collection descrption shows
- Change column setting in administration
- Verify they work as expected

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc
koha-tmpl/intranet-tmpl/prog/js/checkouts.js
svc/checkouts

index cec35f3..3e2a672 100644 (file)
@@ -252,7 +252,7 @@ modules:
         -
           columnname: item_type
         -
-          columnname: collection_code
+          columnname: collection
         -
           columnname: location
         -
@@ -409,7 +409,7 @@ modules:
         -
           columnname: item_type
         -
-          columnname: collection_code
+          columnname: collection
         -
           columnname: location
         -
index 3ac7536..f9265dc 100644 (file)
@@ -16,7 +16,7 @@
                         <th scope="col">Due date</th>
                         <th scope="col">Title</th>
                         <th scope="col">Item type</th>
-                        <th scope="col">Collection code</th>
+                        <th scope="col">Collection</th>
                         <th scope="col">Location</th>
                         <th scope="col">Home library</th>
                         <th scope="col">Checked out on</th>
index c1830af..2525f56 100644 (file)
@@ -297,7 +297,7 @@ $(document).ready(function() {
                 },
                 {
                     "mDataProp": function ( oObj ) {
-                        return oObj.ccode.escapeHtml();
+                        return oObj.collection.escapeHtml();
                     }
                 },
                 {
@@ -638,7 +638,7 @@ $(document).ready(function() {
                     },
                     {
                         "mDataProp": function ( oObj ) {
-                            return oObj.ccode.escapeHtml();
+                            return oObj.collection.escapeHtml();
                         }
                     },
                     {
index d1fb8d3..9a1b3a5 100755 (executable)
@@ -90,7 +90,7 @@ my $sql = '
         items.itype,
         biblioitems.itemtype,
 
-        items.ccode,
+        items.ccode AS collection,
 
         borrowernumber,
         surname,
@@ -156,6 +156,11 @@ while ( my $c = $sth->fetchrow_hashref() ) {
         my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} });
         $location = $av->count ? $av->next->lib : '';
     }
+    my $collection;
+    if ( $c->{collection} ) {
+        my $av = Koha::AuthorisedValues->search({ category => 'CCODE', authorised_value => $c->{collection} });
+        $collection = $av->count ? $av->next->lib : '';
+    }
     my $lost;
     if ( $c->{itemlost} ) {
         my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $c->{itemlost} });
@@ -173,7 +178,7 @@ while ( my $c = $sth->fetchrow_hashref() ) {
         barcode              => $c->{barcode},
         itemtype             => $item_level_itypes ? $c->{itype} : $c->{itemtype},
         itemtype_description => $itemtype ? $itemtype->translated_description : q{},
-        ccode                => $c->{ccode},
+        collection           => $collection,
         location             => $location,
         homebranch           => $c->{homebranch},
         itemnotes            => $c->{itemnotes},