本文整理汇总了PHP中Task::retrieve方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::retrieve方法的具体用法?PHP Task::retrieve怎么用?PHP Task::retrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::retrieve方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testsave
public function testsave()
{
error_reporting(E_ERROR | E_PARSE);
$task = new Task();
$task->name = 'test';
$task->priority = 'Medium';
$task->parent_type = 'Accounts';
$task->status = 'In Progress';
$result = $task->save();
//test for record ID to verify that record is saved
$this->assertTrue(isset($task->id));
$this->assertEquals(36, strlen($task->id));
//mark the record as deleted and verify that this record cannot be retrieved anymore.
$task->mark_deleted($task->id);
$result = $task->retrieve($task->id);
$this->assertEquals(null, $result);
}
示例2: testTaskEmptyStatus
/**
* @group bug40999
*/
public function testTaskEmptyStatus()
{
$task = new Task();
$this->taskid = $task->id = create_guid();
$task->new_with_id = 1;
$task->save();
// then retrieve
$task = new Task();
$task->retrieve($this->taskid);
$this->assertEquals('Not Started', $task->status);
}
示例3: Task
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once 'modules/Tasks/Task.php';
$focus = new Task();
if (!isset($_REQUEST['record'])) {
sugar_die($mod_strings['ERR_DELETE_RECORD']);
}
$focus->retrieve($_REQUEST['record']);
if (!$focus->ACLAccess('Delete')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$focus->mark_deleted($_REQUEST['record']);
header("Location: index.php?module=" . $_REQUEST['return_module'] . "&action=" . $_REQUEST['return_action'] . "&record=" . $_REQUEST['return_id']);
示例4: sync_events
function sync_events($one_user = false, $sel_user = "")
{
global $beanList, $beanFiles, $path;
$use_offset_time = true;
$td = new TimeDate();
$arr_modules[] = "Meetings";
$arr_modules[] = "Calls";
$arr_modules[] = "Tasks";
global $timedate;
global $beanList, $beanFiles, $path, $current_user;
for ($tn = 0; $tn < count($arr_modules); $tn++) {
ob_start();
$module_name = $arr_modules[$tn];
$class_name = $beanList[$module_name];
require_once $beanFiles[$class_name];
$seed = new $class_name();
$tbn = $seed->table_name;
$tablename = $tbn;
$cstmtbname2 = $tablename . "_cstm";
if ($one_user == true) {
if ($_SESSION['authenticated_user_id'] == "" and 1 == 2) {
} else {
if ($sel_user != "") {
$cu = $sel_user;
} else {
$cu = $_SESSION['authenticated_user_id'];
}
$tdus = new TimeDate();
$cus = new User();
$cus->retrieve($cu);
##############
global $current_user;
$current_user = $cus;
##############
$calendar_priv_add = $cus->google_mcalendar_c;
$crdatefilt = $cus->google_mafterdate_c;
$crdatefilt = $tdus->swap_formats($crdatefilt, $td->get_date_format(true, $cus), "Y-m-d");
unset($cus);
$sql_user = " 1 and {$tbn}.assigned_user_id='{$cu}' and ({$cstmtbname2}.old_id_c='' or {$cstmtbname2}.old_id_c is null ) ";
if ($crdatefilt != '') {
$sql_user .= " and {$tbn}.date_entered>='{$crdatefilt}' ";
}
$query = $sql_user;
}
}
$d1d = array();
$s = array();
$ch = array();
$fd = array();
$forexp = "";
$fort1d = "";
$t1d = "";
$nt = "";
$nt1 = "";
$cm = date("m");
$cy = date("Y");
unset($response);
global $max_events_upload_google;
$response = $seed->get_list($order_by, $query, $offset, 10000, $max_events_upload_google, false);
if ($tablename == "calls") {
}
$newdoc = $response['list'][$tn1];
if (1 == 1) {
$tablename = $tbn;
echo "<br>****** Get events from {$tablename}";
require_once 'modules/Calendar/DateTimeUtil.php';
$cm = date("m");
$cy = date("Y");
for ($tn1 = 0; $tn1 < count($response['list']); $tn1++) {
unset($a);
unset($a1);
unset($a2);
unset($s);
unset($current_user);
unset($user);
unset($td);
$a1 = $response['list'][$tn1];
$current_user = new User();
$current_user->retrieve($a1->assigned_user_id);
debugg("<br> current user for event " . $a1->assigned_user_id . " " . $current_user->name);
$user = $current_user;
$td = new TimeDate();
$user_google_mafterdate_c = $td->swap_formats($current_user->google_mafterdate_c, $td->get_date_format(true, $current_user), "Y-m-d");
$add_notifications = $current_user->google_mnotifications_c;
unset($a2);
if ($tablename == 'meetings') {
$a2 = new Meeting();
}
if ($tablename == 'calls') {
$a2 = new Call();
}
if ($tablename == 'tasks') {
$a2 = new Task();
}
unset($a);
$a = $a2->retrieve($a1->id);
if ($a->old_id_c == "" or 1 == 1) {
global $calls_prefix;
global $meetings_prefix;
global $tasks_prefix;
//.........这里部分代码省略.........
示例5: json_encode
// service ID
$result = array();
if ($id != '' && $dachuyengiao == 0) {
$madetour = new GroupProgram();
$madetour->retrieve($id);
$task = new Task();
$task->assigned_user_id = $madetour->operator_id;
$task->name = 'Xác nhận Thực Hiện Tour';
$task->description = 'Xác nhận với bộ phận Sales rằng đã nhận chuyển giao Thực Hiện Tour, chọn completed để xác nhận !';
$task->parent_id = $madetour->id;
$task->parent_type = 'GroupPrograms';
$task->priority = 'High';
$task->parent_name = $madetour->name;
$result['result'] = $task->save();
$result['task_id'] = $task->id;
} elseif ($id != '' && $dachuyengiao == 1) {
$dachuyengiao_task = $_REQUEST['dachuyengiao_task'];
$task = new Task();
$task->retrieve($dachuyengiao_task);
$task->status = 'Completed';
$result['result'] = $task->save();
}
if ($result['result']) {
$result['result'] = 1;
} else {
$result['result'] = 0;
}
} else {
$result['result'] = 0;
}
echo json_encode($result);