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

(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js (-1 / +8 lines)
Lines 136-145 define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin Link Here
136
            record = record.clone();
136
            record = record.clone();
137
            _removeBiblionumberFields( record );
137
            _removeBiblionumberFields( record );
138
138
139
            let csrf_token = $('meta[name="csrf-token"]').attr('content');
139
            $.ajax( {
140
            $.ajax( {
140
                type: 'POST',
141
                type: 'POST',
141
                url: '/cgi-bin/koha/svc/new_bib?frameworkcode=' + encodeURIComponent(frameworkcode),
142
                url: '/cgi-bin/koha/svc/new_bib?frameworkcode=' + encodeURIComponent(frameworkcode),
142
                data: record.toXML(),
143
                data: record.toXML(),
144
                headers: {
145
                    'CSRF-TOKEN':csrf_token
146
                },
143
                contentType: 'text/xml'
147
                contentType: 'text/xml'
144
            } ).done( function( data ) {
148
            } ).done( function( data ) {
145
                var record = _fromXMLStruct( data );
149
                var record = _fromXMLStruct( data );
Lines 157-166 define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin Link Here
157
            record = record.clone();
161
            record = record.clone();
158
            _removeBiblionumberFields( record );
162
            _removeBiblionumberFields( record );
159
163
164
            let csrf_token = $('meta[name="csrf-token"]').attr('content');
160
            $.ajax( {
165
            $.ajax( {
161
                type: 'POST',
166
                type: 'POST',
162
                url: '/cgi-bin/koha/svc/bib/' + id + '?frameworkcode=' + encodeURIComponent(frameworkcode),
167
                url: '/cgi-bin/koha/svc/bib/' + id + '?frameworkcode=' + encodeURIComponent(frameworkcode),
163
                data: record.toXML(),
168
                data: record.toXML(),
169
                headers: {
170
                    'CSRF-TOKEN':csrf_token
171
                },
164
                contentType: 'text/xml'
172
                contentType: 'text/xml'
165
            } ).done( function( data ) {
173
            } ).done( function( data ) {
166
                var record = _fromXMLStruct( data );
174
                var record = _fromXMLStruct( data );
167
- 

Return to bug 36351