initial draft
This commit is contained in:
+193
@@ -0,0 +1,193 @@
|
||||
<cfsilent>
|
||||
<cfimport prefix="m" taglib="lib"/>
|
||||
<cfimport prefix="c" taglib="lib/controls"/>
|
||||
<cfimport prefix="d" taglib="lib/data"/>
|
||||
<cfimport prefix="layout" taglib="layout"/>
|
||||
</cfsilent><m:silent silent="No">
|
||||
|
||||
<cffunction name="plain2HtmClean">
|
||||
<cfargument name="s" type="string"/>
|
||||
<cfreturn request.plain2htm(request.cleanHtm(s))/>
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="cleanInput">
|
||||
<cfargument name="s" type="string"/>
|
||||
<cfreturn htmlEditFormat(s)/>
|
||||
</cffunction>
|
||||
|
||||
<m:prepare_detail entity="contract" accessObject="" key="contract_id" pageInfoOut="pageInfo"/>
|
||||
|
||||
<d:bean readonly=#!pageInfo.writePermitted()# table="contract" datasource="#request.DS#" output="d" status="pageInfo.status">
|
||||
<d:param field="contract_id" type="integer" key autoincrement/>
|
||||
<d:param field="contragent_id" type="integer"/>
|
||||
<d:param field="contract" type="varchar" size="255" preprocessor=#cleanInput#/>
|
||||
<d:param field="dt_contract" type="timestamp" format="yyyy-MM-dd" preprocessor=#cleanInput# forNull="" init="#Now()#"/><!--- !!! Important yyyy-MM-dd NOT YYYY-MM-DD --->
|
||||
<d:param field="descr" type="varchar" preprocessor=#plain2HtmClean#/>
|
||||
|
||||
<d:param field="creator_id" type="integer" value="#request.usr_id#" skipUpdate/>
|
||||
<d:param field="updater_id" type="integer" value="#request.usr_id#" />
|
||||
<d:param field="dt_created" type="timestamp" value="#Now()#" skipUpdate/>
|
||||
<d:param field="dt_updated" type="timestamp" value="#Now()#"/>
|
||||
</d:bean>
|
||||
|
||||
<m:dispatch_detail
|
||||
usePRG="No"<!---*** --->
|
||||
pageInfo=#pageInfo#
|
||||
id="#d.contract_id#"
|
||||
status=#pageInfo.status#
|
||||
trackOut="tr"
|
||||
idAttributesOut="id"
|
||||
/>
|
||||
|
||||
<!--- decoration --->
|
||||
<cfquery name="qDecoration" datasource="#request.DS#">
|
||||
select
|
||||
a.login as creator, a.shortname as creator_shortname, m.login as updater, m.shortname as updater_shortname
|
||||
from contract g
|
||||
left outer join usr a on (g.creator_id=a.usr_id)
|
||||
left outer join usr m on (g.updater_id=m.usr_id)
|
||||
where g.contract_id=<cfqueryparam attributeCollection=#id#/>
|
||||
</cfquery>
|
||||
|
||||
|
||||
</m:silent><!---
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
<layout:attribute name="title">
|
||||
<cfoutput>
|
||||
Договор
|
||||
<cfif d.contract_id GT 0>
|
||||
<b>#d.contract#</b>
|
||||
[#d.contract_id#]
|
||||
</cfif>
|
||||
</cfoutput>
|
||||
</layout:attribute>
|
||||
</layout:page>
|
||||
|
||||
<!--- <cfif status.errorState GT 0>
|
||||
<cfoutput><div class="err">#status.errorMessage#</div></cfoutput>
|
||||
</cfif> --->
|
||||
|
||||
<cfoutput>
|
||||
<input type="hidden" name="contract_id" value="#d.contract_id#"/>
|
||||
<input type="hidden" name="track" value="#tr.self#"/>
|
||||
<input type="hidden" name="pass" value=""/><!--- pass marker to prevent save on submit --->
|
||||
|
||||
<div class="detail">
|
||||
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">ID</div>
|
||||
<div class="td">
|
||||
#d.contract_id#
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Номер договора</div>
|
||||
<div class="td">
|
||||
<input type="text" name="contract" value="#d.contract#" size="70"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Дата договора</div>
|
||||
<div class="td">
|
||||
<input type="date" name="dt_contract" id="dt_contract" value="#dateFormat(d.dt_contract,"YYYY-MM-DD")#"/>
|
||||
<button type="button" onclick="document.getElementById('dt_contract').value='#DateFormat(Now(), 'YYYY-MM-DD')#';">Сегодня</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Контрагент</div>
|
||||
<div class="td">
|
||||
<cfquery name="qList">
|
||||
select c.contragent_id, c.contragent
|
||||
from contragent c
|
||||
order by 2
|
||||
</cfquery>
|
||||
<c:combo
|
||||
query=#qList#
|
||||
combo="contragent_id" id="contragent_id" key="contragent_id"
|
||||
selected="#d.contragent_id#"
|
||||
displayf="##contragent##"
|
||||
class=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Создано</div>
|
||||
<div class="td">
|
||||
#dateFormat(d.dt_created,'YYYY-MM-DD')# #timeFormat(d.dt_created,'HH:MM')#
|
||||
#qDecoration.creator# <cfif len(qDecoration.creator_shortname)>(#qDecoration.creator_shortname#)</cfif>
|
||||
|
||||
Изменено
|
||||
#dateFormat(d.dt_updated,'YYYY-MM-DD')# #timeFormat(d.dt_updated,'HH:MM')#
|
||||
#qDecoration.updater# <cfif len(qDecoration.updater_shortname)>(#qDecoration.updater_shortname#)</cfif>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</cfoutput>
|
||||
|
||||
<layout:page section="extension" closeForm="No"/>
|
||||
|
||||
<cfif d.contract_id GT 0>
|
||||
|
||||
|
||||
<cfquery name="qSpecification">
|
||||
select
|
||||
s.specification_id
|
||||
,s.specification
|
||||
,(select count(*) from specification_item i where i.specification_id=s.specification_id) as item_cnt
|
||||
from specification s
|
||||
where s.contract_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.contract_id#"/>
|
||||
order by 1
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Спецификации (#qSpecification.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
<cfif pageInfo.writePermitted()>
|
||||
<cfoutput>
|
||||
<cfset addUrl="specification.cfm?specification_id=-1&contract_id=#d.contract_id#&#tr.fwx#"/>
|
||||
<button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'">
|
||||
<a href="#addUrl#">Создать</a>
|
||||
</button>
|
||||
</cfoutput>
|
||||
</cfif>
|
||||
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Номер спецификации</th>
|
||||
<th>Строк</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qSpecification">
|
||||
<tr>
|
||||
<td>
|
||||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="specification" id=#specification_id# fwx=#tr.fwx#/>
|
||||
</td>
|
||||
<td>#specification#</td>
|
||||
<td class="c">
|
||||
<cfif item_cnt GT 0>#item_cnt#</cfif>
|
||||
</td>
|
||||
<td class="c">
|
||||
<c:link_del canWrite=#pageInfo.writePermitted()# entity="specification" id=#specification_id# fwx=#tr.fwx#/>
|
||||
</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
</cfif>
|
||||
|
||||
<layout:page section="extension" closeForm="Yes"/> <!--- *** правильно так? --->
|
||||
<layout:page section="footer"/>
|
||||
Reference in New Issue
Block a user