+++ fix for Smarty 5
This commit is contained in:
@@ -1660,18 +1660,18 @@ function _cleanvar($var)
|
||||
if (!empty($request_author))
|
||||
$history['dialog']['request'] = array_merge($history['dialog']['request'], $request_author);
|
||||
|
||||
// ответы
|
||||
foreach ($history['dialog']['response'] as &$response)
|
||||
{
|
||||
$response_author = $AVE_DB->Query("
|
||||
SELECT user_name, firstname, lastname
|
||||
FROM " . PREFIX . "_users
|
||||
WHERE Id = '" . $response['user_id'] . "'
|
||||
")->FetchAssocArray();
|
||||
// ответы
|
||||
foreach ($history['dialog']['response'] ?? [] as &$response)
|
||||
{
|
||||
$response_author = $AVE_DB->Query("
|
||||
SELECT user_name, firstname, lastname
|
||||
FROM " . PREFIX . "_users
|
||||
WHERE Id = '" . $response['user_id'] . "'
|
||||
")->FetchAssocArray();
|
||||
|
||||
if (!empty($response_author))
|
||||
$response = array_merge($response, $response_author);
|
||||
}
|
||||
if (!empty($response_author))
|
||||
$response = array_merge($response, $response_author);
|
||||
}
|
||||
|
||||
// форма ответа
|
||||
if (empty($history['dialog']['response_draft']))
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
$fid = parseInt('{$fid}');
|
||||
$sess = '{$sess}';
|
||||
$smarty = new Array;
|
||||
$smarty['start_alert'] = '{$alert.text}';
|
||||
$smarty['start_alert_theme'] = '{$alert.theme}';
|
||||
$smarty['start_alert'] = '{$alert.text|default:''}';
|
||||
$smarty['start_alert_theme'] = '{$alert.theme|default:''}';
|
||||
</script>
|
||||
|
||||
<div class="title">
|
||||
@@ -91,38 +91,38 @@ $smarty['start_alert_theme'] = '{$alert.theme}';
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{if $dialog.response}
|
||||
<tr>
|
||||
<td colspan="2"><h5>{if $dialog.response|@count == 1}{#response#}{else}{#responses#}{/if}</h5></td>
|
||||
</tr>
|
||||
{foreach from=$dialog.response item=item}
|
||||
<tr>
|
||||
<td valign="middle">
|
||||
{if $item.user_name}
|
||||
[<a target="_blank" href="index.php?do=user&action=edit&Id={$item.user_id}&cp={$sess}" class="toprightDir" title="{#profile_look#}">{$item.user_name}</a>] {if $item.firstname || $item.lastname}{$item.firstname} {$item.lastname}{/if}<br/>
|
||||
{/if}
|
||||
{#from#} <a href="mailto:{$item.from_email}" title="{#write_email#}" class="toprightDir">{$item.from_email}</a> <{$item.from_name|escape}><br/>
|
||||
<span class="date_text dgrey">{$item.date|date_format:$TIME_FORMAT|pretty_date}</span>
|
||||
</td>
|
||||
<td>
|
||||
{if $item.format=='text'}
|
||||
<div style="white-space:pre">{$item.body}</div>
|
||||
{else}
|
||||
{$item.body}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr class="{if $status==='replied'}yellow{/if}">
|
||||
<td colspan="2" style="padding:15px 10px;">
|
||||
{if $status!=='replied'}<a href="index.php?do=modules&action=modedit&mod=forms&moduleaction=dialog_status&hid={$hid}&status=replied&fid={$fid}&cp={$sess}" class="btn redBtn">{#set_replied#}</a>
|
||||
{else}
|
||||
<strong>{#marked_replied#}</strong>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{if !empty($dialog.response)}
|
||||
<tr>
|
||||
<td colspan="2"><h5>{if $dialog.response|@count == 1}{#response#}{else}{#responses#}{/if}</h5></td>
|
||||
</tr>
|
||||
{foreach from=$dialog.response item=item}
|
||||
<tr>
|
||||
<td valign="middle">
|
||||
{if $item.user_name|default:false} <-- ИСПРАВЛЕНИЕ: Проверяем user_name безопасно
|
||||
[<a target="_blank" href="index.php?do=user&action=edit&Id={$item.user_id}&cp={$sess}" class="toprightDir" title="{#profile_look#}">{$item.user_name}</a>] {if $item.firstname|default:false || $item.lastname|default:false}{$item.firstname|default:''} {$item.lastname|default:''}{/if}<br/>
|
||||
{/if}
|
||||
{#from#} <a href="mailto:{$item.from_email}" title="{#write_email#}" class="toprightDir">{$item.from_email}</a> <{$item.from_name|escape}><br/>
|
||||
<span class="date_text dgrey">{$item.date|date_format:$TIME_FORMAT|pretty_date}</span>
|
||||
</td>
|
||||
<td>
|
||||
{if $item.format=='text'}
|
||||
<div style="white-space:pre">{$item.body}</div>
|
||||
{else}
|
||||
{$item.body}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr class="{if $status==='replied'}yellow{/if}">
|
||||
<td colspan="2" style="padding:15px 10px;">
|
||||
{if $status!=='replied'}<a href="index.php?do=modules&action=modedit&mod=forms&moduleaction=dialog_status&hid={$hid}&status=replied&fid={$fid}&cp={$sess}" class="btn redBtn">{#set_replied#}</a>
|
||||
{else}
|
||||
<strong>{#marked_replied#}</strong>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -148,16 +148,18 @@ $smarty['start_alert_theme'] = '{$alert.theme}';
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{#mfld_subject#}:</td>
|
||||
<td><input type="text" name="subject" placeholder="{#mfld_subject#}" class="mousetrap" value="{$dialog.response_draft.subject|escape|default:"RE: $subject"}"/></td>
|
||||
<td><input type="text" name="subject" placeholder="{#mfld_subject#}" class="mousetrap" value="{($dialog.response_draft.subject|default:'')|escape|default:"RE: $subject"}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{#format#}:</td>
|
||||
<td>
|
||||
<input class="mousetrap" type="radio" name="format" value="text" {if $dialog.response_draft.format!='html'}checked="checked"{/if}/>
|
||||
<label>{#text#}</label>
|
||||
<input class="mousetrap" type="radio" name="format" value="html" {if $dialog.response_draft.format=='html'}checked="checked"{/if}/>
|
||||
<label>HTML</label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="mousetrap" type="radio" name="format" value="text"
|
||||
{if $dialog.response_draft.format|default:'text'!='html'}checked="checked"{/if}/>
|
||||
<label>{#text#}</label>
|
||||
<input class="mousetrap" type="radio" name="format" value="html"
|
||||
{if $dialog.response_draft.format|default:''=='html'}checked="checked"{/if}/>
|
||||
<label>HTML</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{#body#}</td>
|
||||
|
||||
Reference in New Issue
Block a user