From: Amit Gupta Date: Wed, 18 Apr 2012 11:11:28 +0000 (+0530) Subject: Bug 7739 - Batch edit items of a title X-Git-Url: http://git.rot13.org/?p=koha.git;a=commitdiff_plain;h=fcc9fcea4faafbb5f14226f841656d88b0f61c43 Bug 7739 - Batch edit items of a title A new option - Edit items in batch - is made available under the menu - Edit - in the catalog detail page. When this option is selected the tool batch item modification is called with all items under this biblio passed as parameters. User can then edit all items of this biblio in batch. Once changes are saved the "done" link takes the user back to the catalog detail page of this biblio. To test: Navigate to catalog detail page of any biblio with one or more item records. Use the option "Edit items in batch" from the "Edit" menu. Modify the items in batch, say the collction code or lost status. Press "Save", verify that changes have been effected in the confirmation screen. Use the "Done" link to navigate back to the catalog detail page. Signed-off-by: Nicole C. Engard Signed-off-by: Paul Poulain --- diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index f368f92f86..7fd2b4e67c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -110,6 +110,7 @@ function confirm_items_deletion() { var editmenu = [ [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=" },[% END %] [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %] + [% IF ( CAN_user_tools_items_batchmod ) %]{ text: _("Edit Items In Batch"), url: "/cgi-bin/koha/tools/batchMod.pl?op=show&biblionumber=[% biblionumber %]&src=CATALOGUING" },[% END %] [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %] [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Link to host item"), url: "/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]" },[% END %][% END %] [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]{ text: _("Upload image"), url: "/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image" },[% END %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt index f25603ef25..e64776a4c3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt @@ -86,6 +86,7 @@ $("input[name='disable_input']").click(function() { + [% IF ( item_loop ) %] [% IF ( show ) %][% ELSE %][% END %] @@ -173,7 +174,11 @@ $("input[name='disable_input']").click(function() { [% ELSE %]
- Done +[% IF ( src == 'CATALOGUING') %] + Done +[% ELSE %] + Done +[% END %]
[% END %] diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 5469496302..3ba93a8ec4 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -39,11 +39,13 @@ my $input = new CGI; my $dbh = C4::Context->dbh; my $error = $input->param('error'); my @itemnumbers = $input->param('itemnumber'); +my $biblionumber = $input->param('biblionumber'); my $op = $input->param('op'); my $del = $input->param('del'); my $del_records = $input->param('del_records'); my $completedJobID = $input->param('completedJobID'); my $runinbackground = $input->param('runinbackground'); +my $src = $input->param('src'); my $template_name; @@ -227,6 +229,12 @@ if ($op eq "show"){ @itemnumbers = @contentlist; } } else { + if (defined $biblionumber){ + my @all_items = GetItemsInfo( $biblionumber ); + foreach my $itm (@all_items) { + push @itemnumbers, $itm->{itemnumber}; + } + } if ( my $list=$input->param('barcodelist')){ push my @barcodelist, split(/\s\n/, $list); @@ -451,6 +459,7 @@ if ($op eq "action") { foreach my $error (@errors) { $template->param($error => 1); } +$template->param(src => $src); output_html_with_http_headers $input, $cookie, $template->output; exit;