Bugzilla – Attachment 79313 Details for
Bug 17282
Ability to create charts for SQL reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17282: add template's variable filters
Bug-17282-add-templates-variable-filters.patch (text/plain), 8.40 KB, created by
Michal Denar
on 2018-09-24 14:24:50 UTC
(
hide
)
Description:
Bug 17282: add template's variable filters
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2018-09-24 14:24:50 UTC
Size:
8.40 KB
patch
obsolete
>From 88ef7ecdaecd92881f6ca455f3ee4f8796971c64 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Mon, 24 Sep 2018 12:22:09 +0000 >Subject: [PATCH] Bug 17282: add template's variable filters >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Michal Denar <black23Ägmail.com> > >Signed-off-by: Your Full Name <your_email> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc | 36 +++++++++++----------- > .../prog/en/includes/reports-toolbar.inc | 2 +- > .../en/modules/reports/guided_reports_start.tt | 8 ++--- > 3 files changed, 23 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc >index e20fb88..03a28f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc >@@ -21,9 +21,9 @@ > <li> > <label for="x_element">x column:</label> > <select id="x_element" name="x"> >- <option value="[% supposed_x %]" selected>[% supposed_x %]</option> >+ <option value="[% supposed_x | html %]" selected>[% supposed_x | html %]</option> > [% FOREACH header IN header_row %] >- <option value="[% header.cell %]">[% header.cell %]</option> >+ <option value="[% header.cell | html %]">[% header.cell | html %]</option> > [% END %] > </select> > </li> >@@ -40,22 +40,22 @@ > [% column = 1 %] > <li> > [% FOREACH header IN header_row %] >- <fieldset class="chart-column-conf" id="column_[% column %]" style="display: inline !important;"> >+ <fieldset class="chart-column-conf" id="column_[% column | html %]" style="display: inline !important;"> > <legend> >- Column [% column %] >- <a class="chart-column-delete" href="#" data-column="[% column %]"> >- <img src="[% interface %]/[% theme %]/img/x.png" alt="Delete" /> >+ Column [% column | html %] >+ <a class="chart-column-delete" href="#" data-column="[% column | html %]"> >+ <img src="[% interface | html %]/[% theme | html %]/img/x.png" alt="Delete" /> > </a> > </legend> > <div> >- <label for="y_[% column %]" >y:</label> >- <select id="y_[% column %]" name="y"> >- <option value="[% supposed_x %]" selected>[% supposed_x %]</option> >+ <label for="y_[% column | html %]" >y:</label> >+ <select id="y_[% column | html %]" name="y"> >+ <option value="[% supposed_x | html %]" selected>[% supposed_x | html %]</option> > [% FOREACH h IN header_row %] > [% IF header.cell == h.cell %] >- <option value="[% h.cell %]" selected>[% h.cell %]</option> >+ <option value="[% h.cell | html %]" selected>[% h.cell | html %]</option> > [% ELSE %] >- <option value="[% h.cell %]">[% h.cell %]</option> >+ <option value="[% h.cell | html %]">[% h.cell | html %]</option> > [% END %] > [% END %] > </select> >@@ -63,13 +63,13 @@ > > <div class="chart-column-group"> > [% i = 1 %] >- <label for="group_[% column %]">Group:</label> >- <select id="group_[% column %]" name="group"> >+ <label for="group_[% column | html %]">Group:</label> >+ <select id="group_[% column | html %]" name="group"> > [% FOREACH h IN header_row %] > [% IF i == column %] >- <option value="[% i %]" selected>[% i %]</option> >+ <option value="[% i | html %]" selected>[% i | html %]</option> > [% ELSE %] >- <option value="[% i %]">[% i %]</option> >+ <option value="[% i | html %]">[% i | html %]</option> > [% END %] > [% i = i + 1 %] > [% END %] >@@ -77,8 +77,8 @@ > </div> > > <div class="chart-column-line"> >- <label for="line_[% column %]">line:</label> >- <input class="column-line" id="column-line" name="[% header.cell %]" type="checkbox"> >+ <label for="line_[% column | html %]">line:</label> >+ <input class="column-line" id="column-line" name="[% header.cell | html %]" type="checkbox"> > </div> > </fieldset> > [% column = column + 1 %] >@@ -91,6 +91,6 @@ > </ol> > </fieldset> > [% item = { cell = supposed_x } %] >- [% header_row.unshift(item) %] >+ [% header_row.unshift(item) | html %] > <div id="chart"></div> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc >index 674fac9..83ad6af 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc >@@ -61,7 +61,7 @@ > <li><a id="tab" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&format=tab&report_id=[% id | html %]&reportname=[% name |uri %][% PROCESS params %]">Tab separated text</a></li> > <li><a id="ods" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&format=ods&report_id=[% id | html %]&reportname=[% name |uri %][% PROCESS params %]">Open Document Spreadsheet</a></li> > [% IF (results.json) %] >- <li><a id="download-chart" href="#">Download chart</a></li> >+ <li><a id="download-chart" href="#">Chart (.svg)</a></li> > [% END %] > </ul> > </div> >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 1bf82b0..0f4a7d8 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 >@@ -1048,14 +1048,14 @@ $(document).ready(function() { > var lines = []; > var options = {}; > >- headers = [% header_row.json %]; >+ headers = [% header_row.json | $raw %]; > > var results; > if ($('input[name="chart-include-all"]').prop('checked')) { >- results = [% allresults.json %] >+ results = [% allresults.json | $raw %] > } > else { >- results = [% results.json %] >+ results = [% results.json | $raw %] > } > > if ($('input[name="chart-exclude-last"]').prop('checked')) { >@@ -1105,7 +1105,7 @@ $(document).ready(function() { > options.lines = lines; > > chart = create_chart(kept_headers, kept_results, x_elements, y_elements, groups, options); >- $('#chart').prepend('<div style="font-size: 1rem; text-align: center;">' + "[% name %]" + '</div>'); >+ $('#chart').prepend('<div style="font-size: 1rem; text-align: center;">' + "[% name | html %]" + '</div>'); > $('#download-chart').show(); > $("#draw-chart").html(_(btn_text)); > $("html, body").animate({ scrollTop: $(document).height() }, "slow"); >-- >2.1.4
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 17282
:
55412
|
55442
|
55444
|
55480
|
55582
|
55586
|
55588
|
55604
|
55605
|
55606
|
55607
|
55868
|
55869
|
62529
|
63565
|
63566
|
63567
|
63568
|
63569
|
63570
|
63571
|
67225
|
67226
|
67227
|
67228
|
67229
|
67230
|
67231
|
69174
|
69429
|
69430
|
69493
|
79182
|
79230
|
79308
|
79309
|
79310
|
79311
|
79312
|
79313
|
79337
|
79338
|
79339