implement delete on details page

This commit is contained in:
zzz
2011-03-29 03:29:23 +00:00
parent 9f475c03cb
commit 172541a368
3 changed files with 11 additions and 5 deletions

View File

@@ -312,7 +312,7 @@ public class AddressbookBean
}
// clear search when adding
search = null;
} else if (action.equals(_("Delete Selected"))) {
} else if (action.equals(_("Delete Selected")) || action.equals(_("Delete Entry"))) {
String name = null;
int deleted = 0;
for (String n : deletionMarks) {
@@ -328,6 +328,8 @@ public class AddressbookBean
else
// parameter will always be >= 2
message = ngettext("1 destination deleted.", "{0} destinations deleted.", deleted);
} else {
message = _("No entries selected to delete.");
}
}
if( changed ) {

View File

@@ -263,7 +263,7 @@ public class NamingServiceBean extends AddressbookBean
}
// clear search when adding
search = null;
} else if (action.equals(_("Delete Selected"))) {
} else if (action.equals(_("Delete Selected")) || action.equals(_("Delete Entry"))) {
String name = null;
int deleted = 0;
for (String n : deletionMarks) {
@@ -281,6 +281,8 @@ public class NamingServiceBean extends AddressbookBean
else
// parameter will always be >= 2
message = ngettext("1 destination deleted.", "{0} destinations deleted.", deleted);
} else {
message = _("No entries selected to delete.");
}
}
if( changed ) {

View File

@@ -125,10 +125,12 @@
</tr></table>
</div>
<div id="buttons">
<form method="POST" action="details.jsp">
<form method="POST" action="addressbook.jsp">
<input type="hidden" name="serial" value="${book.serial}">
<input type="hidden" name="h" value="<%=detail%>">
<input type="submit" name="action" value="<%=intl._("Delete")%>" >
<input type="hidden" name="begin" value="0">
<input type="hidden" name="end" value="99">
<input type="hidden" name="checked" value="<%=detail%>">
<input type="submit" name="action" value="<%=intl._("Delete Entry")%>" >
</form>
</div>
<%