{extends file="layout.html"} {block name=title}LMS: {$layout.pagetitle|striphtml}{/block} {block name=module_content}

{$layout.pagetitle}

{if $message.sender} {/if} {if $filecontainers} {/if}
{if $message.type == $smarty.const.MSG_SMS} {$icon = "sms"} {elseif $message.type == $smarty.const.MSG_WWW} {$icon = "www"} {elseif $message.type == $smarty.const.MSG_USERPANEL || $message.type == $smarty.const.MSG_USERPANEL_URGENT} {$icon = "userpanel"} {else} {$icon = "mail"} {/if} {icon name=$icon class="fa-fw"} {trans("Subject:")} {$message.subject}
{icon name="user" class="fa-fw"} {trans("User:")} {if $message.userid} {$message.username} {else}LMS{/if}
{icon name="calendar" class="fa-fw"} {trans("Creation date:")} {$message.cdate|date_format:"%Y/%m/%d %H:%M"}
{icon name="mail" class="fa-fw"} {trans("Sender:")} {$message.sender|escape:"html"}
{icon name="edit" class="fa-fw"} {trans("Message body:")}
{if $message.contenttype == 'text/plain'} {nl2br(htmlspecialchars($message.body), false)} {elseif $message.contenttype == 'text/html'} {$message.body} {else} {nl2br($message.body, false)} {/if}
{icon name="upload" class="fa-fw"} {trans("Attachments:")} {foreach $filecontainers as $container} {foreach $container.files as $file} {documentview id="{$container.id}-{$file.id}" type=$file.contenttype name=$file.filename url="?m=attachments&attachmentaction=viewfile&type=messageid&id={$container.id}&fileid={$file.id}" external=true text="{$file.filename} "}
{/foreach} {button id="downloadzippedcontainer" onclick="location.href = '?m=attachments&attachmentaction=downloadzippedcontainer&type=messageid&id={$container.id}';" label="Download as zip archive" icon="fileupload"} {/foreach}
{button id="delete-message" icon="delete" label="Delete"} {button icon="cancel" label="Cancel" onclick="location.href = '?m=messagelist';"} {button icon="resend" label="Resend" onclick="location.href = '?m=messageadd&messageid={$message.id}';"}

{if $listdata.total != 0} {/if} {section name=itemlist loop=$itemlist start=$start max=$pagelimit} {assign var=item value=$itemlist[itemlist]} {sectionelse} {/section} {if $listdata.total != 0} {/if}
{trans("Customer:")} {if $listdata.order == "customer"}{/if} {trans("Destination:")} {if $listdata.order == "destination"}{/if} {trans("Status:")} ({trans("Error message")}) {if $listdata.order == "status"}{/if} {trans("Last read on:")} {trans("Was confirm on:")} ({trans("only userpanel message")}) {t a=$listdata.total}Total: $a{/t} 
{trans("Filter:")}     {trans("Status:")}  »»»
{include file="scroller.html" loop=$itemlist scrollerno=1}
{if $item.customerid} {$item.customer|truncate:45:"...":true} ({$item.customerid|string_format:"%04d"}) {else} {trans("none")} {/if} {trans("{$item.destination|escape}")} {if $item.body} {/if} {if $item.status == $smarty.const.MSG_SENT} {trans("sent")} {elseif $item.status == $smarty.const.MSG_ERROR} {trans("errornous")}{if $item.error} ({$item.error|escape}){/if} {elseif $item.status == $smarty.const.MSG_DELIVERED} {trans("delivered")} ({$item.lastdate|date_format:"%Y/%m/%d %H:%M"}) {else} {trans("waiting")} {/if} {if $item.lastreaddate}{$item.lastreaddate|date_format:"%Y/%m/%d %H:%M"}{else} - {/if} {if $item.status == $smarty.const.MSG_DELIVERED && ($message.type == $smarty.const.MSG_USERPANEL || $message.type == $smarty.const.MSG_USERPANEL_URGENT || $message.type == $smarty.const.MSG_WWW) && $item.lastdate}{$item.lastdate|date_format:"%Y/%m/%d %H:%M"}{else} - {/if} {if $item.body} {button type="link" icon="info" tip="Show message body"} {/if}

{trans("No such recipients in database.")}

{include file="scroller.html" loop=$itemlist scrollerno=2}
{t a=$listdata.total}Total: $a{/t}
{/block}