本文整理汇总了PHP中Meeting::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Meeting::save方法的具体用法?PHP Meeting::save怎么用?PHP Meeting::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Meeting
的用法示例。
在下文中一共展示了Meeting::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSaveAndMarkdeletedAndSetAcceptStatus
public function testSaveAndMarkdeletedAndSetAcceptStatus()
{
$meeting = new Meeting();
$meeting->name = 'test';
$meeting->status = 'Not Held';
$meeting->type = 'Sugar';
$meeting->description = 'test description';
$meeting->duration_hours = 1;
$meeting->duration_minutes = 1;
$meeting->date_start = '2016-02-11 17:30:00';
$meeting->date_end = '2016-02-11 17:30:00';
$meeting->save();
//test for record ID to verify that record is saved
$this->assertTrue(isset($meeting->id));
$this->assertEquals(36, strlen($meeting->id));
/* Test set_accept_status method */
//test set_accept_status with User object
$user = new User();
$meeting->set_accept_status($user, 'accept');
//test set_accept_status with contact object
$contact = new Contact();
$meeting->set_accept_status($contact, 'accept');
//test set_accept_status with Lead object
$lead = new Lead();
$meeting->set_accept_status($lead, 'accept');
//mark all created relationships as deleted
$meeting->mark_relationships_deleted($meeting->id);
//mark the record as deleted and verify that this record cannot be retrieved anymore.
$meeting->mark_deleted($meeting->id);
$result = $meeting->retrieve($meeting->id);
$this->assertEquals(null, $result);
}
示例2: save
function save($id = FALSE)
{
if ($_POST) {
$meeting = new Meeting($id);
$_POST['start_date'] = Date2DB($_POST['start_date']);
$_POST['end_date'] = Date2DB($_POST['end_date']);
$_POST['close_date'] = Date2DB($_POST['close_date']);
$meeting->from_array($_POST);
$meeting->save();
fix_file($_FILES['file']);
foreach ($_POST['doc'] as $key => $doc) {
if (@$_FILES['file'][$key]['name'] || @$_POST['doc_id'][$key]) {
$document = new Meeting_document(@$_POST['doc_id'][$key]);
if ($_FILES['file'][$key]['name']) {
if (@$_POST['doc_id'][$key]) {
$document->delete_file('uploads/meeting', 'file');
}
$document->file = $document->upload($_FILES['file'][$key], 'uploads/meeting');
}
$document->name = $doc;
$document->meeting_id = $meeting->id;
$document->save();
}
}
set_notify('success', lang('save_data_complete'));
}
redirect('meetings');
}
示例3: setUp
public function setUp()
{
global $current_user, $currentModule;
$mod_strings = return_module_language($GLOBALS['current_language'], "Meetings");
$current_user = SugarTestUserUtilities::createAnonymousUser();
$meeting = new Meeting();
$meeting->id = uniqid();
$meeting->name = 'Test Meeting';
$meeting->save();
$this->meeting = $meeting;
}
示例4: createMeeting
public static function createMeeting($id = '')
{
$time = mt_rand();
$name = 'Meeting';
$meeting = new Meeting();
$meeting->name = $name . $time;
if (!empty($id)) {
$meeting->new_with_id = true;
$meeting->id = $id;
}
$meeting->save();
self::$_createdMeetings[] = $meeting;
return $meeting;
}
示例5: create
function create()
{
$meeting = new Meeting();
$meeting->m_date = $this->params('date') . ' ' . $this->params('time');
foreach (['local', 'participants', 'systems', 'infra', 'processes', 'people', 'organ_id'] as $field) {
$meeting->{$field} = $this->params($field);
}
$meeting->document_id = $this->session('document_id');
if ($meeting->save()) {
$this->redirect('/documents/' . $this->session('document_id') . '/meetings', 'Salvo com sucesso!');
} else {
$this->redirect('/documents/' . $this->session('document_id') . '/meetings', 'Ocorreu algum erro.');
}
}
示例6: createNewMeeting
protected function createNewMeeting()
{
$m = new Meeting();
$m->name = "40541TestMeeting";
$m->date_start = gmdate($GLOBALS['timedate']->get_db_date_time_format(), time() + 3000);
$m->duration_hours = 0;
$m->duration_minutes = 15;
$m->reminder_time = 60;
$m->reminder_checked = true;
$m->save();
$m->load_relationship("users");
$m->users->add($this->_user->id);
$this->beans[] = $m;
return $m;
}
示例7: createMeetingWithOwnerAndRelatedAccount
public static function createMeetingWithOwnerAndRelatedAccount($name, $owner, $account)
{
$startStamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time() + 10000);
$endStamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time() + 11000);
$meeting = new Meeting();
$meeting->name = $name;
$meeting->owner = $owner;
$meeting->location = 'my location';
$meeting->category->value = 'Call';
$meeting->startDateTime = $startStamp;
$meeting->endDateTime = $endStamp;
$meeting->description = 'my test description';
$meeting->activityItems->add($account);
$saved = $meeting->save();
assert('$saved');
return $meeting;
}
示例8: createMeeting
public static function createMeeting($id = '')
{
$time = mt_rand();
$name = 'Meeting';
$meeting = new Meeting();
$meeting->name = $name . $time;
$meeting->date_start = $GLOBALS['timedate']->getNow()->asDb();
$meeting->duration_hours = '0';
$meeting->duration_minutes = '15';
if (!empty($id)) {
$meeting->new_with_id = true;
$meeting->id = $id;
}
$meeting->save();
self::$_createdMeetings[] = $meeting;
return $meeting;
}
示例9: testUpdateLatestActivityDateTimeWhenAMeetingIsInThePast
public function testUpdateLatestActivityDateTimeWhenAMeetingIsInThePast()
{
$meeting = new Meeting();
$meeting->name = 'my meeting';
$meeting->startDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time() - 86400);
$this->assertNull($meeting->processedForLatestActivity);
$meeting->processedForLatestActivity = true;
$this->assertTrue($meeting->save());
$this->assertTrue($meeting->processedForLatestActivity == false);
$meeting->processedForLatestActivity = true;
$this->assertTrue($meeting->save());
$this->assertTrue($meeting->processedForLatestActivity == true);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:13,代码来源:AccountLatestActivityDateTimeDocumentationTest.php
示例10: Email
$meeting->date_start = create_date() . ' ' . create_time();
//$meeting->time_start = date("H:i",time());
$meeting->duration_hours = array_rand($possible_duration_hours_arr);
$meeting->duration_minutes = array_rand($possible_duration_minutes_arr);
$meeting->assigned_user_id = $assigned_user_id;
$meeting->assigned_user_id = $contacts_account->assigned_user_id;
$meeting->assigned_user_name = $contacts_account->assigned_user_name;
$meeting->description = 'Meeting to discuss project plan and hash out the details of implementation';
$key = array_rand($app_list_strings['meeting_status_dom']);
$meeting->status = $app_list_strings['meeting_status_dom'][$key];
$meeting->contact_id = $contact->id;
$meeting->parent_id = $account_id;
$meeting->parent_type = 'Accounts';
// dont update vcal
$meeting->update_vcal = false;
$meeting->save();
// leverage the seed user to set the acceptance status on the meeting.
$seed_user->id = $meeting->assigned_user_id;
$meeting->set_accept_status($seed_user, 'accept');
//Create new emails
$email = new Email();
$key = array_rand($email->default_email_subject_values);
$email->name = $email->default_email_subject_values[$key];
$email->date_start = create_date();
$email->time_start = create_time();
$email->duration_hours = array_rand($possible_duration_hours_arr);
$email->duration_minutes = array_rand($possible_duration_minutes_arr);
$email->assigned_user_id = $assigned_user_id;
$email->assigned_user_id = $contacts_account->assigned_user_id;
$email->assigned_user_name = $contacts_account->assigned_user_name;
$email->description = 'Discuss project plan and hash out the details of implementation';
示例11: makeMassDeleteData
public static function makeMassDeleteData()
{
$account = new Account();
$account->owner = Yii::app()->user->userModel;
$account->name = 'Mass Delete Full Load Account';
$saved = $account->save();
if (!$saved) {
throw new NotSupportedException();
}
//Load past meetings that will show up as latest activities
for ($i = 0; $i < 15; $i++) {
$meeting = new Meeting();
$meeting->name = 'MyMeeting ' . $i;
$meeting->owner = Yii::app()->user->userModel;
$startStamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time() - 10000 - $i * 3600 * 24);
$meeting->startDateTime = $startStamp;
$meeting->activityItems->add($account);
$saved = $meeting->save();
if (!$saved) {
throw new NotSupportedException();
}
}
//Load upcoming tasks
for ($i = 0; $i < 15; $i++) {
$task = new Task();
$task->name = 'MyTask ' . $i;
$task->completed = false;
$task->owner = Yii::app()->user->userModel;
$dueDateStamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time() + 10000 + $i * 3600 * 24);
$task->dueDateTime = $dueDateStamp;
$task->activityItems->add($account);
$saved = $task->save();
if (!$saved) {
throw new NotSupportedException();
}
}
//Load 20 so there is sufficient data for list view pagination testing
for ($i = 0; $i < 20; $i++) {
$account = new Account();
$account->owner = Yii::app()->user->userModel;
$account->name = 'Mass Delete Test Account ' . $i;
$saved = $account->save();
if (!$saved) {
throw new NotSupportedException();
}
}
}
示例12: testCastDown
/**
* Should not throw exception, should cast down ok
*/
public function testCastDown()
{
Yii::app()->user->userModel = User::getByUsername('super');
$startStamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time());
$meeting = new Meeting();
$meeting->name = 'aTest';
$meeting->startDateTime = $startStamp;
$this->assertTrue($meeting->save());
$itemId = $meeting->getClassId('Item');
$item = Item::getById($itemId);
$modelDerivationPathToItem = RuntimeUtil::getModelDerivationPathToItem('Meeting');
$castedDownModel = $item->castDown(array($modelDerivationPathToItem));
$this->assertEquals('Meeting', get_class($castedDownModel));
}
示例13: testEmailReminder
function testEmailReminder()
{
$meeting = new Meeting();
$meeting->email_reminder_time = "20";
$meeting->name = 'Test Email Reminder';
$meeting->status = "Planned";
$meeting->date_start = $GLOBALS['timedate']->nowDb();
$meeting->save();
require_once "modules/Activities/EmailReminder.php";
$er = new EmailReminder();
$to_remind = $er->getMeetingsForRemind();
$this->assertTrue(in_array($meeting->id, $to_remind));
$GLOBALS['db']->query("DELETE FROM meetings WHERE id = '{$meeting->id}'");
}
示例14: storeMeeting
public function storeMeeting()
{
$advisor = Auth::user();
$day = Day::find(Input::get('day_id'));
// If form validation passes:
$meeting = new Meeting();
$meeting->title = Input::get('title');
if (Input::get('notes')) {
$meeting->notes = Input::get('notes');
}
$meeting->save();
$meeting->days()->save($day);
$advisor->meetings()->save($meeting);
return Redirect::attempt('advisor.dashboard');
}
示例15: die
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once "modules/Calls/Call.php";
require_once "modules/Meetings/Meeting.php";
if ($_REQUEST['type'] == 'call') {
$bean = new Call();
}
if ($_REQUEST['type'] == 'meeting') {
$bean = new Meeting();
}
$bean->retrieve($_REQUEST['record']);
if (!$bean->ACLAccess('Save')) {
die;
}
$bean->date_start = $_REQUEST['datetime'];
$bean->date_end = $_REQUEST['date_end'];
$bean->save();