Bug 11559: (followup) Fill in default values, fix redirect and UNIMARC

This fixes the following issues:
    * Help for UNIMARC tags broken
    * MARC21 resources loaded when in UNIMARC
    * Clicking on "advanced editor" in basic editor fails
    * Shift-Tab goes to the beginning of a fixed-field widget rather
      than the end

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Jesse Weaver 2015-06-23 16:24:17 -06:00 committed by Tomas Cohen Arazi
parent 9c30a2ebe2
commit 042b4da576
5 changed files with 12 additions and 7 deletions

View file

@ -156,7 +156,7 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin
record.addFieldGrouped( newField );
if ( tagnum < '010' ) {
newField.addSubfield( [ '@', '' ] );
newField.addSubfield( [ '@', (taginfo.subfields[0] ? taginfo.subfields[0][1].defaultvalue : null ) || '' ] );
return;
}
}
@ -167,7 +167,7 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin
if ( subfieldinfo.mandatory != "1" && !allTags ) return;
$.each( fields, function( undef, field ) {
if ( !field.hasSubfield(subfieldcode) ) field.addSubfieldGrouped( [ subfieldcode, '' ] );
if ( !field.hasSubfield(subfieldcode) ) field.addSubfieldGrouped( [ subfieldcode, subfieldinfo.defaultvalue || '' ] );
} );
} );
} );

View file

@ -172,7 +172,7 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ],
for ( var i = positions.length - 1; i >= 0; i-- ) {
if ( positions[i].ch < cur.ch ) {
activateTabPosition( cm, positions[i] );
activateTabPosition( cm, positions[i], -1 );
return false;
}
}

View file

@ -31,8 +31,12 @@ define( [ 'module' ], function( module ) {
_allResources.push(deferred);
}
_res( 'marc21/xml/006', $.get( module.config().themelang + '/data/marc21_field_006.xml' ) );
_res( 'marc21/xml/008', $.get( module.config().themelang + '/data/marc21_field_008.xml' ) );
switch ( module.config().marcflavour ) {
case 'MARC21':
_res( 'marc21/xml/006', $.get( module.config().themelang + '/data/marc21_field_006.xml' ) );
_res( 'marc21/xml/008', $.get( module.config().themelang + '/data/marc21_field_008.xml' ) );
break;
}
return Resources;
} );

View file

@ -7,6 +7,7 @@ require.config( {
baseUrl: '/intranet-tmpl/lib/koha/cateditor/',
config: {
resources: {
marcflavour: '[% marcflavour %]',
themelang: '[% themelang %]',
},
},
@ -179,7 +180,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
var first = tag[0];
var url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#";
if ( first == '0' ) url += "b";
if ( first != '9' ) url += field;
if ( first != '9' ) url += tag;
return url;
}

View file

@ -116,7 +116,7 @@
var biblionumber = [% biblionumber || "null" %];
if ( biblionumber ) {
window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog:' + biblionumber;
window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber;
} else {
window.location = '/cgi-bin/koha/cataloguing/editor.pl';
}