{extends file="layout.html"} {block name=title}LMS: {$layout.pagetitle|striphtml}{/block} {block name=module_content} {$document_confirm_date_required = intval(ConfigHelper::getConfig('phpui.document_confirm_date_required'))}

{$layout.pagetitle}

{$xajax}
{if $customer.id}{$cid=$customer.id}{elseif $document.customerid}{$cid=$document.customerid}{else}{$cid=""}{/if} {include file="document/documentreference.html"} {block name="documentpluginreference"} {/block}
{icon name="type"} {trans("Type:")}
{icon name="template"} {trans("Template:")}
{icon name="document"} {trans("Title:")}
{icon name="customer"} {trans("Customer:")} {customerlist customers=$customers selected=$cid version=2 selectname="customer" input_id="customerid_input" inputname="customerid" required=true customOnChange="CustomerChanged();"}
{icon name="id"} {trans("Number:")} {numberplan_selection customer_selector = "#customerid_input" doctype_selector = "#doctype" cdate_selector = "[name='document[cdate]']" numberplanlist = $numberplans input_name = "document[number]" input_value = $document.number select_name = "document[numberplanid]" selected = $document.numberplanid number_trigger = "number" plan_trigger = "numberplanid" time = $document.cdate customer_id = $cid planDocumentType = $planDocumentType reference_selector = '#refdoc' }
{icon name="calendar"} {trans("Consent date")} {if ConfigHelper::checkPrivilege("document_consent_date")} {if $document.cdatewarning} {/if} {else} {$document.cdate|date_format:"Y-m-d"} {/if}
{icon name="period"} {trans("Period")}
{capture assign="hint"}{strip} The validity date range of the document is determined upon its approval. {/strip}{/capture}
{hint content=$hint}
{$allow_past_date = ConfigHelper::checkConfig('documents.allow_past_date', true)}
{date_period_preset from="#fromdate" to="#todate" periods="previous-year,previous-month,current-year,current-month,next-month,next-year"}
{icon name="service"} {trans("Service start")}
{icon name="period"} {trans("Wait for customer action till:")}
{icon name="description"} {trans("Description:")}
{button icon="save" class="operation-button" id="submit-button" label="Submit"} {button icon="cancel" label="Cancel" onclick="location.href = '?m=documentlist';"}
{button icon="print" class="operation-button" id="print-button" label="Print"}
{if !empty($promotions)} {block name="documentpromotions"} {include file="document/documentpromotions.html"} {/block} {/if} {block name="document-consents"} {include file="document/documentconsents.html"} {/block}
{$plugin_result}
{$script_result}
{/block}