Bugzilla – Attachment 108631 Details for
Bug 26251
Remove unused routines from svc/split_callnumbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26251: Remove unused routines from svc/split_callnumbers
Bug-26251-Remove-unused-routines-from-svcsplitcall.patch (text/plain), 3.63 KB, created by
Jonathan Druart
on 2020-08-19 13:24:00 UTC
(
hide
)
Description:
Bug 26251: Remove unused routines from svc/split_callnumbers
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-08-19 13:24:00 UTC
Size:
3.63 KB
patch
obsolete
>From 3f29cdbf96fa0d17e4630bcc2e6f868f5c9a9398 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 19 Aug 2020 11:46:16 +0000 >Subject: [PATCH] Bug 26251: Remove unused routines from svc/split_callnumbers > >This is just a copy and paste from svc/localization > >Test plan: >Read the code. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > svc/split_callnumbers | 74 +------------------------------------------ > 1 file changed, 1 insertion(+), 73 deletions(-) > >diff --git a/svc/split_callnumbers b/svc/split_callnumbers >index 8c85a58546..7fc9deefd3 100755 >--- a/svc/split_callnumbers >+++ b/svc/split_callnumbers >@@ -2,9 +2,9 @@ > > use Modern::Perl; > use JSON qw( from_json ); >- > use C4::Service; > use C4::ClassSplitRoutine::RegEx; >+ > our ( $query, $response ) = C4::Service->init( parameters => 'parameters_remaining_permissions' ); > > sub get_split_callnumbers { >@@ -20,78 +20,6 @@ sub get_split_callnumbers { > C4::Service->return_success( $response ); > } > >-sub update_translation { >- my $id = $query->param('id'); >- my $translation = $query->param('translation'); >- my $lang = $query->param('lang'); >- >- my $localization = Koha::Localizations->find( $id ); >- if ( defined $lang and $localization->lang ne $lang ) { >- $localization->lang( $lang ) >- } >- if ( defined $translation and $localization->translation ne $translation ) { >- $localization->translation( $translation ) >- } >- my %params; >- my $is_changed; >- if ( $localization->is_changed ) { >- $is_changed = 1; >- unless ( Koha::Localizations->search( { entity => $localization->entity, code => $localization->code, lang => $lang, localization_id => { '!=' => $localization->localization_id }, } )->count ) { >- $localization->store; >- } else { >- $params{error} = 1; >- $params{error_code} = 'already_exists'; >- } >- } >- $response->param( >- %params, >- id => $localization->localization_id, >- entity => $localization->entity, >- code => $localization->code, >- lang => $localization->lang, >- translation => $localization->translation, >- is_changed => $is_changed, >- ); >- C4::Service->return_success( $response ); >-} >- >-sub add_translation { >- my $entity = $query->param('entity'); >- my $code = $query->param('code'); >- my $lang = $query->param('lang'); >- my $translation = $query->param('translation'); >- >- unless ( Koha::Localizations->search({entity => $entity, code => $code, lang => $lang, })->count ) { >- my $localization = Koha::Localization->new( >- { >- entity => $entity, >- code => $code, >- lang => $lang, >- translation => $translation, >- } >- ); >- $localization->store; >- $response->param( >- id => $localization->localization_id, >- entity => $localization->entity, >- code => $localization->code, >- lang => $localization->lang, >- translation => $localization->translation, >- ); >- >- } else { >- $response->param( error => 1, error_code => 'already_exists', ); >- } >- C4::Service->return_success( $response ); >-} >- >-sub delete_translation { >- my $id = $query->param('id'); >- Koha::Localizations->find($id)->delete; >- $response->param( id => $id ); >- C4::Service->return_success( $response ); >-} >- > C4::Service->dispatch( > [ 'GET /', [ 'callnumbers', 'regexs' ], \&get_split_callnumbers ], > ); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26251
:
108589
|
108624
| 108631