{extends file="layout.html"} {block name=title}LMS: {$layout.pagetitle|striphtml}{/block} {block name=module_content} {$hide_disabled_users = ConfigHelper::checkConfig('documents.hide_disabled_users')} {$hide_deleted_users = ConfigHelper::checkConfig('documents.hide_deleted_users')}

{$layout.pagetitle}

{$default_all_attachments = ConfigHelper::checkConfig('documents.default_all_attachments')} {if $pagination->getTotal() != 0} {/if} {foreach $documentlist as $doc} {assign var=docid value=$doc.docid} {if empty($doc.attachments)} {$doc.attachments = array()} {/if} {$docattach = reset($doc.attachments)} {capture assign="url"}?m=documentview&id={$doc.docid}{if $default_all_attachments}&attachments=1{elseif $doc.attachments|size == 1}&attachmentid={$docattach.id}{/if}{/capture} {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{if !empty($filter.customer)}&cid={$filter.customer}{/if}{if !empty($filter.type) && count($filter.type) == 1}&type={reset($filter.type)}{/if}';"}
{trans("Filter:")} {trans("Customer:")} {customerlist form="documentlist" 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 $numberplans|size} {else} {/if} »»»
{persistent_filter}
{include file="pagination.html" form="page-form"}
{$doc.cdate|date_format:"Y-m-d H:i"}{if $doc.sdate} / {$doc.sdate|date_format:"Y-m-d H:i"}{/if} {if $doc.closed == $smarty.const.DOC_OPEN && $doc.confirmdate} {hint text=$doc.confirmdate|date_format:"Y-m-d H:i" icon="wait"} {/if} {if $doc.number}
{number number=$doc.number template=$doc.template time=$doc.cdate customerid=$doc.customerid} {/if}
{$doc.username|escape} {if $doc.cuserid} / {$doc.cusername|escape}{/if} {if $doc.closed == $smarty.const.DOC_CLOSED_AFTER_CUSTOMER_SMS} {if !$doc.cuserid} {icon name="sms" tip="customer has accepted document via sms"} {/if} {elseif $doc.closed == $smarty.const.DOC_CLOSED_AFTER_CUSTOMER_SCAN} {icon name="sign" tip="attached document scans with customer signature"} {/if}
{assign var=type value=$doc.type}{$_DOCTYPES.$type}
{$doc.title|truncate:40:"…":true} {if $doc.description} {hint icon="info" content=$doc.description|escape|replace:"\n":'
'} {/if} {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 empty($doc.closed) && ($doc.fromdate || $doc.todate) && !empty($doc.dynamicperiod)}{trans("(dynamic)")}{/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} {block name="documentlistpluginreference"} {/block}
{$doc.name|truncate:40:"…":true} {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:i"}(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 || $doc.attachments|size == 1} {documentview id="global-{$doc.docid}-{$docattach.id}" type=$docattach.contenttype name=$docattach.filename url=$url external=true text="" tip="Preview"} {/if} {/buttons} {if $doc.attachments|size > 1 || $docattach.type < 1} {/if}
{trans("No such documents matching search criteria or list is empty.")}
{include file="pagination.html" form="page-form"}
{if $documentlist|size}
{button icon="mail" label="Send documents" id="send-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"}
{button icon="print" label="Print" id="print-documents"}
{/if}
{/block}