Skip to content

Commit

Permalink
Fix #404: Invite notification - Empty block
Browse files Browse the repository at this point in the history
  • Loading branch information
serh-mosk committed Aug 2, 2023
1 parent 9753395 commit 3b213cb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
30 changes: 15 additions & 15 deletions widgets/mails/views/eventInfoHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,59 @@

use humhub\libs\Html;
use humhub\modules\calendar\interfaces\event\CalendarEventIF;
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;
use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\content\widgets\richtext\converter\RichTextToEmailHtmlConverter;
use humhub\widgets\mails\MailButton;
use humhub\widgets\mails\MailButtonList;

/* @var $event CalendarEventIF */
/* @var $url string */
/* @var $extraInfo string*/
/* @var $extraInfo string */

if(!isset($url)) {
if (!isset($url)) {
$url = $event->getUrl();
}

$formatter = new CalendarDateFormatter(['calendarItem' => $event]);

?>

<div style="overflow:hidden">
<table width="100%" style="table-layout:fixed;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td colspan="2" style="word-wrap:break-word;padding-top:5px; padding-bottom:5px; font-size: 14px; line-height: 22px; font-family:Open Sans,Arial,Tahoma, Helvetica, sans-serif; color:<?= Yii::$app->view->theme->variable('text-color-main', '#777') ?>; font-weight:300; text-align:left;">
<td colspan="2"
style="word-wrap:break-word;padding-top:5px; padding-bottom:5px; font-size: 14px; line-height: 22px; font-family:Open Sans,Arial,Tahoma, Helvetica, sans-serif; color:<?= Yii::$app->view->theme->variable('text-color-main', '#777') ?>; font-weight:300; text-align:left;">

<?php if(!empty($event->getTitle())) :?>
<h1><?= Html::encode($event->getTitle())?></h1>
<?php if (!empty($event->getTitle())): ?>
<h1><?= Html::encode($event->getTitle()) ?></h1>
<?php endif; ?>

<?php if(!empty($event->getStartDateTime())) : ?>
<?php if (!empty($event->getStartDateTime())): ?>
<?= Yii::t('CalendarModule.mail', '<strong>Starting</strong> {date}', [
'date' => $formatter->getFormattedTime()
]) ?>
<br>
<?php endif; ?>

<?php if($event instanceof CalendarEventParticipationIF) : ?>
<?php if($event->getOrganizer()) : ?>
<?php if ($event instanceof CalendarEventParticipationIF): ?>
<?php if ($event->getOrganizer()) : ?>
<b><?= Yii::t('CalendarModule.mail', 'Organized by {userName}', ['userName' => Html::encode($event->getOrganizer()->displayName)]) ?></b>
<?php endif; ?>
<?php endif; ?>

<?php if(!empty($event->getLocation())) : ?>
<b><?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= Html::encode($event->getLocation())?></b>
<?php if (!empty($event->getLocation())): ?>
<b><?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= Html::encode($event->getLocation()) ?></b>
<br>
<?php endif; ?>

<?php if(!empty($event->getDescription())) : ?>
<?php if (!empty($event->getDescription())): ?>
<p><?= RichTextToEmailHtmlConverter::process($event->getDescription()) ?></p>
<?php endif; ?>

<?php if(isset($extraInfo)) : ?>
<?php if (isset($extraInfo) && !empty($extraInfo)): ?>
<h2><?= Yii::t('CalendarModule.mail', 'Additional information:'); ?></h2>
<p><?= RichTextToEmailHtmlConverter::process($extraInfo) ?></p>
<?php endif; ?>

</td>
</tr>
</table>
Expand Down
44 changes: 19 additions & 25 deletions widgets/mails/views/eventInfoText.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,47 @@

use humhub\libs\Html;
use humhub\modules\calendar\interfaces\event\CalendarEventIF;
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;
use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\content\widgets\richtext\RichText;
use humhub\widgets\mails\MailButton;
use humhub\widgets\mails\MailButtonList;

/* @var $event CalendarEventIF */
/* @var $url string */
/* @var $extraInfo string*/
/* @var $extraInfo string */

if(!isset($url)) {
if (!isset($url)) {
$url = $event->getUrl();
}

$formatter = new CalendarDateFormatter(['calendarItem' => $event])

?>
<?= $event->getTitle() ?>


<?php if(!empty($event->getStartDateTime())) : ?>
<?= strip_tags(Yii::t('CalendarModule.mail', '<strong>Starting</strong> {date}', [
'date' => $formatter->getFormattedTime()
])) ?>
<?php if (!empty($event->getStartDateTime())): ?>
<?= strip_tags(Yii::t('CalendarModule.mail', '<strong>Starting</strong> {date}', [
'date' => $formatter->getFormattedTime()
])) ?>
<?php endif; ?>
<?php if($event instanceof CalendarEventParticipationIF) : ?>
<?php if($event->getOrganizer()) : ?>


<?= Yii::t('CalendarModule.mail', 'Organized by {userName}', ['userName' => $event->getOrganizer()->displayName]) ?>

<?php if ($event instanceof CalendarEventParticipationIF): ?>
<?php if ($event->getOrganizer()): ?>
<?= Yii::t('CalendarModule.mail', 'Organized by {userName}', ['userName' => $event->getOrganizer()->displayName]) ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php if(!empty($event->getLocation())) : ?>

<?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= $event->getLocation() ?>

<?php if (!empty($event->getLocation())): ?>
<?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= $event->getLocation() ?>
<?php endif; ?>
<?php if(!empty($event->getDescription())) : ?>

<?= RichText::preview($event->getDescription()) ?>

<?php if (!empty($event->getDescription())): ?>
<?= RichText::preview($event->getDescription()) ?>
<?php endif; ?>
<?php if(isset($extraInfo)) : ?>
<?= Yii::t('CalendarModule.mail', 'Additional information:'); ?>


<?= RichText::preview($extraInfo) ?>
<?php if (isset($extraInfo) && !empty($extraInfo)): ?>
<?= Yii::t('CalendarModule.mail', 'Additional information:'); ?>
<?= RichText::preview($extraInfo) ?>
<?php endif; ?>

<?= Yii::t('CalendarModule.mail', 'View Online: {url}', ['url' => $url]); ?>

0 comments on commit 3b213cb

Please sign in to comment.