当前位置: 首页>>代码示例>>PHP>>正文


PHP Team::delete方法代码示例

本文整理汇总了PHP中Team::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::delete方法的具体用法?PHP Team::delete怎么用?PHP Team::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Team的用法示例。


在下文中一共展示了Team::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _ops_delete

function _ops_delete($OID = 0, $CID = 0)
{
    $OID = max(0, intval($OID));
    $CID = max(0, intval($CID));
    $msg = '';
    loginRequireMgmt();
    if (!loginCheckPermission(USER::MGMT_TEAM)) {
        redirect("errors/401");
    }
    $itemName = "Team";
    $urlPrefix = "mgmt_team";
    $object = new Team($OID, $CID);
    if (!$object->exists()) {
        $msg = "{$itemName} not found!";
    } else {
        transactionBegin();
        if ($object->delete()) {
            transactionCommit();
            $msg = "{$itemName} deleted!";
        } else {
            TransactionRollback();
            $msg = "{$itemName} delete failed!";
        }
    }
    redirect("{$urlPrefix}/manage", $msg);
}
开发者ID:brata-hsdc,项目名称:brata.masterserver,代码行数:26,代码来源:ops_delete.php

示例2: delete

 function delete()
 {
     $this->is_loggedin();
     global $runtime;
     $to_trash = new Team($runtime['ident']);
     $to_trash->delete();
     redirect('teams/all');
 }
开发者ID:stas,项目名称:bebuntu,代码行数:8,代码来源:teams-controller.php

示例3: while

                    $agn = $T_INJS_REV[strtoupper($inj)];
                    while ($p->{$inj}-- > 0) {
                        $status2 &= Match::ImportEntry($pid, array_merge(array_fill_keys(array_merge($T_PMD_ACH, $T_PMD_IR), 0), array_combine($T_PMD_INJ, array($pstatus, $agn, $p->{$inj}-- > 0 ? $agn : NONE))));
                    }
                }
                # Set player achievements
                $status2 &= Match::ImportEntry($pid, array_merge(array_intersect_key((array) $p, array_fill_keys($T_PMD_ACH, null)), array_combine($T_PMD_INJ, array($pstatus, NONE, NONE)), array_fill_keys($T_PMD_IR, 0)));
                status($status2, "Added to '{$t->name}' player '{$p->name}'");
            }
            # Set correct treasury.
            $team->dtreasury($t->treasury * 1000 - $team->treasury);
            // $t->treasury + $delta = XML value
            $team->postImportSync();
        }
        if ($ROLLBACK) {
            status($team->delete(), 'Successfully deleted new team due to error.');
        }
    }
}
title($lng->getTrn('menu/admin_menu/import'));
?>
This page allows you to create a customized team for an existing coach.<br> 
This is useful if you and your league wish to avoid starting from scratch in order to use OBBLM.<br>
<br>
<b>Note</b>: If you discover errors after having imported your team, you can either repair the errors<br> 
via the admin tools in the coach corner, or simply delete the team and import a new.<br>
<br>
<b>Note</b>: The team import feature is <b>not</b> meant to be a way for you to import the entire state of your league, with stats, into OBBLM.<br>
It's meant to be an easy way of getting your existing teams into OBBLM without having to re-create the teams from scratch ie. buying players, buying team stuff, selecting player skills etc..<br>
The fact that you may specify won, lost and draw games etc. for a imported team is merely to make the team pages of imported teams reflect the actual team progress - it 
does not allow you to integreate the imported team's stats with the future collected stats via OBBLM in, for example, the standings tables.
开发者ID:nicholasmr,项目名称:obblm,代码行数:31,代码来源:admin_import.php

示例4: 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') {
//.........这里部分代码省略.........
开发者ID:fg-ok,项目名称:codev,代码行数:101,代码来源:edit_team.php

示例5: connectToEncryptedMySQL

<?php

require_once "/etc/apache2/capstone-mysql/encrypted-config.php";
require_once "your-class-file.php";
$pdo = connectToEncryptedMySQL("/etc/apache2/data-design/dfontaine1.ini");
// now procede to PDO normally
$team = new Team(null, 1, "this is from PHP");
$team->insert($pdo);
$team->setTeamContent("now I change the message");
$team->update($pdo);
$team->delete($pdo);
开发者ID:DenzylFontaine,项目名称:espn,代码行数:11,代码来源:team-shakedown.php


注:本文中的Team::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。