Bugzilla – Attachment 159496 Details for
Bug 35471
Automatically select child MARC framework when adding child records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35471: Add support for selecting parent framework on MARC framework modification screen
Bug-35471-Add-support-for-selecting-parent-framewo.patch (text/plain), 4.21 KB, created by
Lari Taskula
on 2023-12-01 23:16:13 UTC
(
hide
)
Description:
Bug 35471: Add support for selecting parent framework on MARC framework modification screen
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2023-12-01 23:16:13 UTC
Size:
4.21 KB
patch
obsolete
>From 389fa92767869282be0f2158c8c31e220f18e113 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Fri, 1 Dec 2023 16:30:34 +0000 >Subject: [PATCH] Bug 35471: Add support for selecting parent framework on MARC > framework modification screen > >To test: >1. Navigate to Administration -> MARC bibliographic framework >2. Create MARC framework with frameworkcode "A" >3. Observe new field "Parent framework" when adding a new framework >4. After adding the framework, click Actions -> MARC structure >5. Select "Create framework for A" using "Default", click OK >6. Navigate back to frameworks listing >7. Create framework with frameworkcode "A-1" >8. Select framework you created at step 2 as the parent framework >9. After adding the framework, click Actions -> MARC structure >10. Select "Create framework for A-1" using "Default", click OK > >Sponsored-by: Hypernova Oy >--- > admin/biblio_framework.pl | 10 +++++++++- > .../prog/en/modules/admin/biblio_framework.tt | 12 ++++++++++++ > 2 files changed, 21 insertions(+), 1 deletion(-) > >diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl >index d8988e0ecd..7c2ed46885 100755 >--- a/admin/biblio_framework.pl >+++ b/admin/biblio_framework.pl >@@ -44,19 +44,26 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > > my $dbh = C4::Context->dbh; > if ( $op eq 'add_form' ) { >+ my $frameworks = Koha::BiblioFrameworks->search( {}, { order_by => ['frameworktext'], } ); > my $framework; > if ($frameworkcode) { > $framework = Koha::BiblioFrameworks->find($frameworkcode); > } >- $template->param( framework => $framework ); >+ $template->param( >+ framework => $framework, >+ frameworks => $frameworks >+ ); > } elsif ( $op eq 'add_validate' ) { > my $frameworkcode = $input->param('frameworkcode'); > my $frameworktext = $input->param('frameworktext'); > my $is_a_modif = $input->param('is_a_modif'); >+ my $parent_frameworkcode = $input->param('parent_frameworkcode'); >+ $parent_frameworkcode = undef if $input->param('parent_frameworkcode') eq '__undef__'; > > if ($is_a_modif) { > my $framework = Koha::BiblioFrameworks->find($frameworkcode); > $framework->frameworktext($frameworktext); >+ $framework->parent_frameworkcode($parent_frameworkcode); > eval { $framework->store; }; > if ($@) { > push @messages, { type => 'error', code => 'error_on_update' }; >@@ -67,6 +74,7 @@ if ( $op eq 'add_form' ) { > my $framework = Koha::BiblioFramework->new( > { frameworkcode => $frameworkcode, > frameworktext => $frameworktext, >+ parent_frameworkcode => $parent_frameworkcode, > } > ); > eval { $framework->store; }; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt >index 540988a26d..dc42c953c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt >@@ -130,6 +130,18 @@ > <span class="required">Required</span> > </li> > [% END %] >+ <li> >+ [% IF frameworks %] >+ <label for="parent_frameworkcode">Parent framework: </label> >+ <select name="parent_frameworkcode" id="parent_frameworkcode" /> >+ <option value="__undef__">None</option> >+ [% FOREACH loo IN frameworks %] >+ [% NEXT IF framework && loo.frameworkcode == framework.frameworkcode %] >+ <option value="[% loo.frameworkcode | html %]"[% IF framework.parent_frameworkcode == loo.frameworkcode %] selected[% END %]>[% loo.frameworktext | html %]</option> >+ [% END %] >+ </select> >+ </li> >+ [% END %] > <li> > <label for="description" class="required">Description: </label> > <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% framework.frameworktext | html %]" required="required" class="required" /> >-- >2.34.1
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 35471
:
159486
|
159487
|
159488
|
159489
|
159490
|
159491
|
159492
|
159493
|
159494
|
159495
|
159496
|
159497
|
159498
|
159499
|
159500
|
159567
|
159568
|
159569
|
159570
|
159571
|
159572
|
159573
|
159884