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

(-)a/cataloguing/additem.pl (+34 lines)
Lines 566-571 if ($op eq "additem") { Link Here
566
    $itemrecord = C4::Items::GetMarcItem($biblionumber,$itemnumber);
566
    $itemrecord = C4::Items::GetMarcItem($biblionumber,$itemnumber);
567
    $nextop = "saveitem";
567
    $nextop = "saveitem";
568
#-------------------------------------------------------------------------------
568
#-------------------------------------------------------------------------------
569
} elsif ($op eq "dupeitem") {
570
#-------------------------------------------------------------------------------
571
# retrieve item if exist => then, it's a modif
572
    $itemrecord = C4::Items::GetMarcItem($biblionumber,$itemnumber);
573
    if (C4::Context->preference('autoBarcode') eq 'incremental') {
574
        $itemrecord = _increment_barcode($itemrecord, $frameworkcode);
575
    }
576
    else {
577
        # we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin
578
        my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
579
        my $fieldItem = $itemrecord->field($tagfield);
580
        $itemrecord->delete_field($fieldItem);
581
        $fieldItem->delete_subfields($tagsubfield);
582
        $itemrecord->insert_fields_ordered($fieldItem);
583
    }
584
585
    #check for hidden subfield and remove them for the duplicated item
586
    foreach my $field ($itemrecord->fields()){
587
        my $tag = $field->{_tag};
588
        foreach my $subfield ($field->subfields()){
589
            my $subfieldtag = $subfield->[0];
590
            if (subfield_is_koha_internal_p($subfieldtag) || $tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"
591
            ||  abs($tagslib->{$tag}->{$subfieldtag}->{hidden})>4 ){
592
                my $fieldItem = $itemrecord->field($tag);
593
                $itemrecord->delete_field($fieldItem);
594
                $fieldItem->delete_subfields($subfieldtag);
595
                $itemrecord->insert_fields_ordered($fieldItem);
596
            }
597
        }
598
    }
599
600
    $itemrecord = removeFieldsForPrefill($itemrecord) if ($prefillitem);
601
    $nextop = "additem";
602
#-------------------------------------------------------------------------------
569
} elsif ($op eq "delitem") {
603
} elsif ($op eq "delitem") {
570
#-------------------------------------------------------------------------------
604
#-------------------------------------------------------------------------------
571
    # check that there is no issue on this item before deletion.
605
    # check that there is no issue on this item before deletion.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-1 / +1 lines)
Lines 181-186 $(document).ready(function() { Link Here
181
                          <a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a> &nbsp; <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber %]&amp;hostitemnumber=[% item_loo.itemnumber %]">Delink</a>
181
                          <a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a> &nbsp; <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber %]&amp;hostitemnumber=[% item_loo.itemnumber %]">Delink</a>
182
                        [% ELSE %]
182
                        [% ELSE %]
183
                          <a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a>
183
                          <a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a>
184
                          <a href="additem.pl?op=dupeitem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#additema">Duplicate</a>
184
                          [% IF ( item_loo.countanalytics ) %]
185
                          [% IF ( item_loo.countanalytics ) %]
185
                            <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=% item_loo.itemnumber %]">View analytics</a>
186
                            <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=% item_loo.itemnumber %]">View analytics</a>
186
                          [% ELSE %]
187
                          [% ELSE %]
187
- 

Return to bug 7369