本文整理汇总了PHP中Command::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::delete方法的具体用法?PHP Command::delete怎么用?PHP Command::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
//.........这里部分代码省略.........
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("add Issues ({$bugid_list}) on Command {$cmdid} team {$this->teamid}");
}
$bugids = explode(',', $bugid_list);
//$cmd->addIssueList($bugids, true); // DBonly
foreach ($bugids as $id) {
if (is_numeric(trim($id))) {
$cmd->addIssue(intval($id), true);
// DBonly
} else {
self::$logger->error('Attempt to set non_numeric value (' . $id . ')');
die("<span style='color:red'>ERROR: Please contact your CodevTT administrator</span>");
}
}
} else {
if ("removeCmdIssue" == $action) {
$cmd->removeIssue($_POST['bugid']);
} else {
if ("addToCmdSet" == $action) {
$commandsetid = $_POST['commandsetid'];
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("add Command {$cmdid} to CommandSet {$commandsetid}");
}
$cmdset = CommandSetCache::getInstance()->getCommandSet($commandsetid);
$cmdset->addCommand($cmdid, Command::type_general);
} else {
if ("removeFromCmdSet" == $action) {
$commandsetid = $_POST['commandsetid'];
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("remove Command {$cmdid} from CommandSet {$commandsetid}");
}
$cmdset = CommandSetCache::getInstance()->getCommandSet($commandsetid);
$cmdset->removeCommand($cmdid);
} else {
if ("updateCmdInfo" == $action) {
$this->updateCmdInfo($cmd);
header('Location:command_info.php');
} else {
if ("deleteCommand" == $action) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("delete Command {$cmdid}");
}
Command::delete($cmdid);
unset($_SESSION['cmdid']);
header('Location:command_info.php');
} else {
if ("addProvision" == $action) {
# TODO check injections
$prov_date = $_POST['date'];
$prov_type = $_POST['type'];
$prov_budget = $_POST['budget'];
$prov_budgetDays = $_POST['budgetDays'];
$prov_averageDailyRate = $_POST['averageDailyRate'];
$prov_summary = $_POST['summary'];
$isInCheckBudget = 0 == Tools::getSecurePOSTIntValue("isInCheckBudget") ? false : true;
$timestamp = Tools::date2timestamp($prov_date);
CommandProvision::create($cmd->getId(), $timestamp, $prov_type, $prov_summary, $prov_budgetDays, $prov_budget, $prov_averageDailyRate, $isInCheckBudget);
} else {
if ("deleteProvision" == $action) {
# TODO check injections
$provid = $_POST['provid'];
$cmd->deleteProvision($provid);
}
}
}
}
}
}
}
}
}
// Display Command
$this->smartyHelper->assign('commandid', $cmdid);
$this->smartyHelper->assign('cmdInfoFormBtText', T_('Save'));
$this->smartyHelper->assign('cmdInfoFormAction', 'updateCmdInfo');
$this->smartyHelper->assign('isAddIssueForm', true);
$parentCmdSets = $this->getParentCmdSetCandidates($this->session_user);
$this->smartyHelper->assign('parentCmdSetCandidates', $parentCmdSets);
$this->smartyHelper->assign('isAddCmdSetForm', true);
$isManager = $this->session_user->isTeamManager($cmd->getTeamid());
CommandTools::displayCommand($this->smartyHelper, $cmd, $isManager);
$this->smartyHelper->assign('cmdProvisionType', SmartyTools::getSmartyArray(CommandProvision::$provisionNames, 1));
// WBS
$this->smartyHelper->assign('wbsRootId', $cmd->getWbsid());
// multiple selection dialogBox
$availableIssueList = $this->getChildIssuesCandidates($this->teamid);
$this->smartyHelper->assign('availableIssueList', $availableIssueList);
$this->smartyHelper->assign('sendSelectIssuesActionName', "addCmdIssueList");
$this->smartyHelper->assign('selectIssuesBoxTitle', T_('Add tasks to Command') . ' \'' . $cmd->getName() . '\'');
$this->smartyHelper->assign('openDialogLabel', T_("Add multiple tasks"));
$this->smartyHelper->assign('selectIssuesDoneBtText', T_("Add selection"));
$this->smartyHelper->assign('selectIssuesBoxDesc', T_("Note: Tasks already assigned to a Command are not displayed."));
$this->smartyHelper->assign('selectIssuesConfirmMsg', T_("Add the selected issues to the Command ?"));
}
// you can create a command OR move cmd only to managed teams
$mTeamList = $this->session_user->getManagedTeamList();
$this->smartyHelper->assign('grantedTeams', SmartyTools::getSmartyArray($mTeamList, $this->teamid));
}
}
}
示例2: delete
/**
* delete a team (and all it's ServiceContracts,CommandSets,Commands)
* @static
* @param int $teamidToDelete
* @return bool
*/
public static function delete($teamidToDelete)
{
try {
$team = TeamCache::getInstance()->getTeam($teamidToDelete);
$idlist = array_keys($team->getCommands());
foreach ($idlist as $id) {
Command::delete($id);
}
$idlist = array_keys($team->getCommandSetList());
foreach ($idlist as $id) {
CommandSet::delete($id);
}
$idlist = array_keys($team->getServiceContractList());
foreach ($idlist as $id) {
ServiceContract::delete($id);
}
$query = "DELETE FROM `codev_team_project_table` WHERE team_id = {$teamidToDelete};";
$result = SqlWrapper::getInstance()->sql_query($query);
if (!$result) {
echo "<span style='color:red'>ERROR: Query FAILED</span>\n";
exit;
}
$query = "DELETE FROM `codev_team_user_table` WHERE team_id = {$teamidToDelete};";
$result = SqlWrapper::getInstance()->sql_query($query);
if (!$result) {
echo "<span style='color:red'>ERROR: Query FAILED</span>\n";
exit;
}
$query = "DELETE FROM `codev_team_table` WHERE id = {$teamidToDelete};";
$result = SqlWrapper::getInstance()->sql_query($query);
if (!$result) {
echo "<span style='color:red'>ERROR: Query FAILED</span>\n";
exit;
}
} catch (Exception $e) {
return false;
}
return true;
}
示例3: delete
/**
*
*
* @param mixed
* @return
*/
public static function delete($condition = '', $params = [])
{
$command = new Command(get_called_class());
return $command->delete($condition, $params);
}