Bug 21249: (follow-up) Fixing syspref name, description, get working with OPAC masthe...
[srvgit] / catalogue / updateitem.pl
index f8295a0..9ff9f9b 100755 (executable)
@@ -27,7 +27,7 @@ use C4::Output;
 use C4::Circulation;
 use C4::Reserves;
 
-my $cgi= new CGI;
+my $cgi= CGI->new;
 
 checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
 
@@ -40,6 +40,7 @@ my $itemnotes=$cgi->param('itemnotes');
 my $itemnotes_nonpublic=$cgi->param('itemnotes_nonpublic');
 my $withdrawn=$cgi->param('withdrawn');
 my $damaged=$cgi->param('damaged');
+my $exclude_from_local_holds_priority = $cgi->param('exclude_from_local_holds_priority');
 
 my $confirm=$cgi->param('confirm');
 my $dbh = C4::Context->dbh;
@@ -55,6 +56,8 @@ for ($damaged,$itemlost,$withdrawn) {
     }
 }
 
+my $messages = q{};
+
 # modify MARC item if input differs from items table.
 if ( $op eq "set_non_public_note" ) {
     checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
@@ -71,6 +74,9 @@ elsif ( $op eq "set_public_note" ) { # i.e., itemnotes parameter passed from for
     $item->itemlost($itemlost);
 } elsif ( $op eq "set_withdrawn" && $withdrawn ne $item_data_hashref->{'withdrawn'}) {
     $item->withdrawn($withdrawn);
+} elsif ( $op eq "set_exclude_priority" && $exclude_from_local_holds_priority ne $item_data_hashref->{'exclude_from_local_holds_priority'}) {
+    $item->exclude_from_local_holds_priority($exclude_from_local_holds_priority);
+    $messages = "updated_exclude_from_local_holds_priority=$exclude_from_local_holds_priority&";
 } elsif ( $op eq "set_damaged" && $damaged ne $item_data_hashref->{'damaged'}) {
     $item->damaged($damaged);
 } else {
@@ -83,4 +89,4 @@ $item->store;
 
 LostItem($itemnumber, 'moredetail') if $op eq "set_lost";
 
-print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");
+print $cgi->redirect("moredetail.pl?" . $messages . "biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");