Merge remote-tracking branch 'origin/new/bug_7455' into 3.10.x
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
commit
235ee021c4
|
|
@ -152,9 +152,15 @@ sub create_input {
|
|||
$value =~ s/DD/$day/g;
|
||||
}
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
||||
# map '@' as "subfield" label for fixed fields
|
||||
# to something that's allowed in a div id.
|
||||
my $id_subfield = $subfield;
|
||||
$id_subfield = "00" if $id_subfield eq "@";
|
||||
|
||||
my %subfield_data = (
|
||||
tag => $tag,
|
||||
subfield => $subfield,
|
||||
subfield => $id_subfield,
|
||||
marc_lib => substr( $tagslib->{$tag}->{$subfield}->{lib}, 0, 22 ),
|
||||
marc_lib_plain => $tagslib->{$tag}->{$subfield}->{lib},
|
||||
tag_mandatory => $tagslib->{$tag}->{mandatory},
|
||||
|
|
@ -162,14 +168,10 @@ sub create_input {
|
|||
repeatable => $tagslib->{$tag}->{$subfield}->{repeatable},
|
||||
kohafield => $tagslib->{$tag}->{$subfield}->{kohafield},
|
||||
index => $index_tag,
|
||||
id => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
|
||||
id => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield,
|
||||
value => $value,
|
||||
random => CreateKey(),
|
||||
);
|
||||
if($subfield eq '@'){
|
||||
$subfield_data{id} = "tag_".$tag."_subfield_00_".$index_tag."_".$index_subfield;
|
||||
} else {
|
||||
$subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield;
|
||||
}
|
||||
|
||||
if(exists $mandatory_z3950->{$tag.$subfield}){
|
||||
$subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield};
|
||||
|
|
@ -197,7 +199,7 @@ sub create_input {
|
|||
class=\"input_marceditor\"
|
||||
tabindex=\"1\" \/>
|
||||
<a href=\"#\" class=\"buttonDot\"
|
||||
onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a>
|
||||
onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','auth'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a>
|
||||
";
|
||||
# it's a plugin field
|
||||
}
|
||||
|
|
|
|||
|
|
@ -372,7 +372,8 @@ sub create_input {
|
|||
# it's a thesaurus / authority field
|
||||
}
|
||||
elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
|
||||
if (C4::Context->preference("BiblioAddsAuthorities")) {
|
||||
# when authorities auto-creation is allowed, do not set readonly
|
||||
my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities");
|
||||
$subfield_data{marc_value} =
|
||||
"<input type=\"text\"
|
||||
id=\"".$subfield_data{id}."\"
|
||||
|
|
@ -381,26 +382,12 @@ sub create_input {
|
|||
class=\"input_marceditor readonly\"
|
||||
tabindex=\"1\"
|
||||
size=\"67\"
|
||||
maxlength=\"".$subfield_data{maxlength}."\"
|
||||
\/>
|
||||
maxlength=\"".$subfield_data{maxlength}."\"".
|
||||
($is_readonly ? "readonly=\"readonly\"" : "").
|
||||
"\/>
|
||||
<span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\"
|
||||
onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
|
||||
onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','biblio'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
|
||||
";
|
||||
} else {
|
||||
$subfield_data{marc_value} =
|
||||
"<input type=\"text\"
|
||||
id=\"".$subfield_data{id}."\"
|
||||
name=\"".$subfield_data{id}."\"
|
||||
value=\"$value\"
|
||||
class=\"input_marceditor readonly\"
|
||||
tabindex=\"1\"
|
||||
size=\"67\"
|
||||
maxlength=\"".$subfield_data{maxlength}."\"
|
||||
readonly=\"readonly\"
|
||||
\/><span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\"
|
||||
onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
|
||||
";
|
||||
}
|
||||
# it's a plugin field
|
||||
}
|
||||
elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ sub generate_subfield_form {
|
|||
my $change = index($javascript, 'function Change') > -1 ?
|
||||
"return Change$function_name($subfield_data{random}, '$subfield_data{id}');" :
|
||||
'return 1;';
|
||||
$subfield_data{marc_value} = qq[<input $attributes
|
||||
$subfield_data{marc_value} = qq[<input type="text" $attributes
|
||||
onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
|
||||
onchange=" $change"
|
||||
onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
|
||||
|
|
@ -255,7 +255,7 @@ sub generate_subfield_form {
|
|||
$javascript];
|
||||
} else {
|
||||
warn "Plugin Failed: $plugin";
|
||||
$subfield_data{marc_value} = "<input $attributes />"; # supply default input form
|
||||
$subfield_data{marc_value} = "<input type=\"text\" $attributes />"; # supply default input form
|
||||
}
|
||||
}
|
||||
elsif ( $tag eq '' ) { # it's an hidden field
|
||||
|
|
@ -274,7 +274,7 @@ sub generate_subfield_form {
|
|||
$subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n";
|
||||
} else {
|
||||
# it's a standard field
|
||||
$subfield_data{marc_value} = "<input $attributes />";
|
||||
$subfield_data{marc_value} = "<input type=\"text\" $attributes />";
|
||||
}
|
||||
|
||||
return \%subfield_data;
|
||||
|
|
|
|||
|
|
@ -50,8 +50,10 @@ div.tag {
|
|||
}
|
||||
|
||||
div.subfield_line {
|
||||
padding-bottom : .3em;
|
||||
clear: both;
|
||||
padding-bottom: .3em;
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.subfield_line label {
|
||||
|
|
@ -63,6 +65,10 @@ div.subfield_line label {
|
|||
clear:left;
|
||||
}
|
||||
|
||||
.subfieldcode img {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tag_title {
|
||||
font-size : 90%;
|
||||
padding : .2em 0;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,466 @@
|
|||
/*
|
||||
* Unified file for catalogue edition
|
||||
*/
|
||||
|
||||
/* Functions developed for addbiblio.tt and authorities.tt */
|
||||
|
||||
// returns the fieldcode based upon tag div id
|
||||
function getFieldCode(tagDivId){
|
||||
// format : tag_<tagnumber>_...
|
||||
return tagDivId.substr(3+1,3);
|
||||
}
|
||||
|
||||
//returns the field and subfieldcode based upon subfield div id
|
||||
function getFieldAndSubfieldCode(subfieldDivId){
|
||||
// format : subfield<tagnumber><subfieldnumber>...
|
||||
return subfieldDivId.substr(8,3+1);
|
||||
}
|
||||
|
||||
//returns the subfieldcode based upon subfieldid writing
|
||||
function getSubfieldCode(tagsubfieldid){
|
||||
// 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0
|
||||
return tagsubfieldid.substr(3+3+4+8-1,1);
|
||||
}
|
||||
|
||||
// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
|
||||
// returns the filter
|
||||
function getTagInputnameFilter(tagsubfieldid){
|
||||
var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));
|
||||
var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield+"_."+tagcode;
|
||||
return tagsubfield;
|
||||
}
|
||||
|
||||
// if source is "auth", we are editing an authority otherwise it is a biblio
|
||||
function openAuth(tagsubfieldid,authtype,source) {
|
||||
// let's take the base of tagsubfield information (removing the indexes and the codes
|
||||
var element=document.getElementById(tagsubfieldid);
|
||||
var tagsubfield=getTagInputnameFilter(tagsubfieldid);
|
||||
var elementsubfcode=getSubfieldCode(element.name);
|
||||
var mainmainstring=element.value;
|
||||
var mainstring="";
|
||||
var inputs = element.parentNode.parentNode.getElementsByTagName("input");
|
||||
|
||||
for (var myindex =0; myindex<inputs.length;myindex++){
|
||||
if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
|
||||
var subfieldcode=getSubfieldCode(inputs[myindex].name);
|
||||
if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
|
||||
mainstring=inputs[myindex].value+" "+mainstring;
|
||||
}
|
||||
}
|
||||
}
|
||||
newin=window.open("../authorities/auth_finder.pl?source="+source+"&authtypecode="+authtype+"&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
|
||||
}
|
||||
|
||||
function ExpandField(index) {
|
||||
var original = document.getElementById(index); //original <div>
|
||||
var divs = original.getElementsByTagName('div');
|
||||
for(var i=0,divslen = divs.length ; i<divslen ; i++){ // foreach div
|
||||
if(divs[i].getAttribute('id').match(/^subfield/)){ // if it s a subfield
|
||||
if (!divs[i].style.display) {
|
||||
// first time => show all subfields
|
||||
divs[i].style.display = 'block';
|
||||
} else if (divs[i].style.display == 'none') {
|
||||
// show
|
||||
divs[i].style.display = 'block';
|
||||
} else {
|
||||
// hide
|
||||
divs[i].style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* To clone a field
|
||||
* @param hideMarc '0' for false, '1' for true
|
||||
* @param advancedMARCEditor '0' for false, '1' for true
|
||||
*/
|
||||
function CloneField(index, hideMarc, advancedMARCEditor) {
|
||||
var original = document.getElementById(index); //original <div>
|
||||
var clone = original.cloneNode(true);
|
||||
var new_key = CreateKey();
|
||||
var new_id = original.getAttribute('id')+new_key;
|
||||
|
||||
clone.setAttribute('id',new_id); // setting a new id for the parent div
|
||||
|
||||
var divs = clone.getElementsByTagName('div');
|
||||
|
||||
// if hide_marc, indicators are hidden fields
|
||||
// setting a new name for the new indicator
|
||||
for(var i=0; i < 2; i++) {
|
||||
var indicator = clone.getElementsByTagName('input')[i];
|
||||
indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
|
||||
}
|
||||
|
||||
// settings all subfields
|
||||
for(var i=0,divslen = divs.length ; i<divslen ; i++){ // foreach div
|
||||
if(divs[i].getAttribute("id").match(/^subfield/)){ // if it s a subfield
|
||||
|
||||
// set the attribute for the new 'div' subfields
|
||||
divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
|
||||
|
||||
var inputs = divs[i].getElementsByTagName('input');
|
||||
var id_input = "";
|
||||
|
||||
for( j = 0 ; j < inputs.length ; j++ ) {
|
||||
if(inputs[j].getAttribute("id") && inputs[j].getAttribute("id").match(/^tag_/) ){
|
||||
inputs[j].value = "";
|
||||
}
|
||||
}
|
||||
|
||||
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
|
||||
inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
|
||||
var id_input;
|
||||
try {
|
||||
id_input = inputs[1].getAttribute('id')+new_key;
|
||||
inputs[1].setAttribute('id',id_input);
|
||||
inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
|
||||
} catch(e) {
|
||||
try{ // it s a select if it is not an input
|
||||
var selects = divs[i].getElementsByTagName('select');
|
||||
id_input = selects[0].getAttribute('id')+new_key;
|
||||
selects[0].setAttribute('id',id_input);
|
||||
selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
|
||||
}catch(e2){ // it is a textarea if it s not a select or an input
|
||||
var textaeras = divs[i].getElementsByTagName('textarea');
|
||||
id_input = textaeras[0].getAttribute('id')+new_key;
|
||||
textaeras[0].setAttribute('id',id_input);
|
||||
textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
|
||||
}
|
||||
}
|
||||
|
||||
if (advancedMARCEditor == '0') {
|
||||
// when cloning a subfield, re set its label too.
|
||||
var labels = divs[i].getElementsByTagName('label');
|
||||
labels[0].setAttribute('for',id_input);
|
||||
}
|
||||
|
||||
if(hideMarc == '0') {
|
||||
// updating javascript parameters on button up
|
||||
var imgs = divs[i].getElementsByTagName('img');
|
||||
imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
|
||||
}
|
||||
|
||||
// setting its '+' and '-' buttons
|
||||
try {
|
||||
var anchors = divs[i].getElementsByTagName('a');
|
||||
for (var j = 0; j < anchors.length; j++) {
|
||||
if(anchors[j].getAttribute('class') == 'buttonPlus'){
|
||||
anchors[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "','" + advancedMARCEditor + "'); return false;");
|
||||
} else if (anchors[j].getAttribute('class') == 'buttonMinus') {
|
||||
anchors[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "'); return false;");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig if ButtonPlus & CloneButtonPlus don t exist.
|
||||
}
|
||||
|
||||
// button ...
|
||||
var spans=0;
|
||||
try {
|
||||
spans = divs[i].getElementsByTagName('a');
|
||||
} catch(e) {
|
||||
// no spans
|
||||
}
|
||||
if(spans){
|
||||
var buttonDot;
|
||||
if(!CloneButtonPlus){ // it s impossible to have + ... (buttonDot AND buttonPlus)
|
||||
buttonDot = spans[0];
|
||||
if(buttonDot){
|
||||
// 2 possibilities :
|
||||
try{
|
||||
var buttonDotOnClick = buttonDot.getAttribute('onclick');
|
||||
if(buttonDotOnClick.match('Clictag')){ // -1- It s a plugin
|
||||
var re = /\('.*'\)/i;
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
|
||||
if(buttonDotOnClick){
|
||||
buttonDot.setAttribute('onclick',buttonDotOnClick);
|
||||
}
|
||||
} else {
|
||||
if(buttonDotOnClick.match('Dopop')) { // -2- It's a auth value
|
||||
var re1 = /&index=.*',/;
|
||||
var re2 = /,.*\)/;
|
||||
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
|
||||
|
||||
if(buttonDotOnClick){
|
||||
buttonDot.setAttribute('onclick',buttonDotOnClick);
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
// do not copy the script section.
|
||||
var script = spans[0].getElementsByTagName('script')[0];
|
||||
spans[0].removeChild(script);
|
||||
} catch(e) {
|
||||
// do nothing if there is no script
|
||||
}
|
||||
}catch(e){}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hideMarc == '0') {
|
||||
var buttonUp = divs[i].getElementsByTagName('img')[0];
|
||||
buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
|
||||
}
|
||||
|
||||
} else { // it's a indicator div
|
||||
if(divs[i].getAttribute('id').match(/^div_indicator/)){
|
||||
|
||||
// setting a new id for the indicator div
|
||||
divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
|
||||
|
||||
var inputs = divs[i].getElementsByTagName('input');
|
||||
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
|
||||
inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
|
||||
|
||||
var CloneButtonPlus;
|
||||
try {
|
||||
var anchors = divs[i].getElementsByTagName('a');
|
||||
for (var j = 0; j < anchors.length; j++) {
|
||||
if (anchors[j].getAttribute('class') == 'buttonPlus') {
|
||||
anchors[j].setAttribute('onclick',"CloneField('" + new_id + "','" + hideMarc + "','" + advancedMARCEditor + "'); return false;");
|
||||
} else if (anchors[j].getAttribute('class') == 'buttonMinus') {
|
||||
anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "'); return false;");
|
||||
} else if (anchors[j].getAttribute('class') == 'expandfield') {
|
||||
anchors[j].setAttribute('onclick',"ExpandField('" + new_id + "'); return false;");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig CloneButtonPlus doesn't exist.
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
||||
/**
|
||||
* To clone a subfield
|
||||
* @param index
|
||||
* @param advancedMARCEditor '0' for false, '1' for true
|
||||
*/
|
||||
function CloneSubfield(index, advancedMARCEditor){
|
||||
var original = document.getElementById(index); //original <div>
|
||||
var clone = original.cloneNode(true);
|
||||
var new_key = CreateKey();
|
||||
|
||||
// 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 = "";
|
||||
for(var i=0,len=inputs.length; i<len ; i++ ){
|
||||
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
|
||||
for(var i=0,len=selects.length; i<len ; i++ ){
|
||||
id_input = selects[i].getAttribute('id')+new_key;
|
||||
selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
|
||||
selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
|
||||
}
|
||||
|
||||
// textarea
|
||||
for(var i=0,len=textareas.length; i<len ; i++ ){
|
||||
id_input = textareas[i].getAttribute('id')+new_key;
|
||||
textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if(advancedMARCEditor == '0') {
|
||||
// when cloning a subfield, reset its label too.
|
||||
var label = clone.getElementsByTagName('label')[0];
|
||||
label.setAttribute('for',id_input);
|
||||
}
|
||||
|
||||
// setting a new id for the parent div
|
||||
var new_id = original.getAttribute('id')+new_key;
|
||||
clone.setAttribute('id',new_id);
|
||||
|
||||
try {
|
||||
var buttonUp = clone.getElementsByTagName('img')[0];
|
||||
buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
|
||||
var anchors = clone.getElementsByTagName('a');
|
||||
if(anchors.length){
|
||||
for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
|
||||
if(anchors[i].getAttribute('class') == 'buttonPlus'){
|
||||
anchors[i].setAttribute('onclick',"CloneSubfield('" + new_id + "','" + advancedMARCEditor + "'); return false;");
|
||||
} else if (anchors[i].getAttribute('class') == 'buttonMinus') {
|
||||
anchors[i].setAttribute('onclick',"UnCloneField('" + new_id + "'); return false;");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig if ButtonPlus & CloneButtonPlus don't exist.
|
||||
}
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function removes or clears unwanted subfields
|
||||
*/
|
||||
function UnCloneField(index) {
|
||||
var original = document.getElementById(index);
|
||||
var canUnclone = false;
|
||||
if ($(original).hasClass("tag")) {
|
||||
// unclone a field, check if there will remain one field
|
||||
var fieldCode = getFieldCode(index);
|
||||
// tag divs with id begining with original field code
|
||||
var cloneFields = $('.tag[id^="tag_'+fieldCode+'"]');
|
||||
if (cloneFields.length > 1) {
|
||||
canUnclone = true;
|
||||
}
|
||||
} else {
|
||||
// unclone a subfield, check if there will remain one subfield
|
||||
var subfieldCode = getFieldAndSubfieldCode(index);
|
||||
// subfield divs with id begining with original field and subfield field code
|
||||
var cloneSubfields = $('.subfield_line[id^="subfield'+subfieldCode+'"]');
|
||||
if (cloneSubfields.length > 1) {
|
||||
canUnclone = true;
|
||||
}
|
||||
}
|
||||
if (canUnclone) {
|
||||
// remove clone
|
||||
original.parentNode.removeChild(original);
|
||||
} else {
|
||||
// clear inputs, but don't delete
|
||||
$(":input.input_marceditor", original).each(function(){
|
||||
// thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
|
||||
// hint about clearing selects correctly
|
||||
var type = this.type;
|
||||
var tag = this.tagName.toLowerCase();
|
||||
if (type == 'text' || type == 'password' || tag == 'textarea') {
|
||||
this.value = "";
|
||||
} else if (type == 'checkbox' || type == 'radio') {
|
||||
this.checked = false;
|
||||
} else if (tag == 'select') {
|
||||
this.selectedIndex = -1;
|
||||
}
|
||||
});
|
||||
$(":input.indicator", original).val("");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function create a random number
|
||||
*/
|
||||
function CreateKey(){
|
||||
return parseInt(Math.random() * 100000);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function allows to move a subfield up by clickink on the 'up' button .
|
||||
*/
|
||||
function upSubfield(index) {
|
||||
try{
|
||||
var line = document.getElementById(index); // get the line where the user has clicked.
|
||||
} catch(e) {
|
||||
return; // this line doesn't exist...
|
||||
}
|
||||
var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
|
||||
|
||||
// getting all subfields for this tag
|
||||
var subfields = tag.getElementsByTagName('div');
|
||||
var subfieldsLength = subfields.length;
|
||||
|
||||
if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
|
||||
|
||||
// among all subfields
|
||||
for(var i=0;i<subfieldsLength;i++){
|
||||
if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
|
||||
if(i==1){ // if the clicked subfield is on the top
|
||||
tag.appendChild(subfields[1]);
|
||||
return;
|
||||
} else {
|
||||
var lineAbove = subfields[i-1];
|
||||
tag.insertBefore(line,lineAbove);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME :: is it used ?
|
||||
function unHideSubfield(index,labelindex) {
|
||||
subfield = document.getElementById(index);
|
||||
subfield.style.display = 'block';
|
||||
label = document.getElementById(labelindex);
|
||||
label.style.display='none';
|
||||
}
|
||||
|
||||
/* Functions developed for additem.tt */
|
||||
|
||||
/**
|
||||
* To clone a subfield.<br>
|
||||
* @param original subfield div to clone
|
||||
*/
|
||||
function CloneItemSubfield(original){
|
||||
var clone = original.cloneNode(true);
|
||||
var new_key = CreateKey();
|
||||
|
||||
// set the attribute for the new 'div' subfields
|
||||
var inputs = clone.getElementsByTagName('input');
|
||||
var selects = clone.getElementsByTagName('select');
|
||||
var textareas = clone.getElementsByTagName('textarea');
|
||||
|
||||
// input (except hidden type)
|
||||
var id_input = "";
|
||||
for(var i=0,len=inputs.length; i<len ; i++ ){
|
||||
if (inputs[i].getAttribute('type') != 'hidden') {
|
||||
id_input = inputs[i].getAttribute('id')+new_key;
|
||||
inputs[i].setAttribute('id',id_input);
|
||||
}
|
||||
}
|
||||
|
||||
// select
|
||||
for(var i=0,len=selects.length; i<len ; i++ ){
|
||||
id_input = selects[i].getAttribute('id')+new_key;
|
||||
selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
|
||||
}
|
||||
|
||||
// textarea
|
||||
for(var i=0,len=textareas.length; i<len ; i++ ){
|
||||
id_input = textareas[i].getAttribute('id')+new_key;
|
||||
textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
|
||||
}
|
||||
|
||||
// when cloning a subfield, reset its label too.
|
||||
var label = clone.getElementsByTagName('label')[0];
|
||||
label.setAttribute('for',id_input);
|
||||
|
||||
// setting a new if for the parent div
|
||||
var new_id = original.getAttribute('id')+new_key;
|
||||
clone.setAttribute('id',new_id);
|
||||
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
|
@ -2,36 +2,21 @@
|
|||
<title>Koha › Authorities › [% IF ( authid ) %]Modify authority #[% authid %] ([% authtypetext %])[% ELSE %]Adding authority ([% authtypetext %])[% END %]</title>
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>
|
||||
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
var fields_in_use = {};
|
||||
$(document).ready(function() {
|
||||
$('#authoritytabs').tabs();
|
||||
$('.tag').each(function() {
|
||||
var field_id = this.getAttribute('id').substring(0, 7);
|
||||
if (field_id in fields_in_use) {
|
||||
fields_in_use[field_id]++;
|
||||
} else {
|
||||
fields_in_use[field_id] = 1;
|
||||
}
|
||||
});
|
||||
$('.subfield_line').each(function() {
|
||||
var field_id = this.getAttribute('id').substring(0, 12);
|
||||
if (field_id in fields_in_use) {
|
||||
fields_in_use[field_id]++;
|
||||
} else {
|
||||
fields_in_use[field_id] = 1;
|
||||
}
|
||||
});
|
||||
|
||||
$("#f").submit(function(){
|
||||
return $(this).Check();
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* check if mandatory subfields are writed
|
||||
* check if mandatory subfields are written
|
||||
*/
|
||||
function AreMandatoriesNotOk(){
|
||||
var mandatories = new Array();
|
||||
|
|
@ -75,7 +60,6 @@ function AreMandatoriesNotOk(){
|
|||
for(var j=0,len2=eleminputs.length; j<len2; j++){
|
||||
|
||||
if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
|
||||
/* tag_801_subfield_c_841304_545657 */
|
||||
inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
|
||||
|
||||
for( var k=0; k<len2; k++){
|
||||
|
|
@ -118,44 +102,6 @@ function Check(){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// returns the subfieldcode based upon subfieldid writing
|
||||
function getSubfieldcode(tagsubfieldid){
|
||||
// 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0
|
||||
return tagsubfieldid.substr(3+3+4+8-1,1);
|
||||
}
|
||||
|
||||
// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
|
||||
// returns the filter
|
||||
function getTagInputnameFilter(tagsubfieldid){
|
||||
var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));
|
||||
var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield+"_."+tagcode;
|
||||
return tagsubfield;
|
||||
}
|
||||
|
||||
function openAuth(tagsubfieldid,authtype) {
|
||||
// let's take the base of tagsubfield information (removing the indexes and the codes
|
||||
var element=document.getElementById(tagsubfieldid);
|
||||
var tagsubfield=getTagInputnameFilter(tagsubfieldid);
|
||||
var elementsubfcode=getSubfieldcode(element.name);
|
||||
var mainmainstring=element.value;
|
||||
var mainstring="";
|
||||
var inputs = element.parentNode.parentNode.getElementsByTagName("input");
|
||||
|
||||
for (var myindex =0; myindex<inputs.length;myindex++){
|
||||
if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
|
||||
var subfieldcode=getSubfieldcode(inputs[myindex].name);
|
||||
if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
|
||||
mainstring=inputs[myindex].value+" "+mainstring;
|
||||
}
|
||||
}
|
||||
}
|
||||
newin=window.open("../authorities/auth_finder.pl?source=auth&authtypecode="+ authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
|
||||
}
|
||||
|
||||
function AddField(field,cntrepeatfield) {
|
||||
document.forms['f'].op.value = "addfield";
|
||||
document.forms['f'].addfield_field.value=field;
|
||||
|
|
@ -163,335 +109,6 @@ function AddField(field,cntrepeatfield) {
|
|||
document.f.submit();
|
||||
}
|
||||
|
||||
|
||||
function ExpandField(index) {
|
||||
var original = document.getElementById(index); //original <div>
|
||||
var divs = original.getElementsByTagName('div');
|
||||
for(var i=0,divslen = divs.length ; i<divslen ; i++){ // foreach div
|
||||
if(divs[i].getAttribute("name") == 'line'){ // if it s a subfield
|
||||
if (divs[i].style.display == 'block') {
|
||||
divs[i].style.display = 'none';
|
||||
} else {
|
||||
divs[i].style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To clone a field or a subfield by clickink on '+' button
|
||||
*/
|
||||
function CloneField(index) {
|
||||
var original = document.getElementById(index); //original <div>
|
||||
fields_in_use[index.substr(0, 7)]++;
|
||||
var clone = original.cloneNode(true);
|
||||
var new_key = CreateKey();
|
||||
var new_id = original.getAttribute('id')+new_key;
|
||||
|
||||
clone.setAttribute('id',new_id); // setting a new id for the parent div
|
||||
|
||||
var divs = clone.getElementsByTagName('div');
|
||||
|
||||
[% UNLESS ( hide_marc ) %] // No indicator if hide_marc
|
||||
// setting a new name for the new indicator
|
||||
for(var i=0; i < 2; i++) {
|
||||
var indicator = clone.getElementsByTagName('input')[i];
|
||||
indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
|
||||
}
|
||||
[% END %]
|
||||
|
||||
// settings all subfields
|
||||
for(var i=0,divslen = divs.length ; i<divslen ; i++){ // foreach div
|
||||
if(divs[i].getAttribute("name") == 'line'){ // if it s a subfield
|
||||
|
||||
// set the attribute for the new 'div' subfields
|
||||
divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
|
||||
|
||||
var inputs = divs[i].getElementsByTagName('input');
|
||||
var id_input = "";
|
||||
|
||||
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
|
||||
inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
|
||||
var id_input;
|
||||
try {
|
||||
id_input = inputs[1].getAttribute('id')+new_key;
|
||||
inputs[1].setAttribute('id',id_input);
|
||||
inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
|
||||
} catch(e) {
|
||||
try{ // it s a select if it is not an input
|
||||
var selects = divs[i].getElementsByTagName('select');
|
||||
id_input = selects[0].getAttribute('id')+new_key;
|
||||
selects[0].setAttribute('id',id_input);
|
||||
selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
|
||||
}catch(e2){ // it is a textarea if it s not a select or an input
|
||||
var textaeras = divs[i].getElementsByTagName('textarea');
|
||||
id_input = textaeras[0].getAttribute('id')+new_key;
|
||||
textaeras[0].setAttribute('id',id_input);
|
||||
textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
|
||||
}
|
||||
}
|
||||
|
||||
[% UNLESS ( advancedMARCEditor ) %]
|
||||
// when cloning a subfield, re set its label too.
|
||||
var labels = divs[i].getElementsByTagName('label');
|
||||
labels[0].setAttribute('for',id_input);
|
||||
[% END %]
|
||||
|
||||
[% UNLESS ( hide_marc ) %]
|
||||
// updating javascript parameters on button up
|
||||
var imgs = divs[i].getElementsByTagName('img');
|
||||
imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
|
||||
[% END %]
|
||||
|
||||
// setting its '+' and '-' buttons
|
||||
try {
|
||||
var spans = divs[i].getElementsByTagName('span');
|
||||
for (var j = 0; j < spans.length; j++) {
|
||||
if(spans[j].getAttribute('class') == 'buttonPlus'){
|
||||
spans[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
|
||||
} else if (spans[j].getAttribute('class') == 'buttonMinus') {
|
||||
spans[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig if ButtonPlus & CloneButtonPlus don t exist.
|
||||
}
|
||||
|
||||
// button ...
|
||||
var spans=0;
|
||||
try {
|
||||
spans = divs[i].getElementsByTagName('span');
|
||||
} catch(e) {
|
||||
// no spans
|
||||
}
|
||||
if(spans){
|
||||
var buttonDot;
|
||||
if(!CloneButtonPlus){ // it s impossible to have + ... (buttonDot AND buttonPlus)
|
||||
buttonDot = spans[0];
|
||||
if(buttonDot){
|
||||
// 2 possibilities :
|
||||
try{
|
||||
var buttonDotOnClick = buttonDot.getAttribute('onclick');
|
||||
if(buttonDotOnClick.match('Clictag')){ // -1- It s a plugin
|
||||
var re = /\('.*'\)/i;
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
|
||||
if(buttonDotOnClick){
|
||||
buttonDot.setAttribute('onclick',buttonDotOnClick);
|
||||
}
|
||||
} else {
|
||||
if(buttonDotOnClick.match('Dopop')) { // -2- It's a auth value
|
||||
|
||||
var re1 = /&index=.*',/;
|
||||
var re2 = /,.*\)/;
|
||||
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
|
||||
|
||||
if(buttonDotOnClick){
|
||||
buttonDot.setAttribute('onclick',buttonDotOnClick);
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
// do not copy the script section.
|
||||
var script = spans[0].getElementsByTagName('script')[0];
|
||||
spans[0].removeChild(script);
|
||||
} catch(e) {
|
||||
// do nothing if there is no script
|
||||
}
|
||||
}catch(e){}
|
||||
}
|
||||
}
|
||||
}
|
||||
[% UNLESS ( hide_marc ) %]
|
||||
var buttonUp = divs[i].getElementsByTagName('img')[0];
|
||||
buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
|
||||
[% END %]
|
||||
|
||||
} else { // it's a indicator div
|
||||
if(divs[i].getAttribute('name') == 'div_indicator'){
|
||||
var inputs = divs[i].getElementsByTagName('input');
|
||||
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
|
||||
inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
|
||||
|
||||
var CloneButtonPlus;
|
||||
try {
|
||||
var anchors = divs[i].getElementsByTagName('span');
|
||||
for (var j = 0; j < anchors.length; j++) {
|
||||
if (anchors[j].getAttribute('class') == 'buttonPlus') {
|
||||
anchors[j].setAttribute('onclick',"CloneField('" + new_id + "')");
|
||||
} else if (anchors[j].getAttribute('class') == 'buttonMinus') {
|
||||
anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "')");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig CloneButtonPlus doesn't exist.
|
||||
}
|
||||
|
||||
// setting its 'Expand' property
|
||||
var ExpandFieldA=0;
|
||||
try {
|
||||
ExpandFieldA = divs[i].getElementsByTagName('a')[0];
|
||||
ExpandFieldA.setAttribute('onclick',"ExpandField('" + divs[i].parentNode.getAttribute('id') + "')");
|
||||
}
|
||||
catch(e){
|
||||
// do nothig if ButtonPlus & CloneButtonPlus don t exist.
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
||||
function CloneSubfield(index){
|
||||
var original = document.getElementById(index); //original <div>
|
||||
fields_in_use[index.substr(0, 12)]++;
|
||||
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');
|
||||
|
||||
// input
|
||||
var id_input = "";
|
||||
for(var i=0,len=inputs.length; i<len ; i++ ){
|
||||
id_input = inputs[i].getAttribute('id')+new_key;
|
||||
inputs[i].setAttribute('id',id_input);
|
||||
inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
|
||||
}
|
||||
|
||||
// select
|
||||
for(var i=0,len=selects.length; i<len ; i++ ){
|
||||
id_input = selects[i].getAttribute('id')+new_key;
|
||||
selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
|
||||
selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
|
||||
}
|
||||
|
||||
// textarea
|
||||
for(var i=0,len=textareas.length; i<len ; i++ ){
|
||||
id_input = textareas[i].getAttribute('id')+new_key;
|
||||
textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
|
||||
textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
|
||||
}
|
||||
|
||||
[% UNLESS ( advancedMARCEditor ) %]
|
||||
// when cloning a subfield, reset its label too.
|
||||
var label = clone.getElementsByTagName('label')[0];
|
||||
label.setAttribute('for',id_input);
|
||||
[% END %]
|
||||
|
||||
// setting a new if for the parent div
|
||||
clone.setAttribute('id',new_id);
|
||||
|
||||
try {
|
||||
var buttonUp = clone.getElementsByTagName('img')[0];
|
||||
buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
|
||||
var spans = clone.getElementsByTagName('span');
|
||||
if(spans.length){
|
||||
for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
|
||||
if(spans[i].getAttribute('class') == 'buttonPlus'){
|
||||
spans[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
|
||||
} else if (spans[i].getAttribute('class') == 'buttonMinus') {
|
||||
spans[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig if ButtonPlus & CloneButtonPlus don't exist.
|
||||
}
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function removes or clears unwanted subfields
|
||||
*/
|
||||
function UnCloneField(index) {
|
||||
var original = document.getElementById(index);
|
||||
var field_id;
|
||||
if (index.match("tag")) {
|
||||
field_id = index.substr(0, 7);
|
||||
} else {
|
||||
field_id = index.substr(0, 12);
|
||||
}
|
||||
if (1 == fields_in_use[field_id]) {
|
||||
// clear inputs, but don't delete
|
||||
$(":input.input_marceditor", original).each(function(){
|
||||
// thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
|
||||
// hint about clearing selects correctly
|
||||
var type = this.type;
|
||||
var tag = this.tagName.toLowerCase();
|
||||
if (type == 'text' || type == 'password' || tag == 'textarea') {
|
||||
this.value = "";
|
||||
} else if (type == 'checkbox' || type == 'radio') {
|
||||
this.checked = false;
|
||||
} else if (tag == 'select') {
|
||||
this.selectedIndex = -1;
|
||||
}
|
||||
});
|
||||
$(":input.indicator", original).val("");
|
||||
} else {
|
||||
original.parentNode.removeChild(original);
|
||||
fields_in_use[field_id]--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function create a random number
|
||||
*/
|
||||
function CreateKey(){
|
||||
return parseInt(Math.random() * 100000);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function allows to move a subfield up by clickink on the 'up' button .
|
||||
*/
|
||||
function upSubfield(index) {
|
||||
try{
|
||||
var line = document.getElementById(index); // get the line where the user has clicked.
|
||||
} catch(e) {
|
||||
return; // this line doesn't exist...
|
||||
}
|
||||
var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
|
||||
|
||||
// getting all subfields for this tag
|
||||
var subfields = tag.getElementsByTagName('div');
|
||||
var subfieldsLength = subfields.length;
|
||||
|
||||
if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
|
||||
|
||||
// among all subfields
|
||||
for(var i=0;i<subfieldsLength;i++){
|
||||
if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
|
||||
if(i==1){ // if the clicked subfield is on the top
|
||||
tag.appendChild(subfields[1]);
|
||||
return;
|
||||
} else {
|
||||
var lineAbove = subfields[i-1];
|
||||
tag.insertBefore(line,lineAbove);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
|
||||
subfield = document.getElementById(index);
|
||||
subfield.style.display = 'block';
|
||||
label = document.getElementById(labelindex);
|
||||
label.style.display='none';
|
||||
}
|
||||
|
||||
function addauthority() {
|
||||
X = document.forms[0].authtype.value;
|
||||
window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
|
||||
|
|
@ -591,150 +208,161 @@ function searchauthority() {
|
|||
<ul class="toolbar"><li id="addauthc"><input id="addauth" type="submit" value="Save" accesskey="w" /></li></ul></div>
|
||||
|
||||
<div id="authoritytabs" class="toptabs numbered">
|
||||
<ul> [% FOREACH BIG_LOO IN BIG_LOOP %]
|
||||
<li>[% IF ( BIG_LOO.number ) %]
|
||||
<a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
|
||||
[% ELSE %]
|
||||
<a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
|
||||
[% END %]</li>
|
||||
[% END %]</ul>
|
||||
<ul>
|
||||
[% FOREACH BIG_LOO IN BIG_LOOP %]
|
||||
<li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
|
||||
[% END %]
|
||||
</ul>
|
||||
|
||||
[% FOREACH BIG_LOO IN BIG_LOOP %]
|
||||
<!-- hide every tab except the 1st -->
|
||||
[% IF ( BIG_LOO.number ) %]
|
||||
<div id="tab[% BIG_LOO.number %]XX">
|
||||
[% ELSE %]
|
||||
<div id="tab[% BIG_LOO.number %]XX">
|
||||
[% END %]
|
||||
|
||||
[% FOREACH innerloo IN BIG_LOO.innerloop %]
|
||||
[% IF ( innerloo.tag ) %]
|
||||
<div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
|
||||
<div class="tag_title" name="div_indicator">
|
||||
[% UNLESS ( innerloo.hide_marc ) %]
|
||||
[% IF ( innerloo.advancedMARCEditor ) %]
|
||||
<a class="tagnum" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">[% innerloo.tag %]</a>
|
||||
[% ELSE %]
|
||||
<span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
|
||||
[% END %]
|
||||
[% IF ( innerloo.fixedfield ) %]
|
||||
<input class="indicator flat"
|
||||
type="text"
|
||||
style="display:none;"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input class="indicator flat"
|
||||
type="text"
|
||||
style="display:none;"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% ELSE %]
|
||||
<input class="indicator flat"
|
||||
type="text"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input class="indicator flat"
|
||||
type="text"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% END %] -
|
||||
[% ELSE %]
|
||||
[% IF ( innerloo.fixedfield ) %]
|
||||
<input type="hidden"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %]"
|
||||
value="[% innerloo.indicator1 %][% innerloo.random %]" />
|
||||
<input type="hidden"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %]"
|
||||
value="[% innerloo.indicator2 %][% innerloo.random %]" />
|
||||
[% ELSE %]
|
||||
<input type="hidden"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %]"
|
||||
value="[% innerloo.indicator1 %][% innerloo.random %]" />
|
||||
<input type="hidden"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %]"
|
||||
value="[% innerloo.indicator2 %][% innerloo.random %]" />
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% UNLESS ( innerloo.advancedMARCEditor ) %]
|
||||
<a onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">[% innerloo.tag_lib %]</a>
|
||||
[% END %]
|
||||
[% IF ( innerloo.repeatable ) %]
|
||||
<span class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">+</span>
|
||||
[% END %]
|
||||
[% UNLESS ( innerloo.mandatory ) %]
|
||||
<span class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">−</span>
|
||||
[% END %]
|
||||
|
||||
</div>
|
||||
|
||||
[% FOREACH subfield_loo IN innerloo.subfield_loop %]
|
||||
<!-- One line on the marc editor -->
|
||||
<div name="line" class="subfield_line" style="[% subfield_loo.visibility %];" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %]">
|
||||
|
||||
[% UNLESS ( subfield_loo.advancedMARCEditor ) %]
|
||||
[% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield" >
|
||||
[% ELSE %] <label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield" >[% END %]
|
||||
[% END %]
|
||||
|
||||
[% UNLESS ( subfield_loo.hide_marc ) %]
|
||||
[% IF ( subfield_loo.fixedfield ) %]
|
||||
<img class="buttonUp" style="display:none;" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]')" alt="Move Up" title="Move Up" />
|
||||
[% ELSE %]
|
||||
<img class="buttonUp" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]')" alt="Move Up" title="Move Up" />
|
||||
[% END %]
|
||||
<input title="[% subfield_loo.marc_lib_plain %]"
|
||||
style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text"
|
||||
name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
|
||||
value="[% subfield_loo.subfield %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
class="flat"
|
||||
tabindex="0" />
|
||||
[% ELSE %]
|
||||
<input type="hidden"
|
||||
name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
|
||||
value="[% subfield_loo.subfield %]"/>
|
||||
[% END %]
|
||||
|
||||
[% UNLESS ( subfield_loo.advancedMARCEditor ) %]
|
||||
[% IF ( subfield_loo.mandatory ) %]<span class="subfield_mandatory">[% END %]
|
||||
[% subfield_loo.marc_lib %]
|
||||
[% IF ( subfield_loo.mandatory ) %]</span>[% END %]
|
||||
</label>
|
||||
[% END %]
|
||||
|
||||
[% subfield_loo.marc_value %]
|
||||
|
||||
[% IF ( subfield_loo.repeatable ) %]
|
||||
<a href="#" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a>
|
||||
[% END %]
|
||||
[% UNLESS ( subfield_loo.mandatory ) %]
|
||||
<a href="#" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a>
|
||||
[% END %]
|
||||
|
||||
</div>
|
||||
<!-- End of the line -->
|
||||
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]<!-- tag -->
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]
|
||||
<div id="tab[% BIG_LOO.number %]XX">
|
||||
|
||||
[% UNLESS ( singletab ) %]
|
||||
</div>
|
||||
[% END %]
|
||||
</div>
|
||||
[% FOREACH innerloo IN BIG_LOO.innerloop %]
|
||||
[% IF ( innerloo.tag ) %]
|
||||
<div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
|
||||
<div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
|
||||
[% UNLESS hide_marc %]
|
||||
[% IF advancedMARCEditor %]
|
||||
<a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
|
||||
[% ELSE %]
|
||||
<span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
|
||||
[% END %]
|
||||
[% IF ( innerloo.fixedfield ) %]
|
||||
<input type="text"
|
||||
tabindex="1"
|
||||
class="indicator flat"
|
||||
style="display:none;"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input type="text"
|
||||
tabindex="1"
|
||||
class="indicator flat"
|
||||
style="display:none;"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% ELSE %]
|
||||
<input type="text"
|
||||
tabindex="1"
|
||||
class="indicator flat"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input type="text"
|
||||
tabindex="1"
|
||||
class="indicator flat"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% END %] -
|
||||
[% ELSE %]
|
||||
[% IF ( innerloo.fixedfield ) %]
|
||||
<input type="hidden"
|
||||
tabindex="1"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input type="hidden"
|
||||
tabindex="1"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% ELSE %]
|
||||
<input type="hidden"
|
||||
tabindex="1"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input type="hidden"
|
||||
tabindex="1"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% UNLESS advancedMARCEditor %]
|
||||
<a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
|
||||
[% END %]
|
||||
<span class="field_controls">
|
||||
[% IF ( innerloo.repeatable ) %]
|
||||
<a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
|
||||
<img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" />
|
||||
</a>
|
||||
[% END %]
|
||||
<a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
|
||||
<img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" />
|
||||
</a>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
[% FOREACH subfield_loo IN innerloo.subfield_loop %]
|
||||
<!-- One line on the marc editor -->
|
||||
<div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
|
||||
|
||||
[% UNLESS advancedMARCEditor %]
|
||||
[% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield">
|
||||
[% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% UNLESS hide_marc %]
|
||||
<span class="subfieldcode">
|
||||
[% IF ( subfield_loo.fixedfield ) %]
|
||||
<img class="buttonUp" style="display:none;" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
|
||||
[% ELSE %]
|
||||
<img class="buttonUp" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
|
||||
[% END %]
|
||||
<input type="text"
|
||||
title="[% subfield_loo.marc_lib_plain %]"
|
||||
style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
|
||||
name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
|
||||
value="[% subfield_loo.subfield %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
class="flat"
|
||||
tabindex="0" />
|
||||
</span>
|
||||
[% ELSE %]
|
||||
<input type="hidden"
|
||||
name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
|
||||
value="[% subfield_loo.subfield %]" />
|
||||
[% END %]
|
||||
|
||||
[% UNLESS advancedMARCEditor %]
|
||||
[% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
|
||||
[% subfield_loo.marc_lib_plain %]
|
||||
[% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
|
||||
</span>
|
||||
</label>
|
||||
[% END %]
|
||||
|
||||
[% subfield_loo.marc_value %]
|
||||
|
||||
<span class="subfield_controls">
|
||||
[% IF ( subfield_loo.repeatable ) %]
|
||||
<a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
|
||||
<img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
|
||||
</a>
|
||||
<a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
|
||||
<img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
|
||||
</a>
|
||||
[% END %]
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!-- End of the line -->
|
||||
[% END %]
|
||||
|
||||
</div>
|
||||
[% END %]<!-- if innerloo.tag -->
|
||||
[% END %]<!-- BIG_LOO.innerloop -->
|
||||
</div>
|
||||
[% END %]<!-- BIG_LOOP -->
|
||||
|
||||
</div><!-- tabs -->
|
||||
|
||||
<div name="hidden" id="hidden" class="tab">
|
||||
[% FOREACH hidden_loo IN hidden_loop %]
|
||||
|
|
@ -756,10 +384,14 @@ function searchauthority() {
|
|||
<input type="hidden" name="subfield" value="[% oldauthtypetagsubfield %]" />
|
||||
<input type="hidden" name="field_value" value="[% authtypecode %]" />
|
||||
[% END %]
|
||||
|
||||
<fieldset class="action">
|
||||
<input type="button" id="addauth2" value="Save" onclick="Check(this.form)" accesskey="w" />
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
// Try to add as many clones as needed
|
||||
try {
|
||||
for(var i=0; i<nb-subfields.length; i++) {
|
||||
window.opener.opener.CloneSubfield(subfields[0].getAttribute('id'));
|
||||
window.opener.opener.CloneSubfield(subfields[0].getAttribute('id'),'[% advancedMARCEditor %]');
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
|
|
|
|||
|
|
@ -3,30 +3,15 @@
|
|||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>
|
||||
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
|
||||
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
var fields_in_use = {};
|
||||
$(document).ready(function() {
|
||||
$('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) {
|
||||
$("#"+ui.panel.id+" input:eq(0)").focus();
|
||||
});
|
||||
$('.tag').each(function() {
|
||||
var field_id = this.getAttribute('id').substring(0, 7);
|
||||
if (field_id in fields_in_use) {
|
||||
fields_in_use[field_id]++;
|
||||
} else {
|
||||
fields_in_use[field_id] = 1;
|
||||
}
|
||||
});
|
||||
$('.subfield_line').each(function() {
|
||||
var field_id = this.getAttribute('id').substring(0, 12);
|
||||
if (field_id in fields_in_use) {
|
||||
fields_in_use[field_id]++;
|
||||
} else {
|
||||
fields_in_use[field_id] = 1;
|
||||
}
|
||||
});
|
||||
|
||||
/* check cookie to hide/show marcdocs*/
|
||||
if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
|
||||
hideMARCdocLinks();
|
||||
|
|
@ -48,21 +33,6 @@ function confirmnotdup(redirect){
|
|||
Check();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function Check(){
|
||||
var StrAlert = AreMandatoriesNotOk();
|
||||
if( ! StrAlert ){
|
||||
document.f.submit();
|
||||
return true;
|
||||
} else {
|
||||
alert(StrAlert);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function Dopop(link,i) {
|
||||
defaultvalue = document.getElementById(i).value;
|
||||
window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
|
||||
|
|
@ -235,6 +205,21 @@ function AreMandatoriesNotOk(){
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function Check(){
|
||||
var StrAlert = AreMandatoriesNotOk();
|
||||
if( ! StrAlert ){
|
||||
document.f.submit();
|
||||
return true;
|
||||
} else {
|
||||
alert(StrAlert);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check if z3950 mandatories are set or not
|
||||
*/
|
||||
|
|
@ -260,381 +245,6 @@ function Changefwk(FwkList) {
|
|||
f.submit();
|
||||
}
|
||||
|
||||
// returns the subfieldcode based upon subfieldid writing
|
||||
function getSubfieldcode(tagsubfieldid){
|
||||
// 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0
|
||||
return tagsubfieldid.substr(3+3+4+8-1,1);
|
||||
}
|
||||
|
||||
// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
|
||||
// returns the filter
|
||||
function getTagInputnameFilter(tagsubfieldid){
|
||||
var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));
|
||||
var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
|
||||
tagsubfield=tagsubfield+"_."+tagcode;
|
||||
return tagsubfield;
|
||||
}
|
||||
|
||||
function openAuth(tagsubfieldid,authtype) {
|
||||
// let's take the base of tagsubfield information (removing the indexes and the codes
|
||||
var element=document.getElementById(tagsubfieldid);
|
||||
var tagsubfield=getTagInputnameFilter(tagsubfieldid);
|
||||
var elementsubfcode=getSubfieldcode(element.name);
|
||||
var mainmainstring=element.value;
|
||||
var mainstring="";
|
||||
var inputs = element.parentNode.parentNode.getElementsByTagName("input");
|
||||
|
||||
for (var myindex =0; myindex<inputs.length;myindex++){
|
||||
if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
|
||||
var subfieldcode=getSubfieldcode(inputs[myindex].name);
|
||||
if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
|
||||
mainstring=inputs[myindex].value+" "+mainstring;
|
||||
}
|
||||
}
|
||||
}
|
||||
newin=window.open("../authorities/auth_finder.pl?authtypecode="+ authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
|
||||
}
|
||||
|
||||
|
||||
function ExpandField(index) {
|
||||
var original = document.getElementById(index); //original <div>
|
||||
var divs = original.getElementsByTagName('div');
|
||||
for(var i=0,divslen = divs.length ; i<divslen ; i++){ // foreach div
|
||||
if(divs[i].getAttribute('id').match(/^subfield/)){ // if it s a subfield
|
||||
if (divs[i].style.display == 'block') {
|
||||
divs[i].style.display = 'none';
|
||||
} else {
|
||||
divs[i].style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To clone a field or a subfield by clicking on '+' button
|
||||
*/
|
||||
function CloneField(index) {
|
||||
var original = document.getElementById(index); //original <div>
|
||||
fields_in_use[index.substr(0, 7)]++;
|
||||
var clone = original.cloneNode(true);
|
||||
var new_key = CreateKey();
|
||||
var new_id = original.getAttribute('id')+new_key;
|
||||
|
||||
clone.setAttribute('id',new_id); // setting a new id for the parent div
|
||||
|
||||
var divs = clone.getElementsByTagName('div');
|
||||
|
||||
[% UNLESS ( hide_marc ) %] // No indicator if hide_marc
|
||||
// setting a new name for the new indicator
|
||||
for(var i=0; i < 2; i++) {
|
||||
var indicator = clone.getElementsByTagName('input')[i];
|
||||
indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
|
||||
}
|
||||
[% END %]
|
||||
|
||||
// settings all subfields
|
||||
for(var i=0,divslen = divs.length ; i<divslen ; i++){ // foreach div
|
||||
if(divs[i].getAttribute("id").match(/^subfield/)){ // if it s a subfield
|
||||
|
||||
// set the attribute for the new 'div' subfields
|
||||
divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
|
||||
|
||||
var inputs = divs[i].getElementsByTagName('input');
|
||||
var id_input = "";
|
||||
|
||||
for( j = 0 ; j < inputs.length ; j++ ) {
|
||||
if(inputs[j].getAttribute("id") && inputs[j].getAttribute("id").match(/^tag_/) ){
|
||||
inputs[j].value = "";
|
||||
}
|
||||
}
|
||||
|
||||
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
|
||||
inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
|
||||
var id_input;
|
||||
try {
|
||||
id_input = inputs[1].getAttribute('id')+new_key;
|
||||
inputs[1].setAttribute('id',id_input);
|
||||
inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
|
||||
} catch(e) {
|
||||
try{ // it s a select if it is not an input
|
||||
var selects = divs[i].getElementsByTagName('select');
|
||||
id_input = selects[0].getAttribute('id')+new_key;
|
||||
selects[0].setAttribute('id',id_input);
|
||||
selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
|
||||
}catch(e2){ // it is a textarea if it s not a select or an input
|
||||
var textaeras = divs[i].getElementsByTagName('textarea');
|
||||
id_input = textaeras[0].getAttribute('id')+new_key;
|
||||
textaeras[0].setAttribute('id',id_input);
|
||||
textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
|
||||
}
|
||||
}
|
||||
|
||||
[% UNLESS ( advancedMARCEditor ) %]
|
||||
// when cloning a subfield, re set its label too.
|
||||
var labels = divs[i].getElementsByTagName('label');
|
||||
labels[0].setAttribute('for',id_input);
|
||||
[% END %]
|
||||
|
||||
[% UNLESS ( hide_marc ) %]
|
||||
// updating javascript parameters on button up
|
||||
var imgs = divs[i].getElementsByTagName('img');
|
||||
imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
|
||||
[% END %]
|
||||
|
||||
// setting its '+' and '-' buttons
|
||||
try {
|
||||
var anchors = divs[i].getElementsByTagName('a');
|
||||
for (var j = 0; j < anchors.length; j++) {
|
||||
if(anchors[j].getAttribute('class') == 'buttonPlus'){
|
||||
anchors[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
|
||||
} else if (anchors[j].getAttribute('class') == 'buttonMinus') {
|
||||
anchors[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig if ButtonPlus & CloneButtonPlus don t exist.
|
||||
}
|
||||
|
||||
// button ...
|
||||
var spans=0;
|
||||
try {
|
||||
spans = divs[i].getElementsByTagName('a');
|
||||
} catch(e) {
|
||||
// no spans
|
||||
}
|
||||
if(spans){
|
||||
var buttonDot;
|
||||
if(!CloneButtonPlus){ // it s impossible to have + ... (buttonDot AND buttonPlus)
|
||||
buttonDot = spans[0];
|
||||
if(buttonDot){
|
||||
// 2 possibilities :
|
||||
try{
|
||||
var buttonDotOnClick = buttonDot.getAttribute('onclick');
|
||||
if(buttonDotOnClick.match('Clictag')){ // -1- It s a plugin
|
||||
var re = /\('.*'\)/i;
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
|
||||
if(buttonDotOnClick){
|
||||
buttonDot.setAttribute('onclick',buttonDotOnClick);
|
||||
}
|
||||
} else {
|
||||
if(buttonDotOnClick.match('Dopop')) { // -2- It's a auth value
|
||||
var re1 = /&index=.*',/;
|
||||
var re2 = /,.*\)/;
|
||||
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
|
||||
buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
|
||||
|
||||
if(buttonDotOnClick){
|
||||
buttonDot.setAttribute('onclick',buttonDotOnClick);
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
// do not copy the script section.
|
||||
var script = spans[0].getElementsByTagName('script')[0];
|
||||
spans[0].removeChild(script);
|
||||
} catch(e) {
|
||||
// do nothing if there is no script
|
||||
}
|
||||
}catch(e){}
|
||||
}
|
||||
}
|
||||
}
|
||||
[% UNLESS ( hide_marc ) %]
|
||||
var buttonUp = divs[i].getElementsByTagName('img')[0];
|
||||
buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
|
||||
[% END %]
|
||||
|
||||
} else { // it's a indicator div
|
||||
if(divs[i].getAttribute('id').match(/^div_indicator/)){
|
||||
var inputs = divs[i].getElementsByTagName('input');
|
||||
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
|
||||
inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
|
||||
|
||||
var CloneButtonPlus;
|
||||
try {
|
||||
var anchors = divs[i].getElementsByTagName('a');
|
||||
for (var j = 0; j < anchors.length; j++) {
|
||||
if (anchors[j].getAttribute('class') == 'buttonPlus') {
|
||||
anchors[j].setAttribute('onclick',"CloneField('" + new_id + "')");
|
||||
} else if (anchors[j].getAttribute('class') == 'buttonMinus') {
|
||||
anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "')");
|
||||
} else if (anchors[j].getAttribute('class') == 'expandfield') {
|
||||
anchors[j].setAttribute('onclick',"ExpandField('" + new_id + "')");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig CloneButtonPlus doesn't exist.
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
||||
function CloneSubfield(index){
|
||||
var original = document.getElementById(index); //original <div>
|
||||
fields_in_use[index.substr(0, 12)]++;
|
||||
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 = "";
|
||||
for(var i=0,len=inputs.length; i<len ; i++ ){
|
||||
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
|
||||
for(var i=0,len=selects.length; i<len ; i++ ){
|
||||
id_input = selects[i].getAttribute('id')+new_key;
|
||||
selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
|
||||
selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
|
||||
}
|
||||
|
||||
// textarea
|
||||
for(var i=0,len=textareas.length; i<len ; i++ ){
|
||||
id_input = textareas[i].getAttribute('id')+new_key;
|
||||
textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[% UNLESS ( advancedMARCEditor ) %]
|
||||
// when cloning a subfield, reset its label too.
|
||||
var label = clone.getElementsByTagName('label')[0];
|
||||
label.setAttribute('for',id_input);
|
||||
[% END %]
|
||||
|
||||
// setting a new id for the parent div
|
||||
clone.setAttribute('id',new_id);
|
||||
|
||||
try {
|
||||
var buttonUp = clone.getElementsByTagName('img')[0];
|
||||
buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
|
||||
var anchors = clone.getElementsByTagName('a');
|
||||
if(anchors.length){
|
||||
for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
|
||||
if(anchors[i].getAttribute('class') == 'buttonPlus'){
|
||||
anchors[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
|
||||
} else if (anchors[i].getAttribute('class') == 'buttonMinus') {
|
||||
anchors[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig if ButtonPlus & CloneButtonPlus don't exist.
|
||||
}
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function removes or clears unwanted subfields
|
||||
*/
|
||||
function UnCloneField(index) {
|
||||
var original = document.getElementById(index);
|
||||
var field_id;
|
||||
if (index.match("tag")) {
|
||||
field_id = index.substr(0, 7);
|
||||
} else {
|
||||
field_id = index.substr(0, 12);
|
||||
}
|
||||
if (1 == fields_in_use[field_id]) {
|
||||
// clear inputs, but don't delete
|
||||
$(":input.input_marceditor", original).each(function(){
|
||||
// thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
|
||||
// hint about clearing selects correctly
|
||||
var type = this.type;
|
||||
var tag = this.tagName.toLowerCase();
|
||||
if (type == 'text' || type == 'password' || tag == 'textarea') {
|
||||
this.value = "";
|
||||
} else if (type == 'checkbox' || type == 'radio') {
|
||||
this.checked = false;
|
||||
} else if (tag == 'select') {
|
||||
this.selectedIndex = -1;
|
||||
}
|
||||
});
|
||||
$(":input.indicator", original).val("");
|
||||
} else {
|
||||
original.parentNode.removeChild(original);
|
||||
fields_in_use[field_id]--;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function create a random number
|
||||
*/
|
||||
function CreateKey(){
|
||||
return parseInt(Math.random() * 100000);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function allows to move a subfield up by clickink on the 'up' button .
|
||||
*/
|
||||
function upSubfield(index) {
|
||||
try{
|
||||
var line = document.getElementById(index); // get the line where the user has clicked.
|
||||
} catch(e) {
|
||||
return; // this line doesn't exist...
|
||||
}
|
||||
var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
|
||||
|
||||
// getting all subfields for this tag
|
||||
var subfields = tag.getElementsByTagName('div');
|
||||
var subfieldsLength = subfields.length;
|
||||
|
||||
if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
|
||||
|
||||
// among all subfields
|
||||
for(var i=0;i<subfieldsLength;i++){
|
||||
if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
|
||||
if(i==1){ // if the clicked subfield is on the top
|
||||
tag.appendChild(subfields[1]);
|
||||
return;
|
||||
} else {
|
||||
var lineAbove = subfields[i-1];
|
||||
tag.insertBefore(line,lineAbove);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
|
||||
subfield = document.getElementById(index);
|
||||
subfield.style.display = 'block';
|
||||
label = document.getElementById(labelindex);
|
||||
label.style.display='none';
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
|
||||
|
|
@ -657,6 +267,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
|
|||
//]]>
|
||||
</script>
|
||||
[% INCLUDE 'header.inc' %]
|
||||
|
||||
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> › [% IF ( biblionumber ) %]Editing <em>[% title |html %]</em> (Record number [% biblionumber %])[% ELSE %]Add MARC record[% END %]</div>
|
||||
|
||||
<div id="doc" class="yui-t7">
|
||||
|
|
@ -802,83 +413,129 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
|
|||
<input type="hidden" name="breedingid" value="[% breedingid %]" />
|
||||
|
||||
<div id="addbibliotabs" class="toptabs numbered">
|
||||
<ul>[% FOREACH BIG_LOO IN BIG_LOOP %]
|
||||
<li> [% IF ( BIG_LOO.number ) %]
|
||||
<a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
|
||||
[% ELSE %]
|
||||
<a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
|
||||
[% END %]</li>
|
||||
[% END %]</ul>
|
||||
<ul>
|
||||
[% FOREACH BIG_LOO IN BIG_LOOP %]
|
||||
<li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
|
||||
[% END %]
|
||||
</ul>
|
||||
|
||||
[% FOREACH BIG_LOO IN BIG_LOOP %]
|
||||
<!-- hide every tab except the 1st -->
|
||||
[% IF ( BIG_LOO.number ) %]
|
||||
<div id="tab[% BIG_LOO.number %]XX">
|
||||
[% ELSE %]
|
||||
<div id="tab[% BIG_LOO.number %]XX">
|
||||
[% END %]
|
||||
|
||||
|
||||
[% FOREACH innerloo IN BIG_LOO.innerloop %]
|
||||
[% IF ( innerloo.tag ) %]
|
||||
<div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
|
||||
[% IF ( innerloo.tag ) %]
|
||||
<div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
|
||||
<div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
|
||||
[% UNLESS hide_marc %]
|
||||
[% IF advancedMARCEditor %]
|
||||
<a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
|
||||
[% ELSE %]
|
||||
<span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]
|
||||
[% IF marcflavour != 'NORMARC' %]<a class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]', [% BIG_LOO.number %]); return false;"> ?</a>[% END %]
|
||||
</span>
|
||||
[% END %]
|
||||
[% IF ( innerloo.fixedfield ) %]
|
||||
<input tabindex="1" class="indicator flat" type="text" style="display:none;" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator1 %]" />
|
||||
<input tabindex="1" class="indicator flat" type="text" style="display:none;" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator2 %]" />
|
||||
[% ELSE %]
|
||||
<input tabindex="1" class="indicator flat" type="text" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator1 %]" />
|
||||
<input tabindex="1" class="indicator flat" type="text" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator2 %]" />
|
||||
[% END %] -
|
||||
[% UNLESS hide_marc %]
|
||||
[% IF advancedMARCEditor %]
|
||||
<a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
|
||||
[% ELSE %]
|
||||
[% IF ( innerloo.fixedfield ) %]
|
||||
<input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator1 %]" />
|
||||
<input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator2 %]" />
|
||||
[% ELSE %]
|
||||
<input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator1 %]" />
|
||||
<input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator2 %]" />
|
||||
[% END %]
|
||||
<span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]
|
||||
[% IF marcflavour != 'NORMARC' %]<a class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]', [% BIG_LOO.number %]); return false;"> ?</a>[% END %]
|
||||
</span>
|
||||
[% END %]
|
||||
[% IF ( innerloo.fixedfield ) %]
|
||||
<input type="text"
|
||||
tabindex="1"
|
||||
class="indicator flat"
|
||||
style="display:none;"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input type="text"
|
||||
tabindex="1"
|
||||
class="indicator flat"
|
||||
style="display:none;"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% ELSE %]
|
||||
<input type="text"
|
||||
tabindex="1"
|
||||
class="indicator flat"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input type="text"
|
||||
tabindex="1"
|
||||
class="indicator flat"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% END %] -
|
||||
[% ELSE %]
|
||||
[% IF ( innerloo.fixedfield ) %]
|
||||
<input type="hidden"
|
||||
tabindex="1"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input type="hidden"
|
||||
tabindex="1"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% ELSE %]
|
||||
<input type="hidden"
|
||||
tabindex="1"
|
||||
name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
|
||||
value="[% innerloo.indicator1 %]" />
|
||||
<input type="hidden"
|
||||
tabindex="1"
|
||||
name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
|
||||
value="[% innerloo.indicator2 %]" />
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% UNLESS advancedMARCEditor %]
|
||||
<a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
|
||||
<a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
|
||||
[% END %]
|
||||
[% IF ( innerloo.repeatable ) %]
|
||||
<span class="subfield_controls"><a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Repeat this Tag"><img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" /></a>
|
||||
[% END %]
|
||||
<a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag"><img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" /></a></span>
|
||||
<span class="field_controls">
|
||||
[% IF ( innerloo.repeatable ) %]
|
||||
<a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
|
||||
<img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" />
|
||||
</a>
|
||||
[% END %]
|
||||
<a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
|
||||
<img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" />
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
[% FOREACH subfield_loo IN innerloo.subfield_loop %]
|
||||
<!-- One line on the marc editor -->
|
||||
<div class="subfield_line" style="[% subfield_loo.visibility %]; float: left; clear: left; width: 100%;" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
|
||||
<div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
|
||||
|
||||
[% UNLESS advancedMARCEditor %]
|
||||
[% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield">
|
||||
[% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">[% END %]
|
||||
[% END %]
|
||||
[% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% UNLESS hide_marc %]
|
||||
<span class="subfieldcode">[% IF ( subfield_loo.fixedfield ) %]
|
||||
<img class="buttonUp" style="display:none;" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
|
||||
<span class="subfieldcode">
|
||||
[% IF ( subfield_loo.fixedfield ) %]
|
||||
<img class="buttonUp" style="display:none;" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
|
||||
[% ELSE %]
|
||||
<img class="buttonUp" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
|
||||
<img class="buttonUp" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
|
||||
[% END %]
|
||||
<input title="[% subfield_loo.marc_lib_plain %]" style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text" tabindex="0" name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" value="[% subfield_loo.subfield %]" size="1" maxlength="1" class="flat" />
|
||||
</span>
|
||||
<input type="text"
|
||||
title="[% subfield_loo.marc_lib_plain %]"
|
||||
style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
|
||||
name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
|
||||
value="[% subfield_loo.subfield %]"
|
||||
size="1"
|
||||
maxlength="1"
|
||||
class="flat"
|
||||
tabindex="0" />
|
||||
</span>
|
||||
[% ELSE %]
|
||||
<input type="hidden" name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" value="[% subfield_loo.subfield %]" />
|
||||
</span>
|
||||
<input type="hidden"
|
||||
name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
|
||||
value="[% subfield_loo.subfield %]" />
|
||||
[% END %]
|
||||
|
||||
[% UNLESS advancedMARCEditor %]
|
||||
|
|
@ -891,22 +548,29 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
|
|||
|
||||
[% subfield_loo.marc_value %]
|
||||
|
||||
<span class="subfield_controls">
|
||||
[% IF ( subfield_loo.repeatable ) %]
|
||||
<span class="subfield_controls"><a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a>
|
||||
<a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a></span>
|
||||
<a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
|
||||
<img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
|
||||
</a>
|
||||
<a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
|
||||
<img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
|
||||
</a>
|
||||
[% END %]
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!-- End of the line -->
|
||||
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]<!-- tag -->
|
||||
[% END %]
|
||||
|
||||
</div>
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]<!-- if innerloo.tag -->
|
||||
[% END %]<!-- BIG_LOO.innerloop -->
|
||||
</div>
|
||||
[% END %]<!-- BIG_LOOP -->
|
||||
|
||||
</div><!-- tabs -->
|
||||
|
||||
<!-- Fields for fast add cataloguing -->
|
||||
<input type="hidden" name="barcode" value="[% barcode %]" />
|
||||
<input type="hidden" name="branch" value="[% branch %]" />
|
||||
|
|
@ -914,6 +578,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
|
|||
<input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
|
||||
<input type="hidden" name="duedatespec" value="[% duedatespec %]" />
|
||||
<!-- /End of fast add fields -->
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
[% INCLUDE 'doc-head-open.inc' %]
|
||||
<title>Koha › Cataloging › [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) › Items</title>
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$(document).ready(function(){
|
||||
|
|
@ -84,78 +85,6 @@ function confirm_deletion(biblionumber,itemnumber) {
|
|||
}
|
||||
}
|
||||
|
||||
function CloneSubfield(index){
|
||||
var original = document.getElementById(index); //original <div>
|
||||
var clone = original.cloneNode(true);
|
||||
var new_key = CreateKey();
|
||||
var old_id = original.getAttribute('id');
|
||||
old_id=old_id.substr(12);
|
||||
var new_id = old_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');
|
||||
|
||||
// input
|
||||
var id_input = "";
|
||||
for(var i=0,len=inputs.length; i<len ; i++ ){
|
||||
id_input = inputs[i].getAttribute('id')+new_key;
|
||||
inputs[i].setAttribute('id',id_input);
|
||||
inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
|
||||
}
|
||||
|
||||
// select
|
||||
for(var i=0,len=selects.length; i<len ; i++ ){
|
||||
id_input = selects[i].getAttribute('id')+new_key;
|
||||
selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
|
||||
selects[i].setAttribute('name',selects[i].getAttribute('name'));
|
||||
}
|
||||
|
||||
// textarea
|
||||
for(var i=0,len=textareas.length; i<len ; i++ ){
|
||||
id_input = textareas[i].getAttribute('id')+new_key;
|
||||
textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
|
||||
textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
|
||||
}
|
||||
|
||||
[% UNLESS ( advancedMARCEditor ) %]
|
||||
// when cloning a subfield, reset its label too.
|
||||
var label = clone.getElementsByTagName('label')[0];
|
||||
label.setAttribute('for',id_input);
|
||||
[% END %]
|
||||
|
||||
// setting a new if for the parent div
|
||||
clone.setAttribute('id',new_id);
|
||||
|
||||
var CloneButtonPlus;
|
||||
try {
|
||||
var spans = clone.getElementsByTagName('span');
|
||||
if(spans.length){
|
||||
for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
|
||||
if(spans[i].getAttribute('class') == 'buttonPlus'){
|
||||
CloneButtonPlus = spans[i];
|
||||
CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
|
||||
var buttonUp = clone.getElementsByTagName('img')[0];
|
||||
buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothing if ButtonPlus & CloneButtonPlus don't exist.
|
||||
}
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function creates a random number
|
||||
*/
|
||||
function CreateKey(){
|
||||
return parseInt(Math.random() * 100000);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#cataloguing_additem_itemlist tr").hover(
|
||||
function () {$(this).attr("class","highlight");},
|
||||
|
|
@ -247,7 +176,9 @@ $(document).ready(function() {
|
|||
<input type="hidden" name="subfield" value="[% ite.subfield %]" />
|
||||
<input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
|
||||
[% IF ( ite.repeatable ) %]
|
||||
<span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
|
||||
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
|
||||
<img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
|
||||
</a>
|
||||
[% END %]
|
||||
[% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
|
||||
</div></li>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
[% INCLUDE 'doc-head-open.inc' %]
|
||||
<title>Koha › Serials › Serial edition [% bibliotitle %]</title>
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
//<![CDATA[
|
||||
function generateReceive() {
|
||||
|
|
@ -74,70 +75,7 @@ function changeDate2(adate) {
|
|||
var elem = document.getElementById("supexpecteddate");
|
||||
elem.value = adate;
|
||||
}
|
||||
function CloneSubfield(index){
|
||||
var original = document.getElementById(index); //original <div>
|
||||
var clone = original.cloneNode(true);
|
||||
var new_key = CreateKey();
|
||||
var old_id = original.getAttribute('id');
|
||||
old_id=old_id.substr(12);
|
||||
var new_id = old_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');
|
||||
|
||||
// input
|
||||
var id_input = "";
|
||||
for(var i=0,len=inputs.length; i<len ; i++ ){
|
||||
id_input = inputs[i].getAttribute('id')+new_key;
|
||||
inputs[i].setAttribute('id',id_input);
|
||||
inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
|
||||
}
|
||||
|
||||
// select
|
||||
for(var i=0,len=selects.length; i<len ; i++ ){
|
||||
id_input = selects[i].getAttribute('id')+new_key;
|
||||
selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
|
||||
selects[i].setAttribute('name',selects[i].getAttribute('name'));
|
||||
}
|
||||
|
||||
// textarea
|
||||
for(var i=0,len=textareas.length; i<len ; i++ ){
|
||||
id_input = textareas[i].getAttribute('id')+new_key;
|
||||
textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
|
||||
textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
|
||||
}
|
||||
|
||||
[% UNLESS ( advancedMARCEditor ) %]
|
||||
// when cloning a subfield, reset its label too.
|
||||
var label = clone.getElementsByTagName('label')[0];
|
||||
label.setAttribute('for',id_input);
|
||||
[% END %]
|
||||
|
||||
// setting a new if for the parent div
|
||||
clone.setAttribute('id',new_id);
|
||||
|
||||
var CloneButtonPlus;
|
||||
try {
|
||||
var spans = clone.getElementsByTagName('span');
|
||||
if(spans.length){
|
||||
for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
|
||||
if(spans[i].getAttribute('class') == 'buttonPlus'){
|
||||
CloneButtonPlus = spans[i];
|
||||
CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
|
||||
var buttonUp = clone.getElementsByTagName('img')[0];
|
||||
buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
// do nothig if ButtonPlus & CloneButtonPlus don't exist.
|
||||
}
|
||||
// insert this line on the page
|
||||
original.parentNode.insertBefore(clone,original.nextSibling);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("form#serials_edit").submit(function() {
|
||||
var total_errors = 0;
|
||||
|
|
@ -293,7 +231,7 @@ $(document).ready(function() {
|
|||
[% FOREACH item IN serialslis.items %]
|
||||
<div id="item[% item.serialid %][% item.countitems %]" class="items">
|
||||
<ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
|
||||
<div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
|
||||
<div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
|
||||
|
||||
<label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
|
||||
[% iteminformatio.marc_value %]
|
||||
|
|
@ -302,8 +240,10 @@ $(document).ready(function() {
|
|||
<input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
|
||||
<input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
|
||||
<input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
|
||||
[% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
|
||||
<span class="buttonPlus" onclick="CloneSubfield('subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
|
||||
[% IF ( iteminformatio.repeatable ) %]
|
||||
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
|
||||
<img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
|
||||
</a>
|
||||
[% END %]
|
||||
|
||||
</div></li>
|
||||
|
|
@ -396,7 +336,7 @@ $(document).ready(function() {
|
|||
<div class="cataloguing_additem_itemlist">
|
||||
<div id="item[% newserialloo.serialid %][% newserialloo.countitems %]" class="items">
|
||||
<ol>[% FOREACH iteminformatio IN newserialloo.iteminformation %]<li>
|
||||
<div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
|
||||
<div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
|
||||
|
||||
<label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
|
||||
[% iteminformatio.marc_value %]
|
||||
|
|
@ -405,8 +345,10 @@ $(document).ready(function() {
|
|||
<input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
|
||||
<input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
|
||||
<input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
|
||||
[% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
|
||||
<span class="buttonPlus" onclick="CloneSubfield('subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
|
||||
[% IF ( iteminformatio.repeatable ) %]
|
||||
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
|
||||
<img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
|
||||
</a>
|
||||
[% END %]
|
||||
</div>
|
||||
</li>[% END %]</ol>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<title>Koha › Tools › Batch item modification</title>
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
|
||||
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
|
||||
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
|
||||
|
|
@ -163,7 +164,9 @@ $(document).ready(function(){
|
|||
<input type="hidden" name="subfield" value="[% ite.subfield %]" />
|
||||
<input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
|
||||
[% IF ( ite.repeatable ) %]
|
||||
<span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
|
||||
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
|
||||
<img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
|
||||
</a>
|
||||
[% END %]
|
||||
<span class="hint" id="hint[% ite.tag %][% ite.subfield %][% ite.random %]"></span>
|
||||
</div></li>
|
||||
|
|
|
|||
|
|
@ -394,14 +394,14 @@ foreach my $tag (sort keys %{$tagslib}) {
|
|||
my $temp;
|
||||
my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
|
||||
my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
|
||||
$subfield_data{marc_value} = qq[<input $attributes
|
||||
$subfield_data{marc_value} = qq[<input type="text" $attributes
|
||||
onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
|
||||
onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
|
||||
<a href="#" class="buttonDot" onclick="Clic$function_name('$subfield_data{id}'); return false;" title="Tag Editor">...</a>
|
||||
$javascript];
|
||||
} else {
|
||||
warn "Plugin Failed: $plugin";
|
||||
$subfield_data{marc_value} = "<input $attributes />"; # supply default input form
|
||||
$subfield_data{marc_value} = "<input type=\"text\" $attributes />"; # supply default input form
|
||||
}
|
||||
}
|
||||
elsif ( $tag eq '' ) { # it's an hidden field
|
||||
|
|
@ -420,7 +420,7 @@ foreach my $tag (sort keys %{$tagslib}) {
|
|||
$subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n";
|
||||
} else {
|
||||
# it's a standard field
|
||||
$subfield_data{marc_value} = "<input $attributes />";
|
||||
$subfield_data{marc_value} = "<input type=\"text\" $attributes />";
|
||||
}
|
||||
# $subfield_data{marc_value}="<input type=\"text\" name=\"field_value\">";
|
||||
push (@loop_data, \%subfield_data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue