public function testAcceptanceAfterDateUpdate() { global $current_user; global $db; $meeting = SugarTestMeetingUtilities::createMeeting(); $user = SugarTestUserUtilities::createAnonymousUser(); SugarTestMeetingUtilities::addMeetingUserRelation($meeting->id, $current_user->id); SugarTestMeetingUtilities::addMeetingUserRelation($meeting->id, $user->id); // set this to 'accept' before handleSave and make sure it gets set to 'none' after handleSave $meeting->set_accept_status($user, 'accept'); $meeting->save(); $_POST['record'] = $_REQUEST['record'] = $meeting->id; $_POST['user_invitees'] = $current_user->id . ',' . $user->id; $_POST['module'] = 'Meetings'; $_POST['action'] = 'Save'; $_POST['assigned_user_id'] = $current_user->id; $_POST['send_invites'] = $_REQUEST['send_invites'] = 1; $_POST['date_start'] = $GLOBALS['timedate']->getNow()->asDb(); $_POST['date_end'] = $GLOBALS['timedate']->getNow()->modify("+900 seconds")->asDb(); $formBase = new MeetingFormBase(); $formBase->handleSave('', false, false); $sql = "SELECT accept_status FROM meetings_users WHERE meeting_id='{$meeting->id}' AND user_id='{$user->id}'"; $result = $db->query($sql); if ($row = $db->fetchByAssoc($result)) { $this->assertEquals('none', $row['accept_status'], 'Should be none after date changed and invite sent.'); } }
public function testOrganizerDefaultAcceptance() { global $current_user; global $db; $_POST['user_invitees'] = $current_user->id; $_POST['module'] = 'Meetings'; $_POST['action'] = 'Save'; $_POST['assigned_user_id'] = $current_user->id; $formBase = new MeetingFormBase(); $meeting = $formBase->handleSave('', false, false); $sql = "SELECT accept_status FROM meetings_users WHERE meeting_id='{$meeting->id}' AND user_id='{$current_user->id}'"; $result = $db->query($sql); if ($row = $db->fetchByAssoc($result)) { $this->assertEquals('accept', $row['accept_status'], 'Should be accepted for the organizer.'); } }
$accountnote = $noteForm->handleSave('AccountNotes', false, false); if (isset($contact)) { $_POST['ContactNotesparent_type'] = "Contacts"; } $_POST['ContactNotesparent_id'] = $contact->id; $contactnote = $noteForm->handleSave('ContactNotes', false, false); if (isset($opportunity)) { $_POST['OpportunityNotesparent_type'] = "Opportunities"; $_POST['OpportunityNotesparent_id'] = $opportunity->id; $opportunitynote = $noteForm->handleSave('OpportunityNotes', false, false); } if (isset($_POST['newappointment']) && $_POST['newappointment'] == 'on') { if (isset($_POST['appointment']) && $_POST['appointment'] == 'Meeting') { require_once 'modules/Meetings/MeetingFormBase.php'; $meetingForm = new MeetingFormBase(); $meeting = $meetingForm->handleSave('Appointments', false, false); } else { require_once 'modules/Calls/CallFormBase.php'; $callForm = new CallFormBase(); $call = $callForm->handleSave('Appointments', false, false); } } if (isset($call)) { if (isset($contact)) { $call->load_relationship('contacts'); $call->contacts->add($contact->id); } else { if (isset($account)) { $call->load_relationship('account'); $call->account->add($account->id); } else {
* details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by SugarCRM". ********************************************************************************/ /********************************************************************************* * Description: Saves an Account record and then redirects the browser to the * defined return URL. * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. ********************************************************************************/ require_once 'modules/Meetings/MeetingFormBase.php'; $formBase = new MeetingFormBase(); $formBase->handleSave('', true, false);