my $dbh=C4::Context->dbh;
$authtypecode="" unless $authtypecode;
my $sth;
- my $libfield = ($forlibrarian eq 1)? 'liblibrarian' : 'libopac';
+ my $libfield = ($forlibrarian == 1)? 'liblibrarian' : 'libopac';
# check that authority exists
# Suite 330, Boston, MA 02111-1307 USA
use strict;
+use warnings;
use CGI;
use C4::Output;
my $authtypes = getauthtypes;
my @authtypesloop;
foreach my $thisauthtype ( keys %$authtypes ) {
- my $selected = 1 if $thisauthtype eq $authtypecode;
my %row = (
value => $thisauthtype,
- selected => $selected,
+ selected => ($thisauthtype eq $authtypecode),
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
index => $index,
);
push @authtypesloop, \%row;
}
+$op ||= q{};
if ( $op eq "do_search" ) {
my @marclist = $query->param('marclist');
my @and_or = $query->param('and_or');
# Suite 330, Boston, MA 02111-1307 USA
use strict;
+use warnings;
use CGI;
use C4::Auth;
my $query = new CGI;
my $op = $query->param('op');
+$op ||= q{};
my $authtypecode = $query->param('authtypecode');
+$authtypecode ||= q{};
my $dbh = C4::Context->dbh;
my $authid = $query->param('authid');
foreach my $thisauthtype ( sort { $authtypes->{$a}{'authtypetext'} cmp $authtypes->{$b}{'authtypetext'} }
keys %$authtypes )
{
- my $selected = 1 if $thisauthtype eq $authtypecode;
my %row = (
value => $thisauthtype,
- selected => $selected,
+ selected => $thisauthtype eq $authtypecode,
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
);
push @authtypesloop, \%row;
for ( my $i = 0 ; $i <= $#marclist ; $i++ ) {
if ($value[$i]){
push @field_data, { term => "marclist", val => $marclist_ini[$i] };
+ if (!defined $and_or[$i]) {
+ $and_or[$i] = q{};
+ }
push @field_data, { term => "and_or", val => $and_or[$i] };
+ if (!defined $excluding[$i]) {
+ $excluding[$i] = q{};
+ }
push @field_data, { term => "excluding", val => $excluding[$i] };
push @field_data, { term => "operator", val => $operator[$i] };
push @field_data, { term => "value", val => $value[$i] };
my $from = ( $startfrom - 1 ) * $resultsperpage + 1;
my $to;
+ if (!defined $total) {
+ $total = 0;
+ }
if ( $total < $startfrom * $resultsperpage ) {
$to = $total;
# Suite 330, Boston, MA 02111-1307 USA
use strict;
+use warnings;
use CGI;
use C4::Auth;
use C4::Output;
# if there is no value provided but a default value in parameters, get it
unless ($value) {
$value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
+ if (!defined $value) {
+ $value = q{};
+ }
# get today date & replace YYYY, MM, DD if provided in the default value
my ( $year, $month, $day ) = Today();
# if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
# if MARC::Record is empty => use tab as master loop.
- if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
+ if ( $record != -1 && ( $record->field($tag) || $tag eq '000' ) ) {
my @fields;
if ( $tag ne '000' ) {
@fields = $record->field($tag);
($oldauthnumtagfield,$oldauthnumtagsubfield) = &GetAuthMARCFromKohaField("auth_header.authid",$authtypecode);
($oldauthtypetagfield,$oldauthtypetagsubfield) = &GetAuthMARCFromKohaField("auth_header.authtypecode",$authtypecode);
}
-
+$op ||= q{};
#------------------------------------------------------------------------------------------------------------------------------
if ($op eq "add") {
#------------------------------------------------------------------------------------------------------------------------------
}
}
- my ($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "add") && (!$is_a_modif);
+ my ($duplicateauthid,$duplicateauthvalue);
+ ($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "add") && (!$is_a_modif);
my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
if (!$duplicateauthid or $confirm_not_duplicate) {
my $authtypes = getauthtypes;
my @authtypesloop;
foreach my $thisauthtype (keys %$authtypes) {
- my $selected = 1 if $thisauthtype eq $authtypecode;
my %row =(value => $thisauthtype,
- selected => $selected,
+ selected => $thisauthtype eq $authtypecode,
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
);
push @authtypesloop, \%row;
=cut
use strict;
+use warnings;
use C4::AuthoritiesMarc;
use C4::Auth;
my $tagslib = &GetTagsLabels( 1, $authtypecode );
my $auth_type = GetAuthType($authtypecode);
-my $record = GetAuthority($authid) if $authid;
+my $record;
+if ($authid) {
+ $record = GetAuthority($authid);
+}
# open template
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
# fill arrays
-my $tag;
my @loop_data = ();
if ($authid) {
foreach my $field ( $record->field( $auth_type->{auth_tag_to_report} ) ) {
use strict;
+use warnings;
use C4::AuthoritiesMarc;
use C4::Auth;
# fill arrays
my @loop_data =();
-my $tag;
# loop through each tab 0 through 9
# for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
# loop through each tag
my $authtypes = getauthtypes;
my @authtypesloop;
foreach my $thisauthtype (keys %$authtypes) {
- my $selected = 1 if $thisauthtype eq $authtypecode;
my %row =(value => $thisauthtype,
- selected => $selected,
+ selected => $thisauthtype eq $authtypecode,
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
);
push @authtypesloop, \%row;
use strict;
+use warnings;
use C4::AuthoritiesMarc;
use C4::Auth;
foreach my $tag (sort @tab_data) {
$i++;
next if ! $tag;
- my $indicator;
my $index_tag = CreateKey;
# if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
# if MARC::Record is empty => use tab as master loop.
- if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
+ if ( $record != -1 && ( $record->field($tag) || $tag eq '000' ) ) {
my @fields;
if ( $tag ne '000' ) {
@fields = $record->field($tag);
my $cnt=0;
my @loophierarchy;
foreach my $element (@tree){
- my $cell;
my $elementdata = GetAuthority($element);
$record= $elementdata if ($authid==$element);
push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
my $authtypes = getauthtypes;
my @authtypesloop;
foreach my $thisauthtype (sort { $authtypes->{$b} cmp $authtypes->{$a} } keys %$authtypes) {
- my $selected = 1 if $thisauthtype eq $authtypecode;
my %row =(value => $thisauthtype,
- selected => $selected,
+ selected => $thisauthtype eq $authtypecode,
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
);
push @authtypesloop, \%row;