From 35ffbe6b5b8bdb97204d64c74abb26afce2bb408 Mon Sep 17 00:00:00 2001 From: btoumi Date: Tue, 3 Apr 2007 14:21:56 +0000 Subject: [PATCH] add security when u delete biblio : u must delete linked items before delete biblio --- .../prog/en/catalogue/detail.tmpl | 22 +++++++++++++++---- .../prog/en/includes/action-catalogue.inc | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/catalogue/detail.tmpl index 834a5d9185..4bef1f99db 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/catalogue/detail.tmpl @@ -216,10 +216,24 @@ function Dopop(link) { newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes'); } -function confirm_deletion() { - var is_confirmed = confirm('Are you sure you want to delete this biblio?'); - if (is_confirmed) { - window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber="; +function confirm_deletion(count) { + var is_confirmed; + if (count>0){ + is_confirmed= alert('you have [ '+ count +' ] item(s) linked \n you must delete all items before delete this biblio'); + } + else{ + is_confirmed= confirm('Are you sure you want to delete this biblio? '); + } + + + if (is_confirmed) { + if (count>0){ +// window.location="/cgi-bin/koha/catalogue/detail.pl?biblionumber="; + } + else{ + window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber="; + } + } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc index 267f306e3c..781514d764 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc @@ -10,7 +10,7 @@ "> Edit item - + )"> Delete