Skip to content
Browse files

Merge branch 'Bug3480' into ptfs-master

Conflicts:

	koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
  • Loading branch information...
2 parents c07a1c7 + 158461b commit 2173090c19a109cd9438cdd3091f21604640a2f6 J. David Bavousett committed Apr 28, 2010
View
11 catalogue/ISBDdetail.pl
@@ -92,5 +92,14 @@ =head1 FUNCTIONS
C4::Search::enabled_staff_search_views,
);
-output_html_with_http_headers $query, $cookie, $template->output;
+# Get itemnumber to supply to 'New > New Item' URL
+my @items = GetItemsInfo($biblionumber);
+my $itemcount = 0;
+my $additemnumber;
+foreach my $item (@items) {
+ $additemnumber = $item->{'itemnumber'} if (!$itemcount);
+ $itemcount++;
+}
+$template->param(additemnumber => $additemnumber);
+output_html_with_http_headers $query, $cookie, $template->output;
View
10 catalogue/MARCdetail.pl
@@ -321,4 +321,14 @@ =head1 FUNCTIONS
C4::Search::enabled_staff_search_views,
);
+# Get itemnumber to supply to 'New > New Item' URL
+my @items = GetItemsInfo($biblionumber);
+my $itemcount = 0;
+my $additemnumber;
+foreach my $item (@items) {
+ $additemnumber = $item->{'itemnumber'} if (!$itemcount);
+ $itemcount++;
+}
+$template->param(additemnumber => $additemnumber);
+
output_html_with_http_headers $query, $cookie, $template->output;
View
6 catalogue/detail.pl
@@ -124,7 +124,12 @@
my $norequests = 1;
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
my $authvalcode_items_damaged = GetAuthValCode('items.damaged', $fw);
+my $itemcount=0;
+my $additemnumber;
foreach my $item (@items) {
+ $additemnumber = $item->{'itemnumber'} if (!$itemcount);
+ $itemcount++;
+
# can place holds defaults to yes
$norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
@@ -231,6 +236,7 @@
subscriptionsnumber => $subscriptionsnumber,
subscriptiontitle => $dat->{title},
);
+$template->param(additemnumber => $additemnumber);
# $debug and $template->param(debug_display => 1);
View
5 catalogue/moredetail.pl
@@ -85,7 +85,11 @@
$data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
$results[0]=$data;
($itemnumber) and @items = (grep {$_->{'itemnumber'} == $itemnumber} @items);
+my $itemcount=0;
+my $additemnumber;
foreach my $item (@items){
+ $additemnumber = $item->{'itemnumber'} if (!$itemcount);
+ $itemcount++;
$item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
$item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged}) if GetAuthValCode('items.damaged',$fw);
$item->{'collection'} = $ccodes->{$item->{ccode}};
@@ -129,6 +133,7 @@
$template->param(biblionumber => $biblionumber);
$template->param(biblioitemnumber => $bi);
$template->param(itemnumber => $itemnumber);
+$template->param(additemnumber => $additemnumber);
$template->param(ONLY_ONE => 1) if ( $itemnumber && $count != @items );
$template->param(z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)));
View
28 cataloguing/additem.pl
@@ -236,6 +236,12 @@ sub set_item_default_location {
$itemrecord = C4::Items::GetMarcItem($biblionumber,$itemnumber);
$nextop = "saveitem";
#-------------------------------------------------------------------------------
+} elsif ($op eq "addadditionalitem") {
+#-------------------------------------------------------------------------------
+# retrieve marc_value field of an existing record
+ $itemrecord = C4::Items::GetMarcItem($biblionumber,$itemnumber);
+ $nextop="additem";
+#-------------------------------------------------------------------------------
} elsif ($op eq "delitem") {
#-------------------------------------------------------------------------------
# check that there is no issue on this item before deletion.
@@ -406,6 +412,28 @@ sub set_item_default_location {
}
}
+# Void out and/or reset some fields in the creation of a copy of a new item
+ my %iteminfo = ( "Withdrawn status" => '',
+ "Lost status" => '',
+ "Materials specified \(bound volume or other part\)" => '',
+ "Damaged status" => '',
+ "Use restrictions" => '',
+ "Not for loan" => '',
+ "Date acquired" => $today_iso,
+ "Total Checkouts" => 0,
+ "Total Renewals" => 0,
+ "Total Holds" => 0,
+ "Barcode" => '',
+ "Checked out" => '',
+ "Date last seen" => $today_iso,
+ "Date last checked out" => '',
+ "Copy number" => ''
+ );
+ if ($op eq "addadditionalitem") {
+ if (defined($iteminfo{$tagslib->{$tag}->{$subfield}->{lib}})) {
+ $value = $iteminfo{$tagslib->{$tag}->{$subfield}->{lib}};
+ }
+ }
my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" );
my $attributes = qq($attributes_no_value value="$value" );
if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
View
2 koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
@@ -70,7 +70,7 @@ function confirm_deletion() {
{text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" },
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_editcatalogue_add_items" -->
- {text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#additema" },
+ {text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?op=addadditionalitem&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;itemnumber=<!-- TMPL_VAR NAME="additemnumber" -->#additema" },
<!-- /TMPL_IF -->
{text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=<!-- TMPL_VAR NAME="biblionumber" -->"},
];

0 comments on commit 2173090

Please sign in to comment.
Something went wrong with that request. Please try again.