From ba91fb67d397b39582510980d3dbf3b807a3c54f Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Thu, 27 Jul 2023 23:20:44 +0000 Subject: [PATCH] Bug 32607: (follow-up) Apply changes suggested --- .../V1/{ImportSources.pm => RecordSources.pm} | 75 +++---- Koha/{ImportSource.pm => RecordSource.pm} | 12 +- Koha/{ImportSources.pm => RecordSources.pm} | 12 +- .../{import-sources.pl => record-sources.pl} | 4 +- ...{import_source.yaml => record_source.yaml} | 6 +- ...mport_sources.yaml => record_sources.yaml} | 77 ++++--- api/v1/swagger/swagger.yaml | 24 +-- debian/templates/apache-shared-intranet.conf | 2 + .../data/mysql/atomicupdate/bug_32607.pl | 31 +-- installer/data/mysql/kohastructure.sql | 12 +- .../data/mysql/mandatory/userpermissions.sql | 2 +- .../prog/en/modules/admin/admin-home.tt | 6 +- .../{import-sources.tt => record-sources.tt} | 6 +- .../prog/js/vue/components/Form.vue | 144 ------------- .../prog/js/vue/components/Page.vue | 4 +- .../vue/components/import-sources/ISEdit.vue | 80 ------- .../vue/components/import-sources/ISList.vue | 100 --------- .../js/vue/components/record-sources/Edit.vue | 154 ++++++++++++++ .../js/vue/components/record-sources/List.vue | 120 +++++++++++ .../ISMain.vue => record-sources/Main.vue} | 3 +- .../prog/js/vue/fetch/import-sources.js | 40 ---- .../prog/js/vue/fetch/patron-api-client.js | 4 - .../prog/js/vue/fetch/record-sources.js | 48 +++++ .../intranet-tmpl/prog/js/vue/i18n/index.js | 2 +- .../prog/js/vue/import-source/router.js | 12 -- .../prog/js/vue/inputs/autocomplete.js | 199 ------------------ .../intranet-tmpl/prog/js/vue/inputs/index.js | 5 - .../prog/js/vue/models/import-sources.js | 85 -------- .../{import-sources.ts => record-sources.ts} | 30 +-- .../prog/js/vue/routes/import-sources.js | 31 --- .../prog/js/vue/routes/record-sources.js | 34 +++ .../intranet-tmpl/prog/js/vue/stores/model.js | 51 ----- .../Koha/{ImportSources.t => RecordSources.t} | 8 +- .../v1/{import_sources.t => record_sources.t} | 64 +++--- webpack.config.js | 2 +- 35 files changed, 547 insertions(+), 942 deletions(-) rename Koha/REST/V1/{ImportSources.pm => RecordSources.pm} (53%) rename Koha/{ImportSource.pm => RecordSource.pm} (83%) rename Koha/{ImportSources.pm => RecordSources.pm} (83%) rename admin/{import-sources.pl => record-sources.pl} (90%) rename api/v1/swagger/definitions/{import_source.yaml => record_source.yaml} (58%) rename api/v1/swagger/paths/{import_sources.yaml => record_sources.yaml} (79%) rename koha-tmpl/intranet-tmpl/prog/en/modules/admin/{import-sources.tt => record-sources.tt} (83%) delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/Form.vue delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/import-sources/ISEdit.vue delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/import-sources/ISList.vue create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/record-sources/Edit.vue create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/record-sources/List.vue rename koha-tmpl/intranet-tmpl/prog/js/vue/components/{import-sources/ISMain.vue => record-sources/Main.vue} (88%) delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/fetch/import-sources.js create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/fetch/record-sources.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/import-source/router.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/inputs/autocomplete.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/inputs/index.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/models/import-sources.js rename koha-tmpl/intranet-tmpl/prog/js/vue/modules/{import-sources.ts => record-sources.ts} (65%) delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/routes/import-sources.js create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/routes/record-sources.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/stores/model.js rename t/db_dependent/Koha/{ImportSources.t => RecordSources.t} (85%) rename t/db_dependent/api/v1/{import_sources.t => record_sources.t} (78%) diff --git a/Koha/REST/V1/ImportSources.pm b/Koha/REST/V1/RecordSources.pm similarity index 53% rename from Koha/REST/V1/ImportSources.pm rename to Koha/REST/V1/RecordSources.pm index b77e2cadca..3816c9b37e 100644 --- a/Koha/REST/V1/ImportSources.pm +++ b/Koha/REST/V1/RecordSources.pm @@ -1,4 +1,4 @@ -package Koha::REST::V1::ImportSources; +package Koha::REST::V1::RecordSources; # Copyright 2023 Theke Solutions # @@ -21,7 +21,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Koha::ImportSources; +use Koha::RecordSources; use Try::Tiny qw( catch try ); @@ -37,11 +37,10 @@ sub list { my $c = shift->openapi->valid_input or return; return try { - my $import_sources_set = Koha::ImportSources->new; - my $import_sources = $c->objects->search( $import_sources_set ); - return $c->render( status => 200, openapi => $import_sources ); - } - catch { + my $record_sources_set = Koha::RecordSources->new; + my $record_sources = $c->objects->search($record_sources_set); + return $c->render( status => 200, openapi => $record_sources ); + } catch { $c->unhandled_exception($_); }; } @@ -54,16 +53,17 @@ sub get { my $c = shift->openapi->valid_input or return; return try { - my $import_sources_set = Koha::ImportSources->new; - my $import_source = $c->objects->find( $import_sources_set, $c->validation->param('import_source_id') ); - unless ($import_source) { - return $c->render( status => 404, - openapi => { error => "Import source not found" } ); + my $record_sources_set = Koha::RecordSources->new; + my $record_source = $c->objects->find( $record_sources_set, $c->validation->param('record_source_id') ); + unless ($record_source) { + return $c->render( + status => 404, + openapi => { error => "Record source not found" } + ); } - return $c->render( status => 200, openapi => $import_source ); - } - catch { + return $c->render( status => 200, openapi => $record_source ); + } catch { $c->unhandled_exception($_); }; } @@ -76,15 +76,14 @@ sub add { my $c = shift->openapi->valid_input or return; return try { - my $import_source = Koha::ImportSource->new_from_api( $c->validation->param('body') ); - $import_source->store; - $c->res->headers->location( $c->req->url->to_string . '/' . $import_source->import_source_id ); + my $record_source = Koha::RecordSource->new_from_api( $c->validation->param('body') ); + $record_source->store; + $c->res->headers->location( $c->req->url->to_string . '/' . $record_source->record_source_id ); return $c->render( status => 201, - openapi => $import_source->to_api + openapi => $record_source->to_api ); - } - catch { + } catch { $c->unhandled_exception($_); }; } @@ -96,19 +95,20 @@ sub add { sub update { my $c = shift->openapi->valid_input or return; - my $import_source = Koha::ImportSources->find( $c->validation->param('import_source_id') ); + my $record_source = Koha::RecordSources->find( $c->validation->param('record_source_id') ); - if ( not defined $import_source ) { - return $c->render( status => 404, - openapi => { error => "Object not found" } ); + if ( not defined $record_source ) { + return $c->render( + status => 404, + openapi => { error => "Object not found" } + ); } return try { - $import_source->set_from_api( $c->validation->param('body') ); - $import_source->store(); - return $c->render( status => 200, openapi => $import_source->to_api ); - } - catch { + $record_source->set_from_api( $c->validation->param('body') ); + $record_source->store(); + return $c->render( status => 200, openapi => $record_source->to_api ); + } catch { $c->unhandled_exception($_); }; } @@ -120,20 +120,21 @@ sub update { sub delete { my $c = shift->openapi->valid_input or return; - my $import_source = Koha::ImportSources->find( $c->validation->param('import_source_id') ); - if ( not defined $import_source ) { - return $c->render( status => 404, - openapi => { error => "Object not found" } ); + my $record_source = Koha::RecordSources->find( $c->validation->param('record_source_id') ); + if ( not defined $record_source ) { + return $c->render( + status => 404, + openapi => { error => "Object not found" } + ); } return try { - $import_source->delete; + $record_source->delete; return $c->render( status => 204, openapi => q{} ); - } - catch { + } catch { $c->unhandled_exception($_); }; } diff --git a/Koha/ImportSource.pm b/Koha/RecordSource.pm similarity index 83% rename from Koha/ImportSource.pm rename to Koha/RecordSource.pm index b23fc95422..29a817e77c 100644 --- a/Koha/ImportSource.pm +++ b/Koha/RecordSource.pm @@ -1,4 +1,4 @@ -package Koha::ImportSource; +package Koha::RecordSource; # This file is part of Koha. # @@ -24,7 +24,7 @@ use base qw(Koha::Object); =head1 NAME -Koha::ImportSource - Koha ImportSource Object class +Koha::RecordSource - Koha RecordSource Object class =head1 API @@ -32,9 +32,9 @@ Koha::ImportSource - Koha ImportSource Object class =head3 patron -my $patron = $import_source->patron +my $patron = $record_source->patron -Return the patron for this import source +Return the patron for this record source =cut @@ -50,7 +50,7 @@ sub patron { =cut sub _type { - return 'ImportSource'; + return 'RecordSource'; } -1; \ No newline at end of file +1; diff --git a/Koha/ImportSources.pm b/Koha/RecordSources.pm similarity index 83% rename from Koha/ImportSources.pm rename to Koha/RecordSources.pm index 1cdca37b1b..987aec76b9 100644 --- a/Koha/ImportSources.pm +++ b/Koha/RecordSources.pm @@ -1,4 +1,4 @@ -package Koha::ImportSources; +package Koha::RecordSources; # This file is part of Koha. # @@ -22,11 +22,11 @@ use Modern::Perl; use base qw(Koha::Objects); -use Koha::ImportSource; +use Koha::RecordSource; =head1 NAME -Koha::ImportSources - Koha ImportSources Object class +Koha::RecordSources - Koha RecordSources Object class =head1 API @@ -37,7 +37,7 @@ Koha::ImportSources - Koha ImportSources Object class =cut sub _type { - return 'ImportSource'; + return 'RecordSource'; } =head3 object_class @@ -45,7 +45,7 @@ sub _type { =cut sub object_class { - return 'Koha::ImportSource'; + return 'Koha::RecordSource'; } -1; \ No newline at end of file +1; diff --git a/admin/import-sources.pl b/admin/record-sources.pl similarity index 90% rename from admin/import-sources.pl rename to admin/record-sources.pl index c23c53270a..1ccb3d42a9 100755 --- a/admin/import-sources.pl +++ b/admin/record-sources.pl @@ -28,10 +28,10 @@ my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "admin/import-sources.tt", + template_name => "admin/record-sources.tt", query => $query, type => "intranet", - flagsrequired => { parameters => 'manage_import_sources' }, + flagsrequired => { parameters => 'manage_record_sources' }, } ); diff --git a/api/v1/swagger/definitions/import_source.yaml b/api/v1/swagger/definitions/record_source.yaml similarity index 58% rename from api/v1/swagger/definitions/import_source.yaml rename to api/v1/swagger/definitions/record_source.yaml index b7d3555d1d..2a0ae6d91b 100644 --- a/api/v1/swagger/definitions/import_source.yaml +++ b/api/v1/swagger/definitions/record_source.yaml @@ -1,12 +1,12 @@ --- type: object properties: - import_source_id: + record_source_id: type: integer - description: internally assigned import source identifier + description: internally assigned record source identifier readOnly: true name: - description: import source name + description: record source name type: string patron_id: description: linked patron identifier diff --git a/api/v1/swagger/paths/import_sources.yaml b/api/v1/swagger/paths/record_sources.yaml similarity index 79% rename from api/v1/swagger/paths/import_sources.yaml rename to api/v1/swagger/paths/record_sources.yaml index 63c8b50214..7161973267 100644 --- a/api/v1/swagger/paths/import_sources.yaml +++ b/api/v1/swagger/paths/record_sources.yaml @@ -1,10 +1,10 @@ -/import_sources: +/record_sources: get: - x-mojo-to: ImportSources#list - operationId: listImportSources - summary: List import sources + x-mojo-to: RecordSources#list + operationId: listRecordSources + summary: List record sources tags: - - import_sources + - record_sources parameters: - $ref: "../swagger.yaml#/parameters/match" - $ref: "../swagger.yaml#/parameters/order_by" @@ -12,7 +12,6 @@ - $ref: "../swagger.yaml#/parameters/per_page" - $ref: "../swagger.yaml#/parameters/q_param" - $ref: "../swagger.yaml#/parameters/q_body" - - $ref: "../swagger.yaml#/parameters/q_header" - $ref: "../swagger.yaml#/parameters/request_id_header" - name: x-koha-embed in: header @@ -30,7 +29,7 @@ - application/json responses: "200": - description: A list of import sources + description: A list of record sources "400": description: Missing or wrong parameters schema: @@ -56,27 +55,27 @@ $ref: "../swagger.yaml#/definitions/error" x-koha-authorization: permissions: - parameters: manage_import_sources + parameters: manage_record_sources post: - x-mojo-to: ImportSources#add - operationId: addImportSources - summary: Add an import source + x-mojo-to: RecordSources#add + operationId: addRecordSources + summary: Add a record source tags: - - import_sources + - record_sources parameters: - name: body in: body - description: A JSON object containing informations about the new import source + description: A JSON object containing informations about the new record source required: true schema: - $ref: "../swagger.yaml#/definitions/import_source" + $ref: "../swagger.yaml#/definitions/record_source" consumes: - application/json produces: - application/json responses: "201": - description: An import source + description: A record source "400": description: Missing or wrong parameters schema: @@ -102,23 +101,23 @@ $ref: "../swagger.yaml#/definitions/error" x-koha-authorization: permissions: - parameters: manage_import_sources -"/import_sources/{import_source_id}": + parameters: manage_record_sources +"/record_sources/{record_source_id}": get: - x-mojo-to: ImportSources#get - operationId: getImportSources - summary: Get an import source + x-mojo-to: RecordSources#get + operationId: getRecordSources + summary: Get a record source tags: - - import_sources + - record_sources parameters: - - $ref: "../swagger.yaml#/parameters/import_source_id_pp" + - $ref: "../swagger.yaml#/parameters/record_source_id_pp" consumes: - application/json produces: - application/json responses: "200": - description: An import source + description: A record source "400": description: Missing or wrong parameters schema: @@ -148,28 +147,28 @@ $ref: "../swagger.yaml#/definitions/error" x-koha-authorization: permissions: - parameters: manage_import_sources + parameters: manage_record_sources put: - x-mojo-to: ImportSources#update - operationId: updateImportSources - summary: Update an import source + x-mojo-to: RecordSources#update + operationId: updateRecordSources + summary: Update a record source tags: - - import_sources + - record_sources parameters: - - $ref: "../swagger.yaml#/parameters/import_source_id_pp" + - $ref: "../swagger.yaml#/parameters/record_source_id_pp" - name: body in: body - description: A JSON object containing informations about the new import source + description: A JSON object containing informations about the new record source required: true schema: - $ref: "../swagger.yaml#/definitions/import_source" + $ref: "../swagger.yaml#/definitions/record_source" consumes: - application/json produces: - application/json responses: "200": - description: An import source + description: A record source "400": description: Missing or wrong parameters schema: @@ -199,15 +198,15 @@ $ref: "../swagger.yaml#/definitions/error" x-koha-authorization: permissions: - parameters: manage_import_sources + parameters: manage_record_sources delete: - x-mojo-to: ImportSources#delete - operationId: deleteImportSources - summary: Delete an import source + x-mojo-to: RecordSources#delete + operationId: deleteRecordSources + summary: Delete a record source tags: - - import_sources + - record_sources parameters: - - $ref: "../swagger.yaml#/parameters/import_source_id_pp" + - $ref: "../swagger.yaml#/parameters/record_source_id_pp" consumes: - application/json produces: @@ -244,4 +243,4 @@ $ref: "../swagger.yaml#/definitions/error" x-koha-authorization: permissions: - parameters: manage_import_sources + parameters: manage_record_sources diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml index cafc1d68fd..14037945b7 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -70,8 +70,8 @@ definitions: $ref: ./definitions/import_batch_profiles.yaml import_record_match: $ref: ./definitions/import_record_match.yaml - import_source: - $ref: ./definitions/import_source.yaml + record_source: + $ref: ./definitions/record_source.yaml invoice: $ref: ./definitions/invoice.yaml item: @@ -277,10 +277,10 @@ paths: $ref: ./paths/import_batch_profiles.yaml#/~1import_batch_profiles "/import_batch_profiles/{import_batch_profile_id}": $ref: "./paths/import_batch_profiles.yaml#/~1import_batch_profiles~1{import_batch_profile_id}" - /import_sources: - $ref: ./paths/import_sources.yaml#/~1import_sources - "/import_sources/{import_source_id}": - $ref: ./paths/import_sources.yaml#/~1import_sources~1{import_source_id} + /record_sources: + $ref: ./paths/record_sources.yaml#/~1record_sources + "/record_sources/{record_source_id}": + $ref: ./paths/record_sources.yaml#/~1record_sources~1{record_source_id} /items: $ref: ./paths/items.yaml#/~1items "/items/{item_id}": @@ -539,10 +539,10 @@ parameters: name: import_record_id required: true type: integer - import_source_id_pp: - description: Internal import source identifier + record_source_id_pp: + description: Internal record source identifier in: path - name: import_source_id + name: record_source_id required: true type: integer item_id_pp: @@ -842,9 +842,9 @@ tags: - description: "Manage item groups\n" name: item_groups x-displayName: Item groups - - description: "Manage import sources\n" - name: import_sources - x-displayName: Import source + - description: "Manage record sources\n" + name: record_sources + x-displayName: Record source - description: "Manage items\n" name: items x-displayName: Items diff --git a/debian/templates/apache-shared-intranet.conf b/debian/templates/apache-shared-intranet.conf index dbeaf0dca5..85a9549839 100644 --- a/debian/templates/apache-shared-intranet.conf +++ b/debian/templates/apache-shared-intranet.conf @@ -13,6 +13,7 @@ ScriptAlias /search "/usr/share/koha/intranet/cgi-bin/catalogue/search.pl" # Protect dev package install RewriteEngine on + RewriteRule ^/cgi-bin/koha/(C4|debian|etc|installer/data|install_misc|Koha|misc|selenium|t|test|tmp|xt)/|\.PL$ /notfound [PT] RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/catalogue/detail.pl?biblionumber=$1 [PT] @@ -21,6 +22,7 @@ RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] RewriteRule ^(.*)_[0-9]{2}\.[0-9]{7}\.(js|css)$ $1.$2 [L] RewriteRule ^/cgi-bin/koha/erm/.*$ /cgi-bin/koha/erm/erm.pl [PT] +RewriteRule ^/cgi-bin/koha/admin/record-sources(.*)?$ /cgi-bin/koha/admin/record-sources.pl$1 [PT] Alias "/api" "/usr/share/koha/api" diff --git a/installer/data/mysql/atomicupdate/bug_32607.pl b/installer/data/mysql/atomicupdate/bug_32607.pl index 252361d122..9106eb41ab 100755 --- a/installer/data/mysql/atomicupdate/bug_32607.pl +++ b/installer/data/mysql/atomicupdate/bug_32607.pl @@ -2,31 +2,38 @@ use Modern::Perl; return { bug_number => "32607", - description => "Add import_source table", + description => "Add record_sources table", up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; # Do you stuffs here - if(!TableExists('import_source')) { + if(!TableExists('record_sources')) { $dbh->do(q{ - CREATE TABLE `import_source` ( - `import_source_id` int(11) NOT NULL AUTO_INCREMENT, - `name` text NOT NULL, - `patron_id` int(11) NOT NULL, - PRIMARY KEY (`import_source_id`), - CONSTRAINT `import_source_fk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci + -- + -- Table structure for table `record_sources` + -- + + DROP TABLE IF EXISTS `record_sources`; + /*!40101 SET @saved_cs_client = @@character_set_client */; + /*!40101 SET character_set_client = utf8 */; + CREATE TABLE `record_sources` ( + `record_source_id` int(11) NOT NULL AUTO_INCREMENT, + `name` text NOT NULL, + `patron_id` int(11) NOT NULL, + PRIMARY KEY (`record_source_id`), + CONSTRAINT `record_source_fk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; }); } - say $out "Added new import_source table"; + say $out "Added new record_sources table"; $dbh->do(q{ INSERT IGNORE INTO permissions (module_bit, code, description) VALUES - ( 3, 'manage_import_sources', 'Manage import sources') + ( 3, 'manage_record_sources', 'Manage record sources') }); - say $out "Added new manage_import_sources permission"; + say $out "Added new manage_record_sources permission"; }, }; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index d0aac05749..1f773da1ce 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3468,18 +3468,18 @@ CREATE TABLE `import_items` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `import_source` +-- Table structure for table `record_sources` -- -DROP TABLE IF EXISTS `import_source`; +DROP TABLE IF EXISTS `record_sources`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `import_source` ( - `import_source_id` int(11) NOT NULL AUTO_INCREMENT, +CREATE TABLE `record_sources` ( + `record_source_id` int(11) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, `patron_id` int(11) NOT NULL, - PRIMARY KEY (`import_source_id`), - CONSTRAINT `import_source_fk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE + PRIMARY KEY (`record_source_id`), + CONSTRAINT `record_source_fk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Table structure for table `import_record_matches` diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql index 0fed4c6d50..068c4b1a3f 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -42,7 +42,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 3, 'manage_curbside_pickups', 'Manage curbside pickups'), ( 3, 'manage_search_filters', 'Manage custom search filters'), ( 3, 'manage_identity_providers', 'Manage identity providers'), - ( 3, 'manage_import_sources', 'Manage import sources'), + ( 3, 'manage_record_sources', 'Manage record sources'), ( 4, 'delete_borrowers', 'Delete patrons'), ( 4, 'edit_borrowers', 'Add, modify and view patron information'), ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt index 9bf4480968..1e4c64b3ca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt @@ -206,8 +206,10 @@
Search engine configuration (Elasticsearch)
Manage indexes, facets, and their mappings to MARC fields and subfields
[% END %] -
Import sources
-
Define sources to import from
+ [% IF ( CAN_user_parameters_manage_record_sources ) %] +
Record sources
+
Define record sources to import from
+ [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/import-sources.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/record-sources.tt similarity index 83% rename from koha-tmpl/intranet-tmpl/prog/en/modules/admin/import-sources.tt rename to koha-tmpl/intranet-tmpl/prog/en/modules/admin/record-sources.tt index 63fd41f541..e472c69019 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/import-sources.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/record-sources.tt @@ -8,7 +8,7 @@ [% PROCESS 'i18n.inc' %] [% INCLUDE 'doc-head-open.inc' %] - Import sources › Koha + Record sources › Koha [% INCLUDE 'doc-head-close.inc' %] @@ -18,7 +18,7 @@ [% INCLUDE 'erm-search.inc' %] [% END %] -
+
[% MACRO jsinclude BLOCK %] [% INCLUDE 'calendar.inc' %] @@ -31,7 +31,7 @@ const RESTOAuth2ClientCredentials = [% IF Koha.Preference('RESTOAuth2ClientCredentials') %]true[% ELSE %]false[% END %]; - [% Asset.js("js/vue/dist/import-source.js") | $raw %] + [% Asset.js("js/vue/dist/record-source.js") | $raw %] [% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Form.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Form.vue deleted file mode 100644 index fcdfa5a773..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Form.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - - diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Page.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Page.vue index bb98c147e7..c0c607b1cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Page.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Page.vue @@ -16,7 +16,9 @@