Bugzilla – Attachment 31717 Details for
Bug 2969
Report Name should be mandatory for saved reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2969 - Report Name should be mandatory for saved reports
Bug-2969---Report-Name-should-be-mandatory-for-sav.patch (text/plain), 5.94 KB, created by
Jonathan Druart
on 2014-09-18 14:23:33 UTC
(
hide
)
Description:
Bug 2969 - Report Name should be mandatory for saved reports
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-18 14:23:33 UTC
Size:
5.94 KB
patch
obsolete
>From 8cf18cea5dc381a2788516daa49e5897a661bdda Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 23 Jan 2013 10:05:22 -0500 >Subject: [PATCH] Bug 2969 - Report Name should be mandatory for saved reports > >This patch re-implements the database changes from the original patch >and adds an update for existing reports. It also reimplements the >client-side validation using the new built-in validation plugin and adds >coverage for SQL reports. > >I have also added the "required" attribute to the SQL report textarea >since saving a report with no SQL triggers an error. > >To test: > >- Create a new guided report. Confirm that you cannot save your guided > report without a report name. >- Create or edit a saved SQL report. Confirm that you cannot save your > report without a name or without SQL. >- Confirm that the saved_sql table structure has been updated. > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >Functional tests pass, database tables look correct to me. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Even with JS disabled, the form can not be submitted without the >report name filled in. >However we are not checking this server side .. if this was the public >interface that would be a fail. I will leave this up to the RM to >decided if client side checks are ok for this. Bearing in mind we >weren't handling any sql errors properly server side before this. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >Amended patch: description of the updatedb entry >--- > installer/data/mysql/kohastructure.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../prog/en/modules/reports/guided_reports_start.tt | 14 +++++++------- > 3 files changed, 15 insertions(+), 8 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index aeeba17..4eb7e1d 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1877,7 +1877,7 @@ CREATE TABLE saved_sql ( -- saved sql reports > `last_modified` datetime default NULL, -- the date this report was last edited > `savedsql` text, -- the SQL for this report > `last_run` datetime default NULL, >- `report_name` varchar(255) default NULL, -- the name of this report >+ `report_name` varchar(255) NOT NULL default '', -- the name of this report > `type` varchar(255) default NULL, -- always 1 for tabular > `notes` text, -- the notes or description given to this report > `cache_expiry` int NOT NULL default 300, >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index aae80f1..1b2362a 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8776,6 +8776,13 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.17.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("ALTER TABLE saved_sql CHANGE report_name report_name VARCHAR( 255 ) NOT NULL DEFAULT '' "); >+ print "Upgrade to $DBversion done (Bug 2969: Report Name should be mandatory for saved reports)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >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 05c6acb..d639ff9 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 >@@ -668,7 +668,7 @@ canned reports and writing custom SQL reports.</p> > [% END %] > > [% IF ( save ) %] >-<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> >+<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated"> > <input type="hidden" name="sql" value="[% sql |html %]" /> > <input type="hidden" name="type" value="[% type %]" /> > <input type="hidden" name="area" value="[% area %]" /> >@@ -677,7 +677,7 @@ canned reports and writing custom SQL reports.</p> > <fieldset class="rows"> > <legend>Save your custom report</legend> > <ol> >- <li><label for="reportname">Report name: </label><input type="text" id="reportname" name="reportname" /></li> >+ <li><label for="reportname" class="required">Report name: </label><input type="text" id="reportname" name="reportname" class="required" required="required" /> <span class="required">Required</span></li> > [% PROCESS group_and_subgroup_selection %] > <li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li> > </ol></fieldset> >@@ -836,13 +836,13 @@ $(document).ready(function() { > load_group_subgroups(); > }); > </script> >-<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> >+<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated"> > <fieldset class="rows"> > <legend>Create report from SQL</legend> > <ol> >- <li><label for="reportname">Report name:</label> >- [% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" /> >- [% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %] >+ <li><label for="reportname" class="required">Report name:</label> >+ [% IF ( reportname ) %]<input type="text" class="required" required="required" id="reportname" name="reportname" value="[% reportname %]" /> >+ [% ELSE %]<input type="text" class="required" required="required" id="reportname" name="reportname" />[% END %] <span class="required">Required</span> > </li> > [% PROCESS group_and_subgroup_selection %] > >@@ -873,7 +873,7 @@ $(document).ready(function() { > <fieldset class="rows"> > <legend>SQL:</legend> > <div style="margin:1em;"> >-<textarea id="sql" name="sql" cols="50" rows="10">[% sql %]</textarea> >+<textarea id="sql" name="sql" class="required" required="required" cols="50" rows="10">[% sql %]</textarea> <span class="required">Required</span> > </div> > </fieldset> > >-- >2.1.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 2969
:
2366
|
19795
|
19814
|
19821
|
31675
| 31717 |
32927