From 871b511368cbe0f7747272927509e49b180c4ba6 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Mon, 18 Jan 2010 15:22:26 +0000 Subject: [PATCH] Disabled (commented out) the lifecycle declaration for bizServer, bizContract and bizService SVN:trunk[265] --- business/ServiceMgmt.business.php | 12 ++++++++---- business/itop.business.class.inc.php | 15 +++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/business/ServiceMgmt.business.php b/business/ServiceMgmt.business.php index dd8865a055..0319fba53e 100644 --- a/business/ServiceMgmt.business.php +++ b/business/ServiceMgmt.business.php @@ -17,7 +17,8 @@ class bizService extends cmdbAbstractObject "key_type" => "autoincrement", "key_label" => "id", "name_attcode" => "name", - "state_attcode" => "status", + //"state_attcode" => "status", + "state_attcode" => "", "reconc_keys" => array("org_id", "name"), // inherited attributes "db_table" => "services", "db_key_field" => "id", @@ -42,6 +43,7 @@ class bizService extends cmdbAbstractObject MetaModel::Init_AddFilterFromAttribute("type"); MetaModel::Init_AddFilterFromAttribute("status"); +/* // Life cycle MetaModel::Init_DefineState("New", array("label"=>"New", "description"=>"Newly created service", "attribute_inherit"=>null, "attribute_list"=>array())); @@ -59,7 +61,7 @@ class bizService extends cmdbAbstractObject MetaModel::Init_DefineTransition("New", "ev_implement", array("target_state"=>"Implementation", "actions"=>array(), "user_restriction"=>null)); MetaModel::Init_DefineTransition("Implementation", "ev_move2prod", array("target_state"=>"Production", "actions"=>array(), "user_restriction"=>null)); MetaModel::Init_DefineTransition("Production", "ev_obsolete", array("target_state"=>"Obsolete", "actions"=>array('IncrementVersion'), "user_restriction"=>null)); - +*/ MetaModel::Init_SetZListItems('details', array('name', 'status', 'org_id','service_category','type','status','description')); // Attributes to be displayed for the complete details MetaModel::Init_SetZListItems('list', array('name', 'status', 'org_id','service_category','type')); // Attributes to be displayed for a list @@ -95,7 +97,8 @@ class bizContract extends cmdbAbstractObject "key_type" => "autoincrement", "key_label" => "id", "name_attcode" => "name", - "state_attcode" => "status", + //"state_attcode" => "status", + "state_attcode" => "", "reconc_keys" => array("org_id", "name"), // inherited attributes "db_table" => "contracts", "db_key_field" => "id", @@ -139,6 +142,7 @@ class bizContract extends cmdbAbstractObject MetaModel::Init_AddFilterFromAttribute("type"); +/* // Life cycle MetaModel::Init_DefineState("New", array("label"=>"New", "description"=>"Newly created contract", "attribute_inherit"=>null, "attribute_list"=>array('name' => OPT_ATT_MANDATORY,'org_id' => OPT_ATT_MANDATORY, 'service_id' => OPT_ATT_MANDATORY,'type' => OPT_ATT_MANDATORY, 'description' => OPT_ATT_MANDATORY))); @@ -162,7 +166,7 @@ class bizContract extends cmdbAbstractObject MetaModel::Init_DefineTransition("Signed", "ev_begin", array("target_state"=>"Production", "actions"=>array('SetProdDate'), "user_restriction"=>null)); MetaModel::Init_DefineTransition("Signed", "ev_terminate", array("target_state"=>"Finished", "actions"=>array(), "user_restriction"=>null)); MetaModel::Init_DefineTransition("Production", "ev_terminate", array("target_state"=>"Finished", "actions"=>array(), "user_restriction"=>null)); - +*/ MetaModel::Init_SetZListItems('details', array('name', 'status', 'org_id', 'service_id','provider_name','type','description','team_id','service_level','cost','currency','cost_unit','cost_freq','move2prod_date','end_prod', 'version_number')); // Attributes to be displayed for the complete details MetaModel::Init_SetZListItems('list', array('name', 'status', 'org_id', 'service_id','provider_name','service_name','service_level','type')); // Attributes to be displayed for a list diff --git a/business/itop.business.class.inc.php b/business/itop.business.class.inc.php index 17ae3d77c1..a9de9bbb70 100644 --- a/business/itop.business.class.inc.php +++ b/business/itop.business.class.inc.php @@ -249,7 +249,7 @@ class bizPerson extends bizContact "key_label" => "id", "name_attcode" => "name", "state_attcode" => "", - "reconc_keys" => array("org_id", "first_name", "name"), // comment en définir plusieurs + "reconc_keys" => array("org_id", "first_name", "name"), // comment en définir plusieurs // "reconc_keys" => array("org_id", "employee_number"), "db_table" => "persons", // Can it use the same physical DB table as any contact ? "db_key_field" => "id", @@ -591,7 +591,7 @@ class lnkContactInfra extends cmdbAbstractObject //////////////////////////////////////////////////////////////////////////////////// /** * bizLocation (Region, Country, City, Site, Building, Floor, Room, Rack,...) -* pourrait être mis en plusieurs sous objects, puisqu'une adresse sur region n'a pas trop de sens +* pourrait être mis en plusieurs sous objects, puisqu'une adresse sur region n'a pas trop de sens * */ //////////////////////////////////////////////////////////////////////////////////// @@ -1170,6 +1170,7 @@ class bizServer extends bizDevice "key_label" => "id", "name_attcode" => "name", "state_attcode" => "status", + "state_attcode" => "", "reconc_keys" => array("org_id", "name"), // inherited attributes "db_table" => "servers", "db_key_field" => "id", @@ -1190,6 +1191,7 @@ class bizServer extends bizDevice MetaModel::Init_AddAttribute(new AttributeString("default_gateway", array("label"=>"Default Gateway", "description"=>"Default Gateway for this device", "allowed_values"=>null, "sql"=>"default_gateway", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array()))); MetaModel::Init_InheritFilters(); + MetaModel::Init_AddFilterFromAttribute("status"); MetaModel::Init_AddFilterFromAttribute("memory_size"); MetaModel::Init_AddFilterFromAttribute("cpu"); MetaModel::Init_AddFilterFromAttribute("number_of_cpus"); @@ -1199,6 +1201,7 @@ class bizServer extends bizDevice MetaModel::Init_AddFilterFromAttribute("os_version"); +/* // Life cycle MetaModel::Init_DefineState("InStore", array("label"=>"InStore", "description"=>"Device in store", "attribute_inherit"=>null, "attribute_list"=>array())); @@ -1215,7 +1218,6 @@ class bizServer extends bizDevice MetaModel::Init_DefineState("Obsolete", array("label"=>"Obsolete", "description"=>"The device is no more used", "attribute_inherit"=>null, "attribute_list"=>array())); - MetaModel::Init_DefineStimulus("ev_store", new StimulusUserAction(array("label"=>"Store this server", "description"=>"This server is move to storage"))); MetaModel::Init_DefineStimulus("ev_ship", new StimulusUserAction(array("label"=>"Ship this server", "description"=>"This server is shipped to futur location"))); MetaModel::Init_DefineStimulus("ev_plug", new StimulusUserAction(array("label"=>"Plug this server", "description"=>"The server is pluuged on the network"))); @@ -1242,14 +1244,11 @@ class bizServer extends bizDevice MetaModel::Init_DefineTransition("BeingDeconfigured", "ev_store", array("target_state"=>"InStore", "actions"=>array(), "user_restriction"=>null)); MetaModel::Init_DefineTransition("BeingDeconfigured", "ev_obsolete", array("target_state"=>"Obsolete", "actions"=>array(), "user_restriction"=>null)); MetaModel::Init_DefineTransition("Obsolete", "ev_recycle", array("target_state"=>"BeingDeconfigured", "actions"=>array(), "user_restriction"=>null)); - - - - +*/ // Display lists - MetaModel::Init_SetZListItems('details', array('name', 'mgmt_ip','default_gateway','status', 'severity','org_id', 'location_id', 'brand', 'model', 'os_family', 'os_version','serial_number','shipment_number', 'cpu', 'number_of_cpus', 'memory_size', 'hdd_size', 'hdd_free_size')); // Attributes to be displayed for the complete details + MetaModel::Init_SetZListItems('details', array('name', 'status', 'mgmt_ip','default_gateway', 'severity','org_id', 'location_id', 'brand', 'model', 'os_family', 'os_version','serial_number','shipment_number', 'cpu', 'number_of_cpus', 'memory_size', 'hdd_size', 'hdd_free_size')); // Attributes to be displayed for the complete details MetaModel::Init_SetZListItems('list', array('name', 'status','severity', 'org_id', 'location_id', 'brand', 'model', 'os_family', 'os_version')); // Attributes to be displayed for a list // Search criteria MetaModel::Init_SetZListItems('standard_search', array('name', 'status','severity', 'brand', 'model', 'os_family', 'location_id')); // Criteria of the std search form