Bugzilla – Attachment 2527 Details for
Bug 5004
Do not block deletion of cities when instances exist in borrowers table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed fix for HEAD
0001-Fix-for-Bug-5004-Don-t-block-deletion-of-cities-when.patch (text/plain), 2.96 KB, created by
Owen Leonard
on 2010-08-16 19:30:32 UTC
(
hide
)
Description:
Proposed fix for HEAD
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2010-08-16 19:30:32 UTC
Size:
2.96 KB
patch
obsolete
>From 717d4ade5c1ea18981cf3accfb37eb0cfaf3aab5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 16 Aug 2010 15:27:32 -0400 >Subject: [PATCH] Fix for Bug 5004, Don't block deletion of cities when instances exist in borrowers table > >--- > admin/cities.pl | 9 ++------- > .../prog/en/modules/admin/cities.tmpl | 10 ---------- > 2 files changed, 2 insertions(+), 17 deletions(-) > >diff --git a/admin/cities.pl b/admin/cities.pl >index 3e33a71..58e33ae 100755 >--- a/admin/cities.pl >+++ b/admin/cities.pl >@@ -86,15 +86,10 @@ if ($op eq 'add_form') { > # called by default form, used to confirm deletion of data in DB > } elsif ($op eq 'delete_confirm') { > $template->param(delete_confirm => 1); >- my $sth=$dbh->prepare("select count(*) as total from borrowers,cities where borrowers.city=cities.city_name and cityid=?"); >- # FIXME: this check used to pretend there was a FK "select_city" in borrowers. >+ my $sth=$dbh->prepare("select cityid,city_name,city_zipcode from cities where cityid=?"); > $sth->execute($cityid); >- my $total = $sth->fetchrow_hashref; >- my $sth2=$dbh->prepare("select cityid,city_name,city_zipcode from cities where cityid=?"); >- $sth2->execute($cityid); >- my $data=$sth2->fetchrow_hashref; >+ my $data=$sth->fetchrow_hashref; > $template->param( >- total => $total->{'total'}, > city_name => $data->{'city_name'}, > city_zipcode => $data->{'city_zipcode'}, > ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tmpl >index 62055da..203d19b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tmpl >@@ -69,14 +69,8 @@ > > <!-- /TMPL_IF --> > <!-- TMPL_IF NAME="delete_confirm" --> >- <!-- TMPL_IF NAME="total" --> >- <div class="dialog message"> >- <h3>Cannot Delete City "<!-- TMPL_VAR NAME="city_name" -->"</h3> >- <p>This record is used <!-- TMPL_VAR NAME="total" --> times. Impossible to delete it</p> >- <!-- TMPL_ELSE --> > <div class="dialog alert"> > <h3>Delete City "<!-- TMPL_VAR NAME="city_name" -->?"</h3> >- <!-- /TMPL_IF --> > <table> > <tr><th>City id</th> > <td><!-- TMPL_VAR NAME="cityid" --></td> >@@ -89,16 +83,12 @@ > </tr> > </table> > <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"> >- <!-- TMPL_IF NAME="total" --> >- <input type="submit" class="approv" value="OK" /> >- <!-- TMPL_ELSE --> > <input type="hidden" name="op" value="delete_confirmed" /> > <input type="hidden" name="cityid" value="<!-- TMPL_VAR NAME="cityid" -->" /> > <input type="submit" class="approve" value="Yes, Delete" /> > </form> > <form action="<!-- TMPL_VAR NAME="script_name" -->" method="get"> > <input type="submit" class="deny" value="No, do not Delete" /> >- <!-- /TMPL_IF --> > </form> > </div> > <!-- /TMPL_IF --> >-- >1.7.0.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 5004
: 2527 |
2757