(bug #2914) improve the deletion

this patch disable the button to delete all of items if there is no item attached to the marc record.

Signed-off-by: Henri-Damien LAURENT <henridamien@koha-fr.org>
This commit is contained in:
Nahuel ANGELINETTI 2009-01-15 09:49:48 +01:00 committed by Henri-Damien LAURENT
parent 021ceccee9
commit b9b2804fbc
1 changed files with 7 additions and 6 deletions

View File

@ -29,11 +29,12 @@ function confirm_deletion() {
function confirm_items_deletion() {
var count = <!-- TMPL_VAR NAME="count" -->;
if(confirm(_('Are you sure you want to delete the ' + count + ' attached items? '))){
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->";
}else{
return false;
}
if(count > 0)
if(confirm(_('Are you sure you want to delete the ' + count + ' attached items? '))){
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->";
}else{
return false;
}
}
// prepare DOM for YUI Toolbar
@ -65,7 +66,7 @@ function confirm_items_deletion() {
{ text: _("Edit Items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" },
{ text: _("Edit as New (Duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;frameworkcode=&amp;op=duplicate" },
{ text: _("Delete Record"), onclick: {fn: confirm_deletion }<!-- TMPL_IF NAME="count" -->,id:'disabled'<!-- /TMPL_IF --> },
{ text: _("Delete all Items"), onclick: {fn: confirm_items_deletion } }
{ text: _("Delete all Items"), onclick: {fn: confirm_items_deletion }<!-- TMPL_UNLESS NAME="count" -->,id:'disabled'<!-- /TMPL_IF --> }
];
var savemenu = [