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

(-)a/C4/Biblio.pm (+58 lines)
Lines 128-133 BEGIN { Link Here
128
      &TransformHtmlToXml
128
      &TransformHtmlToXml
129
      &PrepareItemrecordDisplay
129
      &PrepareItemrecordDisplay
130
      &GetNoZebraIndexes
130
      &GetNoZebraIndexes
131
      prepare_host_field
131
    );
132
    );
132
}
133
}
133
134
Lines 3681-3688 sub get_biblio_authorised_values { Link Here
3681
    return $authorised_values;
3682
    return $authorised_values;
3682
}
3683
}
3683
3684
3685
=head2 prepare_host_field
3686
3687
$marcfield = prepare_host_field( $hostbiblioitem, $marcflavour );
3688
Generate the host item entry for an analytic child entry
3689
3690
=cut
3691
3692
sub prepare_host_field {
3693
    my ( $hostbiblio, $marcflavour ) = @_;
3694
    $marcflavour ||= 'MARC21';
3695
    my $host = GetMarcBiblio($hostbiblio);
3696
    if ( $marcflavour eq 'MARC21' ) {
3697
3698
        # unfortunately as_string does not 'do the right thing'
3699
        # if field returns undef
3700
        my %sfd;
3701
        my $field;
3702
        if ( $field = $host->author() ) {
3703
            $sfd{a} = $field;
3704
        }
3705
        if ( $field = $host->title() ) {
3706
            $sfd{t} = $field;
3707
        }
3708
        if ( $field = $host->field('260') ) {
3709
            my $s = $field->as_string('abc');
3710
            if ($s) {
3711
                $sfd{d} = $s;
3712
            }
3713
        }
3714
        if ( $field = $host->field('240') ) {
3715
            my $s = $field->as_string();
3716
            if ($s) {
3717
                $sfd{b} = $s;
3718
            }
3719
        }
3720
        if ( $field = $host->field('022') ) {
3721
            my $s = $field->as_string('a');
3722
            if ($s) {
3723
                $sfd{x} = $s;
3724
            }
3725
        }
3726
        if ( $field = $host->field('020') ) {
3727
            my $s = $field->as_string('a');
3728
            if ($s) {
3729
                $sfd{x} = $s;
3730
            }
3731
        }
3732
        if ( $field = $host->field('001') ) {
3733
            $sfd{w} = $field->data(),;
3734
        }
3735
        my $host_field = MARC::Field->new( 773, '0', ' ', %sfd );
3736
        return $host_field;
3737
    }
3738
    return;
3739
}
3740
3684
1;
3741
1;
3685
3742
3743
3686
__END__
3744
__END__
3687
3745
3688
=head1 AUTHOR
3746
=head1 AUTHOR
(-)a/cataloguing/addbiblio.pl (+19 lines)
Lines 827-832 AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|); Link Here
827
my $input = new CGI;
827
my $input = new CGI;
828
my $error = $input->param('error');
828
my $error = $input->param('error');
829
my $biblionumber  = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio.
829
my $biblionumber  = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio.
830
my $parentbiblio  = $input->param('parentbiblionumber');
830
my $breedingid    = $input->param('breedingid');
831
my $breedingid    = $input->param('breedingid');
831
my $z3950         = $input->param('z3950');
832
my $z3950         = $input->param('z3950');
832
my $op            = $input->param('op');
833
my $op            = $input->param('op');
Lines 904-909 if (($biblionumber) && !($breedingid)){ Link Here
904
if ($breedingid) {
905
if ($breedingid) {
905
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
906
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
906
}
907
}
908
# This is  a child record
909
if ($parentbiblio) {
910
    my $marcflavour = C4::Context->preference('marcflavour');
911
    $record = MARC::Record->new();
912
    my $hostfield = prepare_host_field($parentbiblio,$marcflavour);
913
    if ($hostfield) {
914
        $record->append_fields($hostfield);
915
    }
916
}
907
917
908
$is_a_modif = 0;
918
$is_a_modif = 0;
909
    
919
    
Lines 1070-1072 $template->param( Link Here
1070
);
1080
);
1071
1081
1072
output_html_with_http_headers $input, $cookie, $template->output;
1082
output_html_with_http_headers $input, $cookie, $template->output;
1083
1084
sub get_host_control_num {
1085
    my $host_biblio_nr = shift;
1086
    my $host = GetMarcBiblio($host_biblio_nr);
1087
    my $control_num = GetMarcControlnumber($host, C4::Context->preference('marcflavour'));
1088
    $host = GetBiblioData($host_biblio_nr);
1089
    $host->{control_number} = $control_num;
1090
    return $host;
1091
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-4 / +11 lines)
Lines 78-87 function confirm_items_deletion() { Link Here
78
	YAHOO.util.Event.onContentReady("cattoolbar", function () {
78
	YAHOO.util.Event.onContentReady("cattoolbar", function () {
79
		//	Menu for new record, new item, new subscription
79
		//	Menu for new record, new item, new subscription
80
		var newmenu = [
80
		var newmenu = [
81
			[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" },[% END %]
81
			[% IF CAN_user_editcatalogue_edit_catalogue %]
82
			[% IF ( CAN_user_editcatalogue_edit_items ) %]{text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" },[% END %]
82
            {text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" },
83
            [% END %]
84
			[% IF ( CAN_user_editcatalogue_edit_items ) %]
85
            {text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" },
86
            [% END %]
83
			[% IF ( CAN_user_serials_create_subscription ) %]
87
			[% IF ( CAN_user_serials_create_subscription ) %]
84
			{text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"},[% END %]
88
			{text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"},
89
            [% END %]
90
			[% IF CAN_user_editcatalogue_edit_catalogue %]
91
            {text: _("New Child Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?parentbiblionumber=[% biblionumber %]" },
92
            [% END %]
85
		];
93
		];
86
		if(newmenu.length){
94
		if(newmenu.length){
87
			new YAHOO.widget.Button({
95
			new YAHOO.widget.Button({
88
- 

Return to bug 6831