Example #1
0
 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.');
     }
 }
Example #2
0
 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.');
     }
 }
Example #3
0
 }
 $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);
Example #4
0
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * 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);
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    require_once 'modules/Meetings/MeetingFormBase.php';
    $meetingForm = new MeetingFormBase();
    return $meetingForm->getForm('');
}
Example #6
0
<?php

if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */
/*********************************************************************************
 * 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();
if ($formBase->prepareRecurring()) {
    if ($limit = $formBase->checkRecurringLimitExceeded()) {
        echo str_replace('$limit', $limit, $GLOBALS['mod_strings']['LBL_RECURRING_LIMIT_ERROR']);
        sugar_cleanup(true);
    }
}
$formBase->handleSave('', true, false);