Bugzilla – Attachment 127327 Details for
Bug 29391
Improve output of reservoir search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29391: Improve output of reservoir search
Bug-29391-Improve-output-of-reservoir-search.patch (text/plain), 10.75 KB, created by
PTFS Europe Sandboxes
on 2021-11-04 23:09:19 UTC
(
hide
)
Description:
Bug 29391: Improve output of reservoir search
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2021-11-04 23:09:19 UTC
Size:
10.75 KB
patch
obsolete
>From afc6fc6e3cbcbab966c3bf213d970e99c17385af Mon Sep 17 00:00:00 2001 >From: Owen <oleonard@myacpl.org> >Date: Tue, 2 Nov 2021 13:10:35 +0000 >Subject: [PATCH] Bug 29391: Improve output of reservoir search > >This patch makes the cataloging reservoir search results a configurable >DataTable. The empty edition and date columns are removed, and an import >data column is added. > >To test, apply the patch and go to Cataloging. > >- Perform a cataloging search which will return results from the > reservoir. >- The table of reservoir search results should be a DataTable with > paging, navigation, filtering, column configuration, etc. > - Confirm that all DataTable controls work correctly. >- Go to Administration -> Table settings -> Cataloging -> addbooks. > - Try modifying the default configuration and confirm that the > settings take effect. > >Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> >--- > C4/Breeding.pm | 9 ++- > admin/columns_settings.yml | 15 ++++ > cataloguing/addbooks.pl | 3 +- > .../prog/en/modules/cataloguing/addbooks.tt | 75 +++++++++++-------- > 4 files changed, 65 insertions(+), 37 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 75f47c668a..1d1af21978 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -77,8 +77,13 @@ sub BreedingSearch { > # normalise ISBN like at import > $isbn = C4::Koha::GetNormalizedISBN($isbn); > >- $query = "SELECT import_record_id, file_name, isbn, title, author >- FROM import_biblios >+ $query = "SELECT import_biblios.import_record_id, >+ import_batches.file_name, >+ import_biblios.isbn, >+ import_biblios.title, >+ import_biblios.author, >+ import_batches.upload_timestamp >+ FROM import_biblios > JOIN import_records USING (import_record_id) > JOIN import_batches USING (import_batch_id) > WHERE "; >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 18f4ce0c0e..56bec9ea04 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -465,6 +465,21 @@ modules: > columnname: checkin_on > > cataloguing: >+ addbooks: >+ reservoir-table: >+ columns: >+ - >+ columnname: title >+ - >+ columnname: isbn >+ - >+ columnname: coming_from >+ - >+ columnname: import_date >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 > additem: > itemst: > # NOTE: These columns are in the same order as kohastructure.sql, and contain all items >diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl >index 079d477b15..124349e5b7 100755 >--- a/cataloguing/addbooks.pl >+++ b/cataloguing/addbooks.pl >@@ -120,11 +120,10 @@ for my $resultsbr (@resultsbr) { > push @{$breeding_loop}, { > id => $resultsbr->{import_record_id}, > isbn => $resultsbr->{isbn}, >- copyrightdate => $resultsbr->{copyrightdate}, >- editionstatement => $resultsbr->{editionstatement}, > file => $resultsbr->{file_name}, > title => $resultsbr->{title}, > author => $resultsbr->{author}, >+ upload_timestamp => $resultsbr->{upload_timestamp} > }; > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >index ef8e4fa2c8..5fa257b4fd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >@@ -1,5 +1,7 @@ > [% USE raw %] > [% USE Koha %] >+[% USE KohaDates %] >+[% USE TablesSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Cataloging [% IF ( total || breeding_loop ) %] › Search results [% ELSIF ( query ) %] › No results found [% END %] › Koha</title> >@@ -200,41 +202,42 @@ > <div id="searchresult-breeding"> > <h2>Records found in the reservoir</h2> > [% IF ( breeding_loop ) %] >- <table> >- <tr> >- <th>Title</th> >- <th>ISBN</th> >- <th>Date</th> >- <th>Edition</th> >- <th>Coming from</th> >- <th> </th> >- </tr> >- [% FOREACH breeding_loo IN breeding_loop %] >+ <table id="reservoir-table"> >+ <thead> > <tr> >- <td> >- [% breeding_loo.title | html %] >- [% breeding_loo.author | html %] >- </td> >- <td>[% breeding_loo.isbn | html %]</td> >- <td>[% breeding_loo.copyrightdate | html %]</td> >- <td>[% breeding_loo.edition | html %]</td> >- <td>[% breeding_loo.file | html %]</td> >- <td> >- <div class="dropup"> >- <a class="btn btn-default btn-xs dropdown-toggle" id="reservoirsearchactions[% breeding_loo.id | html %]" role="button" data-toggle="dropdown" href="#"> >- Actions <b class="caret"></b> >- </a> >- <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reservoirsearchactions[% breeding_loo.id | html %]"> >- <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.id | uri %]" class="previewData"><i class="fa fa-eye"></i> MARC preview</a></li> >- <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.id | uri %]" class="previewData"><i class="fa fa-eye"></i> Card preview</a></li> >- [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] >- <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?breedingid=[% breeding_loo.id | uri %]"><i class="fa fa-plus"></i> Add biblio</a></li> >- [% END %] >- </ul> >- </div> >- </td> >+ <th>Title</th> >+ <th>ISBN</th> >+ <th>Coming from</th> >+ <th>Import date</th> >+ <th class="NoSort noExport"> </th> > </tr> >- [% END # /IF breeding_loo %] >+ </thead> >+ <tbody> >+ [% FOREACH breeding_loo IN breeding_loop %] >+ <tr> >+ <td> >+ [% breeding_loo.title | html %] [% breeding_loo.author | html %] >+ </td> >+ <td>[% breeding_loo.isbn | html %]</td> >+ <td>[% breeding_loo.file | html %]</td> >+ <td data-sort="[% breeding_loo.upload_timestamp | html %]">[% breeding_loo.upload_timestamp | $KohaDates %]</td> >+ <td> >+ <div class="dropup"> >+ <a class="btn btn-default btn-xs dropdown-toggle" id="reservoirsearchactions[% breeding_loo.id | html %]" role="button" data-toggle="dropdown" href="#"> >+ Actions <b class="caret"></b> >+ </a> >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reservoirsearchactions[% breeding_loo.id | html %]"> >+ <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.id | uri %]" class="previewData"><i class="fa fa-eye"></i> MARC preview</a></li> >+ <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.id | uri %]" class="previewData"><i class="fa fa-eye"></i> Card preview</a></li> >+ [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] >+ <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?breedingid=[% breeding_loo.id | uri %]"><i class="fa fa-plus"></i> Add biblio</a></li> >+ [% END %] >+ </ul> >+ </div> >+ </td> >+ </tr> >+ [% END # /IF breeding_loo %] >+ </tbody> > </table> > [% ELSE %] > <h3 id="searchresult-breeding">No results found</h3> >@@ -262,6 +265,8 @@ > </div> <!-- /.row --> > > [% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > <script> > > $(document).ready(function() { >@@ -306,6 +311,10 @@ > $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); > }); > >+ columns_settings = [% TablesSettings.GetColumns( 'cataloguing', 'addbooks', 'reservoir-table', 'json' ) | $raw %] >+ var reservoirt = KohaTable("reservoir-table", { >+ "pagingType": "simple" >+ }, columns_settings ); > }); > > /* this function open a popup to search on z3950 server. */ >-- >2.20.1
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 29391
:
127216
|
127327
|
128567