PageRenderTime 67ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/plan/planTCNavigator.php

https://bitbucket.org/pfernandez/testlink1.9.6
PHP | 636 lines | 45 code | 19 blank | 572 comment | 1 complexity | 5c47b382c5d39a961b3303943b46e7b2 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, GPL-3.0
  1. <?php
  2. /**
  3. * TestLink Open Source Project - http://testlink.sourceforge.net/
  4. * This script is distributed under the GNU General Public License 2 or later.
  5. *
  6. * Test navigator for Test Plan
  7. *
  8. *
  9. * @package TestLink
  10. * @author Martin Havlat
  11. * @copyright 2003-2009, TestLink community
  12. * @version CVS: $Id: planTCNavigator.php,v 1.51 2010/07/22 14:14:43 asimon83 Exp $
  13. * @link http://www.teamst.org/index.php
  14. *
  15. * @internal Revisions:
  16. * 20100708 - asimon - BUGID 3406
  17. * 20100628 - asimon - removal of constants from filter control class
  18. * 20160625 - asimon - refactoring for new filter features
  19. * 20100624 - asimon - CVS merge (experimental branch to HEAD)
  20. * 20100622 - asimon - huge refactorization for new tlTestCaseFilterControl class
  21. * 20100428 - asimon - BUGID 3301 and related issues - changed name or case
  22. * of some variables used in new common template,
  23. * added filtering by custom fields
  24. * 20100202 - asimon - BUGID 2455, BUGID 3026
  25. * 20081223 - franciscom - advanced/simple filter feature
  26. **/
  27. require('../../config.inc.php');
  28. require_once("common.php");
  29. require_once("users.inc.php");
  30. require_once("treeMenu.inc.php");
  31. require_once('exec.inc.php');
  32. testlinkInitPage($db);
  33. $templateCfg = templateConfiguration();
  34. $assignment_mgr = new assignment_mgr($db); // BUGID 3406
  35. $control = new tlTestCaseFilterControl($db, 'plan_mode');
  36. $gui = initializeGui($db, $control, $assignment_mgr);
  37. $control->build_tree_menu($gui);
  38. $smarty = new TLSmarty();
  39. $smarty->assign('gui', $gui);
  40. $smarty->assign('control', $control);
  41. $smarty->assign('menuUrl', $gui->menuUrl);
  42. $smarty->assign('args', $control->get_argument_string());
  43. $smarty->assign('treeHeader', $gui->title);
  44. $smarty->display($templateCfg->template_dir . $templateCfg->default_template);
  45. /**
  46. * @param unknown_type $dbHandler
  47. * @param unknown_type $control
  48. * @return stdClass
  49. *
  50. * @internal revisions:
  51. * 20100721 - asimon - BUGID 3406, added assignmentMgr
  52. */
  53. function initializeGui(&$dbHandler, &$control, &$assignmentMgr) {
  54. $gui = new stdClass();
  55. $gui->feature = $control->args->feature;
  56. $gui->tPlanID = $control->args->testplan_id;
  57. $gui->title = lang_get('title_test_plan_navigator');
  58. $gui->src_workframe = '';
  59. $gui->additional_string = '';
  60. // configure target URLs and clickable buttons
  61. switch($control->args->feature) {
  62. case 'planUpdateTC':
  63. $gui->menuUrl = "lib/plan/planUpdateTC.php";
  64. $control->draw_bulk_update_button = true;
  65. break;
  66. case 'test_urgency':
  67. $gui->menuUrl = "lib/plan/planUrgency.php";
  68. break;
  69. case 'tc_exec_assignment':
  70. $gui->menuUrl = "lib/plan/tc_exec_assignment.php";
  71. // BUGID 3406 - check for assignments before displaying the unassign button
  72. $build_id = $control->settings['setting_build']['selected'];
  73. if ($assignmentMgr->get_count_of_assignments_for_build_id($build_id)) {
  74. $control->draw_tc_unassign_button = true;
  75. }
  76. break;
  77. }
  78. return $gui;
  79. }
  80. // old file content
  81. //require('../../config.inc.php');
  82. //require_once("common.php");
  83. //require_once("users.inc.php");
  84. //require_once("treeMenu.inc.php");
  85. //require_once('exec.inc.php');
  86. //testlinkInitPage($db);
  87. //
  88. //$templateCfg = templateConfiguration();
  89. //$cfg = getCfg();
  90. //
  91. //$tproject_mgr = new testproject($db);
  92. //$tplan_mgr = new testplan($db);
  93. //$args = init_args($db,$cfg,$tplan_mgr,$tproject_mgr);
  94. //
  95. //// BUGID 3301
  96. //$exec_cfield_mgr = new exec_cfield_mgr($db,$args->tproject_id);
  97. //$gui = initializeGui($db,$args,$cfg,$tplan_mgr, $exec_cfield_mgr);
  98. //
  99. //$smarty = new TLSmarty();
  100. //$smarty->assign('gui',$gui);
  101. //
  102. ////
  103. //// Warning: the following variable names CAN NOT BE Changed,
  104. //// because there is global coupling on template logic
  105. //$smarty->assign('menuUrl',$gui->menuUrl);
  106. //$smarty->assign('args',$gui->args);
  107. //$smarty->assign('additionalArgs',$gui->additionalArgs);
  108. //$smarty->assign('treeHeader', $gui->title);
  109. //
  110. //$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
  111. //
  112. ///*
  113. // * function: getCfg()
  114. // *
  115. // * returns: configuration objects
  116. // */
  117. //function getCfg()
  118. //{
  119. // $cfg = new stdClass();
  120. // $cfg->gui = config_get('gui');
  121. // $cfg->exec = config_get('exec_cfg');
  122. // $cfg->results = config_get('results');
  123. // $cfg->testcase_cfg = config_get('testcase_cfg');
  124. // return $cfg;
  125. //}
  126. //
  127. //
  128. ///**
  129. // * initializes user inputs
  130. // *
  131. // * @param resource $dbHandler database handle
  132. // * @param stdClass $cfgObj configuration
  133. // * @param tlTestplan $tplanMgr reference to testplan manager
  134. // * @param tlTestproject $tprojectMgr reference to testproject manager
  135. // * @return stdClass $args user input values
  136. // */
  137. //function init_args(&$dbHandler,&$cfgObj,&$tplanMgr, &$tprojectMgr)
  138. //{
  139. // $_REQUEST = strings_stripSlashes($_REQUEST);
  140. //
  141. // $args = new stdClass();
  142. //
  143. // $args->feature = $_REQUEST['feature'];
  144. // switch($args->feature)
  145. // {
  146. // case 'planUpdateTC':
  147. // case 'test_urgency':
  148. // case 'tc_exec_assignment':
  149. // break;
  150. //
  151. // default:
  152. // tLog("Wrong or missing GET argument 'feature'.", 'ERROR');
  153. // exit();
  154. // break;
  155. // }
  156. //
  157. // $args->user_id = $_SESSION['userID'];
  158. // $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
  159. // $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : '';
  160. //
  161. // // 20070120 - franciscom -
  162. // // is possible to call this page using a Test Project that have no test plans
  163. // // in this situation the next to entries are undefined in SESSION
  164. // $args->tplan_id = isset($_SESSION['testplanID']) ? intval($_SESSION['testplanID']) : 0;
  165. // $args->tplan_name = isset($_SESSION['testplanName']) ? $_SESSION['testplanName'] : '';
  166. //
  167. // if($args->tplan_id != 0)
  168. // {
  169. // $args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID'];
  170. // $tplan_info = $tplanMgr->get_by_id($args->tplan_id);
  171. // $args->tplan_name = $tplan_info['name'];
  172. //
  173. //
  174. // if($args->tplan_id != $_SESSION['testplanID']) {
  175. // //testplan was changed, so we reset the filters, they were chosen for another testplan
  176. // $keys2delete = array('panelFiltersKeyword', 'panelFilterExecStatus', 'keywordsFilterType',
  177. // 'filter_method', 'filter_assigned_to', 'urgencyImportance',
  178. // 'filter_build_id', 'platform_id', 'include_unassigned', 'colored');
  179. // foreach ($keys2delete as $key) {
  180. // unset($_REQUEST[$key]);
  181. // }
  182. // $currentUser = $_SESSION['currentUser'];
  183. // $arrPlans = $currentUser->getAccessibleTestPlans($dbHandler,$args->tproject_id);
  184. // foreach ($arrPlans as $plan) {
  185. // if ($plan['id'] == $args->tplan_id) {
  186. // setSessionTestPlan($plan);
  187. // }
  188. // }
  189. // }
  190. // }
  191. //
  192. // // Array because is a multiselect input
  193. // $key = 'panelFiltersKeyword';
  194. // $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 0;
  195. // $args->keywordsFilterType=isset($_REQUEST['keywordsFilterType']) ? $_REQUEST['keywordsFilterType'] : 'OR';
  196. // $args->help_topic = isset($_REQUEST['help_topic']) ? $_REQUEST['help_topic'] : $args->feature;
  197. //
  198. // $key = 'panelFilterAdvancedFilterMode';
  199. // $args->$key=isset($_REQUEST[$key]) ? $_REQUEST[$key] : 0;
  200. //
  201. // if(isset($_REQUEST['doUpdateTree']) || isset($_REQUEST['called_by_me']))
  202. // {
  203. // $args->src_workframe = $_SESSION['basehref'] .
  204. // "lib/general/staticPage.php?key={$args->help_topic}";
  205. // }
  206. // else
  207. // {
  208. // $args->src_workframe = '';
  209. // }
  210. //
  211. // $args->tcase_id = isset($_REQUEST['tcase_id']) ? intval($_REQUEST['tcase_id']) : null;
  212. //
  213. // $key = 'panelFiltersExecStatus';
  214. // $args->$key = isset($_REQUEST[$key]) ? (array)$_REQUEST[$key] : array($cfgObj->results['status_code']['all']);
  215. // if( !is_null($args->$key) )
  216. // {
  217. // if( in_array($cfgObj->results['status_code']['all'], $args->$key) )
  218. // {
  219. // $args->$key = array($cfgObj->results['status_code']['all']);
  220. // }
  221. // else if( !$args->advancedFilterMode && count($args->$key) > 0)
  222. // {
  223. // // Because user has switched to simple mode we will get ONLY first status
  224. // $args->$key = array($args->$key[0]);
  225. // }
  226. // }
  227. //
  228. // $filter_cfg = config_get('execution_assignment_filter_methods');
  229. // $args->filter_method_selected = isset($_REQUEST['filter_method']) ?
  230. // (array)$_REQUEST['filter_method'] : (array)$filter_cfg['default_type'];
  231. //
  232. // $args->optBuildSelected = isset($_REQUEST['build_id']) ? $_REQUEST['build_id'] : -1;
  233. // $args->optFilterBuildSelected = isset($_REQUEST['filter_build_id']) ? $_REQUEST['filter_build_id'] : -1;
  234. // $args->optPlatformSelected = isset($_REQUEST['platform_id']) ? $_REQUEST['platform_id'] : null;
  235. //
  236. // if (in_array(0, (array)$args->optPlatformSelected)) {
  237. // $args->optPlatformSelected = null;
  238. // }
  239. //
  240. // // 20081221 - franciscom
  241. // $args->filter_assigned_to = isset($_REQUEST['filter_assigned_to']) ? $_REQUEST['filter_assigned_to'] : null;
  242. // if( !is_null($args->filter_assigned_to) )
  243. // {
  244. // $args->filter_assigned_to = (array)$args->filter_assigned_to;
  245. // if( in_array(TL_USER_ANYBODY, $args->filter_assigned_to) )
  246. // {
  247. // $args->filter_assigned_to = array(TL_USER_ANYBODY);
  248. // }
  249. // else if( in_array(TL_USER_NOBODY, $args->filter_assigned_to) )
  250. // {
  251. // $args->filter_assigned_to = array(TL_USER_NOBODY);
  252. // }
  253. // else if( !$args->advancedFilterMode && count($args->filter_assigned_to) > 0)
  254. // {
  255. // // Because user has switched to simple mode we will get ONLY first status
  256. // $args->filter_assigned_to=array($args->filter_assigned_to[0]);
  257. // }
  258. // }
  259. // $args->include_unassigned = isset($_REQUEST['include_unassigned']) ? $_REQUEST['include_unassigned'] : 0;
  260. //
  261. // return $args;
  262. //}
  263. //
  264. ///*
  265. // function: initializeGui
  266. //
  267. // args :
  268. //
  269. // returns:
  270. //
  271. // rev:
  272. // 20100428 - asimon - BUGID 3301, added exec_cfield_mgr
  273. //*/
  274. //function initializeGui(&$dbHandler,&$argsObj,&$cfgObj,&$tplanMgr, &$exec_cfield_mgr)
  275. //{
  276. //
  277. // $platformMgr = new tlPlatform($dbHandler, $argsObj->tproject_id);
  278. //
  279. // $gui = new stdClass();
  280. //
  281. // $gui_open = config_get('gui_separator_open');
  282. // $gui_close = config_get('gui_separator_close');
  283. //
  284. // $gui->strOptionAny = $gui_open . lang_get('any') . $gui_close;
  285. // $gui->strOptionNone = $gui_open . lang_get('nobody') . $gui_close;
  286. //
  287. // // to get all assigned testcases, no matter to whom they are assigned
  288. // $gui->strOptionSomebody = $gui_open . lang_get('filter_somebody') . $gui_close;
  289. //
  290. // $initValues['keywords'] = "testplan,{$argsObj->tplan_id}";
  291. // $gui->controlPanel = new tlControlPanel($dbHandler,$argsObj,$initValues);
  292. //
  293. // // BUGID 3301
  294. // $gui->design_time_cfields = $exec_cfield_mgr->html_table_of_custom_field_inputs(30);
  295. // $gui->feature = $argsObj->feature;
  296. //
  297. // $gui->filterAssignedTo=$argsObj->filter_assigned_to;
  298. // $gui->includeUnassigned = $argsObj->include_unassigned;
  299. //
  300. // $gui->toggleFilterModeLabel='';
  301. //
  302. //
  303. // // BUGID 2455
  304. // $gui->optFilterBuild = initFilterBuildInfo($dbHandler,$argsObj,$tplanMgr);
  305. // $gui->buildCount = count($gui->optFilterBuild['items']);
  306. // $gui->optPlatform = initPlatformInfo($dbHandler,$argsObj,$platformMgr, $gui->strOptionAny);
  307. //
  308. // $gui->keywordsFilterTypes=new stdClass();
  309. // $gui->keywordsFilterTypes->options = array('OR' => 'Or' , 'AND' =>'And');
  310. // $gui->keywordsFilterTypes->selected=$argsObj->keywordsFilterType;
  311. //
  312. // // filter using user roles
  313. // $tplans = $_SESSION['currentUser']->getAccessibleTestPlans($dbHandler,$argsObj->tproject_id);
  314. // $gui->mapTPlans = array();
  315. // foreach($tplans as $key => $value)
  316. // {
  317. // $gui->mapTPlans[$value['id']] = $value['name'];
  318. // }
  319. //
  320. // $gui->tPlanID=$argsObj->tplan_id;
  321. // $gui->testers=null;
  322. // $gui->title = lang_get('title_test_plan_navigator');
  323. // $gui->src_workframe=$argsObj->src_workframe;
  324. // // $gui->drawBulkUpdateButton=false;
  325. //
  326. // $gui->tcase_id=intval($argsObj->tcase_id) > 0 ? $argsObj->tcase_id : '';
  327. //
  328. // $filter_cfg = config_get('execution_assignment_filter_methods');
  329. // $gui->filterMethods = createExecutionAssignmentFilterMethodMenu();
  330. // $gui->filterMethodSpecificBuild = $filter_cfg['status_code']['specific_build'];
  331. // $gui->optFilterMethodSelected = $argsObj->filter_method_selected;
  332. //
  333. // switch($argsObj->feature)
  334. // {
  335. // case 'planUpdateTC':
  336. // $gui->menuUrl = "lib/plan/planUpdateTC.php";
  337. // $gui->controlPanel->drawBulkUpdateButton=true;
  338. // break;
  339. //
  340. // case 'test_urgency':
  341. // $gui->menuUrl = "lib/plan/planUrgency.php";
  342. // break;
  343. //
  344. // case 'tc_exec_assignment':
  345. // // BUGID 1427
  346. // $gui->menuUrl = "lib/plan/tc_exec_assignment.php";
  347. // $gui->testers = getTestersForHtmlOptions($dbHandler,$argsObj->tplan_id,$argsObj->tproject_id,
  348. // null,
  349. // array(TL_USER_ANYBODY => $gui->controlPanel->strOption['any'],
  350. // TL_USER_NOBODY => $gui->controlPanel->strOption['none'],
  351. // TL_USER_SOMEBODY => $gui->controlPanel->strOption['somebody']) );
  352. //
  353. //
  354. //
  355. // if( $gui->panelFiltersAdvancedFilterMode )
  356. // {
  357. // $label = 'btn_simple_filters';
  358. // $gui->assigneeFilterItemQty=4; // as good as any other number
  359. // }
  360. // else
  361. // {
  362. // $label='btn_advanced_filters';
  363. // $gui->assigneeFilterItemQty=1;
  364. // }
  365. // $gui->toggleFilterModeLabel=lang_get($label);
  366. // $gui->controlPanel->drawTCUnassignButton=true;
  367. // break;
  368. // }
  369. //
  370. // $gui->additional_string = '';
  371. //
  372. // // BUGID 3301
  373. // $gui->tree = buildTree($dbHandler,$gui,$argsObj,$cfgObj, $exec_cfield_mgr);
  374. // return $gui;
  375. //}
  376. //
  377. ///*
  378. // function: buildTree
  379. //
  380. // args:
  381. //
  382. // returns: string used by different tree components to render tree.
  383. // also add ajaxTree property to guiObj
  384. //
  385. // rev: 20100428 - asimon - added exec_cfield_mgr
  386. // 20081221 - franciscom -
  387. // 20080821 - franciscom - added management of ajaxTree property
  388. //
  389. //*/
  390. //function buildTree(&$dbHandler,&$guiObj,&$argsObj, &$cfgObj, &$exec_cfield_mgr)
  391. //{
  392. // // Developer remarks:
  393. // // using global coupling is 99% (ALWAYS) BAD -> global $tlCfg;
  394. // // use config_get() because:
  395. // //
  396. // // - is standard practice on whole TL code (used in 75 files).
  397. // // - is better because you do not need to care about name
  398. // // of config object or variable.
  399. // //
  400. // $filters = new stdClass();
  401. // $additionalInfo = new stdClass();
  402. //
  403. // $filters->keyword = buildKeywordsFilter($argsObj->panelFiltersKeyword,$guiObj);
  404. // $filters->keyword_id = $argsObj->panelFiltersKeyword;
  405. // $filters->keywordsFilterType = $argsObj->keywordsFilterType;
  406. // $filters->platform_id = null;
  407. // if($argsObj->optPlatformSelected != null)
  408. // {
  409. // $filters->platform_id = $argsObj->optPlatformSelected;
  410. // }
  411. //
  412. // $filters->include_unassigned = $guiObj->includeUnassigned;
  413. // $filters->show_testsuite_contents=1;
  414. // $filters->hide_testcases = 0;
  415. //
  416. // $filters->tc_id = $argsObj->tcase_id;
  417. // $filters->build_id = $argsObj->optBuildSelected;
  418. // $filters->filter_build_id = $argsObj->optFilterBuildSelected;
  419. // $filters->method = $argsObj->filter_method_selected;
  420. //
  421. // $filters->filter_status = null;
  422. // if( !is_null($argsObj->panelFiltersExecStatus) )
  423. // {
  424. // if( !in_array($cfgObj->results['status_code']['all'], $guiObj->panelFiltersExecStatus) )
  425. // {
  426. // // want to have code as key
  427. // $dummy = array_flip($argsObj->panelFiltersExecStatus);
  428. // foreach( $dummy as $status_code => $value)
  429. // {
  430. // $dummy[$status_code] = $status_code;
  431. // }
  432. // $filters->filter_status = $dummy;
  433. // }
  434. // }
  435. //
  436. // $filters->hide_testcases = false;
  437. //
  438. // // Set of filters Off
  439. // $filters->build_id = 0;
  440. // $filters->assignedTo = null;
  441. // $filters->status = null;
  442. // $filters->exec_type = null;
  443. //
  444. // // BUGID 3301
  445. // //$filters->cf_hash = null;
  446. // $filters->cf_hash = $exec_cfield_mgr->get_set_values();
  447. //
  448. // switch($argsObj->feature)
  449. // {
  450. // case 'test_urgency':
  451. // $filters->hide_testcases = 1;
  452. // break;
  453. //
  454. // case 'tc_exec_assignment':
  455. // $filters->assignedTo = $argsObj->filter_assigned_to;
  456. // if( !is_null($filters->assignedTo) )
  457. // {
  458. // if( in_array(TL_USER_ANYBODY, $argsObj->filter_assigned_to) )
  459. // {
  460. // $filters->assignedTo = null;
  461. // }
  462. // else
  463. // {
  464. // $dummy = array_flip($guiObj->filterAssignedTo);
  465. // foreach( $dummy as $key => $value)
  466. // {
  467. // $dummy[$key] = $key;
  468. // }
  469. // $filters->assignedTo = $dummy;
  470. // }
  471. // }
  472. // break;
  473. // }
  474. //
  475. // $additionalInfo->useCounters=CREATE_TC_STATUS_COUNTERS_OFF;
  476. // $additionalInfo->useColours=COLOR_BY_TC_STATUS_OFF;
  477. //
  478. // $guiObj->args = initializeGetArguments($argsObj,$filters);
  479. // $guiObj->additionalArgs = '';
  480. // list($treeMenu, $guiObj->additionalArgs) = generateExecTree($dbHandler,$guiObj->menuUrl,
  481. // $argsObj->tproject_id,$argsObj->tproject_name,
  482. // $argsObj->tplan_id,$argsObj->tplan_name,
  483. // $filters,$additionalInfo);
  484. //
  485. // // $guiObj->args .= $add2guiObjArgs;
  486. //
  487. // $guiObj->ajaxTree = new stdClass();
  488. // $guiObj->ajaxTree->loader = '';
  489. // $guiObj->ajaxTree->root_node = $treeMenu->rootnode;
  490. // $guiObj->ajaxTree->children = $treeMenu->menustring ? $treeMenu->menustring : "''";
  491. // $guiObj->ajaxTree->cookiePrefix = $argsObj->feature;
  492. //
  493. // return $treeMenu;
  494. //}
  495. //
  496. //
  497. ///*
  498. // function: initializeGetArguments
  499. // build arguments that will be passed to tc_exec_assignment.php with a http call
  500. // This arguments that will be passed from tree menu to launched pages,
  501. // when user do some action on tree (example clicks on a folder)
  502. //
  503. // args:
  504. //
  505. // returns:
  506. //
  507. // rev: 20100428 - asimon - added cf_hash filter
  508. // 20080427 - franciscom - added cfgObj arguments
  509. // 20080224 - franciscom - added include_unassigned
  510. //
  511. //*/
  512. //function initializeGetArguments($argsObj,$filtersObj)
  513. //{
  514. // $kl='';
  515. // $settings = '&include_unassigned=' . $filtersObj->include_unassigned;
  516. //
  517. // if(is_array($argsObj->panelFiltersKeyword) && !in_array(0, $argsObj->panelFiltersKeyword))
  518. // {
  519. // $kl=implode(',',$argsObj->panelFiltersKeyword);
  520. // $settings .= '&keyword_id=' . $kl;
  521. // }
  522. // else if(!is_array($argsObj->panelFiltersKeyword) && $argsObj->panelFiltersKeyword > 0)
  523. // {
  524. // $settings .= '&keyword_id='.$argsObj->panelFiltersKeyword;
  525. // }
  526. // $settings .= '&keywordsFilterType='.$argsObj->keywordsFilterType;
  527. //
  528. // if($filtersObj->assignedTo)
  529. // {
  530. // $settings .= '&filter_assigned_to=' . serialize($filtersObj->assignedTo);
  531. // }
  532. //
  533. // $settings .= '&tplan_id=' . $argsObj->tplan_id;
  534. //
  535. // // BUGID 3301
  536. // if ($filtersObj->cf_hash)
  537. // {
  538. // $settings .= '&cfields='. serialize($filtersObj->cf_hash);
  539. // }
  540. //
  541. // return $settings;
  542. //}
  543. //
  544. //
  545. ///**
  546. // * initialize build info to choose as filter option
  547. // * loads only active builds
  548. // *
  549. // * @author asimon
  550. // * @param resource &$dbHandler reference
  551. // * @param object &$argsObj reference contains user input arguments
  552. // * @param tlTestplan &$tplanMgr reference
  553. // * @return HTML-Select for builds (names and values)
  554. // */
  555. //function initFilterBuildInfo(&$dbHandler,&$argsObj,&$tplanMgr)
  556. //{
  557. // $htmlSelect = array('items' => null, 'selected' => null);
  558. // $htmlSelect['items'] = $tplanMgr->get_builds_for_html_options($argsObj->tplan_id,
  559. // testplan::GET_ACTIVE_BUILD);
  560. //
  561. // $maxBuildID = $tplanMgr->get_max_build_id($argsObj->tplan_id,
  562. // testplan::GET_ACTIVE_BUILD);
  563. //
  564. // $argsObj->optFilterBuildSelected = $argsObj->optFilterBuildSelected > 0 ? $argsObj->optFilterBuildSelected : $maxBuildID;
  565. // if (!$argsObj->optFilterBuildSelected && sizeof($htmlSelect['items']))
  566. // {
  567. // $argsObj->optFilterBuildSelected = key($htmlSelect['items']);
  568. // }
  569. // $htmlSelect['selected'] = $argsObj->optFilterBuildSelected;
  570. //
  571. // return $htmlSelect;
  572. //}
  573. //
  574. //
  575. ///**
  576. // * creates a map with platform information, useful to create on user
  577. // * interface an HTML select input.
  578. // *
  579. // * @param resource &$dbHandler reference
  580. // * @param object &$argsObj reference contains user input
  581. // * @param tlPlatform &$platformMgr reference
  582. // *
  583. // */
  584. //function initPlatformInfo(&$dbHandler,&$argsObj,&$platformMgr, $str_any)
  585. //{
  586. // $htmlSelect = array('items' => null, 'selected' => null);
  587. // $htmlSelect['items'] = array(0 => $str_any) + (array)$platformMgr->getLinkedToTestplanAsMap($argsObj->tplan_id);
  588. //
  589. // if( !is_null($htmlSelect['items']) && is_array($htmlSelect['items']) )
  590. // {
  591. // if (is_null($argsObj->optPlatformSelected))
  592. // {
  593. // $argsObj->optPlatformSelected = key($htmlSelect['items']);
  594. // }
  595. // $htmlSelect['selected'] = $argsObj->optPlatformSelected;
  596. // }
  597. // return $htmlSelect;
  598. //}
  599. //
  600. //
  601. ///**
  602. // * create map with filter methods for execution assignment,
  603. // * used for creating HTML Select inputs
  604. // *
  605. // * @author asimon
  606. // * @return $menu_data HTML Select (labels and values)
  607. // */
  608. //function createExecutionAssignmentFilterMethodMenu() {
  609. // $filter_cfg = config_get('execution_assignment_filter_methods');
  610. // $menu_data = array();
  611. // foreach($filter_cfg['status_code'] as $status => $label) {
  612. // $code = $filter_cfg['status_code'][$status];
  613. // $menu_data[$code] = lang_get($filter_cfg['status_label'][$status]);
  614. // }
  615. // return $menu_data;
  616. //}
  617. ?>