Merge remote-tracking branch 'origin/new/bug_7408'
[koha_gimpoz] / catalogue / updateitem.pl
index 7b0b673..abc809d 100755 (executable)
@@ -14,9 +14,9 @@
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 use strict; 
 use warnings;
 use CGI;
@@ -26,12 +26,11 @@ use C4::Biblio;
 use C4::Items;
 use C4::Output;
 use C4::Circulation;
-use C4::Accounts;
 use C4::Reserves;
 
 my $cgi= new CGI;
 
-my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {circulate => 1}, 'intranet');
+checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
 
 my $biblionumber=$cgi->param('biblionumber');
 my $itemnumber=$cgi->param('itemnumber');
@@ -57,6 +56,7 @@ for ($damaged,$itemlost,$wthdrawn) {
 # modify MARC item if input differs from items table.
 my $item_changes = {};
 if (defined $itemnotes) { # i.e., itemnotes parameter passed from form
+    checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
     if ((not defined  $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) {
         $item_changes->{'itemnotes'} = $itemnotes;
     }
@@ -74,6 +74,6 @@ if (defined $itemnotes) { # i.e., itemnotes parameter passed from form
 
 ModItem($item_changes, $biblionumber, $itemnumber);
 
-C4::Accounts::chargelostitem($itemnumber) if ($itemlost==1) ;
+LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $itemlost;
 
 print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");