Skip to content

Commit

Permalink
FIX More specific id for report preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Nyeholt committed Sep 15, 2015
1 parent 2946706 commit 936c04e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/admin/AdvancedReportsAdminItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function ItemEditForm() {

if($this->record->isInDB() && $this->record->canGenerate()) {
$form->Actions()->merge(array(
FormAction::create('preview', '')
FormAction::create('reportpreview', '')
->setTitle(_t('AdvancedReport.PREVIEW', 'Preview'))
->setAttribute('target', '_blank')
->setAttribute('data-icon', 'preview'),
Expand All @@ -25,7 +25,7 @@ public function ItemEditForm() {
return $form;
}

public function preview($data, $form) {
public function reportpreview($data, $form) {
$data = $form->getData();
$format = $data['PreviewFormat'];

Expand Down
4 changes: 2 additions & 2 deletions javascript/advanced-report-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
}
})

$(document).on('click', '#action_preview', function (e) {
$(document).on('click', '#action_reportpreview', function (e) {
e.preventDefault();
var form = $(this).parents('form');
var url = form.attr('action');
var base = $('base').attr('href');


url = base + url + '?action_preview=1&' + form.serialize();
url = base + url + '?action_reportpreview=1&' + form.serialize();
window.open(url);
return false;
})
Expand Down

0 comments on commit 936c04e

Please sign in to comment.