{css} {js}
{tab_container id="customerdocuments"} {tab_header content_id="docpanel"} {tab_header_cell icon="lms-ui-icon-document"} {trans("Customer's Documents:")} ({t a=$limit}last $a documents{/t}) {/tab_header_cell} {tab_header_cell} {trans("New Document")} » {trans("All Documents")} » {/tab_header_cell} {/tab_header} {tab_contents id="docpanel"} {tab_table} {if $documents}
{trans("Number:")}
{trans("Creation date")} / {trans("Confirmation date")}:
{trans("Created by")} / {trans("Confirmed by")}:
{trans("Type:")}
{trans("Title:")}
{trans("Description:")}
{trans("Period:")}
 
{/if} {foreach $documents as $doc}
{number number=$doc.number template=$doc.template time=$doc.cdate}
{$doc.cdate|date_format:"%Y/%m/%d %H:%M"}{if $doc.sdate} / {$doc.sdate|date_format:"%Y/%m/%d %H:%M"}{/if}
{$doc.username}{if $doc.cusername} / {$doc.cusername}{/if}
{assign var=type value=$doc.type}{$_DOCTYPES.$type}
{$doc.title|truncate:40:"...":true}
{if $doc.description} {$doc.description|replace:"\n":'
'} {else} – {/if}
{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 $customerinfo.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-doc" 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" href="?m=documentedit&id={$doc.docid}&action=archive" class="archive-doc" icon="archive" tip="Archive"} {/if} {if ($docrights.$type.rights & $smarty.const.DOCRIGHT_DELETE)} {button type="link" class="delete-doc" href="?m=documentdel&id={$doc.docid}" icon="delete" onclick=$onclick 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} {$docattach = $doc.attachments[0]} {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=""} {/if} {if count($doc.attachments) > 1 || !$docattach.type < 1} {/if}
{foreachelse}
{trans("That customer hasn't got any documents.")}
{/foreach} {/tab_table} {if !empty($documents) && count($documents)} {tab_button_panel} {tab_buttons} {/tab_buttons} {tab_buttons} {/tab_buttons} {/tab_button_panel} {/if} {/tab_contents} {/tab_container}