Bugzilla – Attachment 59920 Details for
Bug 7317
Add an Interlibrary Loan Module to Circulation and OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Remove BLDSS configuration from Config.pm.
Remove-BLDSS-configuration-from-Configpm.patch (text/plain), 6.89 KB, created by
Andrew Isherwood
on 2017-02-06 09:04:41 UTC
(
hide
)
Description:
Remove BLDSS configuration from Config.pm.
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2017-02-06 09:04:41 UTC
Size:
6.89 KB
patch
obsolete
>From d37c40b44e769e8a44a5d0ad06ad38169a03f195 Mon Sep 17 00:00:00 2001 >From: Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com> >Date: Mon, 6 Feb 2017 09:54:14 +0100 >Subject: [PATCH] Remove BLDSS configuration from Config.pm. > >* Koha/Illrequest/Config.pm (getLibraryPrivileges, getDefaultFormats) > (getCredentials, getApiUrl, getApiSpecFile): Remove procedures. > (_load_configuration): Remove BLDSS specific config. > >https://bugs.koha-community.org/show_bug.cgi?id=7317 >--- > Koha/Illrequest/Config.pm | 147 +--------------------------------------------- > 1 file changed, 1 insertion(+), 146 deletions(-) > >diff --git a/Koha/Illrequest/Config.pm b/Koha/Illrequest/Config.pm >index 87264b8..69937d3 100644 >--- a/Koha/Illrequest/Config.pm >+++ b/Koha/Illrequest/Config.pm >@@ -137,22 +137,6 @@ sub getPrefixes { > return $values; > } > >-=head3 getLibraryPrivileges >- >- my $privileges= $config->getLibraryPrivileges; >- >-Return the LibraryPrivilege definitions defined by our config. >- >-=cut >- >-sub getLibraryPrivileges { >- my ( $self ) = @_; >- my $values= $self->{configuration}->{library_privileges}->{branch} || {}; >- $values->{default} = >- $self->{configuration}->{library_privileges}->{default}; >- return $values; >-} >- > =head3 getLimitRules > > my $rules = $config->getLimitRules('brw_cat' | 'branch') >@@ -186,52 +170,6 @@ sub getDigitalRecipients { > return $values; > } > >-=head3 getDefaultFormats >- >- my $defaultFormat = $config->getLimitRules('brw_cat' | 'branch') >- >-Return the hash of ILL default formats defined by our config. >- >-=cut >- >-sub getDefaultFormats { >- my ( $self, $type ) = @_; >- die "Unexpected type." unless ( $type eq 'brw_cat' || $type eq 'branch' ); >- my $values = $self->{configuration}->{default_formats}->{$type}; >- $values->{default} = $self->{configuration}->{default_formats}->{default}; >- return $values; >-} >- >-=head3 getCredentials >- >- my $credentials = $config->getCredentials($branchCode); >- >-Fetch the best-fit credentials: if we have credentials for $branchCode, use >-those; otherwise fall back on default credentials. If neither can be found, >-simply populate application details, and populate key details with 0. >- >-=cut >- >-sub getCredentials { >- my ( $self, $branchCode ) = @_; >- my $creds = $self->{configuration}->{credentials} >- || die "We have no credentials defined. Please check koha-conf.xml."; >- >- my $exact = { api_key => 0, api_auth => 0 }; >- if ( $branchCode && $creds->{api_keys}->{$branchCode} ) { >- $exact = $creds->{api_keys}->{$branchCode} >- } elsif ( $creds->{api_keys}->{default} ) { >- $exact = $creds->{api_keys}->{default}; >- } >- >- return { >- api_key => $exact->{api_key}, >- api_key_auth => $exact->{api_auth}, >- api_application => $creds->{api_application}->{key}, >- api_application_auth => $creds->{api_application}->{auth}, >- }; >-} >- > =head3 censorship > > my $censoredValues = $config->censorship($hash); >@@ -251,33 +189,6 @@ sub censorship { > return $self->{configuration}->{censorship}; > } > >-=head3 getApiUrl >- >- my $api_url = $config->getApiUrl; >- >-Return the url for the api configured by koha-conf.xml, or the fall-back url. >- >-=cut >- >-sub getApiUrl { >- my ( $self ) = @_; >- return $self->{configuration}->{api_url}; >-} >- >-=head3 getApiSpecFile >- >- my $api_spec_file = $config->getApiSpecFile; >- >-Return the path pointing to the API specfile, if it indeed exists, from by >-koha-conf.xml, or 0. >- >-=cut >- >-sub getApiSpecFile { >- my ( $self ) = @_; >- return $self->{configuration}->{spec_file} || 0; >-} >- > =head3 _load_configuration > > my $configuration = $config->_load_configuration($config_from_xml); >@@ -292,32 +203,17 @@ file to ensure we have only valid input there. > > sub _load_configuration { > my ( $from_xml, $unmediated ) = @_; >- my $xml_config = $from_xml->{configuration}; >- my $xml_api_url = $from_xml->{api_url}; > my $xml_backend_dir = $from_xml->{backend_directory}; >- >- # Input validation >- die "CONFIGURATION has not been defined in koha-conf.xml." >- unless ( ref($xml_config) eq "HASH" ); >- die "APPLICATION has not been defined in koha-conf.xml." >- unless ( ref($from_xml->{application}) eq "HASH" ); >+ my $xml_config = $from_xml->{configuration} || {}; > > # Default data structure to be returned > my $configuration = { > backend_directory => $xml_backend_dir, >- api_url => $xml_api_url || 'http://apitest.bldss.bl.uk', >- spec_file => $from_xml->{api_specification}, > censorship => { > censor_notes_staff => 0, > censor_reply_date => 0, > }, >- credentials => { >- api_application => {}, >- api_keys => {}, >- }, >- library_privileges => {}, > limits => {}, >- default_formats => {}, > digital_recipients => {}, > prefixes => {}, > }; >@@ -373,12 +269,6 @@ sub _load_configuration { > config => $configuration > }); > >- # Application key & auth >- $configuration->{credentials}->{api_application} = { >- key => $from_xml->{application}->{key}, >- auth => $from_xml->{application}->{auth}, >- }; >- > # Censorship > my $staff_comments = $from_xml->{staff_request_comments}; > $configuration->{censorship}->{censor_notes_staff} = 1 >@@ -448,20 +338,6 @@ sub _load_unit_config { > } > } > >- # Add library_privilege rules (only per branch). >- # LIBRARY_PRIVILEGE := 1 || 0 >- unless ( $type && 'brw_cat' eq $type ) { >- if ( $unit->{library_privilege} ) { >- if ( 'default' eq $id ) { >- $config->{library_privileges}->{$id} = >- $unit->{library_privilege}; >- } else { >- $config->{library_privileges}->{branch}->{$id} = >- $unit->{library_privilege}; >- } >- } >- } >- > # Add prefix rules. > # PREFIX := string > if ( $unit->{prefix} ) { >@@ -483,27 +359,6 @@ sub _load_unit_config { > } > } > >- # Add default_formats types. >- # FORMAT && QUALITY && QUANTITY && SERVICE && SPEED := x >= 0 >- if ( ref $unit->{default_formats} eq 'HASH' ) { >- my @fields = qw(format quality quantity service speed); >- if ( 'default' eq $id ) { >- for ( @fields ) { >- my $val = $unit->{default_formats}->{$_}; >- die "Invalid default_formats: '$_' missing" >- unless $val; >- $config->{default_formats}->{$id}->{$_} = $val; >- } >- } else { >- for ( @fields ) { >- my $val = $unit->{default_formats}->{$_}; >- die "Invalid default_formats: '$_' missing" >- unless $val; >- $config->{default_formats}->{$type}->{$id}->{$_} = $val; >- } >- } >- } >- > return $config; > } > >-- >2.1.4
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 7317
:
59893
|
59894
|
59895
|
59920
|
60485
|
60486
|
60487
|
60488
|
63081
|
63082
|
63083
|
63084
|
63085
|
63086
|
63087
|
63088
|
63089
|
63090
|
63113
|
63175
|
63176
|
63354
|
63421
|
63472
|
63475
|
65469
|
65470
|
65471
|
65472
|
65473
|
65474
|
65475
|
65476
|
66266
|
67242
|
67243
|
67244
|
67245
|
67246
|
67247
|
67248
|
67249
|
67250
|
67251
|
67252
|
67253
|
67254
|
67255
|
67256
|
67257
|
67258
|
67259
|
67260
|
67261
|
67262
|
67263
|
67264
|
67281
|
67282
|
67283
|
67284
|
67285
|
67286
|
67287
|
67288
|
67289
|
67290
|
67291
|
67292
|
67293
|
67294
|
67295
|
67296
|
67297
|
67298
|
67299
|
67300
|
67301
|
67302
|
67303
|
68185
|
68186
|
68328
|
68391
|
68406
|
68407
|
68408
|
68409
|
68418
|
68444
|
68445
|
68483
|
68484
|
68485
|
68487
|
68516
|
68517
|
68518
|
68519
|
68520
|
68521
|
68522
|
68523
|
68524
|
68525
|
68542
|
68543
|
68544
|
68545
|
68546
|
68547
|
68548
|
68549
|
68550
|
68551
|
68552
|
68558
|
68559
|
68560
|
68561
|
68562
|
68563
|
68564
|
68565
|
68566
|
68567
|
68858
|
68874
|
68877
|
68878
|
68885
|
68886
|
68921
|
68922
|
68926
|
68927
|
68928
|
68929
|
68931
|
68932
|
68933
|
68988
|
68989
|
68999
|
69000
|
69006
|
69008
|
69009
|
69012
|
69014
|
69044
|
69045
|
69046
|
69056
|
69059
|
69060
|
69061
|
69063
|
69064
|
69065
|
69066
|
69069
|
69070
|
69071
|
69074