Skip to content

Commit

Permalink
Merge pull request techjoomla#179 from twsvaishali/release-1.1.5
Browse files Browse the repository at this point in the history
Task #156044 Fix : TjReport Bulk Email sending
  • Loading branch information
vaivk369 authored Feb 11, 2020
2 parents b1f3eb7 + 82c60f8 commit 1ec6eb5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tjreports/site/assets/js/tjrContentUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ jQuery.extend(tjrContentUI.report, {

// If sendEmail plug is enabled then try to add a column of checkboxes
if (
typeof window.tjSendEmail != 'undefined' &&
typeof tjutilitysendemail != 'undefined' &&
jQuery('body').find('.td-sendemail').length > 0
)
{
window.tjemail = new window.tjSendEmail.UI("report-table", "td-sendemail", "cid");
tjutilitysendemail.addColumn('report-table');
tjutilitysendemail.btnSendEmail();
}

// Reinitialze some js like for calandar, tooltip, chosen
Expand Down
23 changes: 20 additions & 3 deletions tjreports/site/views/reports/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

$emailColmClass = 'td-sendemail';

$emailColumCnt = 0;
$app = Factory::getApplication();
$headerLevel = $this->headerLevel;
$this->listOrder = $this->state->get('list.ordering');
Expand Down Expand Up @@ -231,6 +231,8 @@
?>
</ul>
</div>
<span id="sendEmail">
</span>
<!--/col-md-2-->
<?php
if (!$app->isClient('administrator') && $userAuthorisedExport && $user)
Expand Down Expand Up @@ -440,8 +442,15 @@
}
else
{
$isSendEmailClass = ($key == $this->emailColumn) ? $emailColmClass : '';
$value = isset($item[$key]) ? $item[$key] : '';
$isSendEmailClass = '';

if ($key == $this->emailColumn)
{
$isSendEmailClass = $emailColmClass;
$emailColumCnt++;
}

$value = isset($item[$key]) ? $item[$key] : '';
echo "<td class=\"{$key} {$isSendEmailClass} \">{$value}</td>";
}
}
Expand Down Expand Up @@ -501,3 +510,11 @@
<!-- COM_TJLMS_WRAPPER_DIV -->
</div>
<!-- reports-container -->
<!-- reports-container -->
<?php
// If plg_system_sendemail enable then load following js
if ($emailColumCnt > 0 && JPluginHelper::isEnabled('system', 'tjsendemail'))
{
JHtml::script('media/editors/tinymce/tinymce.min.js');
JHtml::script('plugins/system/tjsendemail/bulksendemail.min.js');
}

0 comments on commit 1ec6eb5

Please sign in to comment.