Пример #1
0
 /**
  * @ticket 24487
  * @dataProvider vCardNames
  */
 public function testExportVcard($fname, $lname)
 {
     $vcard = new vCard();
     $data = new vCardMockModule();
     $data->first_name = $fname;
     $data->last_name = $lname;
     $GLOBALS['current_user']->setPreference('default_export_charset', 'UTF-8');
     $id = $data->save();
     $vcard->loadContact($id, 'vCardMockModule');
     $cardtext = $vcard->toString();
     $this->assertContains("N;CHARSET=utf-8:{$lname};{$fname}", $cardtext, "Cannot find N name", true);
     $this->assertContains("FN;CHARSET=utf-8: {$fname} {$lname}", $cardtext, "Cannot find FN name", true);
 }
 function display()
 {
     $vcard = new vCard();
     $vcard->loadContact($this->bean->id, $this->bean->object_name);
     $vcard->saveVCard();
 }
Пример #3
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     $vcard = new vCard();
     $vcard->loadContact($this->bean->id, $this->module);
     $vcard->saveVCard();
 }
Пример #4
0
 * 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".
 ********************************************************************************/
require_once 'include/vCard.php';
if (isset($_SESSION['authenticated_user_language']) && $_SESSION['authenticated_user_language'] != '') {
    $current_language = $_SESSION['authenticated_user_language'];
} else {
    $current_language = $sugar_config['default_language'];
}
//set module and application string arrays based upon selected language
$app_strings = return_application_language($current_language);
$app_list_strings = return_app_list_strings_language($current_language);
$vcard = new vCard();
$module = 'Contacts';
if (isset($_REQUEST['module'])) {
    $module = clean_string($_REQUEST['module']);
}
$vcard->loadContact($_REQUEST['contact_id'], $module);
$vcard->saveVCard();
Пример #5
0
 /**
  * Retrieves the generated vcard for a record
  *
  * @param $api  ServiceBase The API class of the request, used in cases where the API changes how the fields are pulled from the args array.
  * @param $args array The arguments array passed in from the API
  *
  * @return String
  */
 protected function getVcardForRecord($api, $args)
 {
     $bean = $this->loadBean($api, $args);
     if (!$bean->ACLAccess('view')) {
         throw new SugarApiExceptionNotAuthorized('No access to view records for module: ' . $args['module']);
     }
     $vcard = new vCard();
     if (isset($args['module'])) {
         $module = clean_string($args['module']);
     } else {
         $module = 'Contacts';
     }
     $vcard->loadContact($args['record'], $module);
     return $vcard->saveVCardApi($api);
 }