本文整理汇总了PHP中Task::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::setTitle方法的具体用法?PHP Task::setTitle怎么用?PHP Task::setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::setTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeUpdate
public function executeUpdate()
{
$jira = new sfJiraPlugin($this->getUser()->getProfile()->getJiraLogin(), $this->getUser()->getProfile()->getJiraPassword());
$aProjects = $jira->getProjects();
foreach ($aProjects as $project) {
#var_dump( $project );
$c = new Criteria();
$c->add(ProjectPeer::USER_ID, $this->getUser()->getProfile()->getId());
$c->add(ProjectPeer::KEY, $project->key);
$p = ProjectPeer::doSelectOne($c);
$c = new Criteria();
$c->add(UserPeer::JIRA_LOGIN, $project->lead);
$u = UserPeer::doSelectOne($c);
if (empty($p)) {
$p = new Project();
$p->setKey($project->key);
$p->setLeadId(!empty($u) ? $u->getId() : null);
$p->setUserId($this->getUser()->getProfile()->getId());
$p->setName($project->name);
$p->setUpdated(date('r'));
$p->save();
}
$issues = $jira->getIssuesForProject($p->getKey());
foreach ($issues as $issue) {
#die($p->getKey());
if ($issue->assignee == $this->getUser()->getProfile()->getJiraLogin()) {
$c = new Criteria();
$c->add(TaskPeer::KEY, $issue->key);
$t = TaskPeer::doSelectOne($c);
if (empty($t)) {
$c = new Criteria();
$c->add(UserPeer::JIRA_LOGIN, $issue->reporter);
$u = UserPeer::doSelectOne($c);
$t = new Task();
$t->setProjectId($p->getId());
$t->setTitle($issue->summary);
$t->setDescription($issue->description);
$t->setKey($issue->key);
$t->setUpdated(date('r'));
$t->setStatusId($issue->status);
$t->setPriorityId($issue->priority);
$t->setLeadId(!empty($u) ? $u->getId() : null);
$t->save();
}
}
}
}
$this->redirect('@homepage');
return sfView::NONE;
}
示例2: createTask
/**
* @param $taskName
* @param $taskDesc
* @param $taskDueDate
* @param $taskStatus
* @param null $userId
* @param null $projectId
* @return bool
* @throws \Exception
*/
public function createTask($taskName, $taskDesc, $taskDueDate, $taskStatus, $userId = null, $projectId = null)
{
$task = new Task();
$task->setTitle($taskName);
$task->setDescription($taskDesc);
$task->setDueDate(new \DateTime($taskDueDate));
$task->setStatus($taskStatus);
if ($projectId) {
$project = $this->em->getRepository('AppBundle:Project');
$task->setProject($project->find($project_id));
}
if ($userId) {
$user = $this->em->getRepository('AppBundle:User');
$task->setUser($user->find($useId));
}
try {
$this->em->persist($task);
$this->em->flush();
return true;
} catch (\Exception $e) {
throw $e;
}
}
示例3: foreach
?>
<!doctype html>
<html>
<head>
<title>Tasks API Sample</title>
<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Droid+Serif|Droid+Sans:regular,bold' />
<link rel='stylesheet' href='css/style.css' />
</head>
<body>
<div id='container'>
<div id='top'><h1>Tasks API Sample</h1></div>
<div id='main'>
<?php
$lists = $tasksService->tasklists->listTasklists();
foreach ($lists['items'] as $list) {
print "<h3>{$list['name']}</h3>";
$tasks = $tasksService->tasks->listTasks($list['id']);
foreach ($tasks['items'] as $task) {
$updated = new Task($task);
$updated->setNotes('Test');
$updated->setTitle($task['title'] + ' ' . time());
$tasksService->tasks->update($list['id'], $task['id'], $updated);
print "<p id='post'>{$task['title']}</p>";
}
}
?>
</div>
</div>
</body>
</html>
<?php $_SESSION['access_token'] = $client->getAccessToken(); ?>
示例4: Event
}
// log it
$logEvent = new Event(array('event_type_id' => 'create_task', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $task->getID(), 'data_1' => $task->getTitle(), 'data_2' => $task->getDescription()));
$logEvent->save();
// we're done here
Session::setMessage('You created a new task.');
$json = array('success' => '1', 'successUrl' => Url::task($task->getID()));
echo json_encode($json);
} elseif ($action == 'edit') {
// flag default is false; assume nothing is modified to start
$modified = false;
// is title modified?
if ($title != $task->getTitle()) {
// save changes
$oldTitle = $task->getTitle();
$task->setTitle($title);
$task->save();
// log it
$logEvent = new Event(array('event_type_id' => 'edit_task_title', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $task->getID(), 'data_1' => $oldTitle, 'data_2' => $title));
$logEvent->save();
// set flag
$modified = true;
}
// is leader modified?
if ($leader->getID() != $task->getLeaderID()) {
// save changes
$oldLeaderID = $task->getLeaderID();
$task->setLeaderID($leader->getID());
$task->save();
// log it
$logEvent = new Event(array('event_type_id' => 'edit_task_leader', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'user_2_id' => $leader->getID(), 'item_1_id' => $task->getID(), 'data_1' => $oldLeaderID, 'data_2' => $leader->getID()));