Bugzilla – Attachment 96629 Details for
Bug 24305
Batch Item modification via item number in reports does not work with CONCAT in report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24305: Fix links to batch tools when report's columns do not contain integers
Bug-24305-Fix-links-to-batch-tools-when-reports-co.patch (text/plain), 5.57 KB, created by
Jonathan Druart
on 2019-12-26 10:17:24 UTC
(
hide
)
Description:
Bug 24305: Fix links to batch tools when report's columns do not contain integers
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-26 10:17:24 UTC
Size:
5.57 KB
patch
obsolete
>From 0799c91366e608ed66db96b0c50c299fe670ab66 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 26 Dec 2019 11:11:55 +0100 >Subject: [PATCH] Bug 24305: Fix links to batch tools when report's columns do > not contain integers > >If report's columns do not only contain integers, we should not point to >batch tools. >For instance, if the value is a link, the batch tools will not work as >they will not retrieve the id (itemnnumber or biblionumber) properly > >Test plan: >Create a report like: > SELECT CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber > FROM items > LIMIT 10; >Execute it >=> There is not link to the batch tools > >Edit the report like: > SELECT itemnumber > FROM items > LIMIT 10; >Execute it >=> There is a link to the batch tools > >Edit the report like > > SELECT itemnumber, CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber > FROM items > LIMIT 10; >Execute it >=> There is link to the batch tools > >Try other combinations with biblionumber. >--- > .../prog/en/modules/reports/guided_reports_start.tt | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index 4ca5833a52..95964dac69 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -755,8 +755,10 @@ canned reports and writing custom SQL reports.</p> > [% FOREACH result IN results %] > [% FOREACH cells IN result.cells %] > [% place = loop.index %] >+ [% NEXT UNLESS cells.cell.match('^(\d+)$') %] > [% IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] > [% SET batch_itemnumbers = 1 %] >+ [% SET header_row.$place.has_itemnumbers = 1 %] > <input type="hidden" name="[% header_row.$place.cell | html %]" value="[% cells.cell | html %]" /> > [% END %] > [% END %] >@@ -769,8 +771,10 @@ canned reports and writing custom SQL reports.</p> > [% FOREACH result IN results %] > [% FOREACH cells IN result.cells %] > [% place = loop.index %] >+ [% NEXT UNLESS cells.cell.match('^(\d+)$') %] > [% IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] > [% SET batch_itemnumbers = 1 %] >+ [% SET header_row.$place.has_itemnumbers = 1 %] > <input type="hidden" name="[% header_row.$place.cell | html %]" value="[% cells.cell | html %]" /> > [% END %] > [% END %] >@@ -781,8 +785,10 @@ canned reports and writing custom SQL reports.</p> > [% FOREACH result IN results %] > [% FOREACH cells IN result.cells %] > [% place = loop.index %] >+ [% NEXT UNLESS cells.cell.match('^(\d+)$') %] > [% IF header_row.$place.cell == 'biblionumber' || header_types.item(header_row.$place.cell) == 'biblionumber' %] > [% SET batch_biblionumbers = 1 %] >+ [% SET header_row.$place.has_biblionumbers = 1 %] > <input type="hidden" class="bib_to_list" name="biblionumber" value="[% cells.cell | html %]" /> > [% END %] > [% END %] >@@ -805,7 +811,7 @@ canned reports and writing custom SQL reports.</p> > </button> > <ul class="dropdown-menu" aria-labelledby="batch_mod_menu"> > [% FOREACH header_ro IN header_row %] >- [% IF header_ro.cell == 'biblionumber' || header_types.item( header_ro.cell ) == 'biblionumber' %] >+ [% IF header_ro.has_biblionumbers && ( header_ro.cell == 'biblionumber' || header_types.item( header_ro.cell ) == 'biblionumber' ) %] > <li class="dropdown-header">Bibliographic records</li> > <li> > <a href="#" data-submit="batch_record_modification" data-toggle="tooltip" data-placement="right" title="Send visible records to batch record modification" class="batch_op send_to_record_mod">Batch record modification</a> >@@ -817,7 +823,7 @@ canned reports and writing custom SQL reports.</p> > <a href="#" data-submit="batch_add_to_list" data-toggle="tooltip" data-placement="right" title="Send visible records to a list" class="batch_op send_to_list">Add to list</a> > </li> > [% END %] >- [% IF header_ro.cell == 'itemnumber' || header_types.item( header_ro.cell ) == 'itemnumber' %] >+ [% IF header_ro.has_itemnumbers && ( header_ro.cell == 'itemnumber' || header_types.item( header_ro.cell ) == 'itemnumber' ) %] > [% IF ( batch_biblionumbers ) %] > <li role="separator" class="divider"></li> > [% END %] >-- >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 24305
:
96629
|
97302
|
97829
|
97866
|
97867
|
97868
|
97869
|
97870
|
98057