Ejemplo n.º 1
0
$gui = new stdClass();
$gui->platform_assignment_subtitle = null;
$gui->tplan_id = $args->tplan_id;
$gui->tproject_id = $args->tproject_id;
$gui->can_do = isset($args->tplan_id);
$gui->mainTitle = lang_get('add_remove_platforms');
$gui->warning = '';
if (isset($args->tplan_id)) {
    // do following check to give warning to user
    // if test plan has test case versions with platform_id=0
    // this means that right now there are not platforms linked to test plan.
    // Give message to user with following info:
    // Till you are not going to assign a platform to this linked tcversions
    // and it's execution results he/she will not be able to execute
    //
    $qtyByPlatform = $tplan_mgr->countLinkedTCVersionsByPlatform($args->tplan_id);
    $qtyLinked2Unknown = isset($qtyByPlatform[0]['qty']) ? $qtyByPlatform[0]['qty'] : 0;
    if ($fix_needed = $qtyLinked2Unknown > 0) {
        $gui->warning = lang_get('unknown_platform');
    }
    $opt_cfg->global_lbl = '';
    $opt_cfg->additional_global_lbl = null;
    $opt_cfg->from->lbl = lang_get('available_platforms');
    $opt_cfg->to->lbl = lang_get('assigned_platforms');
    $gui->platform_count_js = init_option_panels($tplan_mgr, $platform_mgr, $opt_cfg, $args);
    $tplanData = $tplan_mgr->get_by_id($args->tplan_id);
    if (isset($tplanData)) {
        $gui->mainTitle = sprintf($gui->mainTitle, $tplanData['name']);
    }
    if ($args->doAction == 'doAssignPlatforms') {
        $platform_mgr->linkToTestplan($args->platformsToAdd, $args->tplan_id);