Bugzilla – Attachment 157722 Details for
Bug 23111
Setting a custom framework as the default for cataloguing is not possible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23111: Allow switch to Default framework and use selected default when adding New record
Bug-23111-Allow-switch-to-Default-framework-and-us.patch (text/plain), 4.99 KB, created by
Aleisha Amohia
on 2023-10-24 02:44:13 UTC
(
hide
)
Description:
Bug 23111: Allow switch to Default framework and use selected default when adding New record
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2023-10-24 02:44:13 UTC
Size:
4.99 KB
patch
obsolete
>From f26a88839850dc46e1ef54040159ccd7aa124179 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 24 Oct 2023 02:16:11 +0000 >Subject: [PATCH] Bug 23111: Allow switch to Default framework and use selected > default when adding New record > >This ensures that the correct framework is checked when using the 'Change framework' dropdown in the editor. > >This also ensures that the selected default framework is used when using the New record button in the Cataloguing home page or from a record detail page. You would also still be able to use the Default framework if chosen. > >Sponsored-by: Catalyst IT >--- > Koha/Template/Plugin/Biblio.pm | 6 ++++++ > cataloguing/addbiblio.pl | 7 ------- > koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 7 ++++++- > .../prog/en/modules/cataloguing/cataloging-home.tt | 8 ++++++-- > 4 files changed, 18 insertions(+), 10 deletions(-) > >diff --git a/Koha/Template/Plugin/Biblio.pm b/Koha/Template/Plugin/Biblio.pm >index 92b130ac102..56bcfe20889 100644 >--- a/Koha/Template/Plugin/Biblio.pm >+++ b/Koha/Template/Plugin/Biblio.pm >@@ -65,4 +65,10 @@ sub RecallsCount { > return $recalls->count; > } > >+sub DefaultFramework { >+ my ($self) = @_; >+ >+ return Koha::BiblioFrameworks->get_default; >+} >+ > 1; >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 2bf820818f6..a11711afd32 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -807,13 +807,6 @@ if ( $record ne '-1' ) { > my $title = C4::Context->preference('marcflavour') eq "UNIMARC" ? $record->subfield('200', 'a') : $record->title; > $template->param( title => $title ); > } >-my $default_framework = Koha::BiblioFrameworks->get_default; >-if ( defined $default_framework >- && defined $frameworkcode >- && $frameworkcode eq '' ) >-{ >- $frameworkcode = $default_framework->frameworkcode; >-} > $template->param( > popup => $mode, > frameworkcode => $frameworkcode, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index 03bcb38059e..eec16779901 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -1,4 +1,5 @@ > [% USE Context %] >+[% USE Biblio %] > [% INCLUDE 'blocking_errors.inc' %] > <div id="toolbar" class="btn-toolbar"> > >@@ -7,7 +8,11 @@ > <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New <span class="caret"></span></button> > <ul class="dropdown-menu"> > [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] >- <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li> >+ [% IF Biblio.DefaultFramework %] >+ <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% Biblio.DefaultFramework.frameworkcode | html %]">New record</a></li> >+ [% ELSE %] >+ <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li> >+ [% END %] > [% END %] > > [% IF ( CAN_user_editcatalogue_edit_items ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt >index 57a3dcb41cd..d7a42d87eb3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt >@@ -39,7 +39,11 @@ > <ul class="dropdown-menu"> > <li><a id="newRecordDefault" href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li> > [% FOREACH framework IN frameworks %] >- <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode | uri %]">[% framework.frameworktext | html %]</a></li> >+ [% IF framework.is_default %] >+ <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode | uri %]" id="default-framework">[% framework.frameworktext | html %]</a></li> >+ [% ELSE %] >+ <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode | uri %]">[% framework.frameworktext | html %]</a></li> >+ [% END %] > [% END %] > </ul> > </div> >@@ -233,7 +237,7 @@ > $(document).ready(function() { > > $("#newRecord").click(function(){ >- var url = $("a#newRecordDefault").prop("href"); >+ var url = $("#default-framework") ? $("#default-framework").prop("href") : $("a#newRecordDefault").prop("href"); > window.location.href = url; > return false; > }); >-- >2.30.2
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 23111
:
90550
|
90587
|
90588
|
91039
|
91040
|
91791
|
92184
|
102602
|
102603
|
104058
|
104059
|
104060
|
104061
|
104062
|
106560
|
112354
|
112468
|
138766
|
138767
|
138768
|
138769
|
138770
|
141565
|
141566
|
141567
|
141568
|
141569
|
157717
|
157718
|
157719
|
157720
|
157721
| 157722 |
157723