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

(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js (-3 / +8 lines)
Lines 127-142 define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin Link Here
127
        },
127
        },
128
128
129
        CreateRecord: function( record, callback ) {
129
        CreateRecord: function( record, callback ) {
130
            var frameworkcode = record.frameworkcode;
130
            record = record.clone();
131
            record = record.clone();
131
            _removeBiblionumberFields( record );
132
            _removeBiblionumberFields( record );
132
133
133
            $.ajax( {
134
            $.ajax( {
134
                type: 'POST',
135
                type: 'POST',
135
                url: '/cgi-bin/koha/svc/new_bib',
136
                url: '/cgi-bin/koha/svc/new_bib?frameworkcode=' + encodeURIComponent(frameworkcode),
136
                data: record.toXML(),
137
                data: record.toXML(),
137
                contentType: 'text/xml'
138
                contentType: 'text/xml'
138
            } ).done( function( data ) {
139
            } ).done( function( data ) {
139
                callback( _fromXMLStruct( data ) );
140
                var record = _fromXMLStruct( data );
141
                if ( record.marcxml ) {
142
                    record.marcxml[0].frameworkcode = frameworkcode;
143
                }
144
                callback( record );
140
            } ).fail( function( data ) {
145
            } ).fail( function( data ) {
141
                callback( { error: _('Could not save record') } );
146
                callback( { error: _('Could not save record') } );
142
            } );
147
            } );
Lines 159-165 define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin Link Here
159
                }
164
                }
160
                callback( record );
165
                callback( record );
161
            } ).fail( function( data ) {
166
            } ).fail( function( data ) {
162
                callback( { data: { error: data } } );
167
                callback( { error: _('Could not save record') } );
163
            } );
168
            } );
164
        },
169
        },
165
170
(-)a/svc/new_bib (-2 / +2 lines)
Lines 50-55 sub add_bib { Link Here
50
50
51
    my $result = {};
51
    my $result = {};
52
    my $inxml = $query->param('POSTDATA');
52
    my $inxml = $query->param('POSTDATA');
53
    my $frameworkcode = $query->url_param('frameworkcode') // '';
53
    print $query->header(-type => 'text/xml', -charset => 'utf-8');
54
    print $query->header(-type => 'text/xml', -charset => 'utf-8');
54
55
55
    my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21';
56
    my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21';
Lines 73-79 sub add_bib { Link Here
73
        foreach my $field ( $record->field($itemtag) ) {
74
        foreach my $field ( $record->field($itemtag) ) {
74
            $record->delete_field($field);
75
            $record->delete_field($field);
75
        }
76
        }
76
        my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, '' );
77
        my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, $frameworkcode );
77
        my $new_record = GetMarcBiblio({ biblionumber => $biblionumber });
78
        my $new_record = GetMarcBiblio({ biblionumber => $biblionumber });
78
        if ( $query->url_param('items') ) {
79
        if ( $query->url_param('items') ) {
79
            foreach my $field ( $fullrecord->field($itemtag) ) {
80
            foreach my $field ( $fullrecord->field($itemtag) ) {
80
- 

Return to bug 16424