Bugzilla – Attachment 86060 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) Fix missing table values
Bug-21063-follow-up-Fix-missing-table-values.patch (text/plain), 7.03 KB, created by
Andrew Isherwood
on 2019-03-05 12:14:30 UTC
(
hide
)
Description:
Bug 21063: (follow-up) Fix missing table values
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2019-03-05 12:14:30 UTC
Size:
7.03 KB
patch
obsolete
>From cbeaafba3e2cfe2a91b62a18934e632161d105d3 Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Tue, 5 Mar 2019 12:11:26 +0000 >Subject: [PATCH] Bug 21063: (follow-up) Fix missing table values > >As per comment #48 here: >https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21063#c48 > >>pages >This was a misnamed property in colums_settings.yml > >>comments >This was a missing embed in the API call, probably a rebase error > >>article (part title) >This was a bug. A combination of a misnamed property in >columns_settings.yml and a missing "render" method on the datatable > >>completed on >This was an oversight and had apparently never worked. It has now been >added > >>cost >I cannot replicate this, cost is displaying fine for me >--- > Koha/Illrequest.pm | 2 ++ > Koha/REST/V1/Illrequests.pm | 2 +- > admin/columns_settings.yml | 9 +++++++-- > api/v1/swagger/paths/illrequests.json | 6 ++++++ > .../prog/en/modules/ill/ill-requests.tt | 22 ++++++++++++++++++++-- > 5 files changed, 36 insertions(+), 5 deletions(-) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 8bec6074f1..5f7019a139 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -25,6 +25,7 @@ use File::Basename qw( basename ); > use Encode qw( encode ); > use Mail::Sendmail; > use Try::Tiny; >+use DateTime; > > use Koha::Database; > use Koha::Email; >@@ -659,6 +660,7 @@ Mark a request as completed (status = COMP). > sub mark_completed { > my ( $self ) = @_; > $self->status('COMP')->store; >+ $self->completed(DateTime->now)->store; > return { > error => 0, > status => '', >diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm >index 7e79eb60fa..f8385a7fd2 100644 >--- a/Koha/REST/V1/Illrequests.pm >+++ b/Koha/REST/V1/Illrequests.pm >@@ -43,7 +43,7 @@ sub list { > > my $args = $c->req->params->to_hash // {}; > my $output = []; >- my @format_dates = ( 'placed', 'updated' ); >+ my @format_dates = ( 'placed', 'updated', 'completed' ); > > # Create a hash where all keys are embedded values > # Enables easy checking >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 31a13fc863..f93d7585dd 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -360,7 +360,7 @@ modules: > - > columnname: metadata_title > - >- columnname: metadata_item_part_title >+ columnname: metadata_article_title > - > columnname: metadata_issue > - >@@ -368,7 +368,7 @@ modules: > - > columnname: metadata_year > - >- columnname: metadata_item_part_pages >+ columnname: metadata_pages > - > columnname: metadata_type > - >@@ -399,6 +399,11 @@ modules: > columnname: replied > - > columnname: completed >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ is_hidden: 1 >+ - >+ columnname: completed_formatted > - > columnname: accessurl > - >diff --git a/api/v1/swagger/paths/illrequests.json b/api/v1/swagger/paths/illrequests.json >index ac63bc4f55..99ec0dd95b 100644 >--- a/api/v1/swagger/paths/illrequests.json >+++ b/api/v1/swagger/paths/illrequests.json >@@ -51,6 +51,12 @@ > "required": false, > "type": "string" > }, { >+ "name": "completed_formatted", >+ "in": "query", >+ "description": "The date the request was considered complete formatted", >+ "required": false, >+ "type": "string" >+ }, { > "name": "status", > "in": "query", > "description": "A full status string e.g. REQREV", >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 ab4b3a916d..59128904e7 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 >@@ -527,7 +527,8 @@ > <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" class="completed"> </th> >+ <th scope="col" class="completed_formatted">Completed on</th> > <th scope="col">Access URL</th> > <th scope="col">Cost</th> > <th scope="col">Comments</th> >@@ -749,6 +750,14 @@ > '</a>' : ''; > }; > >+ // Our 'render' function for title >+ var createTitle = function(data, type, row) { >+ return ( >+ row.hasOwnProperty('metadata_container_title') && >+ row.metadata_container_title >+ ) ? row.metadata_container_title : row.metadata_title; >+ }; >+ > // Render function for request ID > var createRequestId = function(data, type, row) { > return row.id_prefix + row.illrequest_id; >@@ -834,6 +843,9 @@ > func: createBiblioLink, > skipSanitize: true > }, >+ metadata_title: { >+ func: createTitle >+ }, > metadata_Type: { > func: createType > }, >@@ -905,7 +917,7 @@ > // Get our data from the API and process it prior to passing > // it to datatables > var ajax = $.ajax( >- '/api/v1/illrequests?embed=metadata,patron,capabilities,library,status_alias' >+ '/api/v1/illrequests?embed=metadata,patron,capabilities,library,status_alias,comments' > ).done(function() { > var data = JSON.parse(ajax.responseText); > // Make a copy, we'll be removing columns next and need >@@ -960,6 +972,7 @@ > }); > colData.push(colObj); > }); >+ console.log(colData); > > // Initialise the datatable > table = KohaTable("ill-requests", { >@@ -978,6 +991,11 @@ > // unformatted column > 'aTargets': [ 'updated_formatted'], > 'iDataSort': 16 >+ }, >+ { // When sorting 'completed', we want to use the >+ // unformatted column >+ 'aTargets': [ 'completed_formatted'], >+ 'iDataSort': 19 > } > ], > 'aaSorting': [[ 16, 'desc' ]], // Default sort, updated descending >-- >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