Bugzilla – Attachment 48021 Details for
Bug 15783
C4::Koha::AddAuthorisedValue can be replaced with Koha::AuthorisedValue->new->store
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15783: AddAuthorisedValue - Replace existing calls
Bug-15783-AddAuthorisedValue---Replace-existing-ca.patch (text/plain), 2.48 KB, created by
Kyle M Hall (khall)
on 2016-02-12 19:29:19 UTC
(
hide
)
Description:
Bug 15783: AddAuthorisedValue - Replace existing calls
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-02-12 19:29:19 UTC
Size:
2.48 KB
patch
obsolete
>From 79e2ffe668b90deeda4f0c0fe1e5e2185b3af798 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 Feb 2016 10:20:01 +0000 >Subject: [PATCH] Bug 15783: AddAuthorisedValue - Replace existing calls >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The C4::Koha::AddAuthorisedValue is only called twice from >reports/guided_reports.pl and insert an authorised value. >This job can be achieve easily using the Koha::AuthorisedValue module. > >Test plan: >1/ Create a new guided report >2/ Use an existing group and/or subgroup of reports >3/ Save >4/ Update an existing report >5/ Use an existing group and/or subgroup of reports >6/ Save >7/ Create or update an existing report >8/ Remove its assigned group and subgroup >9/ Save > >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > reports/guided_reports.pl | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 6a03e11..8701085 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -33,6 +33,7 @@ use C4::Koha qw/IsAuthorisedValueCategory GetFrameworksLoop/; > use C4::Context; > use C4::Log; > use Koha::DateUtils qw/dt_from_string output_pref/; >+use Koha::AuthorisedValue; > > =head1 NAME > >@@ -998,12 +999,21 @@ sub create_non_existing_group_and_subgroup { > my $report_groups = C4::Reports::Guided::get_report_groups; > if (not exists $report_groups->{$group}) { > my $groupdesc = $input->param('groupdesc') // $group; >- C4::Koha::AddAuthorisedValue('REPORT_GROUP', $group, $groupdesc); >+ Koha::AuthorisedValue->new({ >+ category => 'REPORT_GROUP', >+ authorised_value => $group, >+ lib => $groupdesc, >+ })->store; > } > if (defined $subgroup and $subgroup ne '') { > if (not exists $report_groups->{$group}->{subgroups}->{$subgroup}) { > my $subgroupdesc = $input->param('subgroupdesc') // $subgroup; >- C4::Koha::AddAuthorisedValue('REPORT_SUBGROUP', $subgroup, $subgroupdesc, $group); >+ Koha::AuthorisedValue->new({ >+ category => 'REPORT_SUBGROUP', >+ authorised_value => $subgroup, >+ lib => $subgroupdesc, >+ lib_opac => $group, >+ })->store; > } > } > } >-- >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 15783
:
47840
|
47841
|
47889
|
47890
| 48021 |
48022