本文整理汇总了PHP中Account::retrieve方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::retrieve方法的具体用法?PHP Account::retrieve怎么用?PHP Account::retrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account::retrieve方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($defines)
{
global $app_strings;
global $currentModule;
$title = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE'];
$accesskey = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY'];
$value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL'];
$this->module = 'Emails';
$to_addrs = '';
$additionalFormFields = array();
$additionalFormFields['type'] = 'out';
// cn: bug 5727 - must override the parents' parent for contacts (which could be an Account)
$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
$additionalFormFields['parent_id'] = $defines['focus']->id;
$additionalFormFields['parent_name'] = $defines['focus']->name;
if (isset($defines['focus']->email1)) {
$to_addrs = $defines['focus']->email1;
} elseif ($defines['focus']->object_name == 'Case') {
require_once 'modules/Accounts/Account.php';
$acct = new Account();
$acct->retrieve($defines['focus']->account_id);
$to_addrs = $acct->email1;
}
if (!empty($to_addrs)) {
$additionalFormFields['to_email_addrs'] = $to_addrs;
}
if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) {
$button = "<input title='{$title}' class='button' type='button' name='button' value=' {$value} '/>\n";
return $button;
}
$button = $this->_get_form($defines, $additionalFormFields);
$button .= "<input title='{$title}' accesskey='{$accesskey}' class='button' type='submit' name='button' value=' {$value} '/>\n";
$button .= "</form>";
return $button;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:35,代码来源:SugarWidgetSubPanelTopComposeEmailButton.php
示例2: execute
function execute(&$bean)
{
if ($bean->sales_stage == "completed") {
$realty_list = $bean->get_linked_beans("realty_opportunities", "Realty");
if (!empty($bean->contact_id)) {
$contact = new Contact();
$contact->retrieve($bean->contact_id);
foreach ($realty_list as $realty) {
if ($realty->operation == 'rent') {
$contact->load_relationship("realty_contacts_rent");
$contact->realty_contacts_rent->add($realty->id);
} elseif ($realty->operation == 'buying') {
$contact->load_relationship("realty_contacts_buying");
$contact->realty_contacts_buying->add($realty->id);
}
}
}
if (!empty($bean->account_id)) {
$account = new Account();
$account->retrieve($bean->account_id);
foreach ($realty_list as $realty) {
if ($realty->operation == 'rent') {
$account->load_relationship("realty_accounts_rent");
$account->realty_accounts_rent->add($realty->id);
} elseif ($realty->operation == 'buying') {
$account->load_relationship("realty_accounts_buying");
$account->realty_accounts_buying->add($realty->id);
}
}
}
}
}
示例3: testIDRetrieve
public function testIDRetrieve()
{
self::authorizeFromEnv();
$d = Account::retrieve('cuD9Rwx8pgmRZRpVe02lsuR9cwp2Bzf7');
$this->assertSame($d->id, "cuD9Rwx8pgmRZRpVe02lsuR9cwp2Bzf7");
$this->assertSame($d->email, "test+bindings@stripe.com");
}
示例4: Account
function process_record_hook(&$bean, $event, $arguments)
{
$bean->acct_mgr_c = '';
$full_copy = new Account();
$full_copy->retrieve($bean->account_id);
$full_copy->custom_fields->retrieve();
$bean->acct_mgr_c = $full_copy->assigned_user_name;
echo "<!-- FINDMOI " . $bean->acct_mgr_c . " -->\n";
}
示例5: tokenLogin
public static function tokenLogin($token)
{
$sql = "SELECT account_id from account where token='{$token}'";
$res = pg_query($sql);
$row = pg_fetch_array($res);
$id = $row[0];
if (isset($id)) {
return Account::retrieve((object) array("id" => $id));
}
}
示例6: display
function display()
{
$this->ev->process();
//echo "<!-- \n";
//var_dump($_REQUEST);
//echo "-->";
if (empty($this->ev->focus->id) && ($_REQUEST['relate_to'] == 'projects_accounts' || $_REQUEST['return_relationship'] == 'projects_accounts')) {
$parent = new Account();
if (isset($_REQUEST['relate_id'])) {
$parent->retrieve($_REQUEST['relate_id']);
} else {
$parent->retrieve($_REQUEST['parent_id']);
}
if (isset($parent->id) && $this->ev->fieldDefs['account_id_c']['value'] == "") {
$this->ev->fieldDefs['account_id_c']['value'] = $parent->id;
$this->ev->fieldDefs['account_c']['value'] = $parent->name;
}
}
echo $this->ev->display();
}
示例7: testNoUpdateDateEnteredWithValue
public function testNoUpdateDateEnteredWithValue()
{
global $disable_date_format;
$disable_date_format = true;
$newDateEntered = '2011-01-28 11:05:10';
$oldDateEntered = $this->_account->date_entered;
$this->_account->date_entered = $newDateEntered;
$this->_account->save();
$acct = new Account();
$acct->retrieve($this->_account->id);
$this->assertEquals($acct->date_entered, $oldDateEntered, "Account date_entered should be equal to old date_entered");
$this->assertNotEquals($acct->date_entered, $newDateEntered, "Account date_entered should not be equal to old date_entered");
}
示例8: testUpdateAdditionalOwners
public function testUpdateAdditionalOwners()
{
self::authorizeFromEnv();
$d = Account::create(array('managed' => true));
$id = $d->id;
$d->legal_entity->additional_owners = array(array('first_name' => 'Bob'));
$d->save();
$d = Account::retrieve($id);
$this->assertSame(1, count($d->legal_entity->additional_owners));
$this->assertSame('Bob', $d->legal_entity->additional_owners[0]->first_name);
$d->legal_entity->additional_owners[0]->last_name = 'Smith';
$d->save();
$d = Account::retrieve($id);
$this->assertSame(1, count($d->legal_entity->additional_owners));
$this->assertSame('Smith', $d->legal_entity->additional_owners[0]->last_name);
}
示例9: testInsertUpdateLongData
/**
* @ticket 49281
*/
public function testInsertUpdateLongData()
{
$acc = new Account();
$acc->name = "PHPUNIT test";
$acc->assigned_user_id = $GLOBALS['current_user']->id;
$acc->sic_code = 'mnbvcxzasdfghjklpoiuytrewqmnbvcxzasdfghjklpoiuytre';
$acc->save();
$id = $acc->id;
SugarTestAccountUtilities::setCreatedAccount(array($id));
$acc = new Account();
$acc->retrieve($id);
$this->assertEquals('mnbvcxzasd', $acc->sic_code);
$acc->sic_code = 'f094f59daaed0983a6a2e5913ddcc5fb';
$acc->save();
$acc = new Account();
$acc->retrieve($id);
$this->assertEquals('f094f59daa', $acc->sic_code);
}
示例10: display
function display()
{
$this->ev->process();
//echo "<!-- \n";
//var_dump($_REQUEST);
//echo "-->";
if (empty($this->ev->focus->id) && $_REQUEST['relate_to'] == 'projects_accounts') {
$parent = new Account();
$parent->retrieve($_REQUEST['relate_id']);
if (isset($parent->specialbilling_c) && $this->ev->fieldDefs['specialbilling_c']['value'] == "") {
$this->ev->fieldDefs['specialbilling_c']['value'] = $parent->specialbilling_c;
}
if (isset($parent->name) && $this->ev->fieldDefs['customer_c']['value'] == "") {
$this->ev->fieldDefs['customer_c']['value'] = $parent->name;
}
}
echo $this->ev->display();
}
示例11: loadRel
function loadRel($module, $module_id, $linked_module_id)
{
if ($module == 'Accounts') {
$Accounts = new Account();
$Accounts->retrieve($linked_module_id);
$Accounts->load_relationships('realty_accounts_interest');
$Accounts->realty_accounts_interest->add($module_id);
} elseif ($module == 'Contacts') {
$Contacts = new Contact();
$Contacts->retrieve($linked_module_id);
$Contacts->load_relationships('realty_contacts_interest');
$Contacts->realty_contacts_interest->add($module_id);
} elseif ($module == 'Request') {
$Request = new Request();
$Request->retrieve($linked_module_id);
$Request->load_relationships('realty_requests_interest');
$Request->realty_requests_interest->add($module_id);
}
}
示例12: infoParties
function infoParties()
{
global $sugar_config;
$this->sellerInfo = array('PersonTypeCode' => $sugar_config['fact_person_type_code'], 'ResidenceTypeCode' => $sugar_config['fact_residence_type_code'], 'TaxIdentificationNumber' => $sugar_config['fact_tax_number'], 'Address' => $sugar_config['fact_address'], 'PostCode' => $sugar_config['fact_post_code'], 'Town' => $sugar_config['fact_town'], 'Province' => $sugar_config['fact_province'], 'CountryCode' => $sugar_config['fact_country_code']);
// Names and other attributes depends on person type
if ($sugar_config['fact_person_type_code'] == 'F') {
$this->sellerInfo['Name'] = $sugar_config['fact_corporate_name'];
$this->sellerInfo['FirstSurname'] = $sugar_config['fact_trade_name_surname1'];
$this->sellerInfo['SecondSurname'] = $sugar_config['fact_registration_surname2'];
} else {
$this->sellerInfo['CorporateName'] = $sugar_config['fact_corporate_name'];
$this->sellerInfo['TradeName'] = $sugar_config['fact_trade_name_surname1'];
$this->sellerInfo['RegistrationData'] = $sugar_config['fact_registration_surname2'];
}
$account = new Account();
$account->retrieve($this->bean->account_id);
$nif_field = $sugar_config['fact_account_nif_field'] ? $sugar_config['fact_account_nif_field'] : 'nonexistenfield';
$this->buyerInfo = array('PersonTypeCode' => 'J', 'ResidenceTypeCode' => 'R', 'TaxIdentificationNumber' => $account->{$nif_field} ? $account->{$nif_field} : '000000', 'CorporateName' => $account->name, 'Address' => $account->billing_address_street, 'PostCode' => $account->billing_address_postalcode ? $account->billing_address_postalcode : '00000', 'Town' => $account->billing_address_city, 'Province' => $account->billing_address_state, 'CountryCode' => 'ESP');
}
示例13: display
function display()
{
global $mod_strings, $app_strings, $app_list_strings, $sugar_config, $beanFiles, $current_user;
$this->ss->assign("MOD", $mod_strings);
$this->ss->assign("APP_LIST", $app_list_strings);
// IF THE PROJECT IS CREATED FROM AN OPP
if (isset($_REQUEST['CreateFromOpp']) && $_REQUEST['CreateFromOpp'] == 'true') {
// CREATE DEFAULT PROJECT LINK WITH OPPORTUNITY
require_once $beanFiles['Opportunity'];
$link_opportunity = new Opportunity();
$link_opportunity->retrieve($_REQUEST['return_id']);
$this->bean->opportunities_id = $link_opportunity->id;
$this->bean->opportunities_name = $link_opportunity->name;
$this->bean->accounts_name = $link_opportunity->account_name;
$this->bean->accounts_id = $link_opportunity->account_id;
$this->bean->id = $this->bean->save();
$_REQUEST['record'] = $this->bean->id;
}
// IF THE PROJECT IS CREATED FROM AN ACCOUNT
if (isset($_REQUEST['CreateFromAcc']) && $_REQUEST['CreateFromAcc'] == 'true') {
// CREATE DEFAULT PROJECT LINK WITH OPPORTUNITY
require_once $beanFiles['Account'];
$link_account = new Account();
$link_account->retrieve($_REQUEST['return_id']);
$this->bean->accounts_name = $link_account->name;
$this->bean->accounts_id = $link_account->id;
$this->bean->id = $this->bean->save();
$_REQUEST['record'] = $this->bean->id;
}
// Build Stat url
/*$edit_url = "";
if (isset($current_user->tilkee_token_c) && !empty($current_user->tilkee_token_c) && !empty($this->bean->edit_url)) {
$edit_url = $this->bean->edit_url.'&access_token='.$current_user->tilkee_token_c;
}*/
$this->ss->assign("EDIT_URL", $this->bean->edit_url);
parent::display();
}
示例14: array
<?php
require_once 'custom/include/fpdf17/fpdf.php';
require_once "custom/send_mail.php";
require_once 'custom/Presentation/generate.php';
global $sugar_config, $db;
echo "<h3>Генерация презентации</h3><br/>";
$emails = array();
$contact = new Account();
$contact->retrieve($_GET['id']);
$assigned_user_id = $contact->assigned_user_id;
$ass = new User();
$ass->retrieve($assigned_user_id);
$sqlemail = "SELECT email_addresses.email_address \n\t\t\tFROM email_addresses\n\t\t\tLEFT JOIN email_addr_bean_rel ON email_addr_bean_rel.email_address_id = email_addresses.id AND email_addr_bean_rel.deleted = 0\n\t\t\tWHERE email_addresses.deleted = 0 \n\t\t\tAND bean_id = '{$contact->id}' ";
$resultemail = $db->query($sqlemail);
while ($rowemail = $db->fetchByAssoc($resultemail)) {
$emails[] = $rowemail['email_address'];
}
$sqla = "SELECT realty_id FROM realty_accounts_m_to_m_table WHERE presentation_checked=1 AND account_id = '" . $contact->id . "' AND deleted = 0";
$resulta = $db->query($sqla);
while ($row = $db->fetchByAssoc($resulta)) {
$pdf = GeneratePresentation($row['realty_id']);
$realty = new Realty();
$realty->retrieve($row['realty_id']);
/*require_once('custom/sms/sms.php');
$sms = new sms();
//$sms->parent_type = 'Users';
$sms->retrieve_settings();
//$sms->parent_id = $user->id;
//$sms->pname = $user->full_name;
//$type = ($bean->object_name == "Call")?"Вам назначен звонок ":"Вам назначена Встреча ";
示例15: array
function parse_template_bean($string, $bean_name, &$focus)
{
global $current_user;
global $beanFiles, $beanList;
$repl_arr = array();
// cn: bug 9277 - create a replace array with empty strings to blank-out invalid vars
$acct = new Account();
$contact = new Contact();
$lead = new Lead();
$prospect = new Prospect();
foreach ($lead->field_defs as $field_def) {
if ($field_def['type'] == 'relate' && empty($field_def['custom_type']) || $field_def['type'] == 'assigned_user_name') {
continue;
}
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('contact_' . $field_def['name'] => '', 'contact_account_' . $field_def['name'] => ''));
}
foreach ($prospect->field_defs as $field_def) {
if ($field_def['type'] == 'relate' && empty($field_def['custom_type']) || $field_def['type'] == 'assigned_user_name') {
continue;
}
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('contact_' . $field_def['name'] => '', 'contact_account_' . $field_def['name'] => ''));
}
foreach ($contact->field_defs as $field_def) {
if ($field_def['type'] == 'relate' && empty($field_def['custom_type']) || $field_def['type'] == 'assigned_user_name') {
continue;
}
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('contact_' . $field_def['name'] => '', 'contact_account_' . $field_def['name'] => ''));
}
foreach ($acct->field_defs as $field_def) {
if ($field_def['type'] == 'relate' && empty($field_def['custom_type']) || $field_def['type'] == 'assigned_user_name') {
continue;
}
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('account_' . $field_def['name'] => '', 'account_contact_' . $field_def['name'] => ''));
}
// cn: end bug 9277 fix
// feel for Parent account, only for Contacts traditionally, but written for future expansion
if (isset($focus->account_id) && !empty($focus->account_id)) {
$acct->retrieve($focus->account_id);
}
if ($bean_name == 'Contacts') {
// cn: bug 9277 - email templates not loading account/opp info for templates
if (!empty($acct->id)) {
foreach ($acct->field_defs as $field_def) {
if ($field_def['type'] == 'relate' && empty($field_def['custom_type']) || $field_def['type'] == 'assigned_user_name') {
continue;
}
if ($field_def['type'] == 'enum') {
$translated = translate($field_def['options'], 'Accounts', $acct->{$field_def}['name']);
if (isset($translated) && !is_array($translated)) {
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('account_' . $field_def['name'] => $translated, 'contact_account_' . $field_def['name'] => $translated));
} else {
// unset enum field, make sure we have a match string to replace with ""
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('account_' . $field_def['name'] => '', 'contact_account_' . $field_def['name'] => ''));
}
} else {
// bug 47647 - allow for fields to translate before adding to template
$translated = self::_convertToType($field_def['type'], $acct->{$field_def}['name']);
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('account_' . $field_def['name'] => $translated, 'contact_account_' . $field_def['name'] => $translated));
}
}
}
if (!empty($focus->assigned_user_id)) {
$user = new User();
$user->retrieve($focus->assigned_user_id);
$repl_arr = EmailTemplate::_parseUserValues($repl_arr, $user);
}
} elseif ($bean_name == 'Users') {
/**
* This section of code will on do work when a blank Contact, Lead,
* etc. is passed in to parse the contact_* vars. At this point,
* $current_user will be used to fill in the blanks.
*/
$repl_arr = EmailTemplate::_parseUserValues($repl_arr, $current_user);
} else {
// assumed we have an Account in focus
foreach ($contact->field_defs as $field_def) {
if ($field_def['type'] == 'relate' && empty($field_def['custom_type']) || $field_def['type'] == 'assigned_user_name' || $field_def['type'] == 'link') {
continue;
}
if ($field_def['type'] == 'enum') {
$translated = translate($field_def['options'], 'Accounts', $contact->{$field_def}['name']);
if (isset($translated) && !is_array($translated)) {
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('contact_' . $field_def['name'] => $translated, 'contact_account_' . $field_def['name'] => $translated));
} else {
// unset enum field, make sure we have a match string to replace with ""
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('contact_' . $field_def['name'] => '', 'contact_account_' . $field_def['name'] => ''));
}
} else {
if (isset($contact->{$field_def}['name'])) {
// bug 47647 - allow for fields to translate before adding to template
$translated = self::_convertToType($field_def['type'], $contact->{$field_def}['name']);
$repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array('contact_' . $field_def['name'] => $translated, 'contact_account_' . $field_def['name'] => $translated));
}
// if
}
}
}
///////////////////////////////////////////////////////////////////////
//// LOAD FOCUS DATA INTO REPL_ARR
foreach ($focus->field_defs as $field_def) {
//.........这里部分代码省略.........