View | Details | Raw Unified | Return to bug 11559
Collapse All | Expand All

(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 751-757 if ($frameworkcode eq 'FA'){ Link Here
751
    # Only use the advanced editor for non-fast-cataloging.
751
    # Only use the advanced editor for non-fast-cataloging.
752
    # breedingid is not handled because those would only come off a Z39.50
752
    # breedingid is not handled because those would only come off a Z39.50
753
    # search initiated by the basic editor.
753
    # search initiated by the basic editor.
754
    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog:' . $biblionumber ) : '' ) );
754
    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog/' . $biblionumber ) : '' ) );
755
}
755
}
756
756
757
757
(-)a/cataloguing/editor.pl (-2 / +2 lines)
Lines 60-67 $template->{VARS}->{DefaultLanguageField008} = pack( 'A3', C4::Context->preferen Link Here
60
my $dbh = C4::Context->dbh;
60
my $dbh = C4::Context->dbh;
61
$template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( q{
61
$template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( q{
62
    SELECT * FROM z3950servers
62
    SELECT * FROM z3950servers
63
    WHERE recordtype != 'authority'
63
    WHERE recordtype != 'authority' AND servertype = 'zed'
64
    ORDER BY name
64
    ORDER BY servername
65
}, { Slice => {} } );
65
}, { Slice => {} } );
66
66
67
output_html_with_http_headers $input, $cookie, $template->output;
67
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-60 / +9 lines)
Lines 28-43 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
28
            recordtype: 'biblio',
28
            recordtype: 'biblio',
29
            checked: false,
29
            checked: false,
30
        },
30
        },
31
        [%- FOREACH batch = editable_batches -%]
32
            'batch:[% batch.import_batch_id %]': {
33
                name: _("Batch: ") + '[% batch.file_name %]',
34
                recordtype: 'biblio',
35
                checked: false,
36
            },
37
        [%- END -%]
38
        [%- FOREACH server = z3950_servers -%]
31
        [%- FOREACH server = z3950_servers -%]
39
            [% server.id %]: {
32
            [% server.id %]: {
40
                name: '[% server.name %]',
33
                name: '[% server.servername %]',
41
                recordtype: '[% server.recordtype %]',
34
                recordtype: '[% server.recordtype %]',
42
                checked: [% server.checked ? 'true' : 'false' %],
35
                checked: [% server.checked ? 'true' : 'false' %],
43
            },
36
            },
Lines 268-281 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
268
        },
261
        },
269
    };
262
    };
270
263
271
    var editable_batches = {
272
        [%- FOREACH batch = editable_batches -%]
273
            [% batch.import_batch_id %]: {
274
                'name': '[% batch.file_name %]',
275
            },
276
        [%- END -%]
277
    };
278
279
    function setSource(parts) {
264
    function setSource(parts) {
280
        state.backend = parts[0];
265
        state.backend = parts[0];
281
        state.recordID = parts[1];
266
        state.recordID = parts[1];
Lines 693-699 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
693
            var name = prompt(_("Please enter the name for the new macro:"));
678
            var name = prompt(_("Please enter the name for the new macro:"));
694
            if (!name) return;
679
            if (!name) return;
695
680
696
            if ( !Preferences.user.macros[name] ) storeMacro( name, { contents: "" } );
681
            if ( !Preferences.user.macros[name] ) storeMacro( name, { format: "rancor", contents: "" } );
697
            showSavedMacros();
682
            showSavedMacros();
698
            loadMacro( name );
683
            loadMacro( name );
699
        } );
684
        } );
Lines 866-920 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
866
851
867
                    reader.onload = function() {
852
                    reader.onload = function() {
868
                        var record = new MARC.Record();
853
                        var record = new MARC.Record();
869
                        $("#search-overlay").show();
870
                        Search.includedServers = [1];
871
                        showResultsBox();
872
854
873
                        if ( /\.mrc$/.test( file.name ) ) {
855
                        if ( /\.mrc$/.test( file.name ) ) {
874
                            /*var data = {
856
                            record.loadISO2709( reader.result );
875
                                errors: {},
876
                                num_fetched: {},
877
                                hits: [],
878
                                sort_direction: 'asc',
879
                                sort_key: 'title',
880
                            };
881
                            data.hits = [];
882
                            $.each( reader.result.split('\035'), function( i, blob ) {
883
                                if ( !blob ) return;
884
885
                                var record = new MARC.Record();
886
                                record.loadISO2709( blob );
887
888
                                var hit = {
889
                                    server: 1,
890
                                    record: record,
891
                                    index: i,
892
                                    metadata: {},
893
                                };
894
895
                                var _addField = function(field, tag, subf) {
896
                                    var f = record.field(tag);
897
                                    if (!f) return;
898
                                    var s = f.subfield(subf);
899
                                    if (s!==false) hit.metadata[field] = s;
900
                                }
901
902
                                _addField('local_number', '001', '@');
903
                                _addField('isbn', '020', 'a');
904
                                _addField('author', '100', 'a');
905
                                _addField('title', '245', 'a');
906
907
                                data.hits.push(hit);
908
                            } );
909
                            showSearchResults(editor, data);
910
                            $("#search-overlay").hide();*/
911
                            record.loadISO2709( blob );
912
                        } else if ( /\.xml$/.test( file.name ) ) {
857
                        } else if ( /\.xml$/.test( file.name ) ) {
913
                            record.loadMARCXML( reader.result );
858
                            record.loadMARCXML( reader.result );
914
                        } else {
859
                        } else {
915
                            humanMsg.displayAlert( _("Unknown record type, cannot import"), { className: 'humanError' } );
860
                            humanMsg.displayAlert( _("Unknown record type, cannot import"), { className: 'humanError' } );
916
                            return;
861
                            return;
917
                        }
862
                        }
863
864
                        editor.displayRecord( record );
918
                    };
865
                    };
919
866
920
                    reader.readAsText( file );
867
                    reader.readAsText( file );
Lines 933-939 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
933
        $('#run-macro').click( function() {
880
        $('#run-macro').click( function() {
934
            var result = Macros.Run( editor, $('#macro-format').val(), macroEditor.getValue() );
881
            var result = Macros.Run( editor, $('#macro-format').val(), macroEditor.getValue() );
935
882
936
            if ( !result.errors.length ) return false;
883
            if ( !result.errors.length ) {
884
                $('#macro-ui').modal('hide');
885
                return false;
886
            }
937
887
938
            var errors = [];
888
            var errors = [];
939
            $.each( result.errors, function() {
889
            $.each( result.errors, function() {
940
- 

Return to bug 11559