コード例 #1
0
 public function testCreateReminderAndCreateLinkAndDeleteCall()
 {
     $call = new call();
     $aosContracts = new AOS_Contracts();
     $aosContracts->name = 'test';
     //test createReminder()
     $aosContracts->createReminder();
     //verify record ID to check that record is saved
     $this->assertTrue(isset($aosContracts->call_id));
     $this->assertEquals(36, strlen($aosContracts->call_id));
     //verify the parent_type value set by createReminder()
     $call->retrieve($aosContracts->call_id);
     $this->assertAttributeEquals('AOS_Contracts', 'parent_type', $call);
     //test createLink() and verify the parent_type value
     $aosContracts->createLink();
     $call->retrieve($aosContracts->call_id);
     $this->assertAttributeEquals('Accounts', 'parent_type', $call);
     //delete the call and verify that this record cannot be retrieved anymore.
     $aosContracts->deleteCall();
     $call->retrieve($aosContracts->call_id);
     $this->assertEquals(null, $result);
 }
コード例 #2
0
ファイル: Reschedule_popup.php プロジェクト: MexinaD/SuiteCRM
$call = new call();
//get the users name format settings
$firstname = $current_user->first_name;
$lastname = $current_user->last_name;
$full_name = $locale->getLocaleFormattedName($firstname, $lastname);
$user_real_names = $current_user->getPreference('use_real_names');
if ($user_real_names == 'on') {
    $Name = $full_name;
} else {
    $Name = $current_user->user_name;
}
$time_format = $current_user->getPreference('timef');
//get the current users time format setting
$dateformat = $current_user->getPreference('datef');
//get the current users date format
$call->retrieve($id);
//get the call fields
$time_stamp = $call->date_start;
//get the time stamp for the current call
//Set the date and time input fields on the pop-up based on the current users time format setting
switch ($time_format) {
    case 'H:i':
        $existing_date = explode(" ", $time_stamp);
        //splits the date from the time
        $time = $existing_date[1];
        //gets the time
        $date = $existing_date[0];
        //gets the date
        $time = explode(":", $time);
        //splits the time into hours and minutes
        $hour = $time[0];