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. Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
c2d63e5e4e
commit
60403419ed
|
|
@ -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;
|
||||
|
|
@ -61,7 +59,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();
|
||||
|
|
|
|||
|
|
@ -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 %]
|
||||
|
|
@ -32,7 +32,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 %]
|
||||
|
|
@ -48,7 +48,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
|
||||
|
|
@ -56,7 +56,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" />
|
||||
|
|
@ -76,7 +76,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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue