本文整理汇总了PHP中Meeting::retrieve方法的典型用法代码示例。如果您正苦于以下问题:PHP Meeting::retrieve方法的具体用法?PHP Meeting::retrieve怎么用?PHP Meeting::retrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Meeting
的用法示例。
在下文中一共展示了Meeting::retrieve方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: testEndDateChange
public function testEndDateChange()
{
$meetingsSql = "UPDATE meetings AS a INNER JOIN meetings AS b ON a.id = b.id SET a.date_end = date_add(b.date_start, INTERVAL + concat(b.duration_hours, b.duration_minutes) HOUR_MINUTE) WHERE a.id = '{$this->_meetingId}'";
$GLOBALS['db']->query($meetingsSql);
$meeting = new Meeting();
$meeting->disable_row_level_security = true;
$meeting->retrieve($this->_meetingId);
$meeting->fixUpFormatting();
$this->assertEquals($meeting->date_end, '2010-10-12 00:15:00', 'Ensuring that the end_date is saved properly as a date time field');
}
示例3: Call
global $beanFiles, $beanList;
if ($_REQUEST['cur_module'] == 'Calls') {
require_once "modules/Calls/Call.php";
$bean = new Call();
$type = 'call';
$table_name = 'calls';
$jn = "call_id_c";
}
if ($_REQUEST['cur_module'] == 'Meetings') {
require_once "modules/Meetings/Meeting.php";
$bean = new Meeting();
$type = 'meeting';
$table_name = 'meetings';
$jn = "meeting_id_c";
}
$bean->retrieve($_REQUEST['record']);
if (!$bean->ACLAccess('DetailView')) {
$json_arr = array('succuss' => 'no');
echo json_encode($json_arr);
die;
}
if ($bean->ACLAccess('Save')) {
$editview = 1;
} else {
$editview = 0;
}
if ($r_id = $bean->id) {
$bean->retrieve($r_id);
if (!empty($bean->parent_type) && !empty($bean->parent_id)) {
require_once $beanFiles[$beanList[$bean->parent_type]];
$par = new $beanList[$bean->parent_type]();
示例4: testConversionAndDoNothing
public function testConversionAndDoNothing()
{
global $sugar_config;
// init
$lead = SugarTestLeadUtilities::createLead();
$account = SugarTestAccountUtilities::createAccount();
$meeting = SugarTestMeetingUtilities::createMeeting();
SugarTestMeetingUtilities::addMeetingParent($meeting->id, $lead->id);
$relation_id = SugarTestMeetingUtilities::addMeetingLeadRelation($meeting->id, $lead->id);
$_REQUEST['record'] = $lead->id;
// set the request/post parameters before converting the lead
$_REQUEST['module'] = 'Leads';
$_REQUEST['action'] = 'ConvertLead';
$_REQUEST['record'] = $lead->id;
$_REQUEST['handle'] = 'save';
$_REQUEST['selectedAccount'] = $account->id;
$sugar_config['lead_conv_activity_opt'] = 'none';
// call display to trigger conversion
$vc = new ViewConvertLead();
$vc->display();
// refresh meeting
$meeting_id = $meeting->id;
$meeting = new Meeting();
$meeting->retrieve($meeting_id);
// refresh lead
$lead_id = $lead->id;
$lead = new Lead();
$lead->retrieve($lead_id);
// retrieve the new contact id from the conversion
$contact_id = $lead->contact_id;
// 1. Lead's contact_id should not be null
$this->assertNotNull($contact_id, 'Lead has null contact id after conversion.');
// 2. Lead status should be 'Converted'
$this->assertEquals('Converted', $lead->status, "Lead atatus should be 'Converted'.");
// 3. parent_type of the original meeting should be Leads
$this->assertEquals('Leads', $meeting->parent_type, 'Meeting parent should be Leads');
// 4. parent_id of the original meeting should be contact id
$this->assertEquals($lead_id, $meeting->parent_id, 'Meeting parent id should be lead id.');
// 5. record should NOT be deleted from meetings_leads table
$sql = "select id from meetings_leads where meeting_id='{$meeting->id}' and lead_id='{$lead->id}' and deleted=0";
$result = $GLOBALS['db']->query($sql);
$row = $GLOBALS['db']->fetchByAssoc($result);
$this->assertFalse(empty($row), "Meeting-Lead relationship is removed.");
// 6. record should NOT be added to meetings_contacts table
$sql = "select meeting_id from meetings_contacts where contact_id='{$contact_id}' and deleted=0";
$result = $GLOBALS['db']->query($sql);
$row = $GLOBALS['db']->fetchByAssoc($result);
$this->assertFalse($row, "Meeting-Contact relationship should not be added.");
// clean up
unset($_REQUEST['record']);
$GLOBALS['db']->query("delete from meetings where parent_id='{$lead->id}' and parent_type= 'Leads'");
$GLOBALS['db']->query("delete from meetings where parent_id='{$contact_id}' and parent_type= 'Contacts'");
$GLOBALS['db']->query("delete from contacts where id='{$contact_id}'");
$GLOBALS['db']->query("delete from meetings_leads where meeting_id='{$meeting->id}' and lead_id= '{$lead_id}'");
$GLOBALS['db']->query("delete from meetings_contacts where contact_id= '{$contact_id}'");
SugarTestMeetingUtilities::deleteMeetingLeadRelation($relation_id);
SugarTestMeetingUtilities::removeMeetingContacts();
SugarTestMeetingUtilities::removeAllCreatedMeetings();
SugarTestAccountUtilities::removeAllCreatedAccounts();
SugarTestLeadUtilities::removeAllCreatedLeads();
}
示例5: save
function save($check_notify = FALSE)
{
global $timedate;
global $current_user;
global $disable_date_format;
if (isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes)) {
if (isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes)) {
$td = $timedate->fromDb($this->date_start);
if (!$td) {
$this->date_start = $timedate->to_db($this->date_start);
$td = $timedate->fromDb($this->date_start);
}
if ($td) {
$this->date_end = $td->modify("+{$this->duration_hours} hours {$this->duration_minutes} mins")->asDb();
}
}
}
$check_notify = !empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1' ? true : false;
if (empty($_REQUEST['send_invites'])) {
if (!empty($this->id)) {
$old_record = new Meeting();
$old_record->retrieve($this->id);
$old_assigned_user_id = $old_record->assigned_user_id;
}
if (empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id'] || isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) {
$this->special_notification = true;
$check_notify = true;
if (isset($_REQUEST['assigned_user_name'])) {
$this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
}
}
}
/*nsingh 7/3/08 commenting out as bug #20814 is invalid
if($current_user->getPreference('reminder_time')!= -1 && isset($_POST['reminder_checked']) && isset($_POST['reminder_time']) && $_POST['reminder_checked']==0 && $_POST['reminder_time']==-1){
$this->reminder_checked = '1';
$this->reminder_time = $current_user->getPreference('reminder_time');
}*/
// prevent a mass mailing for recurring meetings created in Calendar module
if (empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id)) {
$check_notify = false;
}
if (empty($this->status)) {
$this->status = $this->getDefaultStatus();
}
// Do any external API saving
// Clear out the old external API stuff if we have changed types
if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type) {
$this->join_url = '';
$this->host_url = '';
$this->external_id = '';
$this->creator = '';
}
if (!empty($this->type) && $this->type != 'Sugar') {
require_once 'include/externalAPI/ExternalAPIFactory.php';
$api = ExternalAPIFactory::loadAPI($this->type);
}
if (empty($this->type)) {
$this->type = 'Sugar';
}
if (isset($api) && is_a($api, 'WebMeeting') && empty($this->in_relationship_update)) {
// Make sure the API initialized and it supports Web Meetings
// Also make suer we have an ID, the external site needs something to reference
if (!isset($this->id) || empty($this->id)) {
$this->id = create_guid();
$this->new_with_id = true;
}
$response = $api->scheduleMeeting($this);
if ($response['success'] == TRUE) {
// Need to send out notifications
if ($api->canInvite) {
$notifyList = $this->get_notification_recipients();
foreach ($notifyList as $person) {
$api->inviteAttendee($this, $person, $check_notify);
}
}
} else {
SugarApplication::appendErrorMessage($GLOBALS['app_strings']['ERR_EXTERNAL_API_SAVE_FAIL']);
return $this->id;
}
$api->logoff();
}
$return_id = parent::save($check_notify);
if ($this->update_vcal) {
vCal::cache_sugar_vcal($current_user);
}
return $return_id;
}
示例6: handleSave
/**
* handles save functionality for meetings
* @param string prefix
* @param bool redirect default True
* @param bool useRequired default True
*/
function handleSave($prefix, $redirect = true, $useRequired = false)
{
require_once 'include/formbase.php';
global $current_user;
global $timedate;
$focus = new Meeting();
if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
return null;
}
if (!isset($_POST['reminder_checked']) or isset($_POST['reminder_checked']) && $_POST['reminder_checked'] == '0') {
$_POST['reminder_time'] = -1;
}
if (!isset($_POST['reminder_time'])) {
$_POST['reminder_time'] = $current_user->getPreference('reminder_time');
$_POST['reminder_checked'] = 1;
}
if (!isset($_POST['email_reminder_checked']) || isset($_POST['email_reminder_checked']) && $_POST['email_reminder_checked'] == '0') {
$_POST['email_reminder_time'] = -1;
}
if (!isset($_POST['email_reminder_time'])) {
$_POST['email_reminder_time'] = $current_user->getPreference('email_reminder_time');
$_POST['email_reminder_checked'] = 1;
}
// don't allow to set recurring_source from a form
unset($_POST['recurring_source']);
$time_format = $timedate->get_user_time_format();
$time_separator = ":";
if (preg_match('/\\d+([^\\d])\\d+([^\\d]*)/s', $time_format, $match)) {
$time_separator = $match[1];
}
if (!empty($_POST[$prefix . 'time_hour_start']) && empty($_POST['time_start'])) {
$_POST[$prefix . 'time_start'] = $_POST[$prefix . 'time_hour_start'] . $time_separator . $_POST[$prefix . 'time_minute_start'];
}
if (isset($_POST[$prefix . 'meridiem']) && !empty($_POST[$prefix . 'meridiem'])) {
$_POST[$prefix . 'time_start'] = $timedate->merge_time_meridiem($_POST[$prefix . 'time_start'], $timedate->get_time_format(), $_POST[$prefix . 'meridiem']);
}
if (isset($_POST[$prefix . 'time_start']) && strlen($_POST[$prefix . 'date_start']) == 10) {
$_POST[$prefix . 'date_start'] = $_POST[$prefix . 'date_start'] . ' ' . $_POST[$prefix . 'time_start'];
}
// retrieve happens here
$focus = populateFromPost($prefix, $focus);
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
// if dates changed
if (!empty($focus->id)) {
$oldBean = new Meeting();
$oldBean->retrieve($focus->id);
if ($focus->date_start != $oldBean->date_start || $focus->date_end != $oldBean->date_end) {
$focus->date_changed = true;
} else {
$focus->date_changed = false;
}
}
$newBean = true;
if (!empty($focus->id)) {
$newBean = false;
}
//add assigned user and current user if this is the first time bean is saved
if (empty($focus->id) && !empty($_REQUEST['return_module']) && $_REQUEST['return_module'] == 'Meetings' && !empty($_REQUEST['return_action']) && $_REQUEST['return_action'] == 'DetailView') {
//if return action is set to detail view and return module to meeting, then this is from the long form, do not add the assigned user (only the current user)
//The current user is already added to UI and we want to give the current user the option of opting out of meeting.
//add current user if the assigned to user is different than current user.
if ($current_user->id != $_POST['assigned_user_id']) {
$_POST['user_invitees'] .= ',' . $_POST['assigned_user_id'] . ', ';
$_POST['user_invitees'] = str_replace(',,', ',', $_POST['user_invitees']);
}
} elseif (empty($focus->id)) {
//this is not from long form so add assigned and current user automatically as there is no invitee list UI.
//This call could be through an ajax call from subpanels or shortcut bar
if (!isset($_POST['user_invitees'])) {
$_POST['user_invitees'] = '';
}
$_POST['user_invitees'] .= ',' . $_POST['assigned_user_id'] . ', ';
//add current user if the assigned to user is different than current user.
if ($current_user->id != $_POST['assigned_user_id'] && $_REQUEST['module'] != "Calendar") {
$_POST['user_invitees'] .= ',' . $current_user->id . ', ';
}
//remove any double comma's introduced during appending
$_POST['user_invitees'] = str_replace(',,', ',', $_POST['user_invitees']);
}
if (isset($_POST['isSaveFromDetailView']) && $_POST['isSaveFromDetailView'] == 'true' || (isset($_POST['is_ajax_call']) && !empty($_POST['is_ajax_call']) && !empty($focus->id) || isset($_POST['return_action']) && $_POST['return_action'] == 'SubPanelViewer' && !empty($focus->id)) || !isset($_POST['user_invitees'])) {
$focus->save(true);
$return_id = $focus->id;
} else {
if ($focus->status == 'Held' && $this->isEmptyReturnModuleAndAction() && !$this->isSaveFromDCMenu()) {
//if we are closing the meeting, and the request does not have a return module AND return action set and it is not a save
//being triggered by the DCMenu (shortcut bar) then the request is coming from a dashlet or subpanel close icon and there is no
//need to process user invitees, just save the current values.
$focus->save(true);
} else {
///////////////////////////////////////////////////////////////////////////
//// REMOVE INVITEE RELATIONSHIPS
//.........这里部分代码省略.........
示例7: handleSave
/**
* handles save functionality for meetings
* @param string prefix
* @param bool redirect default True
* @param bool useRequired default True
*/
function handleSave($prefix, $redirect = true, $useRequired = false)
{
require_once 'include/formbase.php';
global $current_user;
global $timedate;
$focus = BeanFactory::getBean('Meetings');
if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
return null;
}
if (!isset($_POST['reminder_checked']) or isset($_POST['reminder_checked']) && $_POST['reminder_checked'] == '0') {
$_POST['reminder_time'] = -1;
}
if (!isset($_POST['reminder_time'])) {
$_POST['reminder_time'] = $current_user->getPreference('reminder_time');
$_POST['reminder_checked'] = 1;
}
if (!isset($_POST['email_reminder_checked']) || isset($_POST['email_reminder_checked']) && $_POST['email_reminder_checked'] == '0') {
$_POST['email_reminder_time'] = -1;
}
if (!isset($_POST['email_reminder_time'])) {
$_POST['email_reminder_time'] = $current_user->getPreference('email_reminder_time');
$_POST['email_reminder_checked'] = 1;
}
if (isset($_POST['repeat_parent_id']) && trim($_POST['repeat_parent_id']) == '') {
unset($_POST['repeat_parent_id']);
}
// don't allow to set recurring_source from a form
unset($_POST['recurring_source']);
$time_format = $timedate->get_user_time_format();
$time_separator = ":";
if (preg_match('/\\d+([^\\d])\\d+([^\\d]*)/s', $time_format, $match)) {
$time_separator = $match[1];
}
if (!empty($_POST[$prefix . 'time_hour_start']) && empty($_POST['time_start'])) {
$_POST[$prefix . 'time_start'] = $_POST[$prefix . 'time_hour_start'] . $time_separator . $_POST[$prefix . 'time_minute_start'];
}
if (isset($_POST[$prefix . 'meridiem']) && !empty($_POST[$prefix . 'meridiem'])) {
$_POST[$prefix . 'time_start'] = $timedate->merge_time_meridiem($_POST[$prefix . 'time_start'], $timedate->get_time_format(), $_POST[$prefix . 'meridiem']);
}
if (isset($_POST[$prefix . 'time_start']) && strlen($_POST[$prefix . 'date_start']) == 10) {
$_POST[$prefix . 'date_start'] = $_POST[$prefix . 'date_start'] . ' ' . $_POST[$prefix . 'time_start'];
}
// retrieve happens here
$focus = populateFromPost($prefix, $focus);
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
// if dates changed
if (!empty($focus->id)) {
$oldBean = new Meeting();
$oldBean->retrieve($focus->id);
if ($focus->date_start != $oldBean->date_start || $focus->date_end != $oldBean->date_end) {
$focus->date_changed = true;
} else {
$focus->date_changed = false;
}
}
$newBean = true;
if (!empty($focus->id)) {
$newBean = false;
}
//add assigned user and current user if this is the first time bean is saved
if (empty($focus->id) && !empty($_REQUEST['return_module']) && $_REQUEST['return_module'] == 'Meetings' && !empty($_REQUEST['return_action']) && $_REQUEST['return_action'] == 'DetailView') {
//if return action is set to detail view and return module to meeting, then this is from the long form, do not add the assigned user (only the current user)
//The current user is already added to UI and we want to give the current user the option of opting out of meeting.
//add current user if the assigned to user is different than current user.
if ($current_user->id != $_POST['assigned_user_id']) {
$_POST['user_invitees'] .= ',' . $_POST['assigned_user_id'] . ', ';
$_POST['user_invitees'] = str_replace(',,', ',', $_POST['user_invitees']);
}
} elseif (empty($focus->id)) {
//this is not from long form so add assigned and current user automatically as there is no invitee list UI.
//This call could be through an ajax call from subpanels or shortcut bar
if (!isset($_POST['user_invitees'])) {
$_POST['user_invitees'] = '';
}
$_POST['user_invitees'] .= ',' . $_POST['assigned_user_id'] . ', ';
//add current user if the assigned to user is different than current user.
if ($current_user->id != $_POST['assigned_user_id'] && $_REQUEST['module'] != "Calendar") {
$_POST['user_invitees'] .= ',' . $current_user->id . ', ';
}
//remove any double comma's introduced during appending
$_POST['user_invitees'] = str_replace(',,', ',', $_POST['user_invitees']);
}
if (isset($_POST['isSaveFromDetailView']) && $_POST['isSaveFromDetailView'] == 'true' || (isset($_POST['is_ajax_call']) && !empty($_POST['is_ajax_call']) && !empty($focus->id) || isset($_POST['return_action']) && $_POST['return_action'] == 'SubPanelViewer' && !empty($focus->id)) || !isset($_POST['user_invitees'])) {
$focus->save(true);
$return_id = $focus->id;
} else {
if ($focus->status == 'Held' && $this->isEmptyReturnModuleAndAction() && !$this->isSaveFromDCMenu()) {
//if we are closing the meeting, and the request does not have a return module AND return action set and it is not a save
//being triggered by the DCMenu (shortcut bar) then the request is coming from a dashlet or subpanel close icon and there is no
//need to process user invitees, just save the current values.
$focus->save(true);
//.........这里部分代码省略.........
示例8: process
/**
* main method that runs reminding process
* @return boolean
*/
public function process()
{
$admin = new Administration();
$admin->retrieveSettings();
$meetings = $this->getMeetingsForRemind();
foreach ($meetings as $id) {
$recipients = $this->getRecipients($id, 'Meetings');
$bean = new Meeting();
$bean->retrieve($id);
if ($this->sendReminders($bean, $admin, $recipients)) {
$bean->email_reminder_sent = 1;
$bean->save();
}
}
$calls = $this->getCallsForRemind();
foreach ($calls as $id) {
$recipients = $this->getRecipients($id, 'Calls');
$bean = new Call();
$bean->retrieve($id);
if ($this->sendReminders($bean, $admin, $recipients)) {
$bean->email_reminder_sent = 1;
$bean->save();
}
}
return true;
}
示例9: save
function save($check_notify = FALSE)
{
require_once 'modules/Calendar/DateTimeUtil.php';
global $timedate;
global $current_user;
global $disable_date_format;
if (isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes)) {
$date_time_start = DateTimeUtil::get_time_start($this->date_start);
$date_time_end = DateTimeUtil::get_time_end($date_time_start, $this->duration_hours, $this->duration_minutes);
$this->date_end = gmdate("Y-m-d", $date_time_end->ts);
}
$check_notify = !empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1' ? true : false;
if (empty($_REQUEST['send_invites'])) {
if (!empty($this->id)) {
$old_record = new Meeting();
$old_record->retrieve($this->id);
$old_assigned_user_id = $old_record->assigned_user_id;
}
if (empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id'] || isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) {
$this->special_notification = true;
$check_notify = true;
if (isset($_REQUEST['assigned_user_name'])) {
$this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
}
}
}
/*nsingh 7/3/08 commenting out as bug #20814 is invalid
if($current_user->getPreference('reminder_time')!= -1 && isset($_POST['reminder_checked']) && isset($_POST['reminder_time']) && $_POST['reminder_checked']==0 && $_POST['reminder_time']==-1){
$this->reminder_checked = '1';
$this->reminder_time = $current_user->getPreference('reminder_time');
}*/
if (empty($this->status)) {
$mod_strings = return_module_language($GLOBALS['current_language'], $this->module_dir);
$this->status = $mod_strings['LBL_DEFAULT_STATUS'];
}
$return_id = parent::save($check_notify);
if ($this->update_vcal) {
vCal::cache_sugar_vcal($current_user);
}
return $return_id;
}
示例10: Meeting
*
* 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/Meetings/Meeting.php';
$focus = new Meeting();
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']);
示例11: save
function save($check_notify = FALSE)
{
require_once 'modules/Calendar/DateTimeUtil.php';
global $timedate;
global $current_user;
global $disable_date_format;
if (isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes)) {
$date_start_in_db_fmt = $timedate->swap_formats($this->date_start, $timedate->get_date_time_format(true, $current_user), $timedate->get_db_date_time_format());
$date_start_array = split(" ", trim($date_start_in_db_fmt));
$date_time_start = DateTimeUtil::get_time_start($date_start_array[0], $date_start_array[1]);
$date_start_timestamp = mktime($date_time_start->hour, $date_time_start->min, $date_time_start->sec, $date_time_start->month, $date_time_start->day);
$date_start_timestamp += $this->duration_hours * 3600 + $this->duration_minutes * 60;
$this->date_end = date($timedate->get_date_time_format(true, $current_user), $date_start_timestamp);
// Need to convert it to the db date right here so that we don't miss the time calculation
$this->date_end = $timedate->to_db_date($this->date_end);
if (empty($disable_date_format)) {
$this->date_end = $timedate->swap_formats($this->date_end, $timedate->dbDayFormat, $timedate->get_date_format());
}
}
$check_notify = !empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1' ? true : false;
if (empty($_REQUEST['send_invites'])) {
if (!empty($this->id)) {
$old_record = new Meeting();
$old_record->retrieve($this->id);
$old_assigned_user_id = $old_record->assigned_user_id;
}
if (empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id'] || isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) {
$this->special_notification = true;
$check_notify = true;
if (isset($_REQUEST['assigned_user_name'])) {
$this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
}
}
}
/*nsingh 7/3/08 commenting out as bug #20814 is invalid
if($current_user->getPreference('reminder_time')!= -1 && isset($_POST['reminder_checked']) && isset($_POST['reminder_time']) && $_POST['reminder_checked']==0 && $_POST['reminder_time']==-1){
$this->reminder_checked = '1';
$this->reminder_time = $current_user->getPreference('reminder_time');
}*/
if (empty($this->status)) {
$mod_strings = return_module_language($GLOBALS['current_language'], $this->module_dir);
$this->status = $mod_strings['LBL_DEFAULT_STATUS'];
}
parent::save($check_notify);
if ($this->update_vcal) {
vCal::cache_sugar_vcal($current_user);
}
}