Bugzilla – Attachment 84789 Details for
Bug 21063
Allow columns in intranet ILL request datatable to be customisable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21063: (follow-up) Amendments for rebase
Bug-21063-follow-up-Amendments-for-rebase.patch (text/plain), 10.93 KB, created by
Andrew Isherwood
on 2019-02-05 14:50:20 UTC
(
hide
)
Description:
Bug 21063: (follow-up) Amendments for rebase
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2019-02-05 14:50:20 UTC
Size:
10.93 KB
patch
obsolete
>From ec3a7763e47ce9b48312c62865433425c40d566d Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Fri, 9 Nov 2018 10:47:41 +0000 >Subject: [PATCH] Bug 21063: (follow-up) Amendments for rebase > >Modify to add the additional changes required now we're rebasing on top >of the dependency tree. Includes adding additional columns (and changing >indexes for search/filter where appropriate) >--- > admin/columns_settings.yml | 32 ++++++++++----- > .../prog/en/modules/ill/ill-requests.tt | 47 ++++++++++------------ > 2 files changed, 43 insertions(+), 36 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 960040b04f..7943b3bb73 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -356,21 +356,21 @@ modules: > - > columnname: illrequest_id > - >- columnname: metadata_Author >+ columnname: metadata_author > - >- columnname: metadata_Title >+ columnname: metadata_title > - >- columnname: metadata_Item_part_title >+ columnname: metadata_item_part_title > - >- columnname: metadata_Issue >+ columnname: metadata_issue > - >- columnname: metadata_Volume >+ columnname: metadata_volume > - >- columnname: metadata_Year >+ columnname: metadata_year > - >- columnname: metadata_Item_part_pages >+ columnname: metadata_item_part_pages > - >- columnname: metadata_Type >+ columnname: metadata_type > - > columnname: orderid > - >@@ -378,19 +378,29 @@ modules: > - > columnname: patron_cardnumber > - >- columnname: biblio_id >+ columnname: patron > - >- columnname: borrowernumber >+ columnname: biblio_id > - > columnname: library_branchname > - > columnname: status > - > columnname: placed >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 > - >- columnname: replied >+ columnname: placed_formatted > - > columnname: updated >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 >+ - >+ columnname: updated_formatted >+ - >+ columnname: replied > - > columnname: completed > - >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index f8408ae6fc..06882ed3b1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -521,8 +521,8 @@ > <th scope="col">Order ID</th> > <th scope="col">Patron ID</th> > <th scope="col" class="patron_cardnumber">Patron barcode</th> >- <th scope="col">Biblio ID</th> > <th scope="col">Patron</th> >+ <th scope="col">Biblio ID</th> > <th scope="col">Branch</th> > <th scope="col">Status</th> > <th scope="col" class="placed"> </th> >@@ -530,6 +530,7 @@ > <th scope="col">Replied</th> > <th scope="col" class="updated"> </th> > <th scope="col" class="updated_formatted">Updated on</th> >+ <th scope="col">Replied</th> > <th scope="col">Completed on</th> > <th scope="col">Access URL</th> > <th scope="col">Cost</th> >@@ -615,7 +616,7 @@ > var sel = $('#illfilter_status option:selected').val(); > if (sel && sel.length > 0) { > activeFilters[me] = function() { >- table.column(5).search(sel); >+ table.api().column(15).search(sel); > } > } else { > if (activeFilters.hasOwnProperty(me)) { >@@ -632,7 +633,7 @@ > prep: function(tableData, oData) { > var uniques = {}; > tableData.forEach(function(row) { >- uniques[row.library.branchname] = 1 >+ uniques[row.library_branchname] = 1 > }); > Object.keys(uniques).sort().forEach(function(unique) { > $('#illfilter_branchname').append( >@@ -647,7 +648,7 @@ > var sel = $('#illfilter_branchname option:selected').val(); > if (sel && sel.length > 0) { > activeFilters[me] = function() { >- table.column(4).search(sel); >+ table.api().column(14).search(sel); > } > } else { > if (activeFilters.hasOwnProperty(me)) { >@@ -667,7 +668,7 @@ > var val = $('#illfilter_barcode').val(); > if (val && val.length > 0) { > activeFilters[me] = function() { >- table.column(12).search(val); >+ table.api().column(11).search(val); > } > } else { > if (activeFilters.hasOwnProperty(me)) { >@@ -736,8 +737,7 @@ > if ( row.patron_firstname ) { > patronLink = patronLink + row.patron_firstname + ' '; > } >- patronLink = patronLink + row.patron_surname + >- ' [' + row.patron_cardnumber + ' ]</a>'; >+ patronLink = patronLink + row.patron_surname + '</a>'; > return patronLink; > }; > >@@ -883,11 +883,11 @@ > }); > }); > >- // Display the modal containing request supplier metadata >- $('#ill-request-display-metadata').on('click', function(e) { >- e.preventDefault(); >- $('#dataPreview').modal({show:true}); >- }); >+ // Display the modal containing request supplier metadata >+ $('#ill-request-display-metadata').on('click', function(e) { >+ e.preventDefault(); >+ $('#dataPreview').modal({show:true}); >+ }); > > // Get our data from the API and process it prior to passing > // it to datatables >@@ -913,6 +913,7 @@ > var colObj = $.extend({}, thisCol); > colObj.name = colName; > colObj.className = colName; >+ colObj.defaultContent = ''; > > // We may need to process the data going in this > // column, so do it if necessary >@@ -936,6 +937,7 @@ > }); > > // Initialise the datatable >+ table = KohaTable("ill-requests", {}) > var illTable = KohaTable("ill-requests", { > 'aoColumnDefs': [ > { // Last column shouldn't be sortable or searchable >@@ -943,20 +945,15 @@ > 'bSortable': false, > 'bSearchable': false > }, >- { // Hide the two date columns we use just for sorting >- 'aTargets': [ 'placed', 'updated' ], >- 'bVisible': false, >- 'bSearchable': true >- }, > { // When sorting 'placed', we want to use the > // unformatted column > 'aTargets': [ 'placed_formatted'], >- 'iDataSort': 7 >+ 'iDataSort': 16 > }, > { // When sorting 'updated', we want to use the > // unformatted column > 'aTargets': [ 'updated_formatted'], >- 'iDataSort': 9 >+ 'iDataSort': 18 > }, > { > 'aTargets': [ 'patron_cardnumber' ], >@@ -964,7 +961,7 @@ > 'bSearchable': true > } > ], >- 'aaSorting': [[ 9, 'desc' ]], // Default sort, updated descending >+ 'aaSorting': [[ 18, 'desc' ]], // Default sort, updated descending > 'processing': true, // Display a message when manipulating > 'sPaginationType': "full_numbers", // Pagination display > 'deferRender': true, // Improve performance on big datasets >@@ -995,8 +992,8 @@ > var placedEnd = $('#illfilter_dateplaced_end').datepicker('getDate'); > var modifiedStart = $('#illfilter_datemodified_start').datepicker('getDate'); > var modifiedEnd = $('#illfilter_datemodified_end').datepicker('getDate'); >- var rowPlaced = data[6] ? new Date(data[6]) : null; >- var rowModified = data[8] ? new Date(data[8]) : null; >+ var rowPlaced = data[16] ? new Date(data[16]) : null; >+ var rowModified = data[18] ? new Date(data[18]) : null; > var placedPassed = true; > var modifiedPassed = true; > if (placedStart && rowPlaced && rowPlaced < placedStart) { >@@ -1020,7 +1017,7 @@ > ); > > var clearSearch = function() { >- table.search('').columns().search(''); >+ table.api().search('').columns().search(''); > activeFilters = {}; > for (var filter in filterable) { > if ( >@@ -1030,7 +1027,7 @@ > filterable[filter].clear(); > } > } >- table.draw(); >+ table.api().draw(); > }; > > // Apply any search filters, or clear any previous >@@ -1043,7 +1040,7 @@ > activeFilters[active](); > } > } >- table.draw(); >+ table.api().draw(); > }); > > // Clear all filters >-- >2.11.0
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 21063
:
76940
|
76941
|
76942
|
76943
|
79559
|
79560
|
80690
|
80691
|
80802
|
80841
|
82153
|
82154
|
82155
|
82156
|
82504
|
82505
|
82506
|
82507
|
84405
|
84786
|
84787
|
84788
|
84789
|
84790
|
84862
|
85854
|
85855
|
85869
|
85889
|
85893
|
85894
|
85895
|
85896
|
86060
|
86092
|
86093
|
86094
|
86095
|
86096
|
86097
|
86098
|
86099
|
86100
|
86101
|
86102
|
86103
|
86104
|
86105
|
86106
|
86235