本文整理汇总了PHP中Tasks::deleteTask方法的典型用法代码示例。如果您正苦于以下问题:PHP Tasks::deleteTask方法的具体用法?PHP Tasks::deleteTask怎么用?PHP Tasks::deleteTask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tasks
的用法示例。
在下文中一共展示了Tasks::deleteTask方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Site $site, &$session, $post)
{
$tasks = new Tasks($site);
$user = $session[User::SESSION_NAME];
$root = $site->getRoot();
if (isset($post['add'])) {
$day = strip_tags($post['day']);
$title = strip_tags($post['title']);
$notes = strip_tags($post['notes']);
$notes = $notes === null ? '' : $notes;
$priority = strip_tags($post['priority']);
$row = array("id" => 0, "day" => $day, "title" => $title, "notes" => $notes, "priority" => $priority);
$task = new Task($row);
$tasks->addTask($user->getId(), $task);
$this->redirect = "/tasks.php";
return;
}
if (isset($post['edit'])) {
$id = strip_tags($post['id']);
$day = strip_tags($post['day']);
$title = strip_tags($post['title']);
$notes = strip_tags($post['notes']);
$notes = $notes === null ? '' : $notes;
$priority = strip_tags($post['priority']);
$row = array("id" => $id, "day" => $day, "title" => $title, "notes" => $notes, "priority" => $priority);
$task = new Task($row);
$tasks->updateTask($user->getId(), $task);
$this->redirect = "/tasks.php";
return;
}
if (isset($post['delete'])) {
$id = strip_tags($post['id']);
$tasks->deleteTask($user->getId(), $id);
$this->redirect = "/tasks.php";
return;
}
}
示例2: deleteTask
/**
* Delete Activity
* @var string $prj_uid. Uid for Process
* @var string $act_uid. Uid for Activity
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* return object
*/
public function deleteTask($prj_uid, $act_uid)
{
try {
$prj_uid = $this->validateProUid($prj_uid);
$act_uid = $this->validateActUid($act_uid);
G::LoadClass('tasks');
$tasks = new \Tasks();
$tasks->deleteTask($act_uid);
} catch (Exception $e) {
throw $e;
}
}
示例3: deleteSubProcess
/**
* deleteSubProcess
*
* @param string $sProcessUID
* @param string $sTaskUID
* @return boolean true
* throw Exception $oError
*/
public function deleteSubProcess($sProcessUID = '', $sTaskUID = '')
{
try {
$oTasks = new Tasks();
$oTasks->deleteTask($sTaskUID);
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn('SP_UID');
$oCriteria->add(SubProcessPeer::PRO_PARENT, $sProcessUID);
$oCriteria->add(SubProcessPeer::TAS_PARENT, $sTaskUID);
$oDataset = SubProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$oSubProcess = new SubProcess();
$oSubProcess->remove($aRow['SP_UID']);
return true;
} catch (Exception $oError) {
throw $oError;
}
}
示例4: deleteWebEntry
/**
* Delete WebEntry
*
* @param string $webEntryUid Unique id of WebEntry
* @param string $webEntryTaskUid WebEntry, unique id of Task
*
* return void
*/
public function deleteWebEntry($webEntryUid, $webEntryTaskUid)
{
try {
if ($webEntryTaskUid != "") {
$obj = \TaskPeer::retrieveByPK($webEntryTaskUid);
if (!is_null($obj)) {
$task = new \Tasks();
$task->deleteTask($webEntryTaskUid);
}
}
if ($webEntryUid != "") {
$obj = \WebEntryPeer::retrieveByPK($webEntryUid);
if (!is_null($obj)) {
$this->webEntry->delete($webEntryUid);
}
}
} catch (\Exception $e) {
throw $e;
}
}
示例5: defineProcess
//.........这里部分代码省略.........
}
//Process - Save Calendar ID for this process
if (isset($arrayProcessData["PRO_CALENDAR"]) && $arrayProcessData["PRO_CALENDAR"] != "") {
$calendar = new \Calendar();
$calendar->assignCalendarTo($processUid, $arrayProcessData["PRO_CALENDAR"], "PROCESS");
}
$uidAux = $arrayDefineProcessData["process"]["PRO_UID"];
$arrayDefineProcessData["process"]["PRO_UID"] = $processUid;
$arrayDefineProcessData["process"]["PRO_UID_OLD"] = $uidAux;
//Tasks
if (isset($arrayDefineProcessData["process"]["tasks"]) && count($arrayDefineProcessData["process"]["tasks"]) > 0) {
$arrayTaskData = $arrayDefineProcessData["process"]["tasks"];
foreach ($arrayTaskData as $index => $value) {
$t = $value;
$t["PRO_UID"] = $processUid;
$arrayData = $t;
$action = $arrayData["_action"];
unset($arrayData["_action"]);
switch ($action) {
case "CREATE":
//Create task
$arrayDataAux = array(
"TAS_UID" => $arrayData["TAS_UID"],
"PRO_UID" => $arrayData["PRO_UID"],
"TAS_TITLE" => $arrayData["TAS_TITLE"],
"TAS_DESCRIPTION" => $arrayData["TAS_DESCRIPTION"],
"TAS_POSX" => $arrayData["TAS_POSX"],
"TAS_POSY" => $arrayData["TAS_POSY"],
"TAS_START" => $arrayData["TAS_START"]
);
$task = new \Task();
$taskUid = $task->create($arrayDataAux, false);
$uidAux = $arrayDefineProcessData["process"]["tasks"][$index]["TAS_UID"];
$arrayDefineProcessData["process"]["tasks"][$index]["TAS_UID"] = $taskUid;
$arrayDefineProcessData["process"]["tasks"][$index]["TAS_UID_OLD"] = $uidAux;
//Update task properties
$task2 = new \ProcessMaker\BusinessModel\Task();
$arrayResult = $task2->updateProperties($taskUid, $processUid, $arrayData);
//Update array routes
if (isset($arrayDefineProcessData["process"]["routes"]) && count($arrayDefineProcessData["process"]["routes"]) > 0) {
$arrayDefineProcessData["process"]["routes"] = $this->routeUpdateTaskUidInArray($arrayDefineProcessData["process"]["routes"], $taskUid, $t["TAS_UID"]);
}
break;
case "UPDATE":
//Update task
$task = new \Task();
$result = $task->update($arrayData);
//Update task properties
$task2 = new \ProcessMaker\BusinessModel\Task();
$arrayResult = $task2->updateProperties($arrayData["TAS_UID"], $processUid, $arrayData);
break;
case "DELETE":
$tasks = new \Tasks();
$tasks->deleteTask($arrayData["TAS_UID"]);
break;
}
}
}
//Routes
if (isset($arrayDefineProcessData["process"]["routes"]) && count($arrayDefineProcessData["process"]["routes"]) > 0) {
$arrayRouteData = $arrayDefineProcessData["process"]["routes"];
foreach ($arrayRouteData as $index => $value) {
$r = $value;
$routeUid = $this->defineRoute( //***** New method
$processUid,
$r["TAS_UID"],
$r["ROU_NEXT_TASK"],
$r["ROU_TYPE"],
false
);
$uidAux = $arrayDefineProcessData["process"]["routes"][$index]["ROU_UID"];
$arrayDefineProcessData["process"]["routes"][$index]["ROU_UID"] = $routeUid;
$arrayDefineProcessData["process"]["routes"][$index]["ROU_UID_OLD"] = $uidAux;
}
}
return $arrayDefineProcessData;
}