Bugzilla – Attachment 146969 Details for
Bug 30930
Ability to change authority type while editing record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30930: Ability to change auth type while editing record
Bug-30930-Ability-to-change-auth-type-while-editin.patch (text/plain), 5.81 KB, created by
Jacob O'Mara
on 2023-02-20 15:56:30 UTC
(
hide
)
Description:
Bug 30930: Ability to change auth type while editing record
Filename:
MIME Type:
Creator:
Jacob O'Mara
Created:
2023-02-20 15:56:30 UTC
Size:
5.81 KB
patch
obsolete
>From 61d57ad4653f051f394d7a998cabbe582d6781bc Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 15 Mar 2021 14:51:25 +1300 >Subject: [PATCH] Bug 30930: Ability to change auth type while editing record > >This patch adds the ability to change the authority MARC framework/type >being used while editing an authority record. > >To test: > >1) Log into the staff client and go to Authorities >2) Search for an existing authority and edit it >3) Notice there is no way to change this authority type >4) Apply patch, restart services, refresh editor in browser >5) Notice the new Settings dropdown. Click to open >6) Confirm the correct current authority type is selected >7) Select another type to change to that. The page should reload >8) Confirm the page reloads with the correct authority type framework >loaded and the MARC data is still correct > >Sponsored-by: Education Services Australia SCIS >Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com> >--- > authorities/authorities.pl | 5 +++ > .../en/modules/authorities/authorities.tt | 39 +++++++++++++++++++ > 2 files changed, 44 insertions(+) > >diff --git a/authorities/authorities.pl b/authorities/authorities.pl >index 538f7cdb7b9..34554b5ecee 100755 >--- a/authorities/authorities.pl >+++ b/authorities/authorities.pl >@@ -543,6 +543,7 @@ my $myindex = $input->param('index'); > my $linkid=$input->param('linkid'); > my $authtypecode = $input->param('authtypecode'); > my $breedingid = $input->param('breedingid'); >+my $changed_authtype = $input->param('changed_authtype') // q{}; > > > my $dbh = C4::Context->dbh; >@@ -634,6 +635,10 @@ if ($op eq "duplicate") > { > $authid = ""; > } >+ if($changed_authtype eq "changed"){ >+ $record = TransformHtmlToMarc( $input, 0 ); >+ } >+ > build_tabs ($template, $record, $dbh, $input); > build_hidden_data; > $template->param(oldauthtypetagfield=>$oldauthtypetagfield, oldauthtypetagsubfield=>$oldauthtypetagsubfield, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >index 947821c647f..06a3e0549f4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >@@ -79,6 +79,16 @@ > selectTab( tablink ); > window.scrollTo( 0, getScrollto( field, "toolbar" ) ); > }); >+ >+ $(".change-authtype").on("click", function(){ >+ var authtypecode = $(this).data("authtypecode"); >+ var f = document.f; >+ f.op.value = "[% op | html %]"; >+ f.authid.value = "[% authid | html %]"; >+ f.changed_authtype.value = "changed"; >+ f.authtypecode.value = authtypecode; >+ f.submit(); >+ }); > }); > > function selectTab( tablink ){ >@@ -314,6 +324,7 @@ > <input type="hidden" name="authid" value="[% authid | html %]" /> > <input type="hidden" name="index" value="[% index | html %]" /> > <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" /> >+ <input type="hidden" name="changed_authtype" value="" /> > > <div id="toolbar" class="btn-toolbar"> > <div class="btn-group"><a href="#" id="addauth" class="btn btn-primary" accesskey="w"><i class="fa fa-save"></i> Save</a></div> >@@ -324,6 +335,34 @@ > <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a> > [% END %] > </div> >+ <div class="btn-group"> >+ <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button> >+ <ul id="settings-menu" class="dropdown-menu"> >+ <li class="dropdown-header">Change authority type</li> >+ <li> >+ <a href="#" class="change-authtype" data-authtypecode=""> >+ [% IF ( authtypecode ) %] >+ <i class="fa fa-fw"> </i> >+ [% ELSE %] >+ <i class="fa fa-fw fa-check"></i> >+ [% END %] >+ Default >+ </a> >+ </li> >+ [% FOREACH authority_type IN authority_types %] >+ <li> >+ <a href="#" class="change-authtype" data-authtypecode="[% authority_type.authtypecode | html %]"> >+ [% IF authority_type.authtypecode == authtypecode %] >+ <i class="fa fa-fw fa-check"></i> >+ [% ELSE %] >+ <i class="fa fa-fw"> </i> >+ [% END %] >+ [% authority_type.authtypetext | html %] >+ </a> >+ </li> >+ [% END %] >+ </ul> <!-- /#settings-menu --> >+ </div> <!-- /.btn-group --> > <div class="btn-group"> > [% IF ( authid ) %] > <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a> >-- >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 30930
:
135851
|
146555
|
146969
|
148674
|
148675