4 use JSON
qw( from_json );
6 use C4
::ClassSplitRoutine
::RegEx
;
8 our ( $query, $response ) = C4
::Service
->init( parameters
=> 'parameters_remaining_permissions' );
10 sub get_split_callnumbers
{
11 my $regexs = from_json
( $query->param('regexs') );
12 my $c = $query->param('callnumbers');
13 my @callnumbers = split "\n", $c;
14 my @callnumbers_split;
15 for my $callnumber ( @callnumbers ) {
16 my @lines = C4
::ClassSplitRoutine
::RegEx
::split_callnumber
($callnumber, $regexs);
17 push @callnumbers_split, { inline
=> $callnumber, split => \
@lines };
19 $response->param( split_callnumbers
=> \
@callnumbers_split );
20 C4
::Service
->return_success( $response );
23 C4
::Service
->dispatch(
24 [ 'GET /', [ 'callnumbers', 'regexs' ], \
&get_split_callnumbers
],