Modified Files:
Tag: testlink_1_9
cfield_mgr.class.php
Log Message:
BUGID 3338 - getXMLRPCServerParams()
Index: cfield_mgr.class.php
===================================================================
RCS file: /cvsroot/testlink/testlink/lib/functions/cfield_mgr.class.php,v
retrieving revision 1.96.2.7
retrieving revision 1.96.2.8
diff -C2 -d -r1.96.2.7 -r1.96.2.8
*** cfield_mgr.class.php 20 Jan 2011 15:44:05 -0000 1.96.2.7
--- cfield_mgr.class.php 23 Jan 2011 18:11:37 -0000 1.96.2.8
***************
*** 12,15 ****
--- 12,16 ----
*
* @internal Revisions:
+ * 20110123 - franciscom - BUGID 3338 - getXMLServerParams() -> renamed getXMLRPCServerParams
* 20110120 - Julian - BUGID 4164 - lists and multiselection lists do not use more space than
* necessary anymore
***************
*** 1993,1997 ****
/**
! * Retrieves the XML Server Parameters specified through custom fields.
*
* @param integer $node_id Accepts current node id from nodes hierarchy level
--- 1994,1998 ----
/**
! * Retrieves the XML-RPC Server Parameters specified through custom fields.
*
* @param integer $node_id Accepts current node id from nodes hierarchy level
***************
*** 1999,2010 ****
*
* @internal rev:
! * 20071102 - franciscom - refactoring
! * 200710 - creation - Swanand
**/
! function getXMLServerParams($node_id)
{
$srv_cfg = new stdClass();
! $node_type=$this->tree_manager->get_available_node_types();
$node_info=$this->tree_manager->get_node_hierarchy_info($node_id);
$ret=null;
--- 2000,2023 ----
*
* @internal rev:
! *
! * 20110123 - franciscom - need refactoring after we have choose to link custom field
! * values to test case version not to test case
! *
! * 20071102 - franciscom - refactoring
! * 200710 - creation - Swanand
**/
! function getXMLRPCServerParams($node_id)
{
+ static $node_type;
+
+ $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
+
$srv_cfg = new stdClass();
! if( is_null($node_type) )
! {
! $node_type=$this->tree_manager->get_available_node_types();
! }
!
$node_info=$this->tree_manager->get_node_hierarchy_info($node_id);
$ret=null;
***************
*** 2013,2058 ****
{
$prefix = "";
! $ret = array( 'xml_server_host' => null,
! 'xml_server_port' => null,
! 'xml_server_path' => null);
!
! $node_info=$this->tree_manager->get_node_hierarchy_info($node_id);
!
!
! if( $node_info['node_type_id'] == $node_type['testcase'])
{
$prefix = "tc_";
}
! $srv_cfg->host=$prefix . "server_host";
! $srv_cfg->port=$prefix . "server_port";
! $srv_cfg->path=$prefix . "server_path";
! $sql = "SELECT cf.name, cfdv.value " .
! "FROM {$this->tables['cfield_design_values']} cfdv," .
! " {$this->tables['custom_fields']} cf " .
! "WHERE cfdv.field_id = cf.id AND cfdv.node_id = {$node_id}";
$server_info = $this->db->fetchRowsIntoMap($sql,'name');
! $server_cfg_is_ok=0;
$server_use_host_port=0;
$server_use_path=0;
! if( (isset($server_info[$srv_cfg->host]) && $server_info[$srv_cfg->host] != "") &&
! (isset($server_info[$srv_cfg->port]) && $server_info[$srv_cfg->port] != "") )
{
! $server_cfg_is_ok=1;
! $ret['xml_server_host'] = $server_info[$srv_cfg->host];
! $ret['xml_server_port'] = $server_info[$srv_cfg->port];
}
! else if (isset($server_info[$srv_cfg->path]) && $server_info[$srv_cfg->path] != "")
{
! $server_cfg_is_ok=1;
! $ret['xml_server_path'] = $server_info[$srv_cfg->path];
}
else
{
if($node_info['parent_id'] != "")
{
! $ret=$this->getXMLServerParams($node_info['parent_id']);
}
}
--- 2026,2076 ----
{
$prefix = "";
! $ret = array('xml_server_host' => null, 'xml_server_port' => null,
! 'xml_server_path' => null);
!
!
! if( $node_info['node_type_id'] == $node_type['tcversion'])
{
$prefix = "tc_";
}
! $srv_cfg->host = $prefix . "server_host";
! $srv_cfg->port = $prefix . "server_port";
! $srv_cfg->path = $prefix . "server_path";
! $sql = " /* $debugMsg */ SELECT cf.name, cfdv.value " .
! " FROM {$this->tables['cfield_design_values']} cfdv," .
! " {$this->tables['custom_fields']} cf " .
! " WHERE cfdv.field_id = cf.id AND cfdv.node_id = {$node_id}";
$server_info = $this->db->fetchRowsIntoMap($sql,'name');
! // $server_cfg_is_ok=0;
$server_use_host_port=0;
$server_use_path=0;
! if( (isset($server_info[$srv_cfg->host]) && $server_info[$srv_cfg->host]['value'] != "") &&
! (isset($server_info[$srv_cfg->port]) && $server_info[$srv_cfg->port]['value'] != "") )
{
! // $server_cfg_is_ok=1;
! $ret['xml_server_host'] = $server_info[$srv_cfg->host]['value'];
! $ret['xml_server_port'] = $server_info[$srv_cfg->port]['value'];
}
! else if (isset($server_info[$srv_cfg->path]) && $server_info[$srv_cfg->path]['value'] != "")
{
! // $server_cfg_is_ok=1;
! $ret['xml_server_path'] = $server_info[$srv_cfg->path]['value'];
}
else
{
+ // 20110123 - franciscom
+ // At time of initial development this was thinked to try to get
+ // server info from Test Suite.
+ // Because with TL 1.9.x when working with test case we will receive
+ // Test Case Version ID, instead of Test Case ID (1.8.x), we will do
+ // a call to reach Test Case and then another to reach Test Suite
+ //
+ //
if($node_info['parent_id'] != "")
{
! $ret = $this->getXMLRPCServerParams($node_info['parent_id']);
}
}