From 11140b426ff79dacd84c6f57c54ea4fd7130fc86 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Mon, 12 Nov 2007 23:36:48 -0600 Subject: [PATCH] adding view drop-button to catalog toolbar; mv Delete to Edit Signed-off-by: Joshua Ferraro --- .../prog/en/includes/cat-toolbar.inc | 56 +++++++++++++------ 1 file changed, 40 insertions(+), 16 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 47099294c5..c6bd2f7f1f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -7,6 +7,7 @@ function printBiblio() {window.open('/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=','Print_Biblio','width=700,height=500,toolbar=false,scrollbars=yes'); } function confirm_deletion() { + var count = ; var is_confirmed; if (count>0){ @@ -17,24 +18,31 @@ function confirm_deletion() { if (is_confirmed) { if (count>0){ -// window.location="/cgi-bin/koha/catalogue/detail.pl?biblionumber="; + // window.location="/cgi-bin/koha/catalogue/detail.pl?biblionumber="; + } else { + window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber="; + } } else { - window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber="; +// FIXME -- THIS doesn't work. addbiblio is still the target url after this fcn call ! + window.location="/cgi-bin/koha/catalogue/detail.pl?biblionumber="; + return false; } - - } } //&frameworkcode=&op=" }, { 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: "Edit as New (Duplicate)", url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=&frameworkcode=&op=duplicate" }, + { text: "Delete Record", url: "/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=",disabled: true, onclick: {fn: confirm_deletion }} + ]; + + var viewmenu = [ + { text: "Normal Display", url: "/cgi-bin/koha/catalogue/detail.pl?biblionumber=", selected: true }, + { text: "MARC Display", url: "/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=" }, + { text: "ISBD Display", url: "/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=" }, + { text: "Items Display", url: "/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=" } ]; new YAHOO.widget.Button({ + type: "menu", + label: "View", + name: "viewmenubutton", + menu: viewmenu, + container: "viewmenuc" + }); + + new YAHOO.widget.Button({ type: "menu", label: "Edit", name: "editmenubutton", menu: editmenu, - container: "editmenuc" + container: "editmenuc", + }); - var deletebiblioButton = new YAHOO.widget.Button({ - id: "deletebiblio", - type: "button", - label: "Delete", - container: "deletebiblioc", - onclick: {fn: confirm_deletion } - }); - var addtoshelfButton = new YAHOO.widget.Button({ id: "addtoshelf", type: "button", @@ -90,10 +107,17 @@ function confirm_deletion() {