当前位置: 首页>>代码示例>>PHP>>正文


PHP CContact::getContactMethods方法代码示例

本文整理汇总了PHP中CContact::getContactMethods方法的典型用法代码示例。如果您正苦于以下问题:PHP CContact::getContactMethods方法的具体用法?PHP CContact::getContactMethods怎么用?PHP CContact::getContactMethods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CContact的用法示例。


在下文中一共展示了CContact::getContactMethods方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: strtolower

            $AppUI->redirect('m=public&a=access_denied');
        }
    }
}
$obj->user_username = strtolower($obj->user_username);
// !User's contact information not deleted - left for history.
if ($del) {
    $result = $obj->delete($AppUI);
    $message = $result ? 'User deleted' : $obj->getError();
    $path = $result ? 'm=admin' : 'm=public&a=access_denied';
    $status = $result ? UI_MSG_ALERT : UI_MSG_ERROR;
    $AppUI->setMsg($message, $status);
    $AppUI->redirect($path);
}
$contact->contact_owner = $contact->contact_owner ? $contact->contact_owner : $AppUI->user_id;
$contactArray = $contact->getContactMethods();
$result = $contact->store($AppUI);
if ($result) {
    $contact->setContactMethods($contactArray);
    $obj->user_contact = $contact->contact_id;
    if ($obj->store($AppUI)) {
        if ($isNewUser && w2PgetParam($_POST, 'send_user_mail', 0)) {
            notifyNewUserCredentials($contact->contact_email, $contact->contact_first_name, $obj->user_username, $_POST['user_password']);
        }
        if (isset($_REQUEST['user_role']) && $_REQUEST['user_role']) {
            $perms =& $AppUI->acl();
            if ($perms->insertUserRole($_REQUEST['user_role'], $obj->user_id)) {
                $AppUI->setMsg('', UI_MSG_ALERT, true);
            } else {
                $AppUI->setMsg('failed to add role', UI_MSG_ERROR);
            }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:do_user_aed.php

示例2: substr

}
$department = $AppUI->getState('UsrProjIdxDepartment') !== null ? $AppUI->getState('UsrProjIdxDepartment') : $company_prefix . $AppUI->user_company;
//if $department contains the $company_prefix string that it's requesting a company and not a department.  So, clear the
// $department variable, and populate the $company_id variable.
if (!(strpos($department, $company_prefix) === false)) {
    $company_id = substr($department, strlen($company_prefix));
    $AppUI->setState('UsrProjIdxCompany', $company_id);
    unset($department);
}
$tab = $AppUI->processIntState('UserVwTab', $_GET, 'tab', 0);
// pull data
$user = new CUser();
$user->loadFull($user_id);
$contact = new CContact();
$contact->contact_id = $user->user_contact;
$methods = $contact->getContactMethods();
$methodLabels = w2PgetSysVal('ContactMethods');
if (!$user) {
    $titleBlock = new CTitleBlock('Invalid User ID', 'helix-setup-user.png', $m, "{$m}.{$a}");
    $titleBlock->addCrumb('?m=admin', 'users list');
    $titleBlock->show();
} else {
    $countries = w2PgetSysVal('GlobalCountries');
    // setup the title block
    $titleBlock = new CTitleBlock('View User', 'helix-setup-user.png', $m, "{$m}.{$a}");
    if ($canRead) {
        $titleBlock->addCrumb('?m=admin', 'users list');
    }
    if ($canEdit || $user_id == $AppUI->user_id) {
        $titleBlock->addCrumb('?m=admin&a=addedituser&user_id=' . $user_id, 'edit this user');
        $titleBlock->addCrumb('?m=contacts&a=addedit&contact_id=' . $user->contact_id, 'edit this contact');
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:viewuser.php

示例3: executeGet

 /**
  * Get Request Handler
  *
  * This method is called when a request is a GET
  *
  * @return array
  */
 public function executeGet()
 {
     $valid = $this->hasRequiredParameters($this->requiredParams);
     if ($valid instanceof Frapi_Error) {
         return $valid;
     }
     $username = $this->getParam('username');
     $password = $this->getParam('password');
     $contact_id = $this->getParam('contact_id', self::TYPE_INT);
     // Attempt to login as user, a little bit of a hack as we currently
     // require the $_POST['login'] var to be set as well as a global AppUI
     $AppUI = new CAppUI();
     $GLOBALS['AppUI'] = $AppUI;
     $_POST['login'] = 'login';
     if (!$AppUI->login($username, $password)) {
         throw new Frapi_Error('INVALID_LOGIN');
     }
     $contact = new CContact();
     $allowed_contacts = $contact->getAllowedRecords($AppUI->user_id);
     // Contact ID is the key, so lets get them in an array so we can
     // easily check
     $allowed_contacts = array_keys($allowed_contacts);
     if (!in_array($contact_id, $allowed_contacts)) {
         throw new Frapi_Error('PERMISSION_ERROR');
     }
     // User has permission so load the contact for display
     $contact_array = (array) $contact->load($contact_id);
     $contact_array['contact_methods'] = $contact->getContactMethods();
     // Remove the data that is not for display
     unset($contact_array['_tbl_prefix'], $contact_array['_tbl'], $contact_array['_tbl_key'], $contact_array['_error'], $contact_array['_query'], $contact_array['_tbl_module']);
     $this->data['contact'] = $contact_array;
     $this->data['success'] = true;
     return $this->toArray();
 }
开发者ID:robertbasic,项目名称:web2project-api,代码行数:41,代码来源:Contact.php

示例4: sprintf

// Fields 76 - 80
$text .= sprintf("%s", "\"Notes\",\"Office Location\",\"Organizational ID Number\",\"PO Box\",\"Priority\",");
// Fields 81 - 85
$text .= sprintf("%s", "\"Private\",\"Profession\",\"Referred By\",\"Sensitivity\",\"Spouse\",");
// Fields 86 - 90
$text .= sprintf("%s", "\"User 1\",\"User 2\",\"User 3\",\"User 4\",\"Web Page\",");
$custom_fields = w2p_Core_CustomFields::getCustomFieldList('contacts');
foreach ($custom_fields as $f) {
    $text .= sprintf("%s", "\"{$f['field_description']}\",");
}
$text .= sprintf("%s\r\n", "");
$contactList = CContact::searchContacts();
foreach ($contactList as $contact) {
    $myContact = new CContact();
    $myContact->contact_id = $contact['contact_id'];
    $contactMethods = $myContact->getContactMethods();
    // Fields 1- 10
    $text .= sprintf("\"\",\"%s\",\"\",\"%s\",\"\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",", $contact['contact_first_name'], $contact['contact_last_name'], $contact['company_name'], $contact['dept_name'], $contact['contact_title'], $contact['contact_address1'], $contact['contact_address2']);
    // Fields 11- 20
    $text .= sprintf(",\"%s\",\"%s\",\"%s\",,,,,,,", $contact['contact_city'], $contact['contact_state'], $contact['contact_zip']);
    // Fields 21- 30
    $text .= sprintf(",,,,,,,,,,");
    // Fields 31- 40
    $text .= sprintf(",\"%s\",,,,,,,,,", $contact['contact_phone']);
    // Fields 41- 50
    settype($contactMethods['phone_mobile'], 'string');
    $text .= sprintf("\"%s\",,,,,,,,\"\",\"0/0/00\",", '' . $contactMethods['phone_mobile']);
    // Fields 51- 60
    if ($contact['contact_type'] != '') {
        $categories = "web2Project; " . $contact['contact_type'];
    } else {
开发者ID:,项目名称:,代码行数:31,代码来源:

示例5: testGetContactMethods

 public function testGetContactMethods()
 {
     $methods = array('phone_mobile' => '202-555-1212', 'url' => 'http://web2project.net', 'email_alt' => 'alternate@example.org', 'im_skype' => 'example_s', 'im_google' => 'example_g');
     $contact = new CContact();
     $contact->contact_id = 1;
     $contact->setContactMethods($methods);
     $results = $contact->getContactMethods(array('phone_mobile', 'im_skype'));
     $this->AssertEquals(2, count($results));
     $this->assertEquals($methods['phone_mobile'], $results['phone_mobile']);
     $this->assertEquals($methods['im_skype'], $results['im_skype']);
 }
开发者ID:eureka2,项目名称:web2project,代码行数:11,代码来源:contacts.test.php


注:本文中的CContact::getContactMethods方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。