Bugzilla – Attachment 82156 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), 12.08 KB, created by
Andrew Isherwood
on 2018-11-09 10:52:36 UTC
(
hide
)
Description:
Bug 21063: (follow-up) Amendments for rebase
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2018-11-09 10:52:36 UTC
Size:
12.08 KB
patch
obsolete
>From 674ef7981b0493e9a61657d6a16f8416570d2be5 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 | 59 +++++++++------------- > 2 files changed, 45 insertions(+), 46 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index db4adc3e8d..7ed594852e 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -262,21 +262,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 > - >@@ -284,19 +284,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 299b676053..fcb7bddf29 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 >@@ -507,15 +507,15 @@ > <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> > <th scope="col" class="placed_formatted">Placed on</th> >- <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> >@@ -597,7 +597,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)) { >@@ -614,7 +614,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( >@@ -629,7 +629,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)) { >@@ -649,7 +649,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)) { >@@ -718,8 +718,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; > }; > >@@ -806,7 +805,7 @@ > action: { > func: createActionLink > }, >- borrowernumber: { >+ patron: { > func: createPatronLink > }, > illrequest_id: { >@@ -865,11 +864,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 >@@ -895,6 +894,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 >@@ -918,35 +918,25 @@ > }); > > // Initialise the datatable >- var illTable = KohaTable("ill-requests", { >+ table = KohaTable("ill-requests", { > 'aoColumnDefs': [ > { // Last column shouldn't be sortable or searchable > 'aTargets': [ 'actions' ], > '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 >- }, >- { >- 'aTargets': [ 'patron_cardnumber' ], >- 'bVisible': false, >- 'bSearchable': true >+ 'iDataSort': 18 > } > ], >- '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 >@@ -955,7 +945,6 @@ > 'originalData': data, // Enable render functions to access > // our original data > 'initComplete': function() { >- > // Prepare any filter elements that need it > for (var el in filterable) { > if (filterable.hasOwnProperty(el)) { >@@ -977,8 +966,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) { >@@ -1002,7 +991,7 @@ > ); > > var clearSearch = function() { >- table.search('').columns().search(''); >+ table.api().search('').columns().search(''); > activeFilters = {}; > for (var filter in filterable) { > if ( >@@ -1012,20 +1001,20 @@ > filterable[filter].clear(); > } > } >- table.draw(); >+ table.api().draw(); > }; > > // Apply any search filters, or clear any previous > // ones > $('#illfilter_form').submit(function(event) { > event.preventDefault(); >- table.search('').columns().search(''); >+ table.api().search('').columns().search(''); > for (var active in activeFilters) { > if (activeFilters.hasOwnProperty(active)) { > 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