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

(-)a/C4/Biblio.pm (+57 lines)
Lines 131-136 BEGIN { Link Here
131
      &TransformHtmlToMarc
131
      &TransformHtmlToMarc
132
      &TransformHtmlToXml
132
      &TransformHtmlToXml
133
      &GetNoZebraIndexes
133
      &GetNoZebraIndexes
134
      prepare_host_field
134
    );
135
    );
135
}
136
}
136
137
Lines 3628-3636 sub GetHolds { Link Here
3628
    return ($holds);
3629
    return ($holds);
3629
}
3630
}
3630
3631
3632
=head2 prepare_host_field
3633
3634
$marcfield = prepare_host_field( $hostbiblioitem, $marcflavour );
3635
Generate the host item entry for an analytic child entry
3636
3637
=cut
3638
3639
sub prepare_host_field {
3640
    my ( $hostbiblio, $marcflavour ) = @_;
3641
    $marcflavour ||= 'MARC21';
3642
    my $host = GetMarcBiblio($hostbiblio);
3643
    if ( $marcflavour eq 'MARC21' ) {
3644
3645
        # unfortunately as_string does not 'do the right thing'
3646
        # if field returns undef
3647
        my %sfd;
3648
        my $field;
3649
        if ( $field = $host->author() ) {
3650
            $sfd{a} = $field;
3651
        }
3652
        if ( $field = $host->title() ) {
3653
            $sfd{t} = $field;
3654
        }
3655
        if ( $field = $host->field('260') ) {
3656
            my $s = $field->as_string('abc');
3657
            if ($s) {
3658
                $sfd{d} = $s;
3659
            }
3660
        }
3661
        if ( $field = $host->field('240') ) {
3662
            my $s = $field->as_string();
3663
            if ($s) {
3664
                $sfd{b} = $s;
3665
            }
3666
        }
3667
        if ( $field = $host->field('022') ) {
3668
            my $s = $field->as_string('a');
3669
            if ($s) {
3670
                $sfd{x} = $s;
3671
            }
3672
        }
3673
        if ( $field = $host->field('020') ) {
3674
            my $s = $field->as_string('a');
3675
            if ($s) {
3676
                $sfd{x} = $s;
3677
            }
3678
        }
3679
        if ( $field = $host->field('001') ) {
3680
            $sfd{w} = $field->data(),;
3681
        }
3682
        my $host_field = MARC::Field->new( 773, '0', ' ', %sfd );
3683
        return $host_field;
3684
    }
3685
    return;
3686
}
3631
3687
3632
1;
3688
1;
3633
3689
3690
3634
__END__
3691
__END__
3635
3692
3636
=head1 AUTHOR
3693
=head1 AUTHOR
(-)a/cataloguing/addbiblio.pl (-6 / +28 lines)
Lines 729-734 sub build_tabs { Link Here
729
my $input = new CGI;
729
my $input = new CGI;
730
my $error = $input->param('error');
730
my $error = $input->param('error');
731
my $biblionumber  = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio.
731
my $biblionumber  = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio.
732
my $parentbiblio  = $input->param('parentbiblionumber');
732
my $breedingid    = $input->param('breedingid');
733
my $breedingid    = $input->param('breedingid');
733
my $z3950         = $input->param('z3950');
734
my $z3950         = $input->param('z3950');
734
my $op            = $input->param('op');
735
my $op            = $input->param('op');
Lines 808-820 if (($biblionumber) && !($breedingid)){ Link Here
808
if ($breedingid) {
809
if ($breedingid) {
809
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
810
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
810
}
811
}
812
811
#populate hostfield if hostbiblionumber is available
813
#populate hostfield if hostbiblionumber is available
812
if ($hostbiblionumber){
814
if ($hostbiblionumber) {
813
	my $marcflavour = C4::Context->preference("marcflavour");
815
    my $marcflavour = C4::Context->preference("marcflavour");
814
	$record=MARC::Record->new();
816
    $record = MARC::Record->new();
815
	$record->leader('');
817
    $record->leader('');
816
        my $field = PrepHostMarcField($hostbiblionumber, $hostitemnumber,$marcflavour);
818
    my $field =
817
	$record->append_fields($field);
819
      PrepHostMarcField( $hostbiblionumber, $hostitemnumber, $marcflavour );
820
    $record->append_fields($field);
821
}
822
823
# This is  a child record
824
if ($parentbiblio) {
825
    my $marcflavour = C4::Context->preference('marcflavour');
826
    $record = MARC::Record->new();
827
    my $hostfield = prepare_host_field($parentbiblio,$marcflavour);
828
    if ($hostfield) {
829
        $record->append_fields($hostfield);
830
    }
818
}
831
}
819
832
820
$is_a_modif = 0;
833
$is_a_modif = 0;
Lines 982-984 $template->param( Link Here
982
);
995
);
983
996
984
output_html_with_http_headers $input, $cookie, $template->output;
997
output_html_with_http_headers $input, $cookie, $template->output;
998
999
sub get_host_control_num {
1000
    my $host_biblio_nr = shift;
1001
    my $host = GetMarcBiblio($host_biblio_nr);
1002
    my $control_num = GetMarcControlnumber($host, C4::Context->preference('marcflavour'));
1003
    $host = GetBiblioData($host_biblio_nr);
1004
    $host->{control_number} = $control_num;
1005
    return $host;
1006
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-6 / +15 lines)
Lines 81-91 function confirm_items_deletion() { Link Here
81
	YAHOO.util.Event.onContentReady("cattoolbar", function () {
81
	YAHOO.util.Event.onContentReady("cattoolbar", function () {
82
		//	Menu for new record, new item, new subscription
82
		//	Menu for new record, new item, new subscription
83
		var newmenu = [
83
		var newmenu = [
84
			[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" },[% END %]
84
			[% IF CAN_user_editcatalogue_edit_catalogue %]
85
			[% IF ( CAN_user_editcatalogue_edit_items ) %]{text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" },[% END %]
85
            {text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" },
86
			[% IF ( CAN_user_serials_create_subscription ) %]
86
            [% END %]
87
			{text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"},[% END %]
87
			[% IF ( CAN_user_editcatalogue_edit_items ) %]
88
			[% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{text: _("Analyze items"), url: "/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&analyze=1" },[% END %][% END %]
88
            {text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" },
89
            [% END %]
90
            [% IF ( CAN_user_serials_create_subscription ) %]
91
                {text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"},
92
            [% END %]
93
            [% IF ( EasyAnalyticalRecords && CAN_user_editcatalogue_edit_catalogue ) %]
94
                {text: _("Analyze Items"), url: "/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&analyze=1" },
95
            [% END %]
96
            [% IF CAN_user_editcatalogue_edit_catalogue %]
97
                {text: _("New Child Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?parentbiblionumber=[% biblionumber %]" },
98
            [% END %]
89
		];
99
		];
90
		if(newmenu.length){
100
		if(newmenu.length){
91
			new YAHOO.widget.Button({
101
			new YAHOO.widget.Button({
92
- 

Return to bug 6831