Bug 24701: Add column config to course_items_table
authorLucas Gass <lucas@bywatersolutions.com>
Fri, 21 Feb 2020 20:54:41 +0000 (20:54 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 19 Mar 2020 09:08:33 +0000 (09:08 +0000)
This patch adds course_items_table to the column config tool
TEST PLAN:
1. Have some course reserves
2. Add some items to that course reserve and browse to opac-course-details
2. See all the unconfigurable columns
3. Apply patch
4. Browse to column config > OPAC > opac-course-details
5. Try hiding each column and make sure the correct column is hidden on opac-course-details.pl

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

admin/columns_settings.yml
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt

index ede1cdf..282d929 100644 (file)
@@ -1143,6 +1143,30 @@ modules:
         -
           columnname: serial_notes
 
+      course-items-table:
+        -
+          columnname: title
+        -
+          columnname: author
+        -
+          columnname: itemtype
+        -
+          columnname: location
+        -
+          columnname: collection
+        -
+          columnname: callnumber
+        -
+          columnname: copynumber
+        -
+          columnname: status
+        -
+          columnname: datedue
+        -
+          columnname: notes
+        -
+          columnname: link
+
   serials:
     subscription-detail:
       orders:
index 6ab523f..5db0b52 100644 (file)
@@ -5,6 +5,7 @@
 [% USE AuthorisedValues %]
 [% USE ItemTypes %]
 [% USE Branches %]
+[% USE ColumnsSettings %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Course reserves for [% course.course_name | html %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'opac-bottom.inc' %]
 [% BLOCK jsinclude %]
     [% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'columns_settings.inc' %]
     <script>
     $(document).ready(function() {
-        $("#course-items-table").dataTable($.extend(true, {}, dataTablesDefaults, {
+        columns_settings = [% ColumnsSettings.GetColumns( 'opac', 'biblio-detail', 'course-items-table', 'json' ) | $raw %];
+        KohaTable("#course-items-table", {
             "dom": '<"top"flp>rt<"clear">',
-            "columnDefs": [
+            "sorting": [[ 1, "asc" ]],
+            "autoWidth": false,
+            "asColumnDefs": [
                 { "type": "anti-the", "targets" : [ "anti-the" ] },
-                { "type": "title-string", "targets" : [ "title-string" ] }
+                { "type": "title-string", "targets" : [ "title-string" ] },
             ]
-        }));
+        }, columns_settings );
     });
     </script>
 [% END %]