Bugzilla – Attachment 50603 Details for
Bug 16281
Remove the use of "onclick" from Reports module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 16281: Remove the use of 'onclick' from Reports module
PASSED-QA-Bug-16281-Remove-the-use-of-onclick-from.patch (text/plain), 7.75 KB, created by
Katrin Fischer
on 2016-04-24 23:26:27 UTC
(
hide
)
Description:
[PASSED QA] Bug 16281: Remove the use of 'onclick' from Reports module
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-04-24 23:26:27 UTC
Size:
7.75 KB
patch
obsolete
>From f0f2e01b5ad275caf9e659e4b47e77ff85cefd4c Mon Sep 17 00:00:00 2001 >From: Aleisha <aleishaamohia@hotmail.com> >Date: Sun, 17 Apr 2016 23:45:26 +0000 >Subject: [PATCH] [PASSED QA] Bug 16281: Remove the use of 'onclick' from > Reports module > >EDIT: Removing unnecessary functions > >To test: > >1) Go to Reports -> Dictionary > a) Attempt to delete a definition. Confirm the Ok and cancel > buttons in confirm dialog work as expected >2) Go to Reports -> Build new > a) On each step of building a report, confirm the back button > works as expected > b) Confirm add column and delete column on step 3 works as > expected >3) Confirm deleting a report from the toolbar triggers confirm dialog > and it works as expected >4) Create a report with an SQL error and run it. Confirm that the > 'Return to previous page' link works as expected > >Sponsored-by: Catalyst IT >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/includes/reports-toolbar.inc | 8 ++++++- > .../prog/en/modules/reports/dictionary.tt | 9 ++++++- > .../en/modules/reports/guided_reports_start.tt | 28 +++++++++++++++------- > 3 files changed, 35 insertions(+), 10 deletions(-) > >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 eb1d266..fef1166 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc >@@ -27,7 +27,7 @@ > > [% IF ( CAN_user_reports_create_reports ) %] > <div class="btn-group"> >- <a class="confirmdelete btn btn-small" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Delete%20Saved" onclick="return confirm(MSG_CONFIRM_DELETE);"> >+ <a class="delete btn btn-small" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Delete%20Saved"> > <i class="fa fa-remove"></i> Delete > </a> > </div> >@@ -50,4 +50,10 @@ > > <script type="text/javascript"> > var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this report? This cannot be undone."); >+ >+$(document).ready(function(){ >+ $(".delete").on("click",function(){ >+ return confirmDelete(MSG_CONFIRM_DELETE); >+ }); >+}); > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt >index fbae1d3..c9e8752 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt >@@ -5,6 +5,13 @@ > <style type="text/css">fieldset.rows table { clear: none; margin: 0;}</style> > <script type="text/javascript"> > var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this dictionary definition? This cannot be undone."); >+ >+$(document).ready(function(){ >+ $("#delete").on("click",function(){ >+ return confirmDelete(MSG_CONFIRM_DELETE); >+ }); >+}); >+ > </script> > </head> > <body id="rep_dictionary" class="rep"> >@@ -82,7 +89,7 @@ var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this dictionary defi > <td class="actions"><form method="post" action="/cgi-bin/koha/reports/dictionary.pl"> > <input type="hidden" name="id" value="[% definition.id %]" /> > <input type="hidden" name="phase" value="Delete Definition" /> >- <button type="submit" name="submit" class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);"><i class="fa fa-trash"></i> Delete</button> >+ <button type="submit" name="submit" class="btn btn-mini" id="delete"><i class="fa fa-trash"></i> Delete</button> > </form></td> > </tr> > [% END %] >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 dee52ed..0ff2e8b 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 >@@ -68,6 +68,18 @@ function load_group_subgroups () { > > $(document).ready(function(){ > >+$(".goback").on("click",function(){ >+ window.history.back(); >+}); >+ >+$("#addColumn").on("click",function(){ >+ addColumn(); >+}); >+ >+$("#delColumn").on("click",function(){ >+ delColumn(); >+}); >+ > [% IF (saved1) %] > var rtable = $("#table_reports").dataTable($.extend(true, {}, dataTablesDefaults, { > 'bAutoWidth': false, >@@ -466,7 +478,7 @@ canned reports and writing custom SQL reports.</p> > > <fieldset class="action"> > <input type="hidden" name="phase" value="Choose this type" /> >- <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" /> >+ <input type="button" name="back" value="<< Back" class="goback" /> > <input type="submit" name="submit" value="Next >>" /> > </fieldset> > </form> >@@ -514,8 +526,8 @@ canned reports and writing custom SQL reports.</p> > [% END %] > </optgroup> > </select></div> >-<div style="width: 6.3em; float: right; margin-top: 100px"><input type="button" name="Add" value="Add" class="button" style="width:6em;" onclick="addColumn()" /><br /> >-<input type="button" name="delete" value="<< Delete" class="button" style="width: 6em; margin: 1em 0;" onclick="delColumn()" /></div> >+<div style="width: 6.3em; float: right; margin-top: 100px"><input type="button" name="Add" value="Add" class="button" style="width:6em;" id="addColumn" /><br /> >+<input type="button" name="delete" value="<< Delete" class="button" style="width: 6em; margin: 1em 0;" id="delColumn" /></div> > </div> > > <div class="yui-u"> >@@ -526,7 +538,7 @@ canned reports and writing custom SQL reports.</p> > <div class="yui-g"> > <fieldset class="action"> > <input type="hidden" name="phase" value="Choose these columns" /> >- <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" /> >+ <input type="button" name="back" value="<< Back" class="goback" /> > <input type="submit" name="submit" value="Next >>" /> > </fieldset> > </div> >@@ -599,7 +611,7 @@ canned reports and writing custom SQL reports.</p> > [% END %] > > <fieldset class="action"><input type="hidden" name="phase" value="Choose these criteria" /> >- <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" /> >+ <input type="button" name="back" value="<< Back" class="goback" /> > <input type="submit" name="submit" value="Next >>" /> </fieldset> > </form> > [% END %] >@@ -631,7 +643,7 @@ canned reports and writing custom SQL reports.</p> > </table></fieldset> > > <fieldset class="action"><input type="hidden" name="phase" value="Choose these operations" /> >- <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" /> >+ <input type="button" name="back" value="<< Back" class="goback" /> > <input type="submit" name="submit" value="Next >>" /></fieldset> > </form> > [% END %] >@@ -738,7 +750,7 @@ canned reports and writing custom SQL reports.</p> > </form> > <!-- Go back to editing --> > <form action='/cgi-bin/koha/reports/guided_reports.pl'> >- <button type="button" class="new" onclick="history.back()"><i class="fa fa-fw fa-pencil"></i> Edit SQL</button> >+ <button type="button" class="new goback"><i class="fa fa-fw fa-pencil"></i> Edit SQL</button> > </form> > </div> > [% END %] >@@ -1005,7 +1017,7 @@ Sub report:<select name="subreport"> > [% ELSE %] > [% END %] > <div id="onerror_actions"> >- <a href="javascript:window.history.back()" class="button">Return to previous page</a> >+ <a class="button goback">Return to previous page</a> > </div> > [% END %] > </div> >-- >1.9.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 16281
:
50303
|
50548
|
50585
|
50586
|
50589
| 50603 |
50604