mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 17:18:51 +02:00
Datamodel revised
SVN:trunk[571]
This commit is contained in:
@@ -105,7 +105,7 @@ abstract class AttributeDefinition
|
||||
{
|
||||
if (!array_key_exists($sParam, $this->m_aParams))
|
||||
{
|
||||
throw new CoreException("Unknown attribute definition parameter '$sParam', please select a value in {".implode(", ", $this->m_aParams)."}");
|
||||
throw new CoreException("Unknown attribute definition parameter '$sParam', please select a value in {".implode(", ", array_keys($this->m_aParams))."}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ abstract class Change extends Ticket
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalField("manager_group_name", array("allowed_values"=>null, "extkey_attcode"=>"manager_group_id", "target_attcode"=>"name", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("manager_id", array("targetclass"=>"Person", "jointype"=>null, "allowed_values"=>new ValueSetObjects('SELECT Person AS p JOIN lnkTeamToContact AS l ON l.contact_id=p.id JOIN Team AS t ON l.team_id=t.id WHERE t.id = :this->manager_group_id'), "sql"=>"manager_id", "is_null_allowed"=>true, "on_target_delete"=>DEL_MANUAL, "depends_on"=>array("manager_group_id"))));
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalField("manager_email", array("allowed_values"=>null, "extkey_attcode"=>"manager_id", "target_attcode"=>"email", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeEnum("outage", array("allowed_values"=>new ValueSetEnum('yes,no'), "sql"=>"outage", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeEnum("outage", array("allowed_values"=>new ValueSetEnum('yes,no'), "sql"=>"outage", "default_value"=>"no", "is_null_allowed"=>false, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeText("change_request", array("allowed_values"=>null, "sql"=>"change_request", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeText("fallback", array("allowed_values"=>null, "sql"=>"fallback", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||
|
||||
|
||||
@@ -393,15 +393,6 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:DBServer/Attribute:instance_list+' => 'Instances of this database server',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: OperatingSystem
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:OperatingSystem' => 'OS',
|
||||
'Class:OperatingSystem+' => 'Operating System SW',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: lnkPatchToCI
|
||||
//
|
||||
@@ -516,7 +507,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:DatabaseInstance' => 'Database Instance',
|
||||
'Class:DatabaseInstance+' => '',
|
||||
'Class:DatabaseInstance/Attribute:db_server_instance_id' => 'Database software',
|
||||
'Class:DatabaseInstance/Attribute:db_server_instance_id' => 'Database server',
|
||||
'Class:DatabaseInstance/Attribute:db_server_instance_id+' => '',
|
||||
'Class:DatabaseInstance/Attribute:db_server_instance_version' => 'Database version',
|
||||
'Class:DatabaseInstance/Attribute:db_server_instance_version+' => '',
|
||||
@@ -897,8 +888,6 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Menu:Application+' => 'All Applications',
|
||||
'Menu:DBServer' => 'Database Servers',
|
||||
'Menu:DBServer+' => 'Database Servers',
|
||||
'Menu:OperatingSystem' => 'OS',
|
||||
'Menu:OperatingSystem+' => 'Operating Systems',
|
||||
'Menu:Audit' => 'Audit',
|
||||
'Menu:ConfigManagement' => 'Configuration Management',
|
||||
'Menu:ConfigManagement+' => 'Configuration Management',
|
||||
@@ -925,8 +914,8 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Menu:Licence+' => 'All Licences',
|
||||
'Menu:Patch' => 'Patches',
|
||||
'Menu:Patch+' => 'All Patches',
|
||||
'Menu:ApplicationInstance' => 'Installed Applications',
|
||||
'Menu:ApplicationInstance+' => 'All Installed Applications',
|
||||
'Menu:ApplicationInstance' => 'Installed Software',
|
||||
'Menu:ApplicationInstance+' => 'Applications and Database servers',
|
||||
'Menu:ConfigManagementHardware' => 'Infrastructure Management',
|
||||
'Menu:Subnet' => 'Subnets',
|
||||
'Menu:Subnet+' => 'All Subnets',
|
||||
|
||||
@@ -611,32 +611,6 @@ class DBServer extends Software
|
||||
MetaModel::Init_SetZListItems('list', array('description'));
|
||||
}
|
||||
}
|
||||
class OperatingSystem extends Software
|
||||
{
|
||||
|
||||
public static function Init()
|
||||
{
|
||||
$aParams = array
|
||||
(
|
||||
"category" => "bizmodel,searchable,configmgmt",
|
||||
"key_type" => "autoincrement",
|
||||
"name_attcode" => "name",
|
||||
"state_attcode" => "",
|
||||
"reconc_keys" => array("name"),
|
||||
"db_table" => "software_os",
|
||||
"db_key_field" => "id",
|
||||
"db_finalclass_field" => "",
|
||||
"icon" => "../business/templates/software.png",
|
||||
);
|
||||
MetaModel::Init_Params($aParams);
|
||||
MetaModel::Init_InheritAttributes();
|
||||
|
||||
MetaModel::Init_SetZListItems('details', array('name', 'description', 'instance_list'));
|
||||
MetaModel::Init_SetZListItems('advanced_search', array('name', 'description'));
|
||||
MetaModel::Init_SetZListItems('standard_search', array('name', 'description'));
|
||||
MetaModel::Init_SetZListItems('list', array('description'));
|
||||
}
|
||||
}
|
||||
class lnkPatchToCI extends cmdbAbstractObject
|
||||
{
|
||||
public static function Init()
|
||||
@@ -795,6 +769,8 @@ class DBServerInstance extends SoftwareInstance
|
||||
MetaModel::Init_Params($aParams);
|
||||
MetaModel::Init_InheritAttributes();
|
||||
|
||||
MetaModel::Init_OverloadAttributeParams("software_id", array("targetclass"=>"DBServer"));
|
||||
//MetaModel::Init_OverloadAttributeParams("software_id", array("allowed_values"=>new ValueSetObjects('SELECT DBServer')));
|
||||
MetaModel::Init_AddAttribute(new AttributeLinkedSet("dbinstance_list", array("linked_class"=>"DatabaseInstance", "ext_key_to_me"=>"db_server_instance_id", "allowed_values"=>null, "count_min"=>0, "count_max"=>0, "depends_on"=>array())));
|
||||
|
||||
MetaModel::Init_SetZListItems('details', array('name', 'status', 'org_id', 'importance', 'device_id', 'licence_id', 'software_id', 'version', 'description', 'contact_list', 'document_list', 'solution_list', 'contract_list', 'ticket_list', 'dbinstance_list'));
|
||||
@@ -822,6 +798,8 @@ class ApplicationInstance extends SoftwareInstance
|
||||
MetaModel::Init_Params($aParams);
|
||||
MetaModel::Init_InheritAttributes();
|
||||
|
||||
MetaModel::Init_OverloadAttributeParams("software_id", array("targetclass"=>"Application"));
|
||||
|
||||
MetaModel::Init_SetZListItems('details', array('name', 'status', 'org_id', 'importance', 'device_id', 'licence_id', 'software_id', 'version', 'description', 'contact_list', 'document_list', 'solution_list', 'contract_list', 'ticket_list'));
|
||||
MetaModel::Init_SetZListItems('advanced_search', array('status', 'org_id', 'importance', 'device_id', 'licence_id', 'software_id', 'version'));
|
||||
MetaModel::Init_SetZListItems('standard_search', array('status', 'org_id', 'importance', 'device_id', 'licence_id', 'software_id', 'version'));
|
||||
@@ -1427,7 +1405,6 @@ $oTypologyNode = new TemplateMenuNode('Catalogs', '', $iAdminGroup, 50 /* fRank
|
||||
$iTopology = $oTypologyNode->GetIndex();
|
||||
new OQLMenuNode('Organization', 'SELECT Organization', $iTopology, 10 /* fRank */);
|
||||
new OQLMenuNode('Application', 'SELECT Application', $iTopology, 20 /* fRank */);
|
||||
new OQLMenuNode('OperatingSystem', 'SELECT OperatingSystem', $iTopology, 30 /* fRank */);
|
||||
new OQLMenuNode('DBServer', 'SELECT DBServer', $iTopology, 40 /* fRank */);
|
||||
|
||||
|
||||
@@ -1454,8 +1431,6 @@ $oSWNode = new TemplateMenuNode('ConfigManagementSoftware', '', $oCINode->GetInd
|
||||
new OQLMenuNode('Licence', 'SELECT Licence', $oSWNode->GetIndex(), 0 /* fRank */);
|
||||
new OQLMenuNode('Patch', 'SELECT Patch', $oSWNode->GetIndex(), 1 /* fRank */);
|
||||
new OQLMenuNode('ApplicationInstance', 'SELECT SoftwareInstance', $oSWNode->GetIndex(), 2 /* fRank */);
|
||||
new OQLMenuNode('vraieappliinstance', 'SELECT ApplicationInstance', $oSWNode->GetIndex(), 3 /* fRank */);
|
||||
new OQLMenuNode('DBServerInstance', 'SELECT DBServerInstance', $oSWNode->GetIndex(), 3 /* fRank */);
|
||||
|
||||
$oHWNode = new TemplateMenuNode('ConfigManagementHardware', '', $oCINode->GetIndex(), 3 /* fRank */);
|
||||
new OQLMenuNode('Subnet', 'SELECT Subnet', $oHWNode->GetIndex(), 0 /* fRank */);
|
||||
|
||||
@@ -31,6 +31,8 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Menu:ClosedIncidents+' => 'Closed incidents',
|
||||
'Menu:OpenedIncidents' => 'Opened incidents',
|
||||
'Menu:OpenedIncidents+' => 'Opened incidents',
|
||||
'Menu:MyIncidents' => 'My incidents',
|
||||
'Menu:MyIncidents+' => 'Incidents assigned to me',
|
||||
));
|
||||
|
||||
// Dictionnay conventions
|
||||
|
||||
@@ -70,6 +70,7 @@ $oMyMenuGroup = new MenuGroup('IncidentManagement', 1 /* fRank */);
|
||||
// incident dont je suis caller
|
||||
// incident dont je suis requester
|
||||
new OQLMenuNode('OpenedIncidents', 'SELECT Incident WHERE status IN ("new", "assigned", "escalation")', $oMyMenuGroup->GetIndex(), 0 /* fRank */);
|
||||
new OQLMenuNode('MyIncidents', 'SELECT Incident WHERE status IN ("assigned", "escalation_ttr") AND agent_id = :current_contact_id', $oMyMenuGroup->GetIndex(), 0 /* fRank */);
|
||||
//new OQLMenuNode('EscalatedIncidents', 'SELECT Incident WHERE status IN ("escalation")', $oMyMenuGroup->GetIndex(), 0 /* fRank */);
|
||||
//new TemplateMenuNode('IncidentOverview', 'SELECT Incident', $oMyMenuGroup->GetIndex(), 0 /* fRank */);
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class UserRequest extends ResponseTicket
|
||||
// The freeze reason remains hidden in all other states
|
||||
MetaModel::Init_OverloadStateAttribute('new', 'freeze_reason', OPT_ATT_HIDDEN);
|
||||
MetaModel::Init_OverloadStateAttribute('assigned', 'freeze_reason', OPT_ATT_HIDDEN);
|
||||
MetaModel::Init_OverloadStateAttribute('frozen', 'freeze_reason', OPT_ATT_MANDATORY);
|
||||
MetaModel::Init_OverloadStateAttribute('frozen', 'freeze_reason', OPT_ATT_MANDATORY | OPT_ATT_MUSTPROMPT);
|
||||
MetaModel::Init_OverloadStateAttribute('escalated_tto', 'freeze_reason', OPT_ATT_HIDDEN);
|
||||
MetaModel::Init_OverloadStateAttribute('escalated_ttr', 'freeze_reason', OPT_ATT_HIDDEN);
|
||||
MetaModel::Init_OverloadStateAttribute('resolved', 'freeze_reason', OPT_ATT_HIDDEN);
|
||||
|
||||
@@ -412,6 +412,8 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:lnkServiceToContact/Attribute:contact_name+' => '',
|
||||
'Class:lnkServiceToContact/Attribute:contact_email' => 'Contact email',
|
||||
'Class:lnkServiceToContact/Attribute:contact_email+' => '',
|
||||
'Class:lnkServiceToContact/Attribute:role' => 'Role',
|
||||
'Class:lnkServiceToContact/Attribute:role+' => '',
|
||||
));
|
||||
|
||||
//
|
||||
|
||||
@@ -511,11 +511,12 @@ class lnkServiceToContact extends cmdbAbstractObject
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("contact_id", array("targetclass"=>"Contact", "jointype"=>null, "allowed_values"=>null, "sql"=>"contact_id", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalField("contact_name", array("allowed_values"=>null, "extkey_attcode"=>"contact_id", "target_attcode"=>"name", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalField("contact_email", array("allowed_values"=>null, "extkey_attcode"=>"contact_id", "target_attcode"=>"email", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeString("role", array("allowed_values"=>null, "sql"=>"role", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
|
||||
|
||||
MetaModel::Init_SetZListItems('details', array('service_id', 'contact_id', 'contact_email'));
|
||||
MetaModel::Init_SetZListItems('advanced_search', array('service_id', 'contact_id', 'contact_email'));
|
||||
MetaModel::Init_SetZListItems('standard_search', array('service_id', 'contact_id', 'contact_email'));
|
||||
MetaModel::Init_SetZListItems('list', array('service_id', 'contact_id', 'contact_email'));
|
||||
MetaModel::Init_SetZListItems('details', array('service_id', 'contact_id', 'contact_email', 'role'));
|
||||
MetaModel::Init_SetZListItems('advanced_search', array('service_id', 'contact_id', 'contact_email', 'role'));
|
||||
MetaModel::Init_SetZListItems('standard_search', array('service_id', 'contact_id', 'contact_email', 'role'));
|
||||
MetaModel::Init_SetZListItems('list', array('service_id', 'contact_id', 'contact_email', 'role'));
|
||||
}
|
||||
}
|
||||
class lnkServiceToCI extends cmdbAbstractObject
|
||||
|
||||
@@ -223,7 +223,7 @@ abstract class ResponseTicket extends Ticket
|
||||
'ticket_log' => OPT_ATT_HIDDEN,
|
||||
'caller_id' => OPT_ATT_MANDATORY,
|
||||
'related_change_id' => OPT_ATT_HIDDEN,
|
||||
//'description' => OPT_ATT_MUSTCHANGE,
|
||||
'description' => OPT_ATT_MUSTCHANGE,
|
||||
'contact_list' => OPT_ATT_READONLY,
|
||||
'start_date' => OPT_ATT_READONLY,
|
||||
'last_update' => OPT_ATT_READONLY,
|
||||
@@ -265,10 +265,10 @@ abstract class ResponseTicket extends Ticket
|
||||
'caller_id' => OPT_ATT_READONLY,
|
||||
'org_id' => OPT_ATT_READONLY,
|
||||
'ticket_log' => OPT_ATT_NORMAL,
|
||||
//'description' => OPT_ATT_READONLY,
|
||||
'agent_id' => OPT_ATT_MANDATORY,
|
||||
'description' => OPT_ATT_READONLY,
|
||||
'agent_id' => OPT_ATT_MUSTPROMPT | OPT_ATT_MANDATORY,
|
||||
'agent_email' => OPT_ATT_READONLY,
|
||||
'workgroup_id' => OPT_ATT_MUSTPROMPT,
|
||||
'workgroup_id' => OPT_ATT_MUSTPROMPT | OPT_ATT_MANDATORY,
|
||||
'closure_deadline' => OPT_ATT_HIDDEN,
|
||||
'escalation_deadline' => OPT_ATT_READONLY,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user