initial draft
This commit is contained in:
@@ -0,0 +1,207 @@
|
||||
<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="specification" key="specification_id" pageInfoOut="pageInfo"/>
|
||||
|
||||
<d:bean readonly=#!pageInfo.writePermitted()# table="#pageInfo.entity#" datasource="#request.DS#" output="d" status="status">
|
||||
<d:param field="specification_id" type="integer" key autoincrement/>
|
||||
<d:param field="contract_id" type="integer" forNull=""/>
|
||||
<d:param field="specification" type="varchar" size="255" preprocessor=#cleanInput#/>
|
||||
<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.specification_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 #pageInfo.entity# e
|
||||
left outer join usr a on (e.creator_id=a.usr_id)
|
||||
left outer join usr m on (e.updater_id=m.usr_id)
|
||||
where e.#pageInfo.key#=<cfqueryparam attributeCollection=#id#/>
|
||||
</cfquery>
|
||||
|
||||
<cfquery name="qContract" datasource="#request.DS#">
|
||||
select d.contract_id, d.contract, d.dt_contract, c.contragent_id, c.contragent
|
||||
from contract d
|
||||
left outer join contragent c on (d.contragent_id=c.contragent_id)
|
||||
where d.contract_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.contract_id#"/>
|
||||
</cfquery>
|
||||
|
||||
</m:silent><!---
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
<layout:attribute name="title">
|
||||
<cfoutput>
|
||||
Спецификация
|
||||
<cfif d.specification_id GT 0>
|
||||
<b>#d.specification#</b>
|
||||
[#d.specification_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="specification_id" value="#d.specification_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">Спецификация (номер)</div>
|
||||
<div class="td">
|
||||
<input type="text" name="specification" value="#d.specification#" size="70"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Договор</div>
|
||||
<div class="td">
|
||||
<cfquery name="qList" datasource="#request.DS#">
|
||||
select c.contract_id, c.contract, c.dt_contract
|
||||
from contract c
|
||||
order by 1
|
||||
</cfquery>
|
||||
<c:combo
|
||||
query=#qList#
|
||||
combo="contract_id"
|
||||
id="contract_id"
|
||||
key="contract_id"
|
||||
selected="#d.contract_id#"
|
||||
displayf="##contract## ##dateFormat(dt_contract,'DD.MM.YYYY')##"
|
||||
empty=""
|
||||
class=""
|
||||
<!---onchange="submit();"--->
|
||||
/>
|
||||
<cfif d.contract_id GT 0>
|
||||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="contract" id=#d.contract_id# fwx=#tr.fwx#/>
|
||||
</cfif>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Описание</div>
|
||||
<div class="td">
|
||||
<textarea name="descr" rows="3" cols="100">#request.htm2plain(d.descr)#</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Создано</div>
|
||||
<div class="td">
|
||||
#dateFormat(d.dt_created,'DD.MM.YYYY')# #timeFormat(d.dt_created,'HH:MM')#
|
||||
#qDecoration.creator# <cfif len(qDecoration.creator_shortname)>(#qDecoration.creator_shortname#)</cfif>
|
||||
|
||||
Изменено
|
||||
#dateFormat(d.dt_updated,'DD.MM.YYYY')# #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="Yes"/>
|
||||
|
||||
<cfif d.specification_id GT 0>
|
||||
<cfquery name="qItem" datasource="#request.DS#">
|
||||
select
|
||||
i.specification_item_uid
|
||||
,s.svc_id
|
||||
,s.svc
|
||||
,s.code
|
||||
<!--- ,i.price*i.quantity as cost --->
|
||||
<!--- ,(select count(*) from svc_param sp where sp.svc_id=i.svc_id) as svc_param_count --->
|
||||
,(select count(*) from specification_item_version siv where siv.specification_item_uid=i.specification_item_uid) as item_version_count
|
||||
from specification_item i
|
||||
left outer join svc s on (i.svc_id=s.svc_id)
|
||||
where i.specification_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.specification_id#"/>
|
||||
order by 1
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<p>
|
||||
Строки спецификации (#qItem.recordCount#)
|
||||
<cfif pageInfo.writePermitted()>
|
||||
<cfoutput>
|
||||
<cfset addUrl="specification_item.cfm?specification_item_uid=&specification_id=#d.specification_id#&#tr.fwx#"/>
|
||||
<button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'">
|
||||
<a href="#addUrl#">Создать</a>
|
||||
</button>
|
||||
</cfoutput>
|
||||
</cfif>
|
||||
</p>
|
||||
</cfoutput>
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Ключ строки</th>
|
||||
<th>Услуга</th>
|
||||
<th>Код услуги</th>
|
||||
<!--- <th>Стоимость</th> --->
|
||||
<!--- <th>Компонентов</th> --->
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qItem">
|
||||
<tr>
|
||||
<td>
|
||||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="specification_item" id=#specification_item_uid# fwx=#tr.fwx#/>
|
||||
</td>
|
||||
<td>#specification_item_uid#</td>
|
||||
<td>#svc#</td>
|
||||
<td class="r">#quantity#</td>
|
||||
<td class="r">#price#</td>
|
||||
<td class="c">#item_version_count#</td>
|
||||
<td class="c">
|
||||
<c:link_del canWrite=#pageInfo.writePermitted()# entity="specification_item" id=#specification_item_uid# fwx=#tr.fwx#/>
|
||||
</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
</cfif>
|
||||
|
||||
|
||||
<layout:page section="footer"/>
|
||||
Reference in New Issue
Block a user