Bugzilla – Attachment 38326 Details for
Bug 10947
Default framework for authorities can't be edited
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10947: Fix editing the default authority type
Bug-10947-Fix-editing-the-default-authority-type.patch (text/plain), 4.16 KB, created by
Jonathan Druart
on 2015-04-22 11:48:10 UTC
(
hide
)
Description:
Bug 10947: Fix editing the default authority type
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-04-22 11:48:10 UTC
Size:
4.16 KB
patch
obsolete
>From 01e420cd1e31f743ae6ad4420cf17256a1227815 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 22 Apr 2015 13:45:44 +0200 >Subject: [PATCH] Bug 10947: Fix editing the default authority type > >The default authority type cannot be defined. >The authtypecode is en empty string and the tests should be done on >"defined", not "exist". > >Test plan: >Edit the default authority type, save it. > >Note: There is no way to create an authority with an empty string, with >you deleted you won't be able to recreate it. >--- > admin/authtypes.pl | 6 ++---- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt | 10 +++++----- > 2 files changed, 7 insertions(+), 9 deletions(-) > >diff --git a/admin/authtypes.pl b/admin/authtypes.pl >index 492660d..3a3efed 100755 >--- a/admin/authtypes.pl >+++ b/admin/authtypes.pl >@@ -1,7 +1,6 @@ > #!/usr/bin/perl > > # written 20/02/2002 by paul.poulain@free.fr >-# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html) > > # Copyright 2000-2002 Katipo Communications > # >@@ -20,8 +19,7 @@ > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; > use CGI qw ( -utf8 ); > use C4::Context; > use C4::Auth; >@@ -59,7 +57,7 @@ my $dbh = C4::Context->dbh; > # called by default. Used to create form to add or modify a record > if ($op eq 'add_form') { > #---- if primkey exists, it's a modify action, so read values to modify... >- if ($authtypecode) { >+ if ( defined $authtypecode) { > my $sth = $dbh->prepare("SELECT * FROM auth_types WHERE authtypecode=?"); > $sth->execute($authtypecode); > my $data = $sth->fetchrow_hashref(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >index 691dfe2..4815d69 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >@@ -1,7 +1,7 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Authority types > [% IF ( add_form ) %] >-› [% IF ( authtypecode ) %]Modify authority type[% ELSE %]New authority type[% END %] >+› [% IF authtypecode.defined %]Modify authority type[% ELSE %]New authority type[% END %] > [% ELSIF ( delete_confirm ) %] > › Confirm deletion of authority type > [% END %] >@@ -18,7 +18,7 @@ > › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> > › <a href="[% script_name %]">Authority types</a> > [% IF ( add_form ) %] >-› [% IF ( authtypecode ) %]Modify[% ELSE %]New[% END %] Authority type >+› [% IF authtypecode.defined %]Modify[% ELSE %]New[% END %] Authority type > [% ELSIF ( delete_confirm ) %] > › Confirm deletion of authority type > [% END %] >@@ -34,7 +34,7 @@ > <form action="[% script_name %]" name="Aform" method="post" class="validated"> > <fieldset class="rows"> > <legend> >- [% IF ( authtypecode ) %] >+ [% IF authtypecode.defined %] > Modify authority type > [% ELSE %] > New authority type >@@ -42,7 +42,7 @@ > </legend> > <ol> > <li> >- [% IF ( authtypecode ) %] >+ [% IF authtypecode.defined %] > <span class="label">Authority type</span> > <input type="hidden" name="op" value="add_validate" /> > <input type="hidden" name="checked" value="0" /> >@@ -62,7 +62,7 @@ > <p class="tip">Note: for 'Authority field to copy', enter the authority field that should be copied from the authority record to the bibliographic record. E.g., in MARC21, field 100 in the authority record should be copied to field 100 in the bibliographic record</p> > <label for="auth_tag_to_report">Authority field to copy: </label><input type="text" id="auth_tag_to_report" name="auth_tag_to_report" size="5" maxlength="3" value="[% auth_tag_to_report %]" /> > <input type="hidden" name="op" value="add_validate" /> >- [% IF ( authtypecode ) %] >+ [% IF authtypecode.defined %] > <input type="hidden" name="modif" value="1" /> > [% END %] > </li> >-- >2.1.0
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 10947
:
38326
|
38339
|
38358