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

{$layout.pagetitle|escape}

{$customers = array()} {foreach $itemlist as $item} {if !empty($item.customerid) && !isset($customers[$item.customerid])} {$customers[$item.customerid] = true} {/if} {/foreach}
{if !empty($message.startdate)} {$message.startdate|date_format:"Y-m-d H:i"} {/if} {if !empty($lastchanges[$smarty.const.MSG_SENT])} {/if} {if !empty($lastchanges[$smarty.const.MSG_DELIVERED])} {/if} {if !empty($lastchanges[$smarty.const.MSG_ERROR])} {/if} {if $message.sender} {/if} {if $filecontainers} {/if} {if !empty($summary)} {/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} {trans("Subject")} {$message.subject|escape}
{icon name="user"} {trans("User")} {if $message.userid} {$message.username|escape} {else} {LMS::SOFTWARE_NAME} {/if}
{icon name="calendar"} {trans("Creation date")} {$message.cdate|date_format:"Y-m-d H:i"}
{icon name="calendar"} {trans("Start date")}
{icon name="success"} {trans("Last success")} {$lastchanges[$smarty.const.MSG_SENT]|date_format:"Y-m-d H:i"}
{icon name="mail"} {trans("Last delivery")} {$lastchanges[$smarty.const.MSG_DELIVERED]|date_format:"Y-m-d H:i"}
{icon name="error"} {trans("Last error")} {$lastchanges[$smarty.const.MSG_ERROR]|date_format:"Y-m-d H:i"}
{icon name="mail"} {trans("Sender")} {$message.sender|escape:"html"}
{icon name="edit"} {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="attachment"} {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}
{/foreach} {button id="downloadzippedcontainer" onclick="location.href = '?m=attachments&attachmentaction=downloadzippedcontainer&type=messageid&id={$container.id}';" label="Download as zip archive" icon="download"} {/foreach}
{icon name="stats"} {trans("Summary")} {foreach $summary as $status => $count} {/foreach}
{trans("Status")} {trans("Volume")}
{$_MESSAGESTATUSES[$status].label} {$count}
{if ConfigHelper::checkPrivileges('messaging', 'messaging_removal')} {button id="delete-message" icon="delete" label="Delete"} {/if} {if (!empty($summary[$smarty.const.MSG_NEW]) || !empty($message.startdate) && !empty($summary[$smarty.const.MSG_ERROR])) && ConfigHelper::checkPrivileges('messaging', 'messaging_modification')} {button icon="cancel" label="Cancel" href="?m=messagecancel&id={$message.id}"} {/if} {if !empty($itemerrorlist) && ConfigHelper::checkPrivileges('messaging', 'messaging_modification')} {button icon="reload" label="Increase attempts" href="?m={$layout.module}&id={$message.id}&action=increase-attempts"} {/if} {if ConfigHelper::checkPrivileges('messaging', 'messaging_creation')} {capture assign="content"}
{icon name="customer"} {trans("Recipients")}
{button icon="submit" label="Next" id="resend-button"}
{/capture} {hint icon="reload" label="Resend" class="lms-ui-link-button" id="resend-message-button" content=$content} {/if}

{if empty($message.startdate)} {$colspan=6} {else} {$colspan=7} {/if} {if !empty($message.startdate)} {/if} {if !empty($message.startdate)} {/if} {if $listdata.total != 0} {/if} {section name=itemlist loop=$itemlist start=$start max=$pagelimit} {$item = $itemlist[itemlist]} {if !empty($message.startdate)} {/if} {sectionelse} {/section} {if $listdata.total != 0} {/if}
{trans("Customer")} {if $listdata.order == "customer"} {/if} {trans("Destination")} {if $listdata.order == "destination"} {/if} {trans("Status")} ({trans("Description")}) {if $listdata.order == "status"} {/if} {trans("Last change")} {trans("Attempts left")} {trans("Last read")} {t a=$listdata.total}Total: $a{/t}
{icon name="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")} {if $item.error} ({$item.error|escape}){/if} {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")} {elseif $item.status == $smarty.const.MSG_CANCELLED} {trans("cancelled")} {elseif $item.status == $smarty.const.MSG_BOUNCED} {trans("bounced")} {elseif $item.status == $smarty.const.MSG_READY_TO_SEND} {trans("ready to send")} {else} {trans("waiting")} {/if} {if $item.lastdate}{$item.lastdate|date_format:"Y-m-d H:i"}{else} - {/if} {if !empty($item.attempts)} {icon name="reload" class="fa-fw"} {/if} {$item.attempts} {if $item.lastreaddate}{$item.lastreaddate|date_format:"Y-m-d H:i"}{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}