Bugzilla – Attachment 79383 Details for
Bug 21409
Add column configuration to course reserves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21409: Add column configuration to course reserves
Bug-21409-Add-column-configuration-to-course-reser.patch (text/plain), 7.38 KB, created by
Owen Leonard
on 2018-09-25 18:52:21 UTC
(
hide
)
Description:
Bug 21409: Add column configuration to course reserves
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-09-25 18:52:21 UTC
Size:
7.38 KB
patch
obsolete
>From 122cfb11e5fb6b0ab0888bacf8057a5ced2c1f0b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 25 Sep 2018 18:40:28 +0000 >Subject: [PATCH] Bug 21409: Add column configuration to course reserves > >This patch adds columns configuration and print/export options to two >tables: The table listing courses and the table listing titles reserved >for a course. > >To test you should have more than one course and multiple title reserved >for at least one course. > >- Apply the patch and go to Course reserves > - In the table of courses, confirm that all DataTables controls work > correctly: paging, filter, column visibility, export, etc. > - View a course with multiple titles reserved. Test all DataTables > controls on this table too. >- Go to Administration -> Columns settings > - Change the settings for the courses and reserves table and confirm > that these changes are applied correctly. >--- > admin/columns_settings.yml | 55 ++++++++++++++++++++++ > .../prog/en/modules/admin/columns_settings.tt | 6 +++ > .../en/modules/course_reserves/course-details.tt | 14 ++++-- > .../en/modules/course_reserves/course-reserves.tt | 14 ++++-- > 4 files changed, 79 insertions(+), 10 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 3e2a672..0419c49 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -177,6 +177,61 @@ modules: > - > columnname: stocknumber > >+ coursereserves: >+ courses: >+ course_reserves_table: >+ - >+ columnname: name >+ - >+ columnname: department >+ - >+ columnname: course_no >+ - >+ columnname: section >+ - >+ columnname: term >+ - >+ columnname: instructors >+ - >+ columnname: staff_note >+ - >+ columnname: public_note >+ - >+ columnname: no_of_students >+ - >+ columnname: enabled >+ >+ reserves: >+ course_reserves_table: >+ - >+ columnname: title >+ - >+ columnname: author >+ - >+ columnname: barcode >+ - >+ columnname: call_number >+ - >+ columnname: item_type >+ - >+ columnname: collection >+ - >+ columnname: location >+ - >+ columnname: library >+ - >+ columnname: staff_note >+ - >+ columnname: public_note >+ - >+ columnname: link >+ - >+ columnname: other_course_reserves >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ > members: > fines: > account-fines: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >index b41b653..3395b93 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >@@ -140,6 +140,12 @@ > [% PROCESS pagelist module=modules.circ modulename="circ" %] > </div> > >+ <h3><a href="#coursereserves">Course reserves</a></h3> >+ <div id="coursereserves"> >+ <h4>Course reserves tables</h4> >+ [% PROCESS pagelist module=modules.coursereserves modulename="coursereserves" %] >+ </div> >+ > <h3><a href="#members">Patrons</a></h3> > <div id="members"> > <h4>Patrons tables</h4> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >index f43eb90..86a9a2e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >@@ -3,6 +3,7 @@ > [% USE AuthorisedValues %] > [% USE ItemTypes %] > [% USE Branches %] >+[% USE ColumnsSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Course reserves › Course details for [% course.course_name | html %]</title> >@@ -20,7 +21,7 @@ > > <div class="main container-fluid"> > <div class="row"> >- <div class="col-md-8 col-md-offset-2"> >+ <div class="col-md-10 col-md-offset-1"> > > [% IF CAN_user_coursereserves_add_reserves OR CAN_user_coursereserves_manage_courses OR CAN_user_coursereserves_manage_courses %] > <div id="toolbar"> >@@ -53,8 +54,8 @@ > </div> > > [% IF course_reserves %] >+ <h1>Reserves</h1> > <table id="course_reserves_table"> >- <caption>Reserves</caption> > <thead> > <tr> > <th class="antithe">Title</th> >@@ -202,15 +203,18 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >- <script type="text/javascript"> >+ [% INCLUDE 'columns_settings.inc' %] >+ <script> >+ var columns_settings = [% ColumnsSettings.GetColumns( 'coursereserves', 'reserves', 'course_reserves_table', 'json' ) | $raw %]; > $(document).ready(function(){ >- $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var rtable = KohaTable("course_reserves_table", { > "sPaginationType": "four_button", >+ "bAutoWidth": false, > "aoColumnDefs": [ > { 'bSortable': false, 'aTargets': [ 'NoSort' ] }, > { 'sType': "anti-the", 'aTargets' : [ 'antithe'] } > ] >- })); >+ }, columns_settings ); > > $(".delete_item").click(function(){ > return confirmDelete(_("Are you sure you want to remove this item from the course?")); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt >index b1887b6..b1917a4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt >@@ -1,6 +1,7 @@ > [% USE raw %] > [% USE Asset %] > [% USE AuthorisedValues %] >+[% USE ColumnsSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Course reserves</title> >@@ -18,7 +19,7 @@ > > <div class="main container-fluid"> > <div class="row"> >- <div class="col-md-8 col-md-offset-2"> >+ <div class="col-md-10 col-md-offset-1"> > > [% IF CAN_user_coursereserves_add_reserves OR CAN_user_coursereserves_manage_courses OR CAN_user_coursereserves_manage_courses %] > <div id="toolbar"> >@@ -98,11 +99,14 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >- <script type="text/javascript" id="js"> >+ [% INCLUDE 'columns_settings.inc' %] >+ <script> >+ var columns_settings = [% ColumnsSettings.GetColumns( 'coursereserves', 'courses', 'course_reserves_table', 'json' ) | $raw %]; > $(document).ready(function() { >- $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sPaginationType": "four_button" >- })); >+ var ctable = KohaTable("course_reserves_table", { >+ "sPaginationType": "four_button", >+ "bAutoWidth": false >+ }, columns_settings ); > }); > </script> > [% END %] >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21409
:
79383
|
79737
|
79820