@@ -746,53 +746,49 @@ function testPlanTree(&$dbHandler, &$menuUrl, $tproject_id, $tproject_name,
746746
747747 $ tplan_tcases = array ();
748748 if ($ test_spec ) {
749- if (is_null ($ filters ['tcase_id ' ]) || $ filters ['tcase_id ' ] > 0 ) // 20120519 TO BE CHECKED
750- {
751- // Step 1 - get item set with exec status.
752- // This has to scopes:
753- // 1. tree coloring according exec status on (Test plan, platform, build ) context
754- // 2. produce sql that can be used to reduce item set on combination with filters
755- // that can not be used on this step like:
756- // a. test cases belonging to branch with root TEST SUITE
757- // b. keyword filter on AND MODE
758- // c. execution results on other builds, any build etc
759- //
760- // WE NEED TO ADD FILTERING on CUSTOM FIELD VALUES, WE HAVE NOT REFACTORED
761- // THIS YET.
762- //
763- if (! is_null (
764- $ sql2do = $ tplan_mgr ->{$ objOptions ->getTreeMethod }($ tplan_id ,
765- $ filters , $ options ))) {
766- $ doPinBall = false ;
767- if (is_array ($ sql2do )) {
768- if ($ doPinBall = $ filters ['keyword_filter_type ' ] == 'And ' ) {
769- $ kmethod = "fetchRowsIntoMapAddRC " ;
770- $ unionClause = " UNION ALL " ;
771- } else {
772- $ kmethod = "fetchRowsIntoMap " ;
773- $ unionClause = ' UNION ' ;
774- }
775- $ sql2run = $ sql2do ['exec ' ] . $ unionClause .
776- $ sql2do ['not_run ' ];
749+ // Step 1 - get item set with exec status.
750+ // This has to scopes:
751+ // 1. tree coloring according exec status on (Test plan, platform, build ) context
752+ // 2. produce sql that can be used to reduce item set on combination with filters
753+ // that can not be used on this step like:
754+ // a. test cases belonging to branch with root TEST SUITE
755+ // b. keyword filter on AND MODE
756+ // c. execution results on other builds, any build etc
757+ //
758+ // WE NEED TO ADD FILTERING on CUSTOM FIELD VALUES, WE HAVE NOT REFACTORED
759+ // THIS YET.
760+ //
761+ if ((is_null ($ filters ['tcase_id ' ]) || $ filters ['tcase_id ' ] > 0 ) && ! is_null (
762+ $ sql2do = $ tplan_mgr ->{$ objOptions ->getTreeMethod }($ tplan_id ,
763+ $ filters , $ options ))) {
764+ $ doPinBall = false ;
765+ if (is_array ($ sql2do )) {
766+ if ($ doPinBall = $ filters ['keyword_filter_type ' ] == 'And ' ) {
767+ $ kmethod = "fetchRowsIntoMapAddRC " ;
768+ $ unionClause = " UNION ALL " ;
777769 } else {
778770 $ kmethod = "fetchRowsIntoMap " ;
779- $ sql2run = $ sql2do ;
771+ $ unionClause = ' UNION ' ;
780772 }
781-
782- $ tplan_tcases = $ dbHandler ->$ kmethod ($ sql2run , 'tcase_id ' );
783- if ($ doPinBall && ! is_null ($ tplan_tcases )) {
784- $ kwc = count ($ filters ['keyword_id ' ]);
785- $ ak = array_keys ($ tplan_tcases );
786- $ mx = null ;
787- foreach ($ ak as $ tk ) {
788- if ($ tplan_tcases [$ tk ]['recordcount ' ] == $ kwc ) {
789- $ mx [$ tk ] = $ tplan_tcases [$ tk ];
790- }
773+ $ sql2run = $ sql2do ['exec ' ] . $ unionClause .
774+ $ sql2do ['not_run ' ];
775+ } else {
776+ $ kmethod = "fetchRowsIntoMap " ;
777+ $ sql2run = $ sql2do ;
778+ }
779+ $ tplan_tcases = $ dbHandler ->$ kmethod ($ sql2run , 'tcase_id ' );
780+ if ($ doPinBall && ! is_null ($ tplan_tcases )) {
781+ $ kwc = count ($ filters ['keyword_id ' ]);
782+ $ ak = array_keys ($ tplan_tcases );
783+ $ mx = null ;
784+ foreach ($ ak as $ tk ) {
785+ if ($ tplan_tcases [$ tk ]['recordcount ' ] == $ kwc ) {
786+ $ mx [$ tk ] = $ tplan_tcases [$ tk ];
791787 }
792- $ tplan_tcases = null ;
793- $ tplan_tcases = $ mx ;
794788 }
795- }
789+ $ tplan_tcases = null ;
790+ $ tplan_tcases = $ mx ;
791+ }
796792 }
797793
798794 if (is_null ($ tplan_tcases )) {
0 commit comments