From 389ab7a42a672372a9df539a4f5cf795fb8d7fff Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 15 Dec 2010 20:43:05 +0100 Subject: [PATCH] Bug 5720 : addbiblio: removing dead code and managing new permissions - some dead code removed - deal with edit_catalogue granular permission --- .../prog/en/modules/cataloguing/addbiblio.tmpl | 44 ++++++++----------- 1 files changed, 19 insertions(+), 25 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl index b33f897..7acf4f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl @@ -33,19 +33,23 @@ function confirmnotdup(){ $("#confirm_not_duplicate").attr("value","1"); // alert(_("Not a duplicate confirmed. Please click on Add biblio to save the record")); - var checkform = $("#f"); - Check(checkform); + Check(); } /** * * */ -function Check(dest){ +function Check(event){ var StrAlert = AreMandatoriesNotOk(); if( ! StrAlert ){ - document.f.submit(); - return true; + if(event && event.keyCode == 13){ + return false; + }else{ + document.f.submit(); + return true; + } + } else { alert(StrAlert); return false; @@ -230,7 +234,7 @@ function GetZ3950Terms(){ function Changefwk(FwkList) { var fwk = FwkList.options[FwkList.selectedIndex].value; - window.location = "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=&breedingid=&frameworkcode="+fwk; + window.location = "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=&breedingid=&mode=&frameworkcode="+fwk; } @@ -466,11 +470,11 @@ function CloneSubfield(index){ var clone = original.cloneNode(true); var new_key = CreateKey(); var new_id = original.getAttribute('id')+new_key; + // set the attribute for the new 'div' subfields var inputs = clone.getElementsByTagName('input'); var selects = clone.getElementsByTagName('select'); var textareas = clone.getElementsByTagName('textarea'); - var linkid; // input var id_input = ""; @@ -478,7 +482,6 @@ function CloneSubfield(index){ id_input = inputs[i].getAttribute('id')+new_key; inputs[i].setAttribute('id',id_input); inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key); - linkid = id_input; } // select @@ -495,19 +498,6 @@ function CloneSubfield(index){ textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key); } - // Changing the "..." link's onclick attribute for plugin callback - var links = clone.getElementsByTagName('a'); - var link = links[0]; - var buttonDotOnClick = link.getAttribute('onclick'); - if(buttonDotOnClick.match('Clictag')){ // -1- It s a plugin - var re = /\('.*'\)/i; - buttonDotOnClick = buttonDotOnClick.replace(re,"('"+linkid+"')"); - if(buttonDotOnClick){ - link.setAttribute('onclick',buttonDotOnClick); - } - } - - // when cloning a subfield, reset its label too. var label = clone.getElementsByTagName('label')[0]; @@ -674,8 +664,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? window.close(); -
- + @@ -709,6 +698,10 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? // YUI Toolbar Functions + var onSaveClick = function (e){ + return Check(e); + } + function yuiToolbar() { // new YAHOO.widget.Button("addbiblio"); @@ -734,10 +727,10 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? //]]> - -- 1.7.1