$text = CRM_Utils_Request::retrieve('text', 'Boolean', $form);
if ($text) {
- echo "<pre>{$textHeader}</br>{$report['mailing']['body_text']}</br>{$textFooter}</pre>";
- CRM_Utils_System::civiExit();
+ CRM_Core_Page_AJAX::returnJsonResponse("<pre>{$textHeader}</br>{$report['mailing']['body_text']}</br>{$textFooter}</pre>");
}
if (!$isSMS) {
$html = CRM_Utils_Request::retrieve('html', 'Boolean', $form);
if ($html) {
$output = $htmlHeader . $report['mailing']['body_html'] . $htmlFooter ;
- echo str_replace( "\n", '<br />', $output );
- CRM_Utils_System::civiExit();
+ CRM_Core_Page_AJAX::returnJsonResponse(str_replace("\n", '<br />', $output));
}
}
if (!empty($report['mailing']['body_text'])) {
$url = CRM_Utils_System::url('civicrm/mailing/report', 'reset=1&text=1&mid=' . $form->_mailing_id);
- $popup = "javascript:popUp(\"$url\");";
- $form->assign('textViewURL', $popup);
+ $form->assign('textViewURL', $url);
}
if (!$isSMS) {
if (!empty($report['mailing']['body_html'])) {
$url = CRM_Utils_System::url('civicrm/mailing/report', 'reset=1&html=1&mid=' . $form->_mailing_id);
- $popup = "javascript:popUp(\"$url\");";
- $form->assign('htmlViewURL', $popup);
+ $form->assign('htmlViewURL', $url);
}
}
}
}
}
-/**
- * @deprecated
- */
-function popUp(URL) {
- day = new Date();
- id = day.getTime();
- eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=420,left = 202,top = 184');");
-}
/**
* Function to show / hide the row in optionFields
{$mailingReport.mailing.body_text|mb_truncate:30|escape|nl2br}
<br />
{if $values.mailingId}
- <strong><a href='{$textViewURL}'>» {ts}View complete message{/ts}</a></strong>
+ <strong><a class="crm-popup" href='{$textViewURL}'>» {ts}View complete message{/ts}</a></strong>
{/if}
</td>
</tr>
{$mailingReport.mailing.body_html|mb_truncate:30|escape|nl2br}
<br/>
{if $values.mailingId}
- <strong><a href='{$htmlViewURL}'>» {ts}View complete message{/ts}</a></strong>
+ <strong><a class="crm-popup" href='{$htmlViewURL}'>» {ts}View complete message{/ts}</a></strong>
{/if}
</td>
</tr>
<td>
{$report.mailing.body_text|mb_truncate:30|escape|nl2br}
<br />
- <strong><a href='{$textViewURL}'>» {ts}View complete message{/ts}</a></strong>
+ <strong><a class="crm-popup" href='{$textViewURL}'>» {ts}View complete message{/ts}</a></strong>
</td>
</tr>
{/if}
<td>
{$report.mailing.body_html|mb_truncate:30|escape|nl2br}
<br/>
- <strong><a href='{$htmlViewURL}'>» {ts}View complete message{/ts}</a></strong>
+ <strong><a class="crm-popup" href='{$htmlViewURL}'>» {ts}View complete message{/ts}</a></strong>
</td>
</tr>
{/if}