I would like to add new table name "service_level_access", so that I can store only data that I need from some of my modification from the existing OQL at XML file. Below is the example query that I need to be modify
My solution:
<query>
SELECT UserRequest WHERE status NOT IN ('closed','rejected') AND org_id IN (6, 128)
</query>
Propose query:
<query>
SELECT UserRequest AS ur
JOIN ServiceLevelAccess AS sa ON sa.org_id = ur.org_id
WHERE status NOT IN ('closed','rejected')
</query>
The above numbers 6 and 128 are the organization id that should filter out from the iTop portal and according only on the member organization member should be display.
But my solution is to have new table that I need to be created so that I can stored as many organization id that should be filtered out.
I created a XML tag for these requirements, please see below tags.
Where should I put this code so that I cannot created a new files for these and it will include when I try to modify some of queries from the existing. And I don't need to add more tags like
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I would like to add new table name "service_level_access", so that I can store only data that I need from some of my modification from the existing OQL at XML file. Below is the example query that I need to be modify
My solution:
<query>
SELECT UserRequest WHERE status NOT IN ('closed','rejected') AND org_id IN (6, 128)
</query>
Propose query:
<query>
SELECT UserRequest AS ur
JOIN ServiceLevelAccess AS sa ON sa.org_id = ur.org_id
WHERE status NOT IN ('closed','rejected')
</query>
The above numbers 6 and 128 are the organization id that should filter out from the iTop portal and according only on the member organization member should be display.
But my solution is to have new table that I need to be created so that I can stored as many organization id that should be filtered out.
I created a XML tag for these requirements, please see below tags.
<classes>
<class id="user-content-ServiceLevelAccess" _delta="define">
<parent>Service</parent>
<properties>
<category>bizmodel,searchable</category>
<abstract>false</abstract>
<key_type>autoincrement</key_type>
<db_table>service_level_access</db_table>
<db_key_field>id</db_key_field>
<db_final_class_field>
<naming>
<format>%1$s</format>
<attributes>
<attribute id="user-content-org_id">
</attribute></attributes>
</naming>
<display_template>
<icon>images/monitor.png</icon>
<reconciliation>
<attributes>
<attribute id="user-content-name">
<attribute id="user-content-org_id">
<attribute id="user-content-organization_name">
</attribute></attribute></attribute></attributes>
</reconciliation>
</display_template></db_final_class_field></properties>
<fields>
<field id="user-content-org_id" xsi:type="AttributeEnum">
<values>
<value>EEH</value>
<value>ERH</value>
</values>
<sql>
<default_value>
<is_null_allowed>true</is_null_allowed>
<display_style>radio_horizontal</display_style>
</default_value></sql></field>
</fields>
</class></classes>
And
class ServiceLevelAccess
{
public static function Init()
{
$aParams = array
(
'category' => 'bizmodel,searchable,structure',
'key_type' => 'autoincrement',
'name_attcode' => 'id',
'state_attcode' => 'status',
'reconc_keys' => array('id'),
'db_table' => 'service_level_access',
'db_key_field' => 'id',
'db_finalclass_field' => '',
'icon' => '',
);
MetaModel::Init_Params($aParams);
MetaModel::Init_InheritAttributes();
}
Where should I put this code so that I cannot created a new files for these and it will include when I try to modify some of queries from the existing. And I don't need to add more tags like