Bug 23856: Split author and ISBN/ISSN out of citation in staged MARC record management
authorOwen Leonard <oleonard@myacpl.org>
Mon, 21 Oct 2019 17:01:06 +0000 (17:01 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 29 Jan 2020 09:06:59 +0000 (09:06 +0000)
This patch modifies the way data is passed to the staged MARC record
management template, splitting author, ISBN, and ISSN out of the
"citation" variable and passing them separately.

The DataTables configuration for the staged MARC record management page
is modified so that those now-separate variables are conditionally
displayed.

Unrelated minor change: Added a class to the MARC preview modal so that
it displays wider.

To test, apply the patch and view the "Staged MARC management" page for
both batches of bibliographic records and batches of authority records.

In each case the title or authority heading should be displayed as a
link while author, ISBN, and ISSN (if any) should not.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
tools/batch_records_ajax.pl

index 277e1bf..79c169e 100644 (file)
                         </table>
 
                         <div id="marcPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
-                            <div class="modal-dialog">
+                            <div class="modal-dialog modal-wide">
                                 <div class="modal-content">
                                     <div class="modal-header">
                                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
                             var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber=";
                         [% END %]
 
+                        var additional_details = "";
+                        if( aData['author'] ){
+                            additional_details += " " + aData['author'] + " ";
+                        }
+
+                        if( aData['isbn'] ){
+                            additional_details += " (" + aData['isbn'] + ") ";
+                        }
+
+                        if( aData['issn'] ){
+                            additional_details += " (" + aData['issn'] + ") ";
+                        }
+
                         $('td:eq(1)', nRow).html(
-                            '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a>'
+                            '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a> ' + additional_details
                         );
 
                         $('td:eq(2)', nRow).html(
index 17e8236..b8ca76c 100755 (executable)
@@ -68,12 +68,6 @@ my $records =
 my @list = ();
 foreach my $record (@$records) {
     my $citation = $record->{'title'} || $record->{'authorized_heading'};
-    $citation .= " $record->{'author'}" if $record->{'author'};
-    $citation .= " (" if $record->{'issn'} or $record->{'isbn'};
-    $citation .= $record->{'isbn'} if $record->{'isbn'};
-    $citation .= ", " if $record->{'issn'} and $record->{'isbn'};
-    $citation .= $record->{'issn'} if $record->{'issn'};
-    $citation .= ")" if $record->{'issn'} or $record->{'isbn'};
 
     my $match = GetImportRecordMatches( $record->{'import_record_id'}, 1 );
     my $match_citation = '';
@@ -99,6 +93,9 @@ foreach my $record (@$records) {
         DT_RowId        => $record->{'import_record_id'},
         import_record_id => $record->{'import_record_id'},
         citation        => $citation,
+        author          => $record->{'author'},
+        issn            => $record->{'issn'},
+        isbn            => $record->{'isbn'},
         status          => $record->{'status'},
         overlay_status  => $record->{'overlay_status'},
         match_citation  => $match_citation,