From b9b2804fbc767d4f08a87eed185184560487c600 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Thu, 15 Jan 2009 09:49:48 +0100 Subject: [PATCH] (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 --- .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 0b3fcbba77..3449e94433 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -29,11 +29,12 @@ function confirm_deletion() { function confirm_items_deletion() { var count = ; - if(confirm(_('Are you sure you want to delete the ' + count + ' attached items? '))){ - window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&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&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=" }, { text: _("Edit as New (Duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=&frameworkcode=&op=duplicate" }, { text: _("Delete Record"), onclick: {fn: confirm_deletion },id:'disabled' }, - { text: _("Delete all Items"), onclick: {fn: confirm_items_deletion } } + { text: _("Delete all Items"), onclick: {fn: confirm_items_deletion },id:'disabled' } ]; var savemenu = [ -- 2.39.5