diff --git a/Koha/Plugin/Acquire/Controllers/FundManagement/FiscalYears.pm b/Koha/Plugin/Acquire/Controllers/FundManagement/FiscalYears.pm index 6e5111a..4f20a49 100644 --- a/Koha/Plugin/Acquire/Controllers/FundManagement/FiscalYears.pm +++ b/Koha/Plugin/Acquire/Controllers/FundManagement/FiscalYears.pm @@ -74,8 +74,6 @@ sub get { ); } - $fiscal_year = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_patron_data( - { data => $fiscal_year, field => 'owned_by', key => "owner" } ); $fiscal_year = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_lib_group_data( { data => $fiscal_year } ); @@ -100,7 +98,6 @@ sub add { sub { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; my $fiscal_year = Koha::Acquire::Funds::FiscalYear->new_from_api($body)->store; @@ -141,7 +138,6 @@ sub update { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; delete $body->{last_updated} if $body->{last_updated}; diff --git a/Koha/Plugin/Acquire/Controllers/FundManagement/FundAllocations.pm b/Koha/Plugin/Acquire/Controllers/FundManagement/FundAllocations.pm index 9bccf9c..f82ab8e 100644 --- a/Koha/Plugin/Acquire/Controllers/FundManagement/FundAllocations.pm +++ b/Koha/Plugin/Acquire/Controllers/FundManagement/FundAllocations.pm @@ -85,8 +85,6 @@ sub get { ); } - $fund_allocation = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_patron_data( - { data => $fund_allocation, field => 'owned_by', key => "owner" } ); $fund_allocation = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_lib_group_data( { data => $fund_allocation } ); return $c->render( @@ -110,7 +108,6 @@ sub add { sub { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; my $fund_allocation = Koha::Acquire::Funds::FundAllocation->new_from_api($body)->store; @@ -151,7 +148,6 @@ sub update { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; delete $body->{fiscal_year} if $body->{fiscal_year}; delete $body->{last_updated} if $body->{last_updated}; diff --git a/Koha/Plugin/Acquire/Controllers/FundManagement/Funds.pm b/Koha/Plugin/Acquire/Controllers/FundManagement/Funds.pm index da8734a..7a73b44 100644 --- a/Koha/Plugin/Acquire/Controllers/FundManagement/Funds.pm +++ b/Koha/Plugin/Acquire/Controllers/FundManagement/Funds.pm @@ -74,8 +74,6 @@ sub get { ); } - $fund = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_patron_data( - { data => $fund, field => 'owned_by', key => "owner" } ); $fund = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_lib_group_data( { data => $fund } ); $fund = @@ -104,7 +102,6 @@ sub add { sub { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; $body = _inherit_currency_and_owner($body); @@ -147,7 +144,6 @@ sub update { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; delete $body->{last_updated} if $body->{last_updated}; diff --git a/Koha/Plugin/Acquire/Controllers/FundManagement/Ledgers.pm b/Koha/Plugin/Acquire/Controllers/FundManagement/Ledgers.pm index c89e92e..0a05913 100644 --- a/Koha/Plugin/Acquire/Controllers/FundManagement/Ledgers.pm +++ b/Koha/Plugin/Acquire/Controllers/FundManagement/Ledgers.pm @@ -73,8 +73,6 @@ sub get { ); } - $ledger = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_patron_data( - { data => $ledger, field => 'owned_by', key => "owner" } ); $ledger = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_lib_group_data( { data => $ledger } ); $ledger = @@ -102,7 +100,6 @@ sub add { sub { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; my $ledger = Koha::Acquire::Funds::Ledger->new_from_api($body)->store; @@ -143,7 +140,6 @@ sub update { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; delete $body->{fiscal_year} if $body->{fiscal_year}; delete $body->{last_updated} if $body->{last_updated}; diff --git a/Koha/Plugin/Acquire/Controllers/FundManagement/SubFunds.pm b/Koha/Plugin/Acquire/Controllers/FundManagement/SubFunds.pm index 2e6b300..0f410b4 100644 --- a/Koha/Plugin/Acquire/Controllers/FundManagement/SubFunds.pm +++ b/Koha/Plugin/Acquire/Controllers/FundManagement/SubFunds.pm @@ -74,8 +74,6 @@ sub get { ); } - $sub_fund = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_patron_data( - { data => $sub_fund, field => 'owned_by', key => "owner" } ); $sub_fund = Koha::Plugin::Acquire::Controllers::ControllerUtils->add_lib_group_data( { data => $sub_fund } ); $sub_fund = Koha::Plugin::Acquire::Controllers::ControllerUtils @@ -102,7 +100,6 @@ sub add { sub { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; my $sub_fund = Koha::Acquire::Funds::SubFund->new_from_api($body)->store; @@ -143,7 +140,6 @@ sub update { my $body = $c->req->json; - delete $body->{owned_by} if $body->{owned_by}; delete $body->{lib_groups} if $body->{lib_groups}; delete $body->{last_updated} if $body->{last_updated}; diff --git a/Koha/Plugin/Acquire/api/openapi.json b/Koha/Plugin/Acquire/api/openapi.json index 022b6f3..db7b0ac 100644 --- a/Koha/Plugin/Acquire/api/openapi.json +++ b/Koha/Plugin/Acquire/api/openapi.json @@ -690,7 +690,8 @@ "type": "string", "enum": [ "koha_plugin_acquire_ledgers", - "koha_plugin_acquire_funds" + "koha_plugin_acquire_funds", + "owner" ] }, "collectionFormat": "csv" @@ -846,7 +847,8 @@ "type": "string", "enum": [ "koha_plugin_acquire_ledgers", - "koha_plugin_acquire_funds" + "koha_plugin_acquire_funds", + "owner" ] }, "collectionFormat": "csv" @@ -1187,7 +1189,8 @@ "enum": [ "fiscal_yr", "koha_plugin_acquire_funds", - "koha_plugin_acquire_funds.koha_plugin_acquire_fund_allocations" + "koha_plugin_acquire_funds.koha_plugin_acquire_fund_allocations", + "owner" ] }, "collectionFormat": "csv" @@ -1344,7 +1347,8 @@ "enum": [ "fiscal_yr", "koha_plugin_acquire_funds", - "koha_plugin_acquire_funds.koha_plugin_acquire_fund_allocations" + "koha_plugin_acquire_funds.koha_plugin_acquire_fund_allocations", + "owner" ] }, "collectionFormat": "csv" @@ -1686,7 +1690,8 @@ "fiscal_yr", "ledger", "koha_plugin_acquire_sub_funds", - "koha_plugin_acquire_fund_allocations" + "koha_plugin_acquire_fund_allocations", + "owner" ] }, "collectionFormat": "csv" @@ -1846,7 +1851,8 @@ "fund_group", "koha_plugin_acquire_sub_funds", "koha_plugin_acquire_sub_funds.koha_plugin_acquire_fund_allocations", - "koha_plugin_acquire_fund_allocations" + "koha_plugin_acquire_fund_allocations", + "owner" ] }, "collectionFormat": "csv" @@ -2188,7 +2194,8 @@ "fiscal_yr", "ledger", "fund", - "koha_plugin_acquire_fund_allocations" + "koha_plugin_acquire_fund_allocations", + "owner" ] }, "collectionFormat": "csv" @@ -2346,7 +2353,8 @@ "fiscal_yr", "ledger", "fund", - "koha_plugin_acquire_fund_allocations" + "koha_plugin_acquire_fund_allocations", + "owner" ] }, "collectionFormat": "csv" @@ -2687,7 +2695,8 @@ "enum": [ "fiscal_yr", "ledger", - "fund" + "fund", + "owner" ] }, "collectionFormat": "csv" @@ -2891,7 +2900,8 @@ "enum": [ "fiscal_yr", "ledger", - "fund" + "fund", + "owner" ] }, "collectionFormat": "csv" @@ -3231,7 +3241,8 @@ "type": "string", "enum": [ "koha_plugin_acquire_funds", - "koha_plugin_acquire_funds.koha_plugin_acquire_fund_allocations" + "koha_plugin_acquire_funds.koha_plugin_acquire_fund_allocations", + "owner" ] }, "collectionFormat": "csv" @@ -3387,7 +3398,8 @@ "type": "string", "enum": [ "koha_plugin_acquire_funds", - "koha_plugin_acquire_funds.koha_plugin_acquire_fund_allocations" + "koha_plugin_acquire_funds.koha_plugin_acquire_fund_allocations", + "owner" ] }, "collectionFormat": "csv" diff --git a/Koha/Plugin/Acquire/installer/config/schemaToUI.json b/Koha/Plugin/Acquire/installer/config/schemaToUI.json index 277f8c9..91b1201 100644 --- a/Koha/Plugin/Acquire/installer/config/schemaToUI.json +++ b/Koha/Plugin/Acquire/installer/config/schemaToUI.json @@ -62,7 +62,7 @@ }, "owner": { "label": "Owner", - "type": "patron" + "type": "owner" }, "visible_to": { "label": "Library groups covered", @@ -110,7 +110,7 @@ }, "owner": { "label": "Owner", - "type": "patron" + "type": "owner" }, "visible_to": { "label": "Library groups covered", @@ -200,7 +200,7 @@ }, "owner": { "label": "Owner", - "type": "patron" + "type": "owner" }, "visible_to": { "label": "Library groups covered", @@ -285,7 +285,7 @@ }, "owner": { "label": "Owner", - "type": "patron" + "type": "owner" }, "visible_to": { "label": "Library groups covered", diff --git a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/FiscalYear.pm b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/FiscalYear.pm index f8163eb..e03e75f 100644 --- a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/FiscalYear.pm +++ b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/FiscalYear.pm @@ -97,6 +97,19 @@ sub koha_plugin_acquire_ledgers { } +=head3 owner + +Method to embed the owner to a given fiscal year + +=cut + +sub owner { + my ($self) = @_; + my $owner_rs = $self->_result->owner; + return Koha::Patron->_new_from_dbic($owner_rs); +} + + =head2 Internal methods =head3 _type diff --git a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/Fund.pm b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/Fund.pm index 64e5ef0..30c0ab3 100644 --- a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/Fund.pm +++ b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/Fund.pm @@ -233,6 +233,19 @@ sub koha_plugin_acquire_fund_allocations { return Koha::Acquire::Funds::FundAllocations->_new_from_dbic($fund_allocation_rs); } + +=head3 owner + +Method to embed the owner to a given fund + +=cut + +sub owner { + my ($self) = @_; + my $owner_rs = $self->_result->owner; + return Koha::Patron->_new_from_dbic($owner_rs); +} + =head2 Internal methods =head3 _type diff --git a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/FundAllocation.pm b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/FundAllocation.pm index 42e18e9..732f719 100644 --- a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/FundAllocation.pm +++ b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/FundAllocation.pm @@ -112,6 +112,20 @@ sub sub_fund { return Koha::Acquire::Funds::SubFund->_new_from_dbic($sub_fund_rs); } + +=head3 owner + +Method to embed the owner to a given fund allocation + +=cut + +sub owner { + my ($self) = @_; + my $owner_rs = $self->_result->owner; + return Koha::Patron->_new_from_dbic($owner_rs); +} + + =head2 Internal methods =head3 _type diff --git a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/Ledger.pm b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/Ledger.pm index 449a4b3..cc028e6 100644 --- a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/Ledger.pm +++ b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/Ledger.pm @@ -133,6 +133,18 @@ sub koha_plugin_acquire_funds { } +=head3 owner + +Method to embed the owner to a given ledger + +=cut + +sub owner { + my ($self) = @_; + my $owner_rs = $self->_result->owner; + return Koha::Patron->_new_from_dbic($owner_rs); +} + =head2 Internal methods diff --git a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/SubFund.pm b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/SubFund.pm index 896040a..13498e2 100644 --- a/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/SubFund.pm +++ b/Koha/Plugin/Acquire/lib/Koha/Acquire/Funds/SubFund.pm @@ -158,6 +158,20 @@ sub koha_plugin_acquire_fund_allocations { return Koha::Acquire::Funds::FundAllocations->_new_from_dbic($fund_allocation_rs); } + +=head3 owner + +Method to embed the owner to a given sub fund + +=cut + +sub owner { + my ($self) = @_; + my $owner_rs = $self->_result->owner; + return Koha::Patron->_new_from_dbic($owner_rs); +} + + =head2 Internal methods =head3 _type diff --git a/src/components/DataField.vue b/src/components/DataField.vue index 5316e24..32be737 100644 --- a/src/components/DataField.vue +++ b/src/components/DataField.vue @@ -32,7 +32,7 @@