From 7040d7aadd6653fdad5c25ed7e7d3c278b8c7381 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 25 May 2022 13:41:21 +0200 Subject: [PATCH] Bug 32030: Add eholdings.vendor_id Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- api/v1/swagger/definitions/erm_eholding.yaml | 5 +++ api/v1/swagger/paths/erm_eholdings.yaml | 5 +++ installer/data/mysql/atomicupdate/erm.pl | 2 + installer/data/mysql/kohastructure.sql | 2 + .../vue/components/ERM/EHoldingsFormAdd.vue | 33 +++++++++++++++++ .../js/vue/components/ERM/EHoldingsList.vue | 37 ++++++++++++++++++- .../js/vue/components/ERM/EHoldingsShow.vue | 19 +++++++++- 7 files changed, 100 insertions(+), 3 deletions(-) diff --git a/api/v1/swagger/definitions/erm_eholding.yaml b/api/v1/swagger/definitions/erm_eholding.yaml index 36ce4b74e9..61847b3a5a 100644 --- a/api/v1/swagger/definitions/erm_eholding.yaml +++ b/api/v1/swagger/definitions/erm_eholding.yaml @@ -5,6 +5,11 @@ properties: type: integer description: internally assigned identifier readOnly: true + vendor_id: + description: foreign key to aqbooksellers + type: + - integer + - "null" publication_title: description: publication_title of the eHolding type: string diff --git a/api/v1/swagger/paths/erm_eholdings.yaml b/api/v1/swagger/paths/erm_eholdings.yaml index b7d769d240..280a7bfe95 100644 --- a/api/v1/swagger/paths/erm_eholdings.yaml +++ b/api/v1/swagger/paths/erm_eholdings.yaml @@ -14,6 +14,11 @@ name: eholding_id required: false type: integer + - description: Case insensitive search on eholding vendor_id + in: query + name: vendor_id + required: false + type: integer - description: Case insensitive search on eholding publication_title in: query name: publication_title diff --git a/installer/data/mysql/atomicupdate/erm.pl b/installer/data/mysql/atomicupdate/erm.pl index 859b4ca2c6..c8921749c9 100755 --- a/installer/data/mysql/atomicupdate/erm.pl +++ b/installer/data/mysql/atomicupdate/erm.pl @@ -215,6 +215,7 @@ return { $dbh->do(q{ CREATE TABLE `erm_eholdings` ( `eholding_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', + `vendor_id` INT(11) DEFAULT NULL, `publication_title` VARCHAR(255) DEFAULT NULL, `print_identifier` VARCHAR(255) DEFAULT NULL, `online_identifier` VARCHAR(255) DEFAULT NULL, @@ -240,6 +241,7 @@ return { `parent_publication_title_id` VARCHAR(255) DEFAULT NULL, `preceeding_publication_title_id` VARCHAR(255) DEFAULT NULL, `access_type` VARCHAR(255) DEFAULT NULL, + CONSTRAINT `erm_eholdings_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, PRIMARY KEY(`eholding_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; }); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index fc22324df6..f5a6253684 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2928,6 +2928,7 @@ CREATE TABLE `erm_packages_agreements` ( DROP TABLE IF EXISTS `erm_eholdings`; CREATE TABLE `erm_eholdings` ( `eholding_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', + `vendor_id` INT(11) DEFAULT NULL, `publication_title` VARCHAR(255) DEFAULT NULL, `print_identifier` VARCHAR(255) DEFAULT NULL, `online_identifier` VARCHAR(255) DEFAULT NULL, @@ -2953,6 +2954,7 @@ CREATE TABLE `erm_eholdings` ( `parent_publication_title_id` VARCHAR(255) DEFAULT NULL, `preceeding_publication_title_id` VARCHAR(255) DEFAULT NULL, `access_type` VARCHAR(255) DEFAULT NULL, + CONSTRAINT `erm_eholdings_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, PRIMARY KEY(`eholding_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsFormAdd.vue index bdb3d0090c..df7eb8597c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsFormAdd.vue @@ -22,6 +22,30 @@ {{ $t("Required") }} +
  • + + +
  • +