View | Details | Raw Unified | Return to bug 5004
Collapse All | Expand All

(-)a/admin/cities.pl (-7 / +2 lines)
Lines 86-100 if ($op eq 'add_form') { Link Here
86
# called by default form, used to confirm deletion of data in DB
86
# called by default form, used to confirm deletion of data in DB
87
} elsif ($op eq 'delete_confirm') {
87
} elsif ($op eq 'delete_confirm') {
88
	$template->param(delete_confirm => 1);
88
	$template->param(delete_confirm => 1);
89
	my $sth=$dbh->prepare("select count(*) as total from borrowers,cities where borrowers.city=cities.city_name and cityid=?");
89
	my $sth=$dbh->prepare("select cityid,city_name,city_zipcode from cities where  cityid=?");
90
    # FIXME: this check used to pretend there was a FK "select_city" in borrowers.
91
	$sth->execute($cityid);
90
	$sth->execute($cityid);
92
	my $total = $sth->fetchrow_hashref;
91
	my $data=$sth->fetchrow_hashref;
93
	my $sth2=$dbh->prepare("select cityid,city_name,city_zipcode from cities where  cityid=?");
94
	$sth2->execute($cityid);
95
	my $data=$sth2->fetchrow_hashref;
96
    $template->param(
92
    $template->param(
97
        total        => $total->{'total'},
98
        city_name    =>	$data->{'city_name'},
93
        city_name    =>	$data->{'city_name'},
99
        city_zipcode => $data->{'city_zipcode'},
94
        city_zipcode => $data->{'city_zipcode'},
100
    );
95
    );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tmpl (-11 lines)
Lines 69-82 Link Here
69
69
70
<!-- /TMPL_IF -->
70
<!-- /TMPL_IF -->
71
<!-- TMPL_IF NAME="delete_confirm" -->
71
<!-- TMPL_IF NAME="delete_confirm" -->
72
    <!-- TMPL_IF NAME="total" -->
73
    <div class="dialog message">
74
    <h3>Cannot Delete City "<!-- TMPL_VAR NAME="city_name" -->"</h3>
75
    <p>This record is used <!-- TMPL_VAR NAME="total" --> times. Impossible to delete it</p>
76
    <!-- TMPL_ELSE -->
77
    <div class="dialog alert">
72
    <div class="dialog alert">
78
    <h3>Delete City "<!-- TMPL_VAR NAME="city_name" -->?"</h3>
73
    <h3>Delete City "<!-- TMPL_VAR NAME="city_name" -->?"</h3>
79
    <!-- /TMPL_IF -->
80
    <table>
74
    <table>
81
        <tr><th>City id</th>
75
        <tr><th>City id</th>
82
            <td><!-- TMPL_VAR NAME="cityid" --></td>
76
            <td><!-- TMPL_VAR NAME="cityid" --></td>
Lines 89-104 Link Here
89
        </tr>
83
        </tr>
90
    </table>
84
    </table>
91
    <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
85
    <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
92
    <!-- TMPL_IF NAME="total" -->
93
        <input type="submit" class="approv" value="OK" />
94
    <!-- TMPL_ELSE -->
95
        <input type="hidden" name="op" value="delete_confirmed" />
86
        <input type="hidden" name="op" value="delete_confirmed" />
96
        <input type="hidden" name="cityid" value="<!-- TMPL_VAR NAME="cityid" -->" />
87
        <input type="hidden" name="cityid" value="<!-- TMPL_VAR NAME="cityid" -->" />
97
        <input type="submit" class="approve" value="Yes, Delete" />
88
        <input type="submit" class="approve" value="Yes, Delete" />
98
    </form>
89
    </form>
99
    <form action="<!-- TMPL_VAR NAME="script_name" -->" method="get">
90
    <form action="<!-- TMPL_VAR NAME="script_name" -->" method="get">
100
        <input type="submit" class="deny" value="No, do not Delete" />
91
        <input type="submit" class="deny" value="No, do not Delete" />
101
    <!-- /TMPL_IF -->
102
    </form>
92
    </form>
103
</div>
93
</div>
104
<!-- /TMPL_IF -->
94
<!-- /TMPL_IF -->
105
- 

Return to bug 5004