function initializeGui(&$dbHandler, &$argsObj) { $platform_mgr = new tlPlatform($dbHandler, $argsObj->tproject_id); $guiObj = new stdClass(); $guiObj->platforms = $platform_mgr->getAll(array('include_linked_count' => true)); $guiObj->canManage = $argsObj->currentUser->hasRight($dbHandler, "platform_management", $argsObj->tproject_id); $guiObj->user_feedback = null; $guiObj->tproject_id = $argsObj->tproject_id; return $guiObj; }
/** * Copy platforms * * @param int $source_id original Test Project identificator * @param int $target_id new Test Project identificator */ private function copy_platforms($source_id, $target_id) { $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; $platform_mgr = new tlPlatform($this->db, $source_id); $old_new = null; $platformSet = $platform_mgr->getAll(); if (!is_null($platformSet)) { $platform_mgr->setTestProjectID($target_id); foreach ($platformSet as $platform) { $op = $platform_mgr->create($platform['name'], $platform['notes']); $old_new[$platform['id']] = $op['id']; } } return $old_new; }
* Filename $RCSfile: platformsView.php,v $ * * @version $Revision: 1.7 $ * @modified $Date: 2010/09/12 15:16:09 $ by $Author: franciscom $ * * allows users to manage platforms. * @internal revisions */ require_once "../../config.inc.php"; require_once "common.php"; testlinkInitPage($db, false, false, "checkRights"); $templateCfg = templateConfiguration(); $args = init_args(); $platform_mgr = new tlPlatform($db, $args->testproject_id); $gui = new stdClass(); $gui->platforms = $platform_mgr->getAll(array('include_linked_count' => true)); $gui->canManage = $args->currentUser->hasRight($db, "platform_management"); $gui->user_feedback = null; $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * * */ function init_args() { $args = new stdClass(); $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $args->currentUser = $_SESSION['currentUser']; return $args;
/** * * */ function getPlatforms($db, $tproject_id, $testplan_id) { $platform_mgr = new tlPlatform($db, $tproject_id); if (is_null($testplan_id)) { $platforms = $platform_mgr->getAll(); } else { $platforms = $platform_mgr->getLinkedToTestplan($testplan_id); } if (is_null($platforms)) { // need to create fake data for platform 0 in order // to have only simple logic $platforms = array('id' => 0, 'name' => ''); } return $platforms; }