Skip to content

Commit

Permalink
warn user if no templates_id selected in notification_notificationtem…
Browse files Browse the repository at this point in the history
…plate; fix #2963

clean red class
  • Loading branch information
orthagh authored and trasher committed Feb 22, 2018
1 parent fe92502 commit c6189b7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion inc/notification_notificationtemplate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,17 @@ static function showForNotification(Notification $notif, $withtemplate = 0) {
$tpl = new NotificationTemplate();
$tpl->getFromDB($data['notificationtemplates_id']);

$tpl_link = $tpl->getLink();
if (empty($tpl_link)) {
$tpl_link = "<i class='fa fa-exclamation-triangle red'></i>&nbsp;
<a href='".$notiftpl->getLinkUrl()."'>".
__("No template selected").
"</a>";
}

echo "<tr class='tab_bg_2'>";
echo "<td>".$notiftpl->getLink()."</td>";
echo "<td>".$tpl->getLink()."</td>";
echo "<td>$tpl_link</td>";
$mode = self::getMode($data['mode']);
if ($mode === NOT_AVAILABLE) {
$mode = "{$data['mode']} ($mode)";
Expand Down

0 comments on commit c6189b7

Please sign in to comment.