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

{$layout.pagetitle}

{if $pagination->getTotal() != 0} {/if} {foreach $documentlist as $doc} {assign var=docid value=$doc.docid} {foreachelse} {/foreach} {if $pagination->getTotal() != 0} {/if}
{trans("Creation date")}{if $filter.order == "cdate"}{/if} / {trans("Confirmation date")}:{if $filter.order == "sdate"}{/if}
{trans("Number:")}
{trans("Created by")}{if $filter.order == "user"}{/if} / {trans("Confirmed by")}:{if $filter.order == "cuser"}{/if}
{trans("Type:")}{if $filter.order == "type"}{/if}
{trans("Title:")}{if $filter.order == "title"}{/if}
{trans("Period:")}
{trans("Reference document:")}
{trans("Customer:")}{if $filter.order == "customer"}{/if} {button icon="add" label="New Document" onclick="location.href = '?m=documentadd&cid={$filter.customer}&typeOD={$filter.type}';"}
{trans("Filter:")} {trans("Customer:")} {customerlist form="page" customers=$customers selected=$filter.customer selectname="customer" inputname="c" firstoption="- all customers -"} {trans("User:")} {if empty($users)} {else} {/if} {date_period_preset from="#documentlist [name=\"from\"]" to="#documentlist [name=\"to\"]"} {trans("from")} {trans("to")} {if !empty($numberplans) && count($numberplans)} {else} {/if} »»»
{persistent_filter}
{include file="pagination.html" form="page-form"}
{$doc.cdate|date_format:"%Y/%m/%d %H:%M"}{if $doc.sdate} / {$doc.sdate|date_format:"%Y/%m/%d %H:%M"}{/if} {if $doc.number}
{number number=$doc.number template=$doc.template time=$doc.cdate customerid=$doc.customerid} {/if}
{$doc.username} {if $doc.cuserid} / {$doc.cusername}{/if} {if $doc.closed == 3} {trans("(customer/sms)")} {elseif $doc.closed == 2} {trans("(customer/scans)")} {/if}
{assign var=type value=$doc.type}{$_DOCTYPES.$type}
{$doc.title|truncate:40:"...":true} {if $doc.fromdate || $doc.todate}
{if $doc.fromdate}{trans("from")} {$doc.fromdate|date_format:"%Y/%m/%d"}{/if} {if $doc.todate}{trans("to")} {$doc.todate|date_format:"%Y/%m/%d"}{/if} {/if} {if $doc.reference}
{t a=$_DOCTYPES[$doc.reference.type] b=$doc.reference.fullnumber c=$doc.reference.cdate|date_format:"%Y/%m/%d"}$a no. $b issued on $c{/t} {/if}
{$doc.name|truncate:40:"...":true} {$docattach = $doc.attachments[0]} {buttons} {if $doc.senddocuments} {textformat assign="tip" wrap=5000} {if $doc.senddate}{trans("Send document again")}
{t a=$doc.senddate|date_format:"%Y/%m/%d %H:%M"}(already sent on $a){/t}{else}{trans("Document send")}{/if} {/textformat} {button type="link" class="send-document" icon="{if $doc.senddate}mailsent{else}mail{/if}" href="?m=documentsend&id={$doc.docid}" tip=$tip} {/if} {assign var=type value=$doc.type} {button type="link" icon="save" href="?m=documentview&id={$doc.docid}&save=1" tip="Save"} {if ! $doc.closed && ($docrights.$type.rights & $smarty.const.DOCRIGHT_CONFIRM)} {button type="link" icon="confirm" href="?m=documentedit&id={$doc.docid}&action=confirm" tip="Confirm"} {/if} {if $doc.closed && !$doc.archived && ($docrights.$type.rights & $smarty.const.DOCRIGHT_ARCHIVE)} {button type="link" icon="archive" href="?m=documentedit&id={$doc.docid}&action=archive" tip="Archive" class="archive-document"} {/if} {if ($docrights.$type.rights & $smarty.const.DOCRIGHT_DELETE)} {button type="link" icon="delete" class="delete-document" href="?m=documentdel&id={$doc.docid}" tip="Remove document"} {/if} {if ($docrights.$type.rights & $smarty.const.DOCRIGHT_EDIT)} {button type="link" icon="edit" href="?m=documentedit&id={$doc.docid}" tip="Edit"} {/if} {if $docattach.type == 1 || count($doc.attachments) == 1} {documentview id="{$doc.docid}-{$docattach.id}" type=$docattach.contenttype name=$docattach.filename url="?m=documentview&id={$doc.docid}" external=true text="" tip="Preview"} {/if} {/buttons} {if count($doc.attachments) > 1 || $docattach.type < 1} {/if}

{trans("No such documents matching search criteria or list is empty.")}

{include file="pagination.html" form="page-form"}
{if count($documentlist) > 0}
{button icon="mail" label="Send documents" id="send-documents"} {button icon="print" label="Print" id="print-documents"} {button icon="confirm" label="Confirm" id="confirm-documents"} {button icon="archive" label="Archive" id="archive-documents"} {button icon="delete" label="Delete" id="delete-documents"}
{/if}
{/block}