From ce84e9fed154c2c03a98a9b79d086efe3d586463 Mon Sep 17 00:00:00 2001
From: franciscom <>
Date: Sun, 7 Nov 2010 10:51:05 +0000
Subject: [PATCH 0001/1141] define('TL_VERSION', '2.0 (Development)');
---
cfg/const.inc.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cfg/const.inc.php b/cfg/const.inc.php
index 8e05070a59..d76e09bf47 100644
--- a/cfg/const.inc.php
+++ b/cfg/const.inc.php
@@ -9,7 +9,7 @@
* @package TestLink
* @author Martin Havlat
* @copyright 2007-2009, TestLink community
- * @version CVS: $Id: const.inc.php,v 1.167 2010/11/07 10:20:21 franciscom Exp $
+ * @version CVS: $Id: const.inc.php,v 1.168 2010/11/07 10:51:05 franciscom Exp $
* @see config.inc.php
*
* @internal
@@ -21,8 +21,8 @@
/* [GLOBAL SETTINGS] */
/** TestLink Release version (MUST BE changed before the release day) */
-define('TL_FACE_DIR', 'prague');
-define('TL_VERSION', '1.9 (QA - 20101107 - Prague)');
+define('TL_FACE_DIR', 'baires');
+define('TL_VERSION', '2.0 (Development)');
// needed to avoid problems in install scripts that do not include config.inc.php
// want to point to root install dir, need to remove fixed part
From ff01160fdcc595148533aa76016730d005270898 Mon Sep 17 00:00:00 2001
From: franciscom <>
Date: Sun, 7 Nov 2010 20:06:57 +0000
Subject: [PATCH 0002/1141] *** empty log message ***
---
locale/en_GB/strings.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/locale/en_GB/strings.txt b/locale/en_GB/strings.txt
index 24fc2d4928..b18561cc50 100644
--- a/locale/en_GB/strings.txt
+++ b/locale/en_GB/strings.txt
@@ -24,7 +24,7 @@
* @package TestLink
* @author Francisco Mancardi, Andreas Morsing, Martin Havlat
* @copyright 2003, TestLink community
- * @version CVS: $Id: strings.txt,v 1.751 2010/11/06 18:46:33 amkhullar Exp $
+ * @version CVS: $Id: strings.txt,v 1.752 2010/11/07 20:06:57 franciscom Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions: Not listed - check repository history
@@ -3125,6 +3125,9 @@ $TLS_insert_step = "Insert step";
$TLS_frozen_req_unable_to_import = 'Skipped - Requirement - Doc ID:%s - is FROZEN';
+$TLS_no_linked_cfields_for_testcase = 'There are no custom fields applicable to Test Cases, linked to Test Project';
+$TLS_no_cfield_with_this_name = 'There is no custom field with requested name (%s)';
+
// ----- lib/plan/planExport.php -----
$TLS_export_test_plan = 'Export Test Plan';
From 70969107ab8143f68cb30cf005a9c65da0ff0929 Mon Sep 17 00:00:00 2001
From: franciscom <>
Date: Sun, 7 Nov 2010 20:11:20 +0000
Subject: [PATCH 0003/1141] BUGID 3843 - get_id_by_custom_field()
---
lib/functions/testcase.class.php | 43 +++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/lib/functions/testcase.class.php b/lib/functions/testcase.class.php
index 6c4293ecc0..2052370b0b 100644
--- a/lib/functions/testcase.class.php
+++ b/lib/functions/testcase.class.php
@@ -6,11 +6,12 @@
* @package TestLink
* @author Francisco Mancardi ([email protected])
* @copyright 2005-2009, TestLink community
- * @version CVS: $Id: testcase.class.php,v 1.331 2010/10/30 15:17:29 franciscom Exp $
+ * @version CVS: $Id: testcase.class.php,v 1.332 2010/11/07 20:11:20 franciscom Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
*
+ * 20101107 - franciscom - BUGID 3843 - get_id_by_custom_field() (WIP)
* 20101030 - franciscom - get_by_external() interface changes
* get_basic_info() interface changes
*
@@ -5010,6 +5011,46 @@ function filter_tcversions_by_cfields($tcversion_id,$cf_hash,$options=null)
*
*
*/
+ function get_id_by_custom_field($cf_name, $cf_value, $tproject_id)
+ {
+ static $lbl;
+ if( is_null($lbl) )
+ {
+ $lbl = array();
+ $lbl['no_linked_cfields_for_testcase'] = lang_get('no_linked_cfields_for_testcase');
+ $lbl['no_cfield_with_this_name'] = lang_get('no_cfield_with_this_name');
+ }
+ $ret = array('status_ok' => false, 'msg' => '', 'id' => 0);
+
+
+ // check if custom field is linked to test project
+ $cfields_set = $this->tproject_mgr->get_linked_custom_fields($tproject_id,'testcase','name');
+ $ret['status_ok'] = !is_null($cfields_set);
+ if(!$ret['status_ok'])
+ {
+ $ret['msg'] = $lbl['no_linked_cfields_for_testcase'];
+
+ }
+
+ if($ret['status_ok'])
+ {
+ if( ($ret['status_ok'] = isset($cfields_set[$cf_name])) )
+ {
+ $cfield_id = $cfields_set[$cf_name]['id'];
+ }
+ else
+ {
+ $ret['msg'] = sprintf($lbl['no_cfield_with_this_name'],$cf_name);
+ }
+ }
+
+ if($ret['status_ok'])
+ {
+ // go for the test case
+ }
+
+ return $ret;
+ }
} // end class
?>
\ No newline at end of file
From 6f4ce31bd8bd78f540e6fa76ce124ddcb8e05201 Mon Sep 17 00:00:00 2001
From: amkhullar <>
Date: Mon, 8 Nov 2010 11:30:44 +0000
Subject: [PATCH 0004/1141] *** empty log message ***
---
lib/functions/requirements.inc.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/functions/requirements.inc.php b/lib/functions/requirements.inc.php
index 1a4c1fd66c..7b5c581c56 100644
--- a/lib/functions/requirements.inc.php
+++ b/lib/functions/requirements.inc.php
@@ -8,11 +8,12 @@
* @package TestLink
* @author Martin Havlat
* @copyright 2007-2009, TestLink community
- * @version CVS: $Id: requirements.inc.php,v 1.115 2010/11/06 18:46:33 amkhullar Exp $
+ * @version CVS: $Id: requirements.inc.php,v 1.116 2010/11/08 11:30:44 amkhullar Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
*
+ * 20101106 - amitkhullar - BUGID 3978: BTS integration Code getting triggered
* 20100919 - franciscom - importReqDataFromCSV() refactoring
* importReqDataFromDocBook() added missing keys on generated map
* 20100904 - franciscom - BUGID 0003745: CSV Requirements Import Updates Frozen Requirement
@@ -33,7 +34,7 @@
/** inlude basic functions for printing Test Specification document */
//require_once("print.inc.php"); //TODO is this needed here anymore after removal of render functions?
-
+// BUGID 3978
/**
* exportReqDataToXML
From d28cb0c21dfccc386e052505d1c2225397b72f66 Mon Sep 17 00:00:00 2001
From: asimon83 <>
Date: Tue, 9 Nov 2010 11:11:28 +0000
Subject: [PATCH 0005/1141] BUGID 3989
---
config.inc.php | 6 ++-
lib/functions/cfield_mgr.class.php | 39 +++++++++++++++-----
lib/functions/requirement_mgr.class.php | 11 ++++--
lib/functions/requirement_spec_mgr.class.php | 17 ++++++---
lib/functions/testcase.class.php | 11 ++++--
lib/functions/testplan.class.php | 13 ++++---
lib/functions/testsuite.class.php | 11 ++++--
7 files changed, 77 insertions(+), 31 deletions(-)
diff --git a/config.inc.php b/config.inc.php
index 3d46d4c839..c8c3dee9ba 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -18,10 +18,11 @@
*
* @package TestLink
* @copyright 2005-2009, TestLink community
- * @version CVS: $Id: config.inc.php,v 1.333 2010/10/30 07:50:43 franciscom Exp $
+ * @version CVS: $Id: config.inc.php,v 1.334 2010/11/09 11:11:28 asimon83 Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
+ * 20101109 - asimon - added $tlCfg->custom_fields->show_custom_fields_without_value
* 20101030 - franciscom - bullet image config removed
* 20101028 - Julian - BUGID 3950 - added $tlCfg->gui->dynamic_quick_tcase_search_input_size
* 20101014 - Julian - BUGID 3893 - added $tlCfg->metrics_dashboard->show_test_plan_status
@@ -1210,6 +1211,9 @@
$tlCfg->default_roleid = TL_ROLES_GUEST;
+// only show custom fields if their value isn't empty
+$tlCfg->custom_fields->show_custom_fields_without_value = true;
+
/** used to check size in char for TEXT AREA type custom fields */
// can not be greater that column definition on DB
// 0 => do not check.
diff --git a/lib/functions/cfield_mgr.class.php b/lib/functions/cfield_mgr.class.php
index 442f597821..5266aa2c91 100644
--- a/lib/functions/cfield_mgr.class.php
+++ b/lib/functions/cfield_mgr.class.php
@@ -7,10 +7,11 @@
* @author franciscom
* @copyright 2005-2009, TestLink community
* @copyright Mantis BT team (some parts of code was reuse from the Mantis project)
- * @version CVS: $Id: cfield_mgr.class.php,v 1.96 2010/11/06 11:43:09 amkhullar Exp $
+ * @version CVS: $Id: cfield_mgr.class.php,v 1.97 2010/11/09 11:11:28 asimon83 Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
+ * 20101109 - asimon - BUGID 3989: save custom field values only to db if they are not empty
* 20101104 - amitkhullar - Updated Order By Clause in get_linked_to_testproject()
* 20101026 - asimon - BUGID 3930: changing date format according to given locale
* 20101025 - asimon - BUGID 3716: date pull downs changed to calendar interface
@@ -854,14 +855,16 @@ function design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null)
}
$safe_value=$this->db->prepare_string($value);
- if($this->db->num_rows( $result ) > 0 )
+ // BUGID 3989
+ if($this->db->num_rows( $result ) > 0 && $value != "")
{
$sql = "/* $debugMsg */ UPDATE {$this->tables['cfield_design_values']} " .
" SET value='{$safe_value}' " .
" WHERE field_id={$field_id} AND node_id={$node_id}";
}
- else
+ // BUGID 3989
+ else if ($value != "")
{
# Remark got from Mantis code:
# Always store the value, even if it's the dafault value
@@ -870,7 +873,11 @@ function design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null)
$sql = "/* $debugMsg */ INSERT INTO {$this->tables['cfield_design_values']} " .
" ( field_id, node_id, value ) " .
" VALUES ( {$field_id}, {$node_id}, '{$safe_value}' )";
- }
+ // BUGID 3989
+ } else {
+ $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_design_values']} " .
+ " WHERE field_id={$field_id} AND node_id={$node_id}";
+ }
$this->db->exec_query($sql);
} //foreach($cfield
} //if( !is_null($cfield) )
@@ -1654,14 +1661,16 @@ function execution_values_to_db($hash,$node_id,$execution_id,$testplan_id,
$safe_value=$this->db->prepare_string($value);
// file_put_contents('c:\sql-count.txt',$this->db->num_rows( $result ));
- if( count($rs) > 0 ) //$this->db->num_rows($result) > 0 )
+ // BUGID 3989
+ if( count($rs) > 0 && $value != "") //$this->db->num_rows($result) > 0 )
{
$sql = "UPDATE {$this->tables['cfield_execution_values']} " .
" SET value='{$safe_value}' " .
$where_clause;
// file_put_contents('c:\update.txt',$sql);
}
- else
+ // BUGID 3989
+ else if ($value != "")
{
# Remark got from Mantis code:
@@ -1673,7 +1682,11 @@ function execution_values_to_db($hash,$node_id,$execution_id,$testplan_id,
" VALUES ( {$field_id}, {$node_id}, {$execution_id}, {$testplan_id}, '{$safe_value}' )";
// file_put_contents('c:\insert.txt',$sql);
- }
+ // BUGID 3989
+ } else {
+ $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_execution_values']} " .
+ " WHERE field_id={$field_id} AND node_id={$node_id}";
+ }
$this->db->exec_query($sql);
} //foreach($cfield
@@ -2100,14 +2113,16 @@ function testplan_design_values_to_db($hash,$node_id,$link_id,$cf_map=null,$hash
}
$safe_value=$this->db->prepare_string($value);
- if($this->db->num_rows( $result ) > 0 )
+ // BUGID 3989
+ if($this->db->num_rows( $result ) > 0 && $value != "")
{
$sql = "UPDATE {$this->tables['cfield_testplan_design_values']} " .
" SET value='{$safe_value}' " .
" WHERE field_id={$field_id} AND link_id={$link_id}";
}
- else
+ // BUGID 3989
+ else if ($value != "")
{
# Remark got from Mantis code:
# Always store the value, even if it's the dafault value
@@ -2116,7 +2131,11 @@ function testplan_design_values_to_db($hash,$node_id,$link_id,$cf_map=null,$hash
$sql = "INSERT INTO {$this->tables['cfield_testplan_design_values']} " .
" ( field_id, link_id, value ) " .
" VALUES ( {$field_id}, {$link_id}, '{$safe_value}' )";
- }
+ // BUGID 3989
+ } else {
+ $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testplan_design_values']} " .
+ " WHERE field_id={$field_id} AND node_id={$node_id}";
+ }
$this->db->exec_query($sql);
} //foreach($cfield
} //if( !is_null($cfield) )
diff --git a/lib/functions/requirement_mgr.class.php b/lib/functions/requirement_mgr.class.php
index 5a20960a8a..14f2721dee 100644
--- a/lib/functions/requirement_mgr.class.php
+++ b/lib/functions/requirement_mgr.class.php
@@ -5,14 +5,15 @@
*
* Filename $RCSfile: requirement_mgr.class.php,v $
*
- * @version $Revision: 1.114 $
- * @modified $Date: 2010/10/12 05:52:38 $ by $Author: franciscom $
+ * @version $Revision: 1.115 $
+ * @modified $Date: 2010/11/09 11:11:28 $ by $Author: asimon83 $
* @author Francisco Mancardi
*
* Manager for requirements.
* Requirements are children of a requirement specification (requirements container)
*
* rev:
+ * 20101109 - asimon - BUGID 3989: now it is configurable if custom fields without values are shown
* 20101012 - franciscom - html_table_of_custom_field_inputs() refactoring to use new method on cfield_mgr class
* 20101011 - franciscom - BUGID 3886: CF Types validation - changes in html_table_of_custom_field_inputs()
* 20101011 - Julian - BUGID 3876: Values of custom fields are not displayed when editing requirement
@@ -1496,12 +1497,16 @@ function html_table_of_custom_field_values($id,$version_id)
$cf_map = $this->get_linked_cfields($id,$version_id,$PID_NO_NEEDED);
+ // BUGID 3989
+ $show_cf = config_get('custom_fields')->show_custom_fields_without_value;
+
if(!is_null($cf_map))
{
foreach($cf_map as $cf_id => $cf_info)
{
// if user has assigned a value, then node_id is not null
- if($cf_info['node_id'])
+ // BUGID 3989
+ if($cf_info['node_id'] || $show_cf)
{
$label = str_replace(TL_LOCALIZE_TAG,'',
lang_get($cf_info['label'],null,$NO_WARNING_IF_MISSING));
diff --git a/lib/functions/requirement_spec_mgr.class.php b/lib/functions/requirement_spec_mgr.class.php
index 3285453814..b2b1d63d1f 100644
--- a/lib/functions/requirement_spec_mgr.class.php
+++ b/lib/functions/requirement_spec_mgr.class.php
@@ -5,16 +5,16 @@
*
* Filename $RCSfile: requirement_spec_mgr.class.php,v $
*
- * @version $Revision: 1.87 $
- * @modified $Date: 2010/09/19 17:43:52 $ by $Author: franciscom $
+ * @version $Revision: 1.88 $
+ * @modified $Date: 2010/11/09 11:11:28 $ by $Author: asimon83 $
* @author Francisco Mancardi
*
* Manager for requirement specification (requirement container)
*
- * @internal revision:
+ * @internal revision:
+ * 20101109 - asimon - BUGID 3989: now it is configurable if custom fields without values are shown
* 20100908 - franciscom - BUGID 3762 Import Req Spec - custom fields values are ignored
* createFromXML()
- *
* 20100320 - franciscom - xmlToMapReqSpec() added attributes: type,total_req
* 20100311 - franciscom - fixed bug due to missed isset() control
* 20100307 - amitkhullar - small bug fix for Requirements based report.
@@ -1258,12 +1258,17 @@ function html_table_of_custom_field_values($id,$tproject_id)
$NO_WARNING_IF_MISSING=true;
$cf_smarty = '';
$cf_map = $this->get_linked_cfields($id,$tproject_id);
- if(!is_null($cf_map))
+
+ // BUGID 3989
+ $show_cf = config_get('custom_fields')->show_custom_fields_without_value;
+
+ if(!is_null($cf_map))
{
foreach($cf_map as $cf_id => $cf_info)
{
// if user has assigned a value, then node_id is not null
- if($cf_info['node_id'])
+ // BUGID 3989
+ if($cf_info['node_id'] || $show_cf)
{
$label = str_replace(TL_LOCALIZE_TAG,'',
lang_get($cf_info['label'],null,$NO_WARNING_IF_MISSING));
diff --git a/lib/functions/testcase.class.php b/lib/functions/testcase.class.php
index 2052370b0b..fc7e6bf422 100644
--- a/lib/functions/testcase.class.php
+++ b/lib/functions/testcase.class.php
@@ -6,11 +6,12 @@
* @package TestLink
* @author Francisco Mancardi ([email protected])
* @copyright 2005-2009, TestLink community
- * @version CVS: $Id: testcase.class.php,v 1.332 2010/11/07 20:11:20 franciscom Exp $
+ * @version CVS: $Id: testcase.class.php,v 1.333 2010/11/09 11:11:28 asimon83 Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
*
+ * 20101109 - asimon - BUGID 3989: now it is configurable if custom fields without values are shown
* 20101107 - franciscom - BUGID 3843 - get_id_by_custom_field() (WIP)
* 20101030 - franciscom - get_by_external() interface changes
* get_basic_info() interface changes
@@ -4078,13 +4079,17 @@ function html_table_of_custom_field_values($id,$scope='design',$filters=null,$ex
$testplan_id,$tproject_id,$location);
break;
}
-
+
+ // BUGID 3989
+ $show_cf = config_get('custom_fields')->show_custom_fields_without_value;
+
if(!is_null($cf_map))
{
foreach($cf_map as $cf_id => $cf_info)
{
// if user has assigned a value, then node_id is not null
- if(isset($cf_info['node_id']) )
+ // BUGID 3989
+ if(isset($cf_info['node_id']) || $show_cf)
{
// true => do not create input in audit log
$label=str_replace(TL_LOCALIZE_TAG,'',lang_get($cf_info['label'],null,true));
diff --git a/lib/functions/testplan.class.php b/lib/functions/testplan.class.php
index 78843dda49..56f4cba53b 100644
--- a/lib/functions/testplan.class.php
+++ b/lib/functions/testplan.class.php
@@ -9,13 +9,13 @@
* @package TestLink
* @author franciscom
* @copyright 2007-2009, TestLink community
- * @version CVS: $Id: testplan.class.php,v 1.235 2010/11/01 11:43:00 franciscom Exp $
+ * @version CVS: $Id: testplan.class.php,v 1.236 2010/11/09 11:11:28 asimon83 Exp $
* @link http://www.teamst.org/index.php
*
*
* @internal Revisions:
+ * 20101109 - asimon - BUGID 3989: now it is configurable if custom fields without values are shown
* 20101101 - franciscom - exportTestPlanDataToXML() interface changes + changes in output (more info added)
- *
* 20101030 - amitkhullar - BUGID 3845 delete() - Reordered deletion of tables due to error generated
* when using this method as part of Test Project delete.
* (Postgres complains due to use of Foreing Keys).
@@ -2467,8 +2467,10 @@ function html_table_of_custom_field_values($id,$scope='design',$filters=null,$fo
$add_table=isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true;
$table_style=isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style;
}
-
-
+
+ // BUGID 3989
+ $show_cf = config_get('custom_fields')->show_custom_fields_without_value;
+
if( $scope=='design' )
{
$cf_map=$this->get_linked_cfields_at_design($id,$parent_id,$filters);
@@ -2483,7 +2485,8 @@ function html_table_of_custom_field_values($id,$scope='design',$filters=null,$fo
foreach($cf_map as $cf_id => $cf_info)
{
// if user has assigned a value, then node_id is not null
- if(isset($cf_info['node_id']) && $cf_info['node_id'])
+ // BUGID 3989
+ if(isset($cf_info['node_id']) || $cf_info['node_id'] || $show_cf)
{
// true => do not create input in audit log
$label=str_replace(TL_LOCALIZE_TAG,'',lang_get($cf_info['label'],null,true));
diff --git a/lib/functions/testsuite.class.php b/lib/functions/testsuite.class.php
index 9dd7b16468..df44fc320d 100644
--- a/lib/functions/testsuite.class.php
+++ b/lib/functions/testsuite.class.php
@@ -6,11 +6,12 @@
* @package TestLink
* @author franciscom
* @copyright 2005-2009, TestLink community
- * @version CVS: $Id: testsuite.class.php,v 1.106 2010/10/12 19:06:20 franciscom Exp $
+ * @version CVS: $Id: testsuite.class.php,v 1.107 2010/11/09 11:11:28 asimon83 Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
*
+ * 20101109 - asimon - BUGID 3989: now it is configurable if custom fields without values are shown
* 20101012 - franciscom - html_table_of_custom_field_inputs() refactoring to use new method on cfield_mgr class
* 20101009 - franciscom - exportTestSuiteDataToXML() - better checks on $optExport
* 20100920 - franciscom - html_table_of_custom_field_values() changed keys on $formatOptions
@@ -1266,7 +1267,10 @@ function html_table_of_custom_field_values($id,$scope='design',$show_on_executio
$cf_smarty='';
$parent_id=null;
-
+
+ // BUGID 3989
+ $show_cf = config_get('custom_fields')->show_custom_fields_without_value;
+
if( $scope=='design' )
{
$cf_map = $this->get_linked_cfields_at_design($id,$parent_id,$filters,$tproject_id);
@@ -1283,7 +1287,8 @@ function html_table_of_custom_field_values($id,$scope='design',$show_on_executio
foreach($cf_map as $cf_id => $cf_info)
{
// if user has assigned a value, then node_id is not null
- if($cf_info['node_id'])
+ // BUGID 3989
+ if($cf_info['node_id'] || $show_cf)
{
// true => do not create input in audit log
$label=str_replace(TL_LOCALIZE_TAG,'',lang_get($cf_info['label'],null,true));
From 97e9323245a5088b7dc31c7048b00a4b10cdef82 Mon Sep 17 00:00:00 2001
From: asimon83 <>
Date: Tue, 9 Nov 2010 14:58:41 +0000
Subject: [PATCH 0006/1141] BUGID 3989: save custom field values only to db if
they are not empty
---
lib/functions/cfield_mgr.class.php | 40 ++++++++++++++++--------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/lib/functions/cfield_mgr.class.php b/lib/functions/cfield_mgr.class.php
index 5266aa2c91..89adee3b28 100644
--- a/lib/functions/cfield_mgr.class.php
+++ b/lib/functions/cfield_mgr.class.php
@@ -7,7 +7,7 @@
* @author franciscom
* @copyright 2005-2009, TestLink community
* @copyright Mantis BT team (some parts of code was reuse from the Mantis project)
- * @version CVS: $Id: cfield_mgr.class.php,v 1.97 2010/11/09 11:11:28 asimon83 Exp $
+ * @version CVS: $Id: cfield_mgr.class.php,v 1.98 2010/11/09 14:58:41 asimon83 Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
@@ -862,6 +862,7 @@ function design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null)
$sql = "/* $debugMsg */ UPDATE {$this->tables['cfield_design_values']} " .
" SET value='{$safe_value}' " .
" WHERE field_id={$field_id} AND node_id={$node_id}";
+ $this->db->exec_query($sql);
}
// BUGID 3989
else if ($value != "")
@@ -873,12 +874,14 @@ function design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null)
$sql = "/* $debugMsg */ INSERT INTO {$this->tables['cfield_design_values']} " .
" ( field_id, node_id, value ) " .
" VALUES ( {$field_id}, {$node_id}, '{$safe_value}' )";
+ $this->db->exec_query($sql);
// BUGID 3989
} else {
$sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_design_values']} " .
" WHERE field_id={$field_id} AND node_id={$node_id}";
+ $this->db->exec_query($sql);
}
- $this->db->exec_query($sql);
+
} //foreach($cfield
} //if( !is_null($cfield) )
@@ -1644,14 +1647,13 @@ function execution_values_to_db($hash,$node_id,$execution_id,$testplan_id,
$where_clause = " WHERE field_id={$field_id} AND tcversion_id={$node_id} " .
" AND execution_id={$execution_id} AND testplan_id={$testplan_id}" ;
+ $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
// do I need to update or insert this value?
$sql = " SELECT value,field_id,execution_id " .
" FROM {$this->tables['cfield_execution_values']} " . $where_clause;
- // file_put_contents('c:\sql.txt',$sql);
$rs = $this->db->get_recordset($sql);
- // file_put_contents('c:\sql-dd.txt',serialize($rs));
// max_length_value = 0 => no limit
if( $this->max_length_value > 0 && tlStringLen($value) > $this->max_length_value)
@@ -1660,17 +1662,16 @@ function execution_values_to_db($hash,$node_id,$execution_id,$testplan_id,
}
$safe_value=$this->db->prepare_string($value);
- // file_put_contents('c:\sql-count.txt',$this->db->num_rows( $result ));
// BUGID 3989
if( count($rs) > 0 && $value != "") //$this->db->num_rows($result) > 0 )
{
$sql = "UPDATE {$this->tables['cfield_execution_values']} " .
" SET value='{$safe_value}' " .
$where_clause;
- // file_put_contents('c:\update.txt',$sql);
+ $this->db->exec_query($sql);
}
// BUGID 3989
- else if ($value != "")
+ else if (count($rs) == 0 && $value != "")
{
# Remark got from Mantis code:
@@ -1680,19 +1681,17 @@ function execution_values_to_db($hash,$node_id,$execution_id,$testplan_id,
$sql = "INSERT INTO {$this->tables['cfield_execution_values']} " .
" ( field_id, tcversion_id, execution_id,testplan_id,value ) " .
" VALUES ( {$field_id}, {$node_id}, {$execution_id}, {$testplan_id}, '{$safe_value}' )";
- // file_put_contents('c:\insert.txt',$sql);
-
+ $this->db->exec_query($sql);
+
// BUGID 3989
- } else {
+ } else if (count($rs) > 0 && $value == "") {
$sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_execution_values']} " .
- " WHERE field_id={$field_id} AND node_id={$node_id}";
+ $where_clause;
+ $this->db->exec_query($sql);
}
-
- $this->db->exec_query($sql);
+
} //foreach($cfield
} //if( !is_null($cfield) )
- // file_put_contents('c:\bye.txt','bye');
-
} //function end
@@ -2091,7 +2090,7 @@ function testplan_design_values_to_db($hash,$node_id,$link_id,$cf_map=null,$hash
{
return;
}
-
+ $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
$cfield = is_null($hash_type) ? $this->_build_cfield($hash,$cf_map) : $hash;
if( !is_null($cfield) )
{
@@ -2120,9 +2119,10 @@ function testplan_design_values_to_db($hash,$node_id,$link_id,$cf_map=null,$hash
$sql = "UPDATE {$this->tables['cfield_testplan_design_values']} " .
" SET value='{$safe_value}' " .
" WHERE field_id={$field_id} AND link_id={$link_id}";
+ $this->db->exec_query($sql);
}
// BUGID 3989
- else if ($value != "")
+ else if ($this->db->num_rows( $result ) == 0 && $value != "")
{
# Remark got from Mantis code:
# Always store the value, even if it's the dafault value
@@ -2131,12 +2131,14 @@ function testplan_design_values_to_db($hash,$node_id,$link_id,$cf_map=null,$hash
$sql = "INSERT INTO {$this->tables['cfield_testplan_design_values']} " .
" ( field_id, link_id, value ) " .
" VALUES ( {$field_id}, {$link_id}, '{$safe_value}' )";
+ $this->db->exec_query($sql);
// BUGID 3989
- } else {
+ } else if ($this->db->num_rows( $result ) > 0 && $value == "") {
$sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testplan_design_values']} " .
" WHERE field_id={$field_id} AND node_id={$node_id}";
+ $this->db->exec_query($sql);
}
- $this->db->exec_query($sql);
+
} //foreach($cfield
} //if( !is_null($cfield) )
From c52a690756eeb3d02bc302dbf7ef44e44fa67b93 Mon Sep 17 00:00:00 2001
From: asimon83 <>
Date: Tue, 9 Nov 2010 15:27:19 +0000
Subject: [PATCH 0007/1141] BUGID 3989
---
lib/functions/cfield_mgr.class.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/functions/cfield_mgr.class.php b/lib/functions/cfield_mgr.class.php
index 89adee3b28..bb707e0c96 100644
--- a/lib/functions/cfield_mgr.class.php
+++ b/lib/functions/cfield_mgr.class.php
@@ -7,7 +7,7 @@
* @author franciscom
* @copyright 2005-2009, TestLink community
* @copyright Mantis BT team (some parts of code was reuse from the Mantis project)
- * @version CVS: $Id: cfield_mgr.class.php,v 1.98 2010/11/09 14:58:41 asimon83 Exp $
+ * @version CVS: $Id: cfield_mgr.class.php,v 1.99 2010/11/09 15:27:19 asimon83 Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
@@ -2132,11 +2132,11 @@ function testplan_design_values_to_db($hash,$node_id,$link_id,$cf_map=null,$hash
" ( field_id, link_id, value ) " .
" VALUES ( {$field_id}, {$link_id}, '{$safe_value}' )";
$this->db->exec_query($sql);
- // BUGID 3989
- } else if ($this->db->num_rows( $result ) > 0 && $value == "") {
- $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testplan_design_values']} " .
- " WHERE field_id={$field_id} AND node_id={$node_id}";
- $this->db->exec_query($sql);
+ // BUGID 3989
+ } else if ($this->db->num_rows( $result ) > 0 && $value == "") {
+ $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testplan_design_values']} " .
+ " WHERE field_id={$field_id} AND link_id={$link_id}";
+ $this->db->exec_query($sql);
}
} //foreach($cfield
From 8820baf3cc2cbde3bfd87e9c3313dcc13d37d4f1 Mon Sep 17 00:00:00 2001
From: amkhullar <>
Date: Wed, 10 Nov 2010 07:05:16 +0000
Subject: [PATCH 0008/1141] BUGID 3995 Custom Field Filters not working
properly since the cf_hash is array
---
lib/functions/testplan.class.php | 34 ++++++++++++++----
lib/functions/treeMenu.inc.php | 60 ++++++++++++++++++++++----------
2 files changed, 69 insertions(+), 25 deletions(-)
diff --git a/lib/functions/testplan.class.php b/lib/functions/testplan.class.php
index 56f4cba53b..4de36dad2a 100644
--- a/lib/functions/testplan.class.php
+++ b/lib/functions/testplan.class.php
@@ -9,11 +9,12 @@
* @package TestLink
* @author franciscom
* @copyright 2007-2009, TestLink community
- * @version CVS: $Id: testplan.class.php,v 1.236 2010/11/09 11:11:28 asimon83 Exp $
+ * @version CVS: $Id: testplan.class.php,v 1.237 2010/11/10 07:05:16 amkhullar Exp $
* @link http://www.teamst.org/index.php
*
*
* @internal Revisions:
+ * 20101110 - amitkhullar - BUGID 3995 Custom Field Filters not working properly since the cf_hash is array
* 20101109 - asimon - BUGID 3989: now it is configurable if custom fields without values are shown
* 20101101 - franciscom - exportTestPlanDataToXML() interface changes + changes in output (more info added)
* 20101030 - amitkhullar - BUGID 3845 delete() - Reordered deletion of tables due to error generated
@@ -2524,12 +2525,30 @@ function filter_cf_selection ($tp_tcs, $cf_hash)
// BUGID 3809 - Radio button based Custom Fields not working
$or_clause = '';
$cf_query = '';
- foreach ($cf_hash as $cf_id => $cf_value)
- {
- $cf_query .= $or_clause . " (CFD.field_id=" . $cf_id . " AND CFD.value='" . $cf_value . "') ";
- $or_clause = ' or ';
+ //BUGID 3995 Custom Field Filters not working properly since the cf_hash is array
+ if (isset($cf_hash)) {
+ $suffix = 1;
+
+ foreach ($cf_hash as $cf_id => $cf_value) {
+ // single value or array?
+ if (is_array($cf_value)) {
+ $cf_query .= " AND ( ";
+ $count = 1;
+ foreach ($cf_value as $value) {
+ if ($count > 1) {
+ $cf_query .= " AND ";
+ }
+ $cf_query .= " ( CFD.value LIKE '%{$value}%' AND CFD.field_id = {$cf_id} )";
+ $count++;
+ }
+ $cf_query .= " ) ";
+ } else {
+ $cf_query .= " AND CFD.value LIKE '%{$cf_value}%' ";
+ }
+ $suffix ++;
+ }
}
-
+
$cf_qty = count($cf_hash);
foreach ($tp_tcs as $tc_id => $tc_value)
{
@@ -2537,7 +2556,8 @@ function filter_cf_selection ($tp_tcs, $cf_hash)
$sql = " /* $debugMsg */ SELECT CFD.value FROM {$this->tables['cfield_design_values']} CFD," .
" {$this->tables['nodes_hierarchy']} NH" .
" WHERE CFD.node_id = NH.id " .
- " AND NH.parent_id = {$tc_value['tc_id']} AND ({$cf_query})";
+ " AND NH.parent_id = {$tc_value['tc_id']} " .
+ " {$cf_query} ";
$rows = $this->db->fetchRowsIntoMap($sql,'value');
// if there exist as many rows as custom fields to be filtered by => tc does meet the criteria
diff --git a/lib/functions/treeMenu.inc.php b/lib/functions/treeMenu.inc.php
index 7daec3840c..9c9a69b3a7 100644
--- a/lib/functions/treeMenu.inc.php
+++ b/lib/functions/treeMenu.inc.php
@@ -8,22 +8,23 @@
* @package TestLink
* @author Martin Havlat
* @copyright 2005-2009, TestLink community
- * @version CVS: $Id: treeMenu.inc.php,v 1.154 2010/10/10 14:45:20 franciscom Exp $
+ * @version CVS: $Id: treeMenu.inc.php,v 1.155 2010/11/10 07:05:16 amkhullar Exp $
* @link http://www.teamst.org/index.php
* @uses config.inc.php
*
* @internal Revisions:
- * 20101010 - franciscom - added testlink_node_name as new attribute to be accessed while working with EXT-JS tree
- * 20101003 - franciscom - generateExecTree() - added option remove_empty_nodes_of_type on get_subtree() call
+ * 20101110 - amitkhullar - BUGID 3995 Custom Field Filters not working properly since the cf_hash is array
+ * 20101010 - franciscom - added testlink_node_name as new attribute to be accessed while working with EXT-JS tree
+ * 20101003 - franciscom - generateExecTree() - added option remove_empty_nodes_of_type on get_subtree() call
* 20100929 - asimon - BUGID 3814: fixed keyword filtering with "and" selected as type
* 20100926 - amitkhullar - BUGID 3806 - Filter not working in tree menu for Assign TC Execution
- * 20100912 - franciscom - BUGID 3772: MS SQL - LIMIT CLAUSE can not be used
- * 20100908 - Julian - BUGID 2877 - Custom Fields linked to Req versions
+ * 20100912 - franciscom - BUGID 3772: MS SQL - LIMIT CLAUSE can not be used
+ * 20100908 - Julian - BUGID 2877 - Custom Fields linked to Req versions
* - Custom Fields linked to TC versions
- * 20100908 - franciscom - extjs_renderExecTreeNodeOnOpen() - 'tlNodeType' -> testlink_node_type
+ * 20100908 - franciscom - extjs_renderExecTreeNodeOnOpen() - 'tlNodeType' -> testlink_node_type
* 20100820 - asimon - refactoring for less redundant checks and better readibility of code
* in generateExecTree()
- * 20100812 - franciscom - get_filtered_req_map() - BUGID 3671
+ * 20100812 - franciscom - get_filtered_req_map() - BUGID 3671
* 20100810 - asimon - added filtering by TC ID on prepareNode() and generateTestSpecTree()
* 20100808 - asimon - generate_reqspec_tree() implemented to generate statically filtered
* requirement specification tree, plus additional functions
@@ -40,7 +41,7 @@
* 20100622 - asimon - refactoring of following functions for new filter classes:
* generateExecTree, renderExecTreeNode(), prepareNode(),
* generateTestSpecTree, renderTreeNode(), filter_by_*()
- * 20100611 - franciscom - renderExecTreeNode(), renderTreeNode() interface changes
+ * 20100611 - franciscom - renderExecTreeNode(), renderTreeNode() interface changes
* generateExecTree() - interface changes and output changes
* 20100602 - franciscom - extjs_renderExecTreeNodeOnOpen() - added 'tlNodeType'
* 20100428 - asimon - BUGID 3301 and related:
@@ -49,18 +50,18 @@
* "undefined" error in event log,
* added function filter_by_cfield_values()
* which is used from generateTestSpecTree()
- * 20100417 - franciscom - BUGID 2498 - spec tree - filter by test case spec importance
- * 20100417 - franciscom - BUGID 3380 - execution tree - filter by test case execution type
- * 20100415 - franciscom - BUGID 2797 - filter by test case execution type
- * 20100202 - asimon - changes for filtering, BUGID 2455, BUGID 3026
+ * 20100417 - franciscom - BUGID 2498 - spec tree - filter by test case spec importance
+ * 20100417 - franciscom - BUGID 3380 - execution tree - filter by test case execution type
+ * 20100415 - franciscom - BUGID 2797 - filter by test case execution type
+ * 20100202 - asimon - changes for filtering, BUGID 2455, BUGID 3026
* added filter_by_* - functions, changed generateExecTree()
- * 20091212 - franciscom - prepareNode(), generateTestSpecTree() interface changes
+ * 20091212 - franciscom - prepareNode(), generateTestSpecTree() interface changes
* added logic to do filtering on test spec for execution type
*
- * 20090815 - franciscom - get_last_execution() call changes
+ * 20090815 - franciscom - get_last_execution() call changes
* 20090801 - franciscom - table prefix missed
- * 20090716 - franciscom - BUGID 2692
- * 20090328 - franciscom - BUGID 2299 - introduced on 20090308.
+ * 20090716 - franciscom - BUGID 2692
+ * 20090328 - franciscom - BUGID 2299 - introduced on 20090308.
* Added logic to remove Empty Top level test suites
* (have neither test cases nor test suites inside) when applying
* test case keyword filtering.
@@ -232,7 +233,6 @@ function generateTestSpecTree(&$db,$tproject_id, $tproject_name,$linkto,$filters
// BUGID 3301 - added filtering by custom field values
if (isset($my['filters']['filter_custom_fields'])
&& isset($test_spec['childNodes'])) {
-
$test_spec['childNodes'] = filter_by_cf_values($test_spec['childNodes'],
$my['filters']['filter_custom_fields'],
$db, $tsuite_node_type, $tcase_node_type);
@@ -1500,7 +1500,31 @@ function filter_by_cf_values(&$tcase_tree, &$cf_hash, &$db, $node_type_testsuite
$sql = " /* $debugMsg */ SELECT CFD.value FROM {$tables['cfield_design_values']} CFD," .
" {$tables['nodes_hierarchy']} NH" .
" WHERE CFD.node_id = NH.id" .
- " AND NH.parent_id = {$node['id']} AND value in ('" . implode("' , '",$cf_hash) . "')";
+ " AND NH.parent_id = {$node['id']} ";
+ // AND value in ('" . implode("' , '",$cf_hash) . "')";
+ //BUGID 3995 Custom Field Filters not working properly since the cf_hash is array
+ if (isset($cf_hash)) {
+ $suffix = 1;
+
+ foreach ($cf_hash as $cf_id => $cf_value) {
+ // single value or array?
+ if (is_array($cf_value)) {
+ $sql .= " AND ( ";
+ $count = 1;
+ foreach ($cf_value as $value) {
+ if ($count > 1) {
+ $sql .= " AND ";
+ }
+ $sql .= " ( CFD.value LIKE '%{$value}%' AND CFD.field_id = {$cf_id} )";
+ $count++;
+ }
+ $sql .= " ) ";
+ } else {
+ $sql .= " AND CFD.value LIKE '%{$cf_value}%' ";
+ }
+ $suffix ++;
+ }
+ }
$rows = $db->fetchRowsIntoMap($sql,'value');
From df27d1b8bd359bf494c800f21e48de2ee91a5fdc Mon Sep 17 00:00:00 2001
From: mx-julian <>
Date: Wed, 10 Nov 2010 09:48:37 +0000
Subject: [PATCH 0009/1141] BUGID 3989 - improved else if statements
---
lib/functions/cfield_mgr.class.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/functions/cfield_mgr.class.php b/lib/functions/cfield_mgr.class.php
index bb707e0c96..cce1caf48a 100644
--- a/lib/functions/cfield_mgr.class.php
+++ b/lib/functions/cfield_mgr.class.php
@@ -7,7 +7,7 @@
* @author franciscom
* @copyright 2005-2009, TestLink community
* @copyright Mantis BT team (some parts of code was reuse from the Mantis project)
- * @version CVS: $Id: cfield_mgr.class.php,v 1.99 2010/11/09 15:27:19 asimon83 Exp $
+ * @version CVS: $Id: cfield_mgr.class.php,v 1.100 2010/11/10 09:48:37 mx-julian Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
@@ -865,7 +865,7 @@ function design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null)
$this->db->exec_query($sql);
}
// BUGID 3989
- else if ($value != "")
+ else if ($this->db->num_rows( $result ) == 0 && $value != "")
{
# Remark got from Mantis code:
# Always store the value, even if it's the dafault value
@@ -876,7 +876,7 @@ function design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null)
" VALUES ( {$field_id}, {$node_id}, '{$safe_value}' )";
$this->db->exec_query($sql);
// BUGID 3989
- } else {
+ } else if ($this->db->num_rows( $result ) > 0 && $value == 0) {
$sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_design_values']} " .
" WHERE field_id={$field_id} AND node_id={$node_id}";
$this->db->exec_query($sql);
From f2323d087e1166c088918f28bf954ebd2cc33d73 Mon Sep 17 00:00:00 2001
From: mx-julian <>
Date: Wed, 10 Nov 2010 09:52:51 +0000
Subject: [PATCH 0010/1141] fixed wrong comparison of value
---
lib/functions/cfield_mgr.class.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/functions/cfield_mgr.class.php b/lib/functions/cfield_mgr.class.php
index cce1caf48a..15a29deaf2 100644
--- a/lib/functions/cfield_mgr.class.php
+++ b/lib/functions/cfield_mgr.class.php
@@ -7,7 +7,7 @@
* @author franciscom
* @copyright 2005-2009, TestLink community
* @copyright Mantis BT team (some parts of code was reuse from the Mantis project)
- * @version CVS: $Id: cfield_mgr.class.php,v 1.100 2010/11/10 09:48:37 mx-julian Exp $
+ * @version CVS: $Id: cfield_mgr.class.php,v 1.101 2010/11/10 09:52:51 mx-julian Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
@@ -876,7 +876,7 @@ function design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null)
" VALUES ( {$field_id}, {$node_id}, '{$safe_value}' )";
$this->db->exec_query($sql);
// BUGID 3989
- } else if ($this->db->num_rows( $result ) > 0 && $value == 0) {
+ } else if ($this->db->num_rows( $result ) > 0 && $value == "") {
$sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_design_values']} " .
" WHERE field_id={$field_id} AND node_id={$node_id}";
$this->db->exec_query($sql);
From 64042636dacb5b0067fa903472e3f3b1384cef9f Mon Sep 17 00:00:00 2001
From: franciscom <>
Date: Wed, 10 Nov 2010 15:09:00 +0000
Subject: [PATCH 0011/1141] BUGID 3992 - getTestCasesForTestPlan() keywords
issue BUGID 3991 - getValidKeywordSetById() missing $this in return
---
.../php/clientGetTestCasesForTestPlan.php | 37 +++++++++++++++----
lib/api/xmlrpc.class.php | 33 +++++++++++------
2 files changed, 50 insertions(+), 20 deletions(-)
diff --git a/lib/api/sample_clients/php/clientGetTestCasesForTestPlan.php b/lib/api/sample_clients/php/clientGetTestCasesForTestPlan.php
index 9932aa39b4..5447fcf0e1 100644
--- a/lib/api/sample_clients/php/clientGetTestCasesForTestPlan.php
+++ b/lib/api/sample_clients/php/clientGetTestCasesForTestPlan.php
@@ -5,8 +5,8 @@
*
* Filename $RCSfile: clientGetTestCasesForTestPlan.php,v $
*
- * @version $Revision: 1.5 $
- * @modified $Date: 2010/07/15 16:27:25 $ by $Author: franciscom $
+ * @version $Revision: 1.6 $
+ * @modified $Date: 2010/11/10 15:09:00 $ by $Author: franciscom $
* @Author: [email protected]
*
* rev:
@@ -21,9 +21,10 @@
$test_num=1;
$unitTestDescription="Test {$test_num} - {$method}";
+$tplan_id = 3020;
$args=array();
$args["devKey"]=DEV_KEY;
-$args["testplanid"]=227;
+$args["testplanid"]=$tplan_id;
$args["executiontype"]=2;
$additionalInfo='';
@@ -42,9 +43,9 @@
$args=array();
$args["devKey"]=DEV_KEY;
-$args["testplanid"]=227;
-$args["keywords"]='KU,UOL';
-$additionalInfo='Filter by Keyword name';
+$args["testplanid"]=$tplan_id;
+$args["keywords"]='Key Feature';
+$additionalInfo='Filter by Keyword name - JUST ONE KEYWORD';
$debug=true;
echo $unitTestDescription;
@@ -61,7 +62,27 @@
$args=array();
$args["devKey"]=DEV_KEY;
-$args["testplanid"]=227;
+$args["testplanid"]=$tplan_id;
+$args["keywords"]='Key Feature,Must have,Obsolete,Performance,System wide,Usability';
+$additionalInfo='Filter by Keyword name - Multiple Keywords - ONLY OR Search';
+
+$debug=true;
+echo $unitTestDescription;
+echo $additionalInfo;
+
+$client = new IXR_Client($server_url);
+$client->debug=$debug;
+
+$answer = runTest($client,$method,$args,$test_num);
+// ---------------------------------------------------------------------------------
+
+
+// ---------------------------------------------------------------------------------
+$test_num++;
+
+$args=array();
+$args["devKey"]=DEV_KEY;
+$args["testplanid"]=$tplan_id;
$args["getstepsinfo"]=false;
$additionalInfo='get steps info: -> false';
@@ -81,7 +102,7 @@
$args=array();
$args["devKey"]=DEV_KEY;
-$args["testplanid"]=227;
+$args["testplanid"]=$tplan_id;
$args["getstepsinfo"]=true;
$additionalInfo='get steps info: -> true';
diff --git a/lib/api/xmlrpc.class.php b/lib/api/xmlrpc.class.php
index c935f0beb8..dab4539a0b 100644
--- a/lib/api/xmlrpc.class.php
+++ b/lib/api/xmlrpc.class.php
@@ -5,8 +5,8 @@
*
* Filename $RCSfile: xmlrpc.class.php,v $
*
- * @version $Revision: 1.23 $
- * @modified $Date: 2010/10/23 09:45:34 $ by $Author: franciscom $
+ * @version $Revision: 1.24 $
+ * @modified $Date: 2010/11/10 15:09:00 $ by $Author: franciscom $
* @author Asiel Brumfield =CNjyHU3iNdi_66dhNcfO%Um`>AoUuG?0pzZ!E^Mmo0~E(T
zuZY}ynJv3`GUbGunE@yCWd>Q;A
debug - " . __FUNCTION__ . "
" . $sql . "
";
+
+
+ $rs = $this->db->fetchRowsIntoMap($sql,'node_id');
+ return($rs);
+}
+
} // end class
?>
From 43266b6454583faa2cc4837d1caa8bff9491da7e Mon Sep 17 00:00:00 2001
From: franciscom <>
Date: Wed, 10 Nov 2010 17:21:13 +0000
Subject: [PATCH 0014/1141] BUGID 3843 -> get_linked_items_at_design() new
method
---
lib/functions/cfield_mgr.class.php | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/lib/functions/cfield_mgr.class.php b/lib/functions/cfield_mgr.class.php
index 4fd69ed559..42a7710948 100644
--- a/lib/functions/cfield_mgr.class.php
+++ b/lib/functions/cfield_mgr.class.php
@@ -7,7 +7,7 @@
* @author franciscom
* @copyright 2005-2009, TestLink community
* @copyright Mantis BT team (some parts of code was reuse from the Mantis project)
- * @version CVS: $Id: cfield_mgr.class.php,v 1.102 2010/11/10 16:51:35 franciscom Exp $
+ * @version CVS: $Id: cfield_mgr.class.php,v 1.103 2010/11/10 17:21:13 franciscom Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
@@ -2633,16 +2633,21 @@ function getValuesFromUserInput($cf_map,$name_suffix='',$input_values=null)
* @param int $id Custom Field ID
* @param string $value Custom Field Value
* @param string $node_type verbose node type (see tree.class.php)
+ * @param map $options default -> null , get defaults inside method
*
- * @return map key: node_id
+ * @return map key: depends of options
*
* @internal revision
* 20101110 - franciscom - created as part of refactoring related to BUGID 3843
*
*/
-function get_linked_items_at_design($id,$value,$node_type)
+function get_linked_items_at_design($id,$value,$node_type,$options=null)
{
$debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
+
+ $my['opt'] = array('access_key' => 'node_id', 'secondary:_access_key' => null,
+ 'cumulative' => !database::CUMULATIVE);
+ $my['opt'] = array_merge($my['opt'], (array)$options);
$hash_descr_id = $this->tree_manager->get_available_node_types();
$node_type_id=$hash_descr_id[$node_type];
@@ -2656,10 +2661,16 @@ function get_linked_items_at_design($id,$value,$node_type)
" JOIN {$this->tables['nodes_hierarchy']} NH ON NH.id=CFDV.node_id " .
" WHERE CFNT.node_type_id={$node_type_id} " .
" AND CFDV.value = '{$safe_value}' ";
- // echo "
debug - " . __FUNCTION__ . "
" . $sql . "
";
-
- $rs = $this->db->fetchRowsIntoMap($sql,'node_id');
+ if( is_null($my['opt']['secondary_access_key']) )
+ {
+ $rs = $this->db->fetchRowsIntoMap($sql,$my['opt']['access_key'],$my['opt']['cumulative']);
+ }
+ else
+ {
+ $rs = $this->db->fetchMapRowsIntoMap($sql,$my['opt']['access_key'],
+ $my['opt']['secondary_access_key'],$my['opt']['cumulative']);
+ }
return($rs);
}
From 798d19b00dce6ab975185b19ec9ef08fcc046402 Mon Sep 17 00:00:00 2001
From: franciscom <>
Date: Wed, 10 Nov 2010 17:34:25 +0000
Subject: [PATCH 0015/1141] BUGID 3843 - get_id_by_custom_field() work in
progress
---
lib/functions/testcase.class.php | 30 +++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/lib/functions/testcase.class.php b/lib/functions/testcase.class.php
index 2d52e190cd..8171195f83 100644
--- a/lib/functions/testcase.class.php
+++ b/lib/functions/testcase.class.php
@@ -6,7 +6,7 @@
* @package TestLink
* @author Francisco Mancardi ([email protected])
* @copyright 2005-2009, TestLink community
- * @version CVS: $Id: testcase.class.php,v 1.334 2010/11/10 15:30:13 franciscom Exp $
+ * @version CVS: $Id: testcase.class.php,v 1.335 2010/11/10 17:34:25 franciscom Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
@@ -5029,7 +5029,7 @@ function get_id_by_custom_field($cf_name, $cf_value, $tproject_id)
$lbl['no_linked_cfields_for_testcase'] = lang_get('no_linked_cfields_for_testcase');
$lbl['no_cfield_with_this_name'] = lang_get('no_cfield_with_this_name');
}
- $ret = array('status_ok' => false, 'msg' => '', 'id' => 0);
+ $ret = array('status_ok' => false, 'msg' => '', 'id' => null);
// check if custom field is linked to test project
@@ -5059,11 +5059,35 @@ function get_id_by_custom_field($cf_name, $cf_value, $tproject_id)
// Need to get all node id (will be test case VERSION ID), that has cf with requested value
// After this I need to get ONLY ID of test case that belong to Test Project
// If more than one Test Case exists -> we have a problem ?
- // If this method has to be generica, then will be possible
+ // If this method has to be generic, then will be possible
// Check test cases that have a certain value on custom field
// (We alredy are doing this may be in a different way when applying filters on CF values).
//
+ $cfget_opt = array('access_key' => 'parent_id', 'secondary_access_key' => 'node_id');
+ // map key: test case id
+ // map value: map indexed by test case version id
+ $itemSet = $this->cfield_mgr->get_linked_items_at_design($cfield_id,$cf_value,'testcase',$cfget_opt);
+
+ // // Now filter result
+ if( !is_null($itemSet) )
+ {
+ $tcaseSet = array_keys($itemSet);
+ $cache = array('tproject_id' => array());
+
+ foreach($tcaseSet as $tcase_id)
+ {
+ if( !isset($cache['tproject_id'][$tcase_id]) )
+ {
+ $cache['tproject_id'][$tcase_id] = $this->tree_manager->getTreeRoot($tcase_id);
+ }
+ if( $tproject_id == $cache['tproject_id'][$tcase_id] )
+ {
+ $ret['id'] = array($tcase_id => $itemSet[$tcase_id]);
+ break;
+ }
+ }
+ }
}
return $ret;
From 4b5176806fed387b2493c31fa1304e4f737a110f Mon Sep 17 00:00:00 2001
From: asimon83 <>
Date: Wed, 10 Nov 2010 17:46:07 +0000
Subject: [PATCH 0016/1141] BUGID 3822: Keywords combobox was absent on the
Filters pane of 'Add / Remove Test Cases'
---
lib/functions/tlTestCaseFilterControl.class.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/functions/tlTestCaseFilterControl.class.php b/lib/functions/tlTestCaseFilterControl.class.php
index afc29534f9..dc1cb535f7 100644
--- a/lib/functions/tlTestCaseFilterControl.class.php
+++ b/lib/functions/tlTestCaseFilterControl.class.php
@@ -6,7 +6,7 @@
* @package TestLink
* @author Andreas Simon
* @copyright 2006-2010, TestLink community
- * @version CVS: $Id: tlTestCaseFilterControl.class.php,v 1.33 2010/11/03 08:06:16 asimon83 Exp $
+ * @version CVS: $Id: tlTestCaseFilterControl.class.php,v 1.34 2010/11/10 17:46:07 asimon83 Exp $
* @link http://www.teamst.org/index.php
* @filesource http://testlink.cvs.sourceforge.net/viewvc/testlink/testlink/lib/functions/tlTestCaseFilterControl.class.php?view=markup
*
@@ -35,6 +35,7 @@
*
* @internal Revisions:
*
+ * 20101110 - asimon - BUGID 3822: Keywords combobox is absent on the Filters pane of 'Add / Remove Test Cases'
* 20101103 - asimon - custom fields on test spec did not retain value after apply
* 20101028 - asimon - BUGID 3933: Add test case to test plan - Left Pane filter uses
* priority concept to filter test spec where priority does not exist
@@ -1185,6 +1186,8 @@ private function init_filter_keywords() {
switch ($this->mode) {
case 'edit_mode':
+ // BUGID 3822
+ case 'plan_add_mode':
// we need the keywords for the whole testproject
if (!$this->testproject_mgr) {
$this->testproject_mgr = new testproject($this->db);
From c72564ae35dffa0dd75afe374fb115a632d047ab Mon Sep 17 00:00:00 2001
From: franciscom <>
Date: Wed, 10 Nov 2010 18:10:18 +0000
Subject: [PATCH 0017/1141] *** empty log message ***
---
locale/en_GB/strings.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/locale/en_GB/strings.txt b/locale/en_GB/strings.txt
index b18561cc50..5032ad73a0 100644
--- a/locale/en_GB/strings.txt
+++ b/locale/en_GB/strings.txt
@@ -24,7 +24,7 @@
* @package TestLink
* @author Francisco Mancardi, Andreas Morsing, Martin Havlat
* @copyright 2003, TestLink community
- * @version CVS: $Id: strings.txt,v 1.752 2010/11/07 20:06:57 franciscom Exp $
+ * @version CVS: $Id: strings.txt,v 1.753 2010/11/10 18:10:18 franciscom Exp $
* @link http://www.teamst.org/index.php
*
* @internal Revisions: Not listed - check repository history
@@ -2072,6 +2072,9 @@ $TLS_bug_id_invalid_len = "BUG ID length is invalid [%s > %s] " . $TLS_imp_resul
$TLS_tproject_id_not_found = "Test Project ID not found [%s] " . $TLS_imp_result_ko;
$TLS_invalid_exec_type = "Execution type code [%s] is not valid" . $TLS_imp_result_ko;
$TLS_missing_exec_type = "Execution type code was not provided - using (%s => %s)";
+$TLS_internal_id = "Internal ID:%s";
+$TLS_external_id = "External ID:%s";
+
// ----- lib/functions/results.inc.php -----
$TLS_trep_failing = "Failing";
From 79ac68c2eccf15e56e4954f2f47e1943a94fdb9d Mon Sep 17 00:00:00 2001
From: franciscom <>
Date: Wed, 10 Nov 2010 18:10:59 +0000
Subject: [PATCH 0018/1141] BUGID 3843 - Contribution - Match testcases on
custom fields when importing test results
---
lib/results/resultsImport.php | 124 ++++++++++++++++++++++++----------
1 file changed, 87 insertions(+), 37 deletions(-)
diff --git a/lib/results/resultsImport.php b/lib/results/resultsImport.php
index aca8fcb4c3..a3dc0c649f 100644
--- a/lib/results/resultsImport.php
+++ b/lib/results/resultsImport.php
@@ -8,10 +8,11 @@
* @package TestLink
* @author Kevin Levy
* @copyright 2010, TestLink community
- * @version CVS: $Id: resultsImport.php,v 1.22 2010/10/04 19:48:00 franciscom Exp $
+ * @version CVS: $Id: resultsImport.php,v 1.23 2010/11/10 18:10:59 franciscom Exp $
*
* @internal Revisions:
*
+ * 20101107 - franciscom - BUGID 3843 - Contribution - Match testcases on custom fields when importing test results
* 20101004 - franciscom - added new checks other than if( isset($tcase_exec['bug_id']) )
* to avoid warnings on event viewer.
* 20100926 - franciscom - BUGID 3751: New attribute "execution type" makes old XML import files incompatible
@@ -190,6 +191,7 @@ function: saveImportedResultData
returns:
rev:
+ 20101107 - franciscom - BUGID 3843 - Contribution
20100823 - franciscom - BUGID 3543 - added execution_type
20100328 - franciscom - BUGID 3331 manage bug id
*/
@@ -204,7 +206,8 @@ function saveImportedResultData(&$db,$resultData,$context)
$l18n = array('import_results_tc_not_found' => '' ,'import_results_invalid_result' => '',
- 'tproject_id_not_found' => '', 'import_results_ok' => '');
+ 'tproject_id_not_found' => '', 'import_results_ok' => '',
+ 'internal_id' => '', 'external_id' => '');
foreach($l18n as $key => $value)
{
$l18n[$key] = lang_get($key);
@@ -233,11 +236,15 @@ function saveImportedResultData(&$db,$resultData,$context)
$resultMap=array();
$tplan_mgr=null;
$tc_qty=sizeof($resultData);
-
+ $cfields = null;
+
if($tc_qty)
{
- $tplan_mgr=new testplan($db);
- $tproject_mgr=new testproject($db);
+ $tplan_mgr = new testplan($db);
+ $tproject_mgr = new testproject($db);
+
+ // BUGID 3843
+ $cfields = $tproject_mgr->get_linked_custom_fields($context->tprojectID,'testcase','name');
}
// Need to do checks on common settings
@@ -278,6 +285,7 @@ function saveImportedResultData(&$db,$resultData,$context)
// --------------------------------------------------------------------
+
for($idx=0; $doIt && $idx < $tc_qty;$idx++)
{
$tester_id = 0;
@@ -291,7 +299,9 @@ function saveImportedResultData(&$db,$resultData,$context)
// Important NOTICE:
// tcase_exec is passed BY REFERENCE to allow check_exec_values()change execution type if needed
//
- $checks = check_exec_values($db,$tcase_mgr,$user_mgr,$tcaseCfg,$tcase_exec,$columnDef['execution_bugs']);
+
+ $checks = check_exec_values($db,$context->tprojectID,$cfields,$tcase_mgr,$user_mgr,$tcaseCfg,
+ $tcase_exec,$columnDef['execution_bugs']);
$status_ok = $checks['status_ok'];
if($status_ok)
{
@@ -312,7 +322,10 @@ function saveImportedResultData(&$db,$resultData,$context)
if( $status_ok)
{
- $tcase_identity=$using_external_id ? $tcase_external_id : $tcase_id;
+ $tcase_identity = $using_external_id ? $tcase_external_id : $tcase_id;
+ $verbose_identity = $using_external_id ? $l18n['external_id'] : $l18n['internal_id'];
+ $verbose_identity = sprintf($verbose_identity,$tcase_identity);
+
$result_code=strtolower($tcase_exec['result']);
$result_is_acceptable=isset($resulstCfg['code_status'][$result_code]) ? true : false;
@@ -323,14 +336,14 @@ function saveImportedResultData(&$db,$resultData,$context)
$linked_cases=$tplan_mgr->get_linked_tcversions($context->tplanID,$filters);
$info_on_case=$linked_cases[$tcase_id];
-
+
if (!$linked_cases)
{
- $message=sprintf($l18n['import_results_tc_not_found'],$tcase_identity);
+ $message=sprintf($l18n['import_results_tc_not_found'],$verbose_identity);
}
else if (!$result_is_acceptable)
{
- $message=sprintf($l18n['import_results_invalid_result'],$tcase_identity,$tcase_exec['result']);
+ $message=sprintf($l18n['import_results_invalid_result'],$verbose_identity,$tcase_exec['result']);
}
else
{
@@ -382,9 +395,10 @@ function saveImportedResultData(&$db,$resultData,$context)
}
}
}
- $message=sprintf($l18n['import_results_ok'],$tcase_identity,$version,$tester_name,
- $resulstCfg['code_status'][$result_code],$execution_ts);
-
+
+ // Improvements on feedback
+ $message=sprintf($l18n['import_results_ok'],($info_on_case['name'] . " - " . $verbose_identity),
+ $version,$tester_name,$resulstCfg['code_status'][$result_code],$execution_ts);
}
}
@@ -454,7 +468,6 @@ function importExecutionFromXML(&$xmlTCExec)
$execInfo['tester'] = (string) trim($xmlTCExec->tester);
$execInfo['execution_type'] = intval((int) trim($xmlTCExec->execution_type)); //BUGID 3543
-
$bugQty = count($xmlTCExec->bug_id);
if( ($bugQty = count($xmlTCExec->bug_id)) > 0 )
{
@@ -463,6 +476,18 @@ function importExecutionFromXML(&$xmlTCExec)
$execInfo['bug_id'][] = (string) $bug; // BUGID 3331
}
}
+
+ // BUGID 3843 - Contribution
+ // Can get link to test case using Custom Field
+ $execInfo['link_by_cf_name'] = null;
+ $execInfo['link_by_cf_value'] = null;
+ $link_attrs = $xmlTCExec->linkby->attributes();
+ if ($link_attrs)
+ {
+ $execInfo['link_by_cf_name'] = (string) $link_attrs->custom_field;
+ $execInfo['link_by_cf_value'] = (string) $link_attrs->value;
+ }
+
return $execInfo;
}
@@ -546,40 +571,65 @@ function: check_exec_values()
msg -> array with localized messages
@internal revisions:
+ 20101107 - franciscom - BUGID 3843
20100926 - franciscom - BUGID 3751: New attribute "execution type" makes old XML import files incompatible
Passed $execValues BY REFERENCE to allow change of execution type if needed
*/
-function check_exec_values(&$db,&$tcase_mgr,&$user_mgr,$tcaseCfg,&$execValues,&$columnDef)
+function check_exec_values(&$db,$tproject_id,$cfields,&$tcase_mgr,&$user_mgr,$tcaseCfg,&$execValues,&$columnDef)
{
$tables = tlObjectWithDB::getDBTables(array('users','execution_bugs'));
- $checks=array('status_ok' => false, 'tcase_id' => 0, 'tester_id' => 0, 'msg' => array());
+ $checks=array('status_ok' => true, 'tcase_id' => 0, 'tester_id' => 0, 'msg' => array());
- $tcase_id=$execValues['tcase_id'];
- $tcase_external_id=trim($execValues['tcase_external_id']);
+ $tcase_id = $execValues['tcase_id'];
+ $tcase_external_id = trim($execValues['tcase_external_id']);
// external_id has precedence over internal id
$using_external_id = ($tcase_external_id != "");
- if($using_external_id)
- {
- // need to get internal id
- $checks['tcase_id']=$tcase_mgr->getInternalID($tcase_external_id,$tcaseCfg->glue_character);
- $checks['status_ok']=intval($checks['tcase_id']) > 0 ? true : false;
- if(!$checks['status_ok'])
- {
- $checks['msg'][]=sprintf(lang_get('tcase_external_id_do_not_exists'),$tcase_external_id);
- }
- }
- else
- {
- // before using internal id, I want to check it's a number
- $checks['tcase_id']=$tcase_id;
- $checks['status_ok']=intval($checks['tcase_id']) > 0 ? true : false;
- if(!$checks['status_ok'])
- {
- $checks['msg'][]=sprintf(lang_get('tcase_id_is_not_number'),$tcase_id);
- }
+
+ // BUGID 3843 - Contribution
+ // Possibly using custom fields to identify test cases.
+ if( $tcase_id <= 0 && !$using_external_id)
+ {
+ $cf_name = $execValues['link_by_cf_name'];
+ if( !is_null($cf_name) )
+ {
+ $cf_value = $execValues['link_by_cf_value'];
+ $ret = $tcase_mgr->get_id_by_custom_field($cf_name,$cf_value,$tproject_id);
+
+ $checks['status_ok'] = $ret['status_ok'];
+ $checks['msg'][] = $ret['msg'];
+ if( $ret['status_ok'])
+ {
+ $tcase_id = key($ret['id']);
+ }
+ }
+ }
+
+ if( $checks['status_ok'] )
+ {
+ if($using_external_id)
+ {
+ // need to get internal id
+ $checks['tcase_id']=$tcase_mgr->getInternalID($tcase_external_id,$tcaseCfg->glue_character);
+ $checks['status_ok']=intval($checks['tcase_id']) > 0 ? true : false;
+ if(!$checks['status_ok'])
+ {
+ $checks['msg'][]=sprintf(lang_get('tcase_external_id_do_not_exists'),$tcase_external_id);
+ }
+ }
+ else
+ {
+ // before using internal id, I want to check it's a number
+ $checks['tcase_id']=$tcase_id;
+ $checks['status_ok']=intval($checks['tcase_id']) > 0 ? true : false;
+ if(!$checks['status_ok'])
+ {
+ $checks['msg'][]=sprintf(lang_get('tcase_id_is_not_number'),$tcase_id);
+ }
+ }
}
+
if($checks['status_ok'])
{
// useful for user feedback
From df0dec7e0bf02448b105f9dadad2ec4b4e008314 Mon Sep 17 00:00:00 2001
From: amkhullar <>
Date: Thu, 11 Nov 2010 16:50:37 +0000
Subject: [PATCH 0019/1141] BUGID 4011 - Export XML for Requirements also using
the same file.
---
docs/utils/XLSTOXML.xls | Bin 0 -> 153600 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 docs/utils/XLSTOXML.xls
diff --git a/docs/utils/XLSTOXML.xls b/docs/utils/XLSTOXML.xls
new file mode 100644
index 0000000000000000000000000000000000000000..d96a3129f0da74d02c3dee0f0f8127c6fe1a094f
GIT binary patch
literal 153600
zcmeFa31Ae*l{a2964K}Zgg7kQ7&n&@7=#cQW6Yr&$<{H}fw7G(4blirkY?nW5eUbQ
zMT`@YI1V9>gJWkyZsIt*_L&xdbYmE!gDJDH4wuh$IPZQqucV%Z2TUMx8;@X{^>TwVy$p%Tu|$t-a6U?Z