Skip to content

Commit

Permalink
Merge branch 'add-callbacks'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Crome committed Sep 20, 2024
2 parents e30335f + a67e80f commit 2ce342c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion html/Elements/XLSXExport
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ while (my $row = $Collection->Next) {
$workbook->close();

binmode $fh;
$r->content_type('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
$r->content_type('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') unless defined wantarray;

$m->print($xlsx_file);
$fh->close;
Expand Down
8 changes: 8 additions & 0 deletions html/Search/Results.xlsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,13 @@ if ( $Class eq 'RT::Assets' && !$Format ) {
$Format .= "'__CF.{$_}__/TITLE:$_', " for map {$_ = $_->Name; s/['\\]/\\$1/g; $_} @{$CFs->ItemsArrayRef};
}

$m->callback(
CallbackName => 'BeforeExport',
ARGSRef => \%ARGS,
Collection => $collection,
Format => $Format,
PreserveNewLines => $PreserveNewLines,
%ARGS,
);
$m->comp( "/Elements/XLSXExport", Collection => $collection, Format => $Format, PreserveNewLines => $PreserveNewLines );
</%INIT>

0 comments on commit 2ce342c

Please sign in to comment.