View | Details | Raw Unified | Return to bug 2505
Collapse All | Expand All

(-)a/C4/AuthoritiesMarc.pm (-1 / +1 lines)
Lines 441-447 sub GetTagsLabels { Link Here
441
  my $dbh=C4::Context->dbh;
441
  my $dbh=C4::Context->dbh;
442
  $authtypecode="" unless $authtypecode;
442
  $authtypecode="" unless $authtypecode;
443
  my $sth;
443
  my $sth;
444
  my $libfield = ($forlibrarian eq 1)? 'liblibrarian' : 'libopac';
444
  my $libfield = ($forlibrarian == 1)? 'liblibrarian' : 'libopac';
445
445
446
446
447
  # check that authority exists
447
  # check that authority exists
(-)a/authorities/auth_finder.pl (-2 / +3 lines)
Lines 19-24 Link Here
19
# Suite 330, Boston, MA  02111-1307 USA
19
# Suite 330, Boston, MA  02111-1307 USA
20
20
21
use strict;
21
use strict;
22
use warnings;
22
23
23
use CGI;
24
use CGI;
24
use C4::Output;
25
use C4::Output;
Lines 44-59 my $resultsperpage; Link Here
44
my $authtypes = getauthtypes;
45
my $authtypes = getauthtypes;
45
my @authtypesloop;
46
my @authtypesloop;
46
foreach my $thisauthtype ( keys %$authtypes ) {
47
foreach my $thisauthtype ( keys %$authtypes ) {
47
    my $selected = 1 if $thisauthtype eq $authtypecode;
48
    my %row = (
48
    my %row = (
49
        value        => $thisauthtype,
49
        value        => $thisauthtype,
50
        selected     => $selected,
50
        selected     => ($thisauthtype eq $authtypecode),
51
        authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
51
        authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
52
        index        => $index,
52
        index        => $index,
53
    );
53
    );
54
    push @authtypesloop, \%row;
54
    push @authtypesloop, \%row;
55
}
55
}
56
56
57
$op ||= q{};
57
if ( $op eq "do_search" ) {
58
if ( $op eq "do_search" ) {
58
    my @marclist  = $query->param('marclist');
59
    my @marclist  = $query->param('marclist');
59
    my @and_or    = $query->param('and_or');
60
    my @and_or    = $query->param('and_or');
(-)a/authorities/authorities-home.pl (-2 / +13 lines)
Lines 18-23 Link Here
18
# Suite 330, Boston, MA  02111-1307 USA
18
# Suite 330, Boston, MA  02111-1307 USA
19
19
20
use strict;
20
use strict;
21
use warnings;
21
22
22
use CGI;
23
use CGI;
23
use C4::Auth;
24
use C4::Auth;
Lines 32-38 use C4::Biblio; Link Here
32
33
33
my $query        = new CGI;
34
my $query        = new CGI;
34
my $op           = $query->param('op');
35
my $op           = $query->param('op');
36
$op ||= q{};
35
my $authtypecode = $query->param('authtypecode');
37
my $authtypecode = $query->param('authtypecode');
38
$authtypecode ||= q{};
36
my $dbh          = C4::Context->dbh;
39
my $dbh          = C4::Context->dbh;
37
40
38
my $authid = $query->param('authid');
41
my $authid = $query->param('authid');
Lines 43-52 my @authtypesloop; Link Here
43
foreach my $thisauthtype ( sort { $authtypes->{$a}{'authtypetext'} cmp $authtypes->{$b}{'authtypetext'} }
46
foreach my $thisauthtype ( sort { $authtypes->{$a}{'authtypetext'} cmp $authtypes->{$b}{'authtypetext'} }
44
    keys %$authtypes )
47
    keys %$authtypes )
45
{
48
{
46
    my $selected = 1 if $thisauthtype eq $authtypecode;
47
    my %row = (
49
    my %row = (
48
        value        => $thisauthtype,
50
        value        => $thisauthtype,
49
        selected     => $selected,
51
        selected     => $thisauthtype eq $authtypecode,
50
        authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
52
        authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
51
    );
53
    );
52
    push @authtypesloop, \%row;
54
    push @authtypesloop, \%row;
Lines 88-94 if ( $op eq "do_search" ) { Link Here
88
    for ( my $i = 0 ; $i <= $#marclist ; $i++ ) {
90
    for ( my $i = 0 ; $i <= $#marclist ; $i++ ) {
89
        if ($value[$i]){   
91
        if ($value[$i]){   
90
          push @field_data, { term => "marclist",  val => $marclist_ini[$i] };
92
          push @field_data, { term => "marclist",  val => $marclist_ini[$i] };
93
          if (!defined $and_or[$i]) {
94
              $and_or[$i] = q{};
95
          }
91
          push @field_data, { term => "and_or",    val => $and_or[$i] };
96
          push @field_data, { term => "and_or",    val => $and_or[$i] };
97
          if (!defined $excluding[$i]) {
98
              $excluding[$i] = q{};
99
          }
92
          push @field_data, { term => "excluding", val => $excluding[$i] };
100
          push @field_data, { term => "excluding", val => $excluding[$i] };
93
          push @field_data, { term => "operator",  val => $operator[$i] };
101
          push @field_data, { term => "operator",  val => $operator[$i] };
94
          push @field_data, { term => "value",     val => $value[$i] };
102
          push @field_data, { term => "value",     val => $value[$i] };
Lines 113-118 if ( $op eq "do_search" ) { Link Here
113
121
114
    my $from = ( $startfrom - 1 ) * $resultsperpage + 1;
122
    my $from = ( $startfrom - 1 ) * $resultsperpage + 1;
115
    my $to;
123
    my $to;
124
    if (!defined $total) {
125
        $total = 0;
126
    }
116
127
117
    if ( $total < $startfrom * $resultsperpage ) {
128
    if ( $total < $startfrom * $resultsperpage ) {
118
        $to = $total;
129
        $to = $total;
(-)a/authorities/authorities.pl (-5 / +9 lines)
Lines 19-24 Link Here
19
# Suite 330, Boston, MA  02111-1307 USA
19
# Suite 330, Boston, MA  02111-1307 USA
20
20
21
use strict;
21
use strict;
22
use warnings;
22
use CGI;
23
use CGI;
23
use C4::Auth;
24
use C4::Auth;
24
use C4::Output;
25
use C4::Output;
Lines 131-136 sub create_input { Link Here
131
    # if there is no value provided but a default value in parameters, get it
132
    # if there is no value provided but a default value in parameters, get it
132
    unless ($value) {
133
    unless ($value) {
133
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
134
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
135
        if (!defined $value) {
136
            $value = q{};
137
        }
134
138
135
        # get today date & replace YYYY, MM, DD if provided in the default value
139
        # get today date & replace YYYY, MM, DD if provided in the default value
136
        my ( $year, $month, $day ) = Today();
140
        my ( $year, $month, $day ) = Today();
Lines 352-358 sub build_tabs ($$$$$) { Link Here
352
356
353
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
357
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
354
            # if MARC::Record is empty => use tab as master loop.
358
            # if MARC::Record is empty => use tab as master loop.
355
            if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
359
            if ( $record != -1 && ( $record->field($tag) || $tag eq '000' ) ) {
356
                my @fields;
360
                my @fields;
357
                if ( $tag ne '000' ) {
361
                if ( $tag ne '000' ) {
358
                                @fields = $record->field($tag);
362
                                @fields = $record->field($tag);
Lines 553-559 if ($authid) { Link Here
553
    ($oldauthnumtagfield,$oldauthnumtagsubfield) = &GetAuthMARCFromKohaField("auth_header.authid",$authtypecode);
557
    ($oldauthnumtagfield,$oldauthnumtagsubfield) = &GetAuthMARCFromKohaField("auth_header.authid",$authtypecode);
554
    ($oldauthtypetagfield,$oldauthtypetagsubfield) = &GetAuthMARCFromKohaField("auth_header.authtypecode",$authtypecode);
558
    ($oldauthtypetagfield,$oldauthtypetagsubfield) = &GetAuthMARCFromKohaField("auth_header.authtypecode",$authtypecode);
555
}
559
}
556
560
$op ||= q{};
557
#------------------------------------------------------------------------------------------------------------------------------
561
#------------------------------------------------------------------------------------------------------------------------------
558
if ($op eq "add") {
562
if ($op eq "add") {
559
#------------------------------------------------------------------------------------------------------------------------------
563
#------------------------------------------------------------------------------------------------------------------------------
Lines 578-584 if ($op eq "add") { Link Here
578
        }    
582
        }    
579
    }
583
    }
580
584
581
    my ($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "add") && (!$is_a_modif);
585
    my ($duplicateauthid,$duplicateauthvalue);
586
     ($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "add") && (!$is_a_modif);
582
    my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
587
    my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
583
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
588
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
584
    if (!$duplicateauthid or $confirm_not_duplicate) {
589
    if (!$duplicateauthid or $confirm_not_duplicate) {
Lines 627-635 $template->param(authid => $authid, Link Here
627
my $authtypes = getauthtypes;
632
my $authtypes = getauthtypes;
628
my @authtypesloop;
633
my @authtypesloop;
629
foreach my $thisauthtype (keys %$authtypes) {
634
foreach my $thisauthtype (keys %$authtypes) {
630
    my $selected = 1 if $thisauthtype eq $authtypecode;
631
    my %row =(value => $thisauthtype,
635
    my %row =(value => $thisauthtype,
632
                selected => $selected,
636
                selected => $thisauthtype eq $authtypecode,
633
                authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
637
                authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
634
            );
638
            );
635
    push @authtypesloop, \%row;
639
    push @authtypesloop, \%row;
(-)a/authorities/blinddetail-biblio-search.pl (-2 / +5 lines)
Lines 38-43 parameters tables. Link Here
38
=cut
38
=cut
39
39
40
use strict;
40
use strict;
41
use warnings;
41
42
42
use C4::AuthoritiesMarc;
43
use C4::AuthoritiesMarc;
43
use C4::Auth;
44
use C4::Auth;
Lines 58-64 my $authtypecode = &GetAuthTypeCode($authid); Link Here
58
my $tagslib      = &GetTagsLabels( 1, $authtypecode );
59
my $tagslib      = &GetTagsLabels( 1, $authtypecode );
59
60
60
my $auth_type = GetAuthType($authtypecode);
61
my $auth_type = GetAuthType($authtypecode);
61
my $record = GetAuthority($authid) if $authid;
62
my $record;
63
if ($authid) {
64
    $record = GetAuthority($authid);
65
}
62
66
63
# open template
67
# open template
64
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
68
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 72-78 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
72
);
76
);
73
77
74
# fill arrays
78
# fill arrays
75
my $tag;
76
my @loop_data = ();
79
my @loop_data = ();
77
if ($authid) {
80
if ($authid) {
78
    foreach my $field ( $record->field( $auth_type->{auth_tag_to_report} ) ) {
81
    foreach my $field ( $record->field( $auth_type->{auth_tag_to_report} ) ) {
(-)a/authorities/detail-biblio-search.pl (-3 / +2 lines)
Lines 39-44 parameters tables. Link Here
39
39
40
40
41
use strict;
41
use strict;
42
use warnings;
42
43
43
use C4::AuthoritiesMarc;
44
use C4::AuthoritiesMarc;
44
use C4::Auth;
45
use C4::Auth;
Lines 73-79 my ($template, $loggedinuser, $cookie) Link Here
73
74
74
# fill arrays
75
# fill arrays
75
my @loop_data =();
76
my @loop_data =();
76
my $tag;
77
# loop through each tab 0 through 9
77
# loop through each tab 0 through 9
78
# for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
78
# for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
79
# loop through each tag
79
# loop through each tag
Lines 121-129 my @fields = $record->fields(); Link Here
121
my $authtypes = getauthtypes;
121
my $authtypes = getauthtypes;
122
my @authtypesloop;
122
my @authtypesloop;
123
foreach my $thisauthtype (keys %$authtypes) {
123
foreach my $thisauthtype (keys %$authtypes) {
124
	my $selected = 1 if $thisauthtype eq $authtypecode;
125
	my %row =(value => $thisauthtype,
124
	my %row =(value => $thisauthtype,
126
				selected => $selected,
125
				selected => $thisauthtype eq $authtypecode,
127
				authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
126
				authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
128
			);
127
			);
129
	push @authtypesloop, \%row;
128
	push @authtypesloop, \%row;
(-)a/authorities/detail.pl (-6 / +3 lines)
Lines 39-44 parameters tables. Link Here
39
39
40
40
41
use strict;
41
use strict;
42
use warnings;
42
43
43
use C4::AuthoritiesMarc;
44
use C4::AuthoritiesMarc;
44
use C4::Auth;
45
use C4::Auth;
Lines 324-335 sub build_tabs ($$$$$) { Link Here
324
        foreach my $tag (sort @tab_data) {
325
        foreach my $tag (sort @tab_data) {
325
            $i++;
326
            $i++;
326
            next if ! $tag;
327
            next if ! $tag;
327
            my $indicator;
328
            my $index_tag = CreateKey;
328
            my $index_tag = CreateKey;
329
329
330
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
330
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
331
            # if MARC::Record is empty => use tab as master loop.
331
            # if MARC::Record is empty => use tab as master loop.
332
            if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
332
            if ( $record != -1 && ( $record->field($tag) || $tag eq '000' ) ) {
333
                my @fields;
333
                my @fields;
334
                if ( $tag ne '000' ) {
334
                if ( $tag ne '000' ) {
335
                    @fields = $record->field($tag);
335
                    @fields = $record->field($tag);
Lines 439-445 if (C4::Context->preference("AuthDisplayHierarchy")){ Link Here
439
    my $cnt=0;
439
    my $cnt=0;
440
    my @loophierarchy;
440
    my @loophierarchy;
441
    foreach my $element (@tree){
441
    foreach my $element (@tree){
442
      my $cell;
443
      my $elementdata = GetAuthority($element);
442
      my $elementdata = GetAuthority($element);
444
      $record= $elementdata if ($authid==$element);
443
      $record= $elementdata if ($authid==$element);
445
      push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
444
      push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
Lines 477-485 my $tag; Link Here
477
my $authtypes = getauthtypes;
476
my $authtypes = getauthtypes;
478
my @authtypesloop;
477
my @authtypesloop;
479
foreach my $thisauthtype (sort { $authtypes->{$b} cmp $authtypes->{$a} } keys %$authtypes) {
478
foreach my $thisauthtype (sort { $authtypes->{$b} cmp $authtypes->{$a} } keys %$authtypes) {
480
	my $selected = 1 if $thisauthtype eq $authtypecode;
481
	my %row =(value => $thisauthtype,
479
	my %row =(value => $thisauthtype,
482
				selected => $selected,
480
				selected => $thisauthtype eq $authtypecode,
483
				authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
481
				authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
484
			);
482
			);
485
	push @authtypesloop, \%row;
483
	push @authtypesloop, \%row;
486
- 

Return to bug 2505