$tousername = $_POST['touser'];
 $query = "select user_name, id from users where id in ('{$_POST['fromuser']}', '{$_POST['touser']}')";
 $res = $db->query($query);
 while ($row = $db->fetchByAssoc($res)) {
     if ($row['id'] == $_POST['fromuser']) {
         $fromusername = $row['user_name'];
     }
     if ($row['id'] == $_POST['touser']) {
         $tousername = $row['user_name'];
     }
 }
 //rrs bug: 31056 - instead of setting the team_id let's set the team_set_id and set the team_id as the primary
 $teamSetField = new SugarFieldTeamset('Teamset');
 $teams = $teamSetField->getTeamsFromRequest('team_name');
 $team_ids = array_keys($teams);
 $team_id = $teamSetField->getPrimaryTeamIdFromRequest('team_name', $_REQUEST);
 $teamSet = BeanFactory::getBean('TeamSets');
 $team_set_id = $teamSet->addTeams($team_ids);
 $toteamname = TeamSetManager::getCommaDelimitedTeams($team_set_id, $team_id, true);
 echo "{$mod_strings_users['LBL_REASS_DESC_PART2']}\n";
 echo "<form action=\"index.php?module=Users&action=reassignUserRecords&execute=true\" method=post>\n";
 echo "<BR>{$mod_strings_users['LBL_REASS_NOTES_TITLE']}\n";
 echo "<ul>\n";
 echo "<li>* {$mod_strings_users['LBL_REASS_NOTES_ONE']}\n";
 echo "<li>* {$mod_strings_users['LBL_REASS_NOTES_TWO']}\n";
 echo "<li>* {$mod_strings_users['LBL_REASS_NOTES_THREE']}\n";
 echo "</ul>\n";
 require_once 'include/SugarSmarty/plugins/function.sugar_help.php';
 $sugar_smarty = new Sugar_Smarty();
 $help_img = smarty_function_sugar_help(array("text" => $mod_strings['LBL_REASS_VERBOSE_HELP']), $sugar_smarty);
 echo "<BR><input type=checkbox name=verbose> {$mod_strings_users['LBL_REASS_VERBOSE_OUTPUT']}" . $help_img . "<BR>\n";