mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°729 Form prefill : Included Contract case in the datamodel.
SVN:trunk[5703]
This commit is contained in:
@@ -3696,6 +3696,7 @@ abstract class DBObject implements iDisplay
|
||||
|
||||
/**
|
||||
* Complete a filter ($aContextParam['filter']) data from context
|
||||
* (Called on source object)
|
||||
* @param array $aContextParam Context used for creation form prefilling
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -173,7 +173,36 @@
|
||||
<display_style>list</display_style>
|
||||
</field>
|
||||
</fields>
|
||||
<methods/>
|
||||
<methods>
|
||||
<method id="PrefillSearchForm">
|
||||
<code>
|
||||
<![CDATA[
|
||||
public function PrefillSearchForm(&$aContextParam)
|
||||
{
|
||||
if($aContextParam['dest_class'] == 'Service' || is_subclass_of($aContextParam['dest_class'], 'Service'))
|
||||
{
|
||||
if(MetaModel::IsValidAttCode($aContextParam['dest_class'],'org_id') && !empty($aContextParam['source_obj']->Get('provider_id')))
|
||||
{
|
||||
$aContextParam['filter']->ResetCondition();
|
||||
$aContextParam['filter']->AddCondition('org_id', $aContextParam['source_obj']->Get('provider_id'));
|
||||
}
|
||||
}
|
||||
elseif (($aContextParam['dest_class'] == 'Contact' || is_subclass_of($aContextParam['dest_class'], 'Contact'))
|
||||
|| ($aContextParam['dest_class'] == 'Document' || is_subclass_of($aContextParam['dest_class'], 'Document')))
|
||||
{
|
||||
if(MetaModel::IsValidAttCode($aContextParam['dest_class'],'org_id') && !empty($aContextParam['source_obj']->Get('provider_id')) && !empty($aContextParam['source_obj']->Get('org_id')))
|
||||
{
|
||||
$aContextParam['filter']->ResetCondition();
|
||||
$sOrgIds = array( $aContextParam['source_obj']->Get('provider_id'),
|
||||
$aContextParam['source_obj']->Get('org_id'));
|
||||
$aContextParam['filter']->AddCondition('org_id', $sOrgIds , 'IN');
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</code>
|
||||
</method>
|
||||
</methods>
|
||||
<presentation>
|
||||
<details>
|
||||
<items>
|
||||
|
||||
@@ -177,7 +177,36 @@
|
||||
<display_style>list</display_style>
|
||||
</field>
|
||||
</fields>
|
||||
<methods/>
|
||||
<methods>
|
||||
<method id="PrefillSearchForm">
|
||||
<code>
|
||||
<![CDATA[
|
||||
public function PrefillSearchForm(&$aContextParam)
|
||||
{
|
||||
if($aContextParam['dest_class'] == 'Service' || is_subclass_of($aContextParam['dest_class'], 'Service'))
|
||||
{
|
||||
if(MetaModel::IsValidAttCode($aContextParam['dest_class'],'org_id') && !empty($aContextParam['source_obj']->Get('provider_id')))
|
||||
{
|
||||
$aContextParam['filter']->ResetCondition();
|
||||
$aContextParam['filter']->AddCondition('org_id', $aContextParam['source_obj']->Get('provider_id'));
|
||||
}
|
||||
}
|
||||
elseif (($aContextParam['dest_class'] == 'Contact' || is_subclass_of($aContextParam['dest_class'], 'Contact'))
|
||||
|| ($aContextParam['dest_class'] == 'Document' || is_subclass_of($aContextParam['dest_class'], 'Document')))
|
||||
{
|
||||
if(MetaModel::IsValidAttCode($aContextParam['dest_class'],'org_id') && !empty($aContextParam['source_obj']->Get('provider_id')) && !empty($aContextParam['source_obj']->Get('org_id')))
|
||||
{
|
||||
$aContextParam['filter']->ResetCondition();
|
||||
$sOrgIds = array( $aContextParam['source_obj']->Get('provider_id'),
|
||||
$aContextParam['source_obj']->Get('org_id'));
|
||||
$aContextParam['filter']->AddCondition('org_id', $sOrgIds , 'IN');
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</code>
|
||||
</method>
|
||||
</methods>
|
||||
<presentation>
|
||||
<details>
|
||||
<items>
|
||||
|
||||
Reference in New Issue
Block a user