From 2f85a3ec7cc2adf45f032203586542aba6178fab Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 7 Sep 2021 13:35:13 -0300 Subject: [PATCH] WIP https://bugs.koha-community.org/show_bug.cgi?id=28959 --- Koha/Schema/Result/Virtualshelve.pm | 4 +++- Koha/Virtualshelf.pm | 17 +++++++++++++++++ api/v1/swagger/paths.json | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Koha/Schema/Result/Virtualshelve.pm b/Koha/Schema/Result/Virtualshelve.pm index 9aaae8d602..fa1e553059 100644 --- a/Koha/Schema/Result/Virtualshelve.pm +++ b/Koha/Schema/Result/Virtualshelve.pm @@ -210,7 +210,9 @@ sub koha_objects_class { } __PACKAGE__->add_columns( - '+public' => { is_boolean => 1 }, + '+allow_change_from_others' => { is_boolean => 1 }, + '+allow_change_from_owner' => { is_boolean => 1 }, + '+public' => { is_boolean => 1 }, ); 1; diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm index a7273a95d9..98dcaadcf9 100644 --- a/Koha/Virtualshelf.pm +++ b/Koha/Virtualshelf.pm @@ -255,6 +255,23 @@ sub can_biblios_be_removed { # Same answer since bug 18228 } +=head3 to_api_mapping + +This method returns the mapping for representing a Koha::Virtualshelf object +on the API. + +=cut + +sub to_api_mapping { + return { + created_on => 'creation_date', + lastmodified => 'updated_on_date', + owner => 'owner_id', + shelfname => 'name', + shelfnumber => 'list_id', + }; +} + =head2 Internal methods =head3 _type diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json index cdcd0368c5..e989dcf538 100644 --- a/api/v1/swagger/paths.json +++ b/api/v1/swagger/paths.json @@ -155,6 +155,9 @@ "/import_batch_profiles/{import_batch_profile_id}": { "$ref": "paths/import_batch_profiles.json#/~1import_batch_profiles~1{import_batch_profile_id}" }, + "/lists": { + "$ref": "paths/lists.yaml#/~1lists" + }, "/rotas/{rota_id}/stages/{stage_id}/position": { "$ref": "paths/rotas.json#/~1rotas~1{rota_id}~1stages~1{stage_id}~1position" }, -- 2.30.2