本文整理汇总了PHP中Schedule::find_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::find_by_id方法的具体用法?PHP Schedule::find_by_id怎么用?PHP Schedule::find_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::find_by_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSchedule
public function getSchedule($scheduleId)
{
$schedule = Schedule::find_by_id($scheduleId);
if (!$schedule instanceof Schedule) {
throw new Exception('Invalid schedule: ' . $scheduleId);
}
return $schedule;
}
示例2: getTaskById
/**
* Add tastsupport find task
*/
public function getTaskById($id)
{
return Schedule::find_by_id($id);
}
示例3: getCloseSchedule
public function getCloseSchedule($id)
{
$schedule = Schedule::find_by_id($id);
//var_dump($_POST['status']);
//Change in schedule should result in change
//in ticket and activation call status
/*
* checks if $activityShed is a ticket
* if not then it is an activation
* call change the status corresponding to
* schedule status for each condition
* */
if ($_REQUEST['status'] == "Open") {
// Condition to check if schedule is Open
$schedule->status = "Open";
$activityShed = Ticket::find_by_id($schedule->ticket_id);
if ($activityShed) {
$activityShed->status = 'Open';
$activityShed->datemodified = date("Y-m-d H:i:s");
$activityShed->update();
} else {
$activityShed = Activation::find_by_id($schedule->ticket_id);
if ($activityShed) {
$activityShed->status = "Open";
$activityShed->created_at = date("Y-m-d H:i:s");
$activityShed->update();
}
}
$schedule->update();
return true;
} elseif ($_REQUEST['status'] == "Closed") {
// Condition to check if schedule is closed
$schedule->status = "Closed";
$activityShed = Ticket::find_by_id($schedule->ticket_id);
if ($activityShed) {
$activityShed->status = 'Closed';
$activityShed->datemodified = date("Y-m-d H:i:s");
$activityShed->update();
} else {
$activityShed = Activation::find_by_id($schedule->ticket_id);
if ($activityShed) {
$activityShed->status = "Closed";
$activityShed->created_at = date("Y-m-d H:i:s");
$activityShed->update();
}
}
$schedule->update();
return true;
} elseif ($_REQUEST['status'] == "In Progress") {
// Condition to check if schedule is in progress
$schedule->status = "In Progress";
$activityShed = Ticket::find_by_id($schedule->ticket_id);
if ($activityShed) {
$activityShed->status = 'Admin Reply';
// admin reply stands for response for administrator for response to ticket or engineer assigned
$activityShed->datemodified = date("Y-m-d H:i:s");
} else {
$activityShed = Activation::find_by_id($schedule->ticket_id);
if ($activityShed) {
$activityShed->status = "In Progress";
$activityShed->created_at = date("Y-m-d H:i:s");
$activityShed->update();
}
}
$schedule->update();
return true;
} else {
return false;
}
//echo $schedule->update();
}
示例4: acceptTask
public function acceptTask()
{
global $session;
$newWorkSheet = new Worksheet();
$ticket = Schedule::find_by_id($_POST['taskid']);
if (isset($_POST['taskid'])) {
$newWorkSheet->cse_emp_id = $_SESSION['emp_ident'];
$newWorkSheet->formid = $_POST['taskid'];
$newWorkSheet->prod_id = $ticket->prod_id;
$newWorkSheet->client_id = $ticket->client_id;
//$newWorkSheet->contact_person = $ticket->contact_name;
$newWorkSheet->problem = $ticket->issue;
$newWorkSheet->sheet_date = date("Y:m:d H:i:s");
$newWorkSheet->datecreated = date("Y:m:d H:i:s");
$newWorkSheet->status = "Open";
$ticket->status = "In Progress";
$ticket->datemodified = date("Y:m:d H:i:s");
if ($newWorkSheet->create()) {
$ticket->update();
return 1;
} else {
return 2;
}
} else {
return 3;
}
}