Lines 152-160
require( [ 'koha-backend', 'widget', 'text-marc' ], function( KohaBackend, Widge
Link Here
|
152 |
$( this.node ) |
152 |
$( this.node ) |
153 |
.find('.control-number-widget-assign').click( function() { |
153 |
.find('.control-number-widget-assign').click( function() { |
154 |
var sequence = $( widget.node ).find('.control-number-widget-sequence').val(); |
154 |
var sequence = $( widget.node ).find('.control-number-widget-sequence').val(); |
155 |
const token = $("input[name='csrf_token']").first().val(); |
155 |
const csrf_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content'); |
156 |
$.post( |
156 |
$.post( |
157 |
'/cgi-bin/koha/svc/cataloguing/control_num_sequences/' + sequence + '?csrf_token=' + token |
157 |
'/cgi-bin/koha/svc/cataloguing/control_num_sequences/' + sequence, |
|
|
158 |
{ csrf_token: csrf_token } |
158 |
).done( function( result ) { |
159 |
).done( function( result ) { |
159 |
if ( result.next_value ) widget.setControlNumber( result.next_value ); |
160 |
if ( result.next_value ) widget.setControlNumber( result.next_value ); |
160 |
} ); |
161 |
} ); |
161 |
- |
|
|