本文整理汇总了PHP中Team::getTeams方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::getTeams方法的具体用法?PHP Team::getTeams怎么用?PHP Team::getTeams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Team
的用法示例。
在下文中一共展示了Team::getTeams方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __
<option value="">— <?php echo __('Anyone');?> —</option>
<option value="s0">— <?php echo __('Unassigned');?> —</option>
<option value="s<?php echo $thisstaff->getId(); ?>"><?php echo __('Me');?></option>
<?php
if(($users=Staff::getStaffMembers())) {
echo '<OPTGROUP label="'.sprintf(__('Agents (%d)'),count($users)-1).'">';
foreach($users as $id => $name) {
if ($id == $thisstaff->getId())
continue;
$k="s$id";
echo sprintf('<option value="%s">%s</option>', $k, $name);
}
echo '</OPTGROUP>';
}
if(($teams=Team::getTeams())) {
echo '<OPTGROUP label="'.__('Teams').' ('.count($teams).')">';
foreach($teams as $id => $name) {
$k="t$id";
echo sprintf('<option value="%s">%s</option>', $k, $name);
}
echo '</OPTGROUP>';
}
?>
</select>
</fieldset>
<fieldset class="span6">
<label for="topicId"><?php echo __('Help Topics');?>:</label>
<select id="topicId" name="topicId">
<option value="" selected >— <?php echo __('All Help Topics');?> —</option>
<?php
示例2: teamNameDumpAction
public function teamNameDumpAction()
{
if ($this->version < 1) {
throw new BadRequestException();
}
// Create an array to store all teams and the BZIDs
$teamArray = array();
foreach (Team::getTeams() as $team) {
$memberList = "";
foreach ($team->getMembers() as $member) {
$memberList .= $member->getBZID() . ",";
}
$teamName = preg_replace("/&[^\\s]*;/", "", $team->getName());
$teamID = $team->getId();
$teamMembers = rtrim($memberList, ",");
$teamArray[] = array("team" => $teamName, "members" => $teamMembers, "team_id" => $teamID, "team_name" => $teamName, "team_members" => $teamMembers);
}
return new JsonResponse(array("teamDump" => &$teamArray, "team_list" => &$teamArray));
}
示例3: makeList
public static function makeList()
{
global $lng, $coach, $settings;
HTMLOUT::frame_begin();
# Make page frame, banner and menu.
title($lng->getTrn('name', __CLASS__));
echo $lng->getTrn('desc', __CLASS__) . "<br><br>\n";
list($sel_node, $sel_node_id) = HTMLOUT::nodeSelector(array());
$ALLOW_EDIT = is_object($coach) && $coach->isNodeCommish($sel_node, $sel_node_id);
/* A new entry was sent. Add it to system */
if ($ALLOW_EDIT && isset($_POST['tid']) && isset($_POST['trid'])) {
if (get_magic_quotes_gpc()) {
$_POST['title'] = stripslashes($_POST['title']);
$_POST['txt'] = stripslashes($_POST['txt']);
}
switch ($_GET['action']) {
case 'new':
status(self::create($_POST['ptype'], $_POST['tid'], $_POST['trid'], $_POST['title'], $_POST['txt']));
break;
}
}
/* Was a request for a new entry made? */
if (isset($_GET['action']) && $ALLOW_EDIT) {
switch ($_GET['action']) {
case 'delete':
if (isset($_GET['prid']) && is_numeric($_GET['prid'])) {
$pr = new Prize($_GET['prid']);
status($pr->delete());
unset($pr);
} else {
fatal('Sorry. You did not specify which prize ID you wish to delete.');
}
break;
case 'new':
echo "<a href='handler.php?type=prize'><-- " . $lng->getTrn('common/back') . "</a><br><br>";
$_DISABLED = !isset($_POST['trid']) ? 'DISABLED' : '';
?>
<form name="STS" method="POST" enctype="multipart/form-data">
<b><?php
echo $lng->getTrn('common/tournament');
?>
</b><br>
<?php
echo HTMLOUT::nodeList(T_NODE_TOURNAMENT, 'trid');
?>
<input type='submit' value='<?php
echo $lng->getTrn('common/select');
?>
'>
</form>
<br>
<form method="POST" enctype="multipart/form-data">
<b><?php
echo $lng->getTrn('team', __CLASS__);
?>
</b><br>
<select name="tid" <?php
echo $_DISABLED;
?>
>
<?php
$teams = isset($_POST['trid']) ? Team::getTeams(false, array(get_parent_id(T_NODE_TOURNAMENT, (int) $_POST['trid'], T_NODE_LEAGUE)), true) : array();
foreach ($teams as $tid => $name) {
echo "<option value='{$tid}'>{$name}</option>\n";
}
?>
</select>
<br><br>
<b><?php
echo $lng->getTrn('kind', __CLASS__);
?>
</b><br>
<select name="ptype" <?php
echo $_DISABLED;
?>
>
<?php
foreach (self::getTypes() as $ptype => $desc) {
echo "<option value='{$ptype}'>{$desc}</option>\n";
}
?>
</select>
<br><br>
<?php
echo '<b>' . $lng->getTrn('g_title', __CLASS__) . '</b> — ' . $lng->getTrn('title', __CLASS__);
?>
<br>
<input type="text" name="title" size="60" maxlength="100" value="" <?php
echo $_DISABLED;
?>
>
<br><br>
<?php
echo '<b>' . $lng->getTrn('g_about', __CLASS__) . '</b> — ' . $lng->getTrn('about', __CLASS__);
?>
<br>
<textarea name="txt" rows="15" cols="100" <?php
echo $_DISABLED;
?>
></textarea>
//.........这里部分代码省略.........
示例4: foreach
echo '<td>' . $team->getStatus() . '</td>';
if ($_SESSION['login']['role'] == 3 || $_SESSION['login']['role'] == 2 && $_SESSION['login']['id_person'] == $team->getLeader()->getId()) {
if ($team->getStatus() != 'Inativa') {
echo '<td>' . '<a href="forms.php?p=altEquipe&cod=' . $team->getId() . '">' . '<i class="icon icon-pencil"></i> Editar' . '</a>' . '</td>';
} else {
echo '<td></td>';
}
} else {
echo '<td></td>';
}
echo '</tr>';
}
}
} else {
if (Team::getTeams() != '') {
foreach (Team::getTeams() as $team) {
$calebe = false;
foreach ($team->getMembers() as $cal) {
if ($cal->getId() == $_SESSION['login']['id_person']) {
$calebe = true;
}
}
if ($calebe) {
echo '<tr>';
echo '<td>' . $team->getId() . '</td>';
echo '<td>' . '<a class="modalTeam" data-id="' . $team->getId() . '" >' . $team->getName() . '</a>' . '</td>';
echo '<td>' . '<a class="modalCalebe" data-id="' . $team->getLeader()->getId() . '" >' . $team->getLeader()->getName() . '</a>' . '</td>';
echo '<td>' . count($team->getMembersTeam($team->getId())) . '</td>';
echo '<td>' . $team->getStatus() . '</td>';
echo '<td></td>';
echo '</tr>';
示例5: listAction
public function listAction()
{
return array("teams" => Team::getTeams());
}
示例6: foreach
?>
" readonly="" />
<span class="input-group-addon add-on"><i class="icon-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="pass1" class="control-label col-lg-4" title="É necessário que tenha ao menos uma equipe disponivel">Equipe da Missão</label>
<div class="col-lg-5">
<select name="ID_TEAM" class="form-control" required title="É necessário que tenha ao menos uma equipe disponivel">
<option value="">Selecione a Equipe</option>
<?php
if (Team::getTeams()) {
foreach (Team::getTeams() as $rel) {
if ($rel->getStatus() == 'Disponível') {
echo '<option value="' . $rel->getId() . '">' . $rel->getName() . '</option>';
}
}
} else {
echo '<script>
alert("Para agendar uma Missão é necessário ter ao menos uma Equipe!");
window.location = "consulta.php?p=equipe";
</script>';
}
?>
</select>
</div>
</div>
示例7: display
protected function display()
{
if (Tools::isConnectedUser()) {
$teamList = NULL;
// leadedTeams only, except Admins: they can edit all teams
if ($this->session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId))) {
$teamList = Team::getTeams(true);
} else {
$teamList = $this->session_user->getLeadedTeamList(true);
}
if (count($teamList) > 0) {
if (isset($_POST['deletedteam'])) {
$teamidToDelete = Tools::getSecurePOSTIntValue("deletedteam");
if (array_key_exists($teamidToDelete, $teamList)) {
$retCode = Team::delete($teamidToDelete);
if (!$retCode) {
$this->smartyHelper->assign('error', T_("Couldn't delete the team"));
} else {
if ($teamidToDelete == $_SESSION['teamid']) {
unset($_SESSION['teamid']);
$this->updateTeamSelector();
}
unset($teamList[$teamidToDelete]);
}
}
}
// use the teamid set in the form, if not defined (first page call) use session teamid
if (isset($_POST['displayed_teamid'])) {
$displayed_teamid = Tools::getSecurePOSTIntValue('displayed_teamid');
} else {
if (isset($_SESSION['teamid']) && array_key_exists($_SESSION['teamid'], $teamList)) {
$displayed_teamid = $_SESSION['teamid'];
} else {
$teamIds = array_keys($teamList);
if (count($teamIds) > 0) {
$displayed_teamid = $teamIds[0];
} else {
$displayed_teamid = 0;
}
}
}
$this->smartyHelper->assign('availableTeams', SmartyTools::getSmartyArray($teamList, $displayed_teamid));
if (array_key_exists($displayed_teamid, $teamList)) {
$team = TeamCache::getInstance()->getTeam($displayed_teamid);
if ($displayed_teamid != Config::getInstance()->getValue(Config::id_adminTeamId)) {
$this->smartyHelper->assign('allowDeleteTeam', 1);
}
// ----------- actions ----------
$action = isset($_POST['action']) ? $_POST['action'] : '';
if ($action == "updateTeamLeader") {
$teamleader_id = Tools::getSecurePOSTIntValue('leaderid');
if (!$team->setLeader($teamleader_id)) {
$this->smartyHelper->assign('error', T_("Couldn't update the team leader"));
} else {
// --- add teamLeader as Mantis manager of the SideTaskProject
//$leader = UserCache::getInstance()->getUser($teamleader_id);
//$access_level = 70; // TODO mantis manager
//$leader->setProjectAccessLevel($stproj_id, $access_level);
}
} elseif ($action == "updateTeamCreationDate") {
$formatedDate = Tools::getSecurePOSTStringValue("date_createTeam");
$date_create = Tools::date2timestamp($formatedDate);
if (!$team->setCreationDate($date_create)) {
$this->smartyHelper->assign('error', T_("Couldn't update the creation date"));
}
} elseif ($action == "setTeamEnabled") {
$isTeamEnabled = 0 == Tools::getSecurePOSTIntValue("isTeamEnabled") ? false : true;
if (!$team->setEnabled($isTeamEnabled)) {
$this->smartyHelper->assign('error', T_("Couldn't enable/disable team"));
}
} elseif ($action == "addTeamMember") {
$memberid = Tools::getSecurePOSTIntValue('memberid');
$memberAccess = Tools::getSecurePOSTIntValue('member_access');
$formatedDate = Tools::getSecurePOSTStringValue("date1");
$arrivalTimestamp = Tools::date2timestamp($formatedDate);
try {
// save to DB
$team->addMember($memberid, $arrivalTimestamp, $memberAccess);
// CodevTT administrators can manage ExternalTasksProject in Mantis
if (Config::getInstance()->getValue(Config::id_adminTeamId) == $team->getId()) {
$newUser = UserCache::getInstance()->getUser($memberid);
$extProjId = Config::getInstance()->getValue(Config::id_externalTasksProject);
$access_level = 70;
// TODO mantis manager
$newUser->setProjectAccessLevel($extProjId, $access_level);
}
} catch (Exception $e) {
$this->smartyHelper->assign('error', "Couldn't add user {$memberid} to the team");
}
} elseif ($action == "setMemberDepartureDate") {
$formatedDate = Tools::getSecurePOSTStringValue("date2");
$departureTimestamp = Tools::date2timestamp($formatedDate);
$memberid = Tools::getSecurePOSTIntValue('memberid');
$team->setMemberDepartureDate($memberid, $departureTimestamp);
} elseif ($action == 'addMembersFrom') {
$src_teamid = Tools::getSecurePOSTIntValue('f_src_teamid');
// add all members declared in Team $src_teamid (same dates, same access)
// except if already declared
$team->addMembersFrom($src_teamid);
} elseif ($action == 'removeIssueTooltip') {
//.........这里部分代码省略.........
示例8: execute
/**
*
*/
public function execute()
{
$my_endTimestamp = mktime(23, 59, 59, date('m', $this->endTimestamp), date('d', $this->endTimestamp), date('Y', $this->endTimestamp));
// candidate teams
$teamList = Team::getTeams(true);
if (!array_key_exists($this->displayedTeam, $teamList)) {
$teamIds = array_keys($teamList);
if (count($teamIds) > 0) {
$this->displayedTeam = $teamIds[0];
} else {
$this->displayedTeam = 0;
}
}
// get timetracks
$timetracks = array();
if (0 != $this->displayedTeam) {
$members = TeamCache::getInstance()->getTeam($this->displayedTeam)->getActiveMembers();
if (!empty($members)) {
$memberIdList = array_keys($members);
$formatedMembers = implode(', ', $memberIdList);
$query = "SELECT * FROM `codev_timetracking_table` " . "WHERE date >= {$this->startTimestamp} AND date <= {$my_endTimestamp} " . "AND userid IN ({$formatedMembers})" . "ORDER BY date;";
$result = SqlWrapper::getInstance()->sql_query($query);
if (!$result) {
echo "<span style='color:red'>ERROR: Query FAILED</span>";
exit;
}
$jobs = new Jobs();
while ($row = SqlWrapper::getInstance()->sql_fetch_object($result)) {
$tt = TimeTrackCache::getInstance()->getTimeTrack($row->id, $row);
$user = UserCache::getInstance()->getUser($tt->getUserId());
$issue = IssueCache::getInstance()->getIssue($tt->getIssueId());
if (!is_null($tt->getCommitterId())) {
$committer = UserCache::getInstance()->getUser($tt->getCommitterId());
$committer_name = $committer->getName();
$commit_date = date('Y-m-d H:i:s', $tt->getCommitDate());
} else {
$committer_name = '';
// this info does not exist before v1.0.4
$commit_date = '';
}
$timetracks[$row->id] = array('user' => $user->getName(), 'date' => date('Y-m-d', $tt->getDate()), 'job' => $jobs->getJobName($tt->getJobId()), 'duration' => $tt->getDuration(), 'committer' => $committer_name, 'commit_date' => $commit_date, 'task_id' => $issue->getId(), 'task_extRef' => $issue->getTcId(), 'task_summary' => $issue->getSummary());
}
}
}
$this->execData = array('teamList' => $teamList, 'startTimestamp' => $this->startTimestamp, 'endTimestamp' => $this->endTimestamp, 'timetracks' => $timetracks);
return $this->execData;
}