Bug 7739 - Batch edit items of a title
authorAmit Gupta <amit.gupta@osslabs.biz>
Wed, 18 Apr 2012 11:11:28 +0000 (16:41 +0530)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 11 May 2012 10:16:22 +0000 (12:16 +0200)
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 <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
tools/batchMod.pl

index f368f92..7fd2b4e 100644 (file)
@@ -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 %]&amp;frameworkcode=&amp;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 %]
index f25603e..e64776a 100644 (file)
@@ -86,6 +86,7 @@ $("input[name='disable_input']").click(function() {
      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
      <input type="hidden" name="runinbackground" id="runinbackground" value="" />
      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
+     <input type="hidden" name="src" id="src" value="[% src %]" />
 
 [% IF ( item_loop ) %]
   [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>[% ELSE %][% END %]
@@ -173,7 +174,11 @@ $("input[name='disable_input']").click(function() {
 </div>
 [% ELSE %] <!-- // show -->
 <fieldset class="action">
-  <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
+[% IF ( src == 'CATALOGUING') %]
+   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">Done</a>
+[% ELSE %]
+   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
+[% END %]
 </fieldset>
          
 [% END %]
index 5469496..3ba93a8 100755 (executable)
@@ -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;