本文整理汇总了PHP中CRM_Core_Page类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Page类的具体用法?PHP CRM_Core_Page怎么用?PHP CRM_Core_Page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Core_Page类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
// Add our template
CRM_Core_Smarty::singleton()->assign('isModulePermissionSupported', CRM_Core_Config::singleton()->userPermissionClass->isModulePermissionSupported());
CRM_Core_Region::instance('page-header')->add(array('template' => 'CRM/Volunteer/Form/Manage.tpl'));
parent::run();
}
开发者ID:adam-edison,项目名称:org.civicrm.volunteer,代码行数:7,代码来源:Backbone.php
示例2: run
function run()
{
$date_ranges = array('thisMonth' => '', 'lastMonth' => '- INTERVAL 1 MONTH', 'twoMonths' => '- INTERVAL 2 MONTH', 'threeMonths' => '- INTERVAL 3 MONTH', 'fourMonths' => '- INTERVAL 4 MONTH', 'fiveMonths' => '- INTERVAL 5 MONTH', 'sixMonths' => '- INTERVAL 6 MONTH');
$createdArray = array();
foreach ($date_ranges as $name => $date_range) {
// $sql = "SELECT count(id) as createdtotal, DATE_FORMAT(MONTH(CURRENT_DATE ".$date_range."), '%M') as month FROM civicrm_contact WHERE MONTH(created_date) = MONTH(CURRENT_DATE ".$date_range.") AND YEAR(created_date) = YEAR(CURRENT_DATE ".$date_range.");";
$sql = "SELECT count(id) as createdtotal FROM civicrm_contact WHERE MONTH(created_date) = MONTH(CURRENT_DATE " . $date_range . ") AND YEAR(created_date) = YEAR(CURRENT_DATE " . $date_range . ");";
$dao = CRM_Core_DAO::executeQuery($sql);
if ($dao->fetch()) {
$createdArray[$name] = $dao->createdtotal;
}
}
$createdAgg = array();
$createdTotal = array_sum($createdArray);
foreach ($createdArray as $name => $created) {
if ($createdTotal < 50) {
$createdAgg[$name] = $created;
} elseif ($createdTotal < 300 && $createdTotal >= 50) {
$createdAgg[$name] = $created / 10;
} elseif ($createdTotal < 1000 && $createdTotal >= 300) {
$createdAgg[$name] = $created / 100;
} else {
$createdAgg[$name] = $created / 1000;
}
}
$this->assign('createdArray', $createdArray);
$this->assign('createdAgg', $createdAgg);
parent::run();
}
开发者ID:agh1,项目名称:civisociety-extension,代码行数:29,代码来源:ContactPerMonth.php
示例3: run
/**
* @return string
*/
public function run()
{
$action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0);
$this->assign('action', $action);
$this->browse();
return parent::run();
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:10,代码来源:Petition.php
示例4: run
function run()
{
$config =& CRM_Core_Config::singleton();
$ufAccessURL = CRM_Utils_System::url('admin/user/permissions');
$this->assign('ufAccessURL', $ufAccessURL);
return parent::run();
}
开发者ID:ksecor,项目名称:civicrm,代码行数:7,代码来源:Access.php
示例5: run
function run()
{
$sql = "SELECT * FROM civicrm_metrics_server ORDER BY site_name, timestamp";
$dao =& CRM_Core_DAO::executeQuery($sql);
$rows = array();
while ($dao->fetch()) {
$row = array();
$row['id'] = $dao->id;
$row['site_name'] = $dao->site_name;
$row['site_url'] = $dao->site_url;
$row['timestamp'] = $dao->timestamp;
$row['type'] = $dao->type;
$row['data'] = $dao->data;
$rows[] = $row;
}
if (array_key_exists("export", $_REQUEST) && $_REQUEST['export'] == 'csv') {
header('Content-type: text/csv');
header('Content-disposition: attachment;filename=metrics_data_' . date("Ymd_HiO") . '.csv');
$output = fopen('php://output', 'w');
$headers = array("Id", "Site Name", "Site URL", "Timestamp", "Metric Type", "Metric Data");
fputcsv($output, $headers);
foreach ($rows as $row) {
fputcsv($output, $row);
}
fclose($output);
die;
} else {
CRM_Utils_System::setTitle(ts('Metrics Report'));
$this->assign('data', $rows);
$this->assign('headers', array_keys($rows[0]));
parent::run();
}
}
开发者ID:TobiasLounsbury,项目名称:civicrm-metrics-server,代码行数:33,代码来源:Report.php
示例6: run
/**
* This function is the main function that is called when the page loads, it decides the which action has to be taken for the page.
*
* return null
* @access public
*/
function run()
{
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
$this->assign('action', $this->_action);
$this->assign('context', $this->_context);
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
CRM_Pledge_Page_Tab::setContext();
if ($this->_action & CRM_Core_Action::UPDATE) {
$this->edit();
// set page title
CRM_Contact_Page_View::setTitle($this->_contactId);
} else {
$pledgeId = CRM_Utils_Request::retrieve('pledgeId', 'Positive', $this);
$paymentDetails = CRM_Pledge_BAO_PledgePayment::getPledgePayments($pledgeId);
$this->assign('rows', $paymentDetails);
$this->assign('pledgeId', $pledgeId);
$this->assign('contactId', $this->_contactId);
// check if we can process credit card contribs
$processors = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE, "billing_mode IN ( 1, 3 )");
if (count($processors) > 0) {
$this->assign('newCredit', TRUE);
} else {
$this->assign('newCredit', FALSE);
}
// check is the user has view/edit signer permission
$permission = 'view';
if (CRM_Core_Permission::check('edit pledges')) {
$permission = 'edit';
}
$this->assign('permission', $permission);
}
return parent::run();
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:40,代码来源:Payment.php
示例7: run
/**
* List blog articles as dashlet.
*/
public function run()
{
$context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'dashlet');
$this->assign('context', $context);
$this->assign('blog', $this->_getBlog());
return parent::run();
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:10,代码来源:Blog.php
示例8: run
function run()
{
// Example: Set the page-title dynamically; alternatively, declare a static title in xml/Menu/*.xml
CRM_Utils_System::setTitle(ts('JobsTab'));
self::registerScripts();
parent::run();
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:7,代码来源:JobsTab.php
示例9: run
function run()
{
// title
CRM_Utils_System::setTitle(ts('WindowSill'));
// config
// https://github.com/kreynen/civicrm-min/blob/master/CRM/Core/Extensions.php
$config = CRM_Core_Config::singleton();
if ($config->userFramework != 'Drupal') {
$error = "<div class='messages status no-popup'><div class='icon inform-icon'></div>Not a Drupal installation</div>";
} else {
$error = "<div class='messages status no-popup'><div class='icon inform-icon'></div>Drupal installation</div>";
}
// error
$this->assign('error', $error);
// on form action update settings
if (isset($_REQUEST['settings'])) {
// set
CRM_Core_BAO_Setting::setItem($_REQUEST['settings'], 'windowsill', 'settings');
// notice
CRM_Core_Session::setStatus(ts('Windowsill settings changed'), ts('Saved'), 'success');
}
// url
$url = CRM_Utils_System::url() . "civicrm/ctrl/windowsill";
$this->assign('url', $url);
// render
parent::run();
}
开发者ID:Alienpruts,项目名称:be.ctrl.windowsill,代码行数:27,代码来源:windowsill.php
示例10: run
/**
* run this page (figure out the action needed and perform it).
*
* @return void
*/
function run()
{
$selector =& new CRM_Mailing_Selector_Event(CRM_Utils_Request::retrieve('event', 'String', $this), CRM_Utils_Request::retrieve('distinct', 'Boolean', $this), CRM_Utils_Request::retrieve('mid', 'Positive', $this), CRM_Utils_Request::retrieve('jid', 'Positive', $this), CRM_Utils_Request::retrieve('uid', 'Positive', $this));
$mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
//assign backurl
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
if ($context == 'activitySelector') {
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
$backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
$backUrlTitle = ts('Back to Activities');
} elseif ($context == 'mailing') {
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
$backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing");
$backUrlTitle = ts('Back to Mailing');
} else {
$backUrl = CRM_Utils_System::url('civicrm/mailing/report', "reset=1&mid={$mailing_id}");
$backUrlTitle = ts('Back to Report');
}
$this->assign('backUrl', $backUrl);
$this->assign('backUrlTitle', $backUrlTitle);
CRM_Utils_System::setTitle($selector->getTitle());
$this->assign('title', $selector->getTitle());
$this->assign('mailing_id', $mailing_id);
$sortID = NULL;
if ($this->get(CRM_Utils_Sort::SORT_ID)) {
$sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID), $this->get(CRM_Utils_Sort::SORT_DIRECTION));
}
$controller = new CRM_Core_Selector_Controller($selector, $this->get(CRM_Utils_Pager::PAGE_ID), $sortID, CRM_Core_Action::VIEW, $this, CRM_Core_Selector_Controller::TEMPLATE);
$controller->setEmbedded(TRUE);
$controller->run();
return parent::run();
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:37,代码来源:Event.php
示例11: run
/**
* Run the page.
*
* This method is called after the page is created. It checks for the
* type of action and executes that action.
* Finally it calls the parent's run method.
*
* @return void
* @access public
*
*/
function run()
{
// get the requested action
$action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add');
// set breadcrumb to append to 2nd layer pages
$breadCrumb = array(array('title' => ts('Manage Items'), 'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1')));
// what action to take ?
if ($action & CRM_Core_Action::ADD) {
$session = CRM_Core_Session::singleton();
if ($session->get('userID')) {
// For logged in user directly go to add/update item page.
$controller = new CRM_Core_Controller_Simple('CRM_Auction_Form_Item', 'New Item', $action);
$controller->set('donorID', $session->get('userID'));
} else {
// For anonymous user go via account creation wizard.
require_once 'CRM/Auction/Controller/Item.php';
$controller = new CRM_Auction_Controller_Item('New Item', $action);
}
return $controller->run();
} elseif ($action & CRM_Core_Action::UPDATE) {
$session = CRM_Core_Session::singleton();
if ($session->get('userID')) {
$controller = new CRM_Core_Controller_Simple('CRM_Auction_Form_Item', 'Update Item', $action);
$controller->set('donorID', $session->get('userID'));
return $controller->run();
}
}
// parent run
parent::run();
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:41,代码来源:AddItem.php
示例12: run
function run()
{
if (CRM_Utils_System::authenticateKey()) {
$request_type = CRM_Utils_Request::retrieve('type', 'String');
$request_data = CRM_Utils_Request::retrieve('data', 'String');
$config = CRM_Core_Config::singleton();
if ($config->debug) {
$request_data_log = print_r($request_data, TRUE);
CRM_Core_Error::debug_log_message("Mailchimp Webhook Request [{$request_type}]: \n{$request_data_log}");
}
$function_name = 'self::mailchimpWebhook' . ucwords($request_type);
if (is_callable($function_name)) {
// Set a canary to prevent CiviMailchimp hooks from firing, which
// would trigger updates back to Mailchimp, resulting in an endless
// loop.
civimailchimp_static('mailchimp_do_not_run_hooks', TRUE);
try {
call_user_func($function_name, $request_data);
} catch (Exception $e) {
$error = array('code' => get_class($e), 'message' => $e->getMessage(), 'exception' => $e);
$message = "Mailchimp Webhook Request [{$request_type}]: {$error['code']}: {$error['message']}";
CRM_CiviMailchimp_BAO_SyncLog::saveMessage('error', 'mailchimp_to_civicrm', $message, $request_data);
CRM_Core_Error::debug_var('Fatal Error Details', $error);
CRM_Core_Error::backtrace('backTrace', TRUE);
throw $e;
}
}
}
parent::run();
}
开发者ID:kbrownell,项目名称:com.giantrabbit.civimailchimp,代码行数:30,代码来源:Webhook.php
示例13: run
function run()
{
$apiURL = "https://www.googleapis.com/oauth2/v3";
CRM_Utils_System::setTitle(ts('GoogleCallback'));
$redirect_uri = rawurldecode(CRM_Utils_System::url('civicrm/civisocial/googlepluscallback', NULL, TRUE));
$client_secret = civicrm_api3('setting', 'getvalue', array('group' => 'CiviSocial Account Credentials', 'name' => 'google_plus_secret'));
$client_id = civicrm_api3('setting', 'getvalue', array('group' => 'CiviSocial Account Credentials', 'name' => 'google_plus_key'));
// Facebook sends a code to thge
if (array_key_exists('code', $_GET)) {
$google_code = $_GET['code'];
} else {
if (array_key_exists('error', $_GET)) {
die("GOOGLE FATAL: the request returned without the code. Please try loging in again.");
}
}
// Getting Access Token
$access_token = "";
$access_token_response = $this->get_response($apiURL, "token", TRUE, array("client_id" => $client_id, "client_secret" => $client_secret, "code" => $google_code, "redirect_uri" => $redirect_uri, "grant_type" => "authorization_code"));
if (array_key_exists("error", $access_token_response)) {
die($access_token_response["error"]);
} else {
$access_token = $access_token_response["access_token"];
}
// Get the user data
$user_data_response = $this->get_response($apiURL, "userinfo", FALSE, array("access_token" => $access_token, "alt" => "json"));
$this->assign('status', $user_data_response);
$this->assign('currentTime', $user_data_response);
parent::run();
}
开发者ID:rolencea,项目名称:org.civicrm.civisocial2,代码行数:29,代码来源:GooglePlusCallback.php
示例14: run
public function run()
{
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE, 0);
$config = CRM_Chapters_AutomatchConfig::singelton();
$sql = "SELECT id, `" . $config->getMatchTypeField('column_name') . "` AS `type`, `" . $config->getCountryField('column_name') . "` AS `country`, `" . $config->getZipCodeRangeFromField('column_name') . "` AS `zipcode_from`, `" . $config->getZipCodeRangeToField('column_name') . "` AS `zipcode_to` FROM `" . $config->getCustomGroup('table_name') . "` WHERE entity_id = %1";
$params[1] = array($cid, 'Integer');
$rows = array();
$dao = CRM_Core_DAO::executeQuery($sql, $params);
$types = CRM_Core_OptionGroup::values('chapter_match_type');
$countries = CRM_Core_OptionGroup::values('chapter_match_country');
while ($dao->fetch()) {
$country = '';
if (!empty($countries[$dao->country])) {
$country = $countries[$dao->country];
}
$row = array();
$row['type'] = $types[$dao->type];
$row['type_value'] = $dao->type;
$row['country'] = $country;
$row['zipcode_from'] = $dao->zipcode_from;
$row['zipcode_to'] = $dao->zipcode_to;
$row['id'] = $dao->id;
$rows[] = $row;
}
$this->assign('rows', $rows);
$this->assign('cid', $cid);
parent::run();
}
开发者ID:CiviCooP,项目名称:net.emphanos.iida.chapters,代码行数:28,代码来源:AutomatchChapters.php
示例15: run
/**
* Run dashboard.
*
* @return void
*/
public function run()
{
// Add dashboard js and css
$resources = CRM_Core_Resources::singleton();
$resources->addScriptFile('civicrm', 'js/jquery/jquery.dashboard.js', 0, 'html-header', FALSE);
$resources->addStyleFile('civicrm', 'css/dashboard.css');
$resetCache = CRM_Utils_Request::retrieve('resetCache', 'Positive', CRM_Core_DAO::$_nullObject);
CRM_Utils_System::setTitle(ts('CiviCRM Home'));
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if ($resetCache) {
CRM_Core_BAO_Dashboard::resetDashletCache($contactID);
}
// call hook to get html from other modules
// ignored but needed to prevent warnings
$contentPlacement = CRM_Utils_Hook::DASHBOARD_BELOW;
$html = CRM_Utils_Hook::dashboard($contactID, $contentPlacement);
if (is_array($html)) {
$this->assign_by_ref('hookContent', $html);
$this->assign('hookContentPlacement', $contentPlacement);
}
$communityMessages = CRM_Core_CommunityMessages::create();
if ($communityMessages->isEnabled()) {
$message = $communityMessages->pick();
if ($message) {
$this->assign('communityMessages', $communityMessages->evalMarkup($message['markup']));
}
}
return parent::run();
}
开发者ID:utkarshsharma,项目名称:civicrm-core,代码行数:35,代码来源:DashBoard.php
示例16: run
function run()
{
CRM_Utils_System::setTitle(ts('Bank Transaction Exporter'));
// get the plugins
$plugin_list = CRM_Banking_BAO_PluginInstance::listInstances('export');
$this->assign('plugin_list', $plugin_list);
// get the IDs
$txbatch2ids = CRM_Banking_PluginModel_Exporter::getIdLists($_REQUEST);
$txcount = 0;
foreach ($txbatch2ids as $txbatchid => $txbatchcontent) {
$txcount += count($txbatchcontent);
}
$this->assign('txbatch_count', count($txbatch2ids));
$this->assign('tx_count', $txcount);
if (!empty($_REQUEST['list'])) {
$this->assign('list', $_REQUEST['list']);
}
if (!empty($_REQUEST['s_list'])) {
$this->assign('s_list', $_REQUEST['s_list']);
}
// check for the page mode
if (isset($_REQUEST['exporter-plugin'])) {
// EXECUTE
// get the plugin instance
$plugin_id = $_REQUEST['exporter-plugin'];
foreach ($plugin_list as $plugin) {
if ($plugin->id == $plugin_id) {
break;
}
}
$plugin_instance = $plugin->getInstance();
// TODO: select WHICH mode (this is only file mode)
// start exporting
$file_data = $plugin_instance->export_file($txbatch2ids, $_REQUEST);
// process result (redirect, ...)
if (empty($file_data['is_error'])) {
$mime_type = mime_content_type($file_data['path']);
$buffer = file_get_contents($file_data['path']);
CRM_Utils_System::download($file_data['file_name'], $file_data['mime_type'], $buffer, $file_data['file_extension']);
}
} else {
// CONFIGURATION MODE:
$plugin_capabilities = array();
foreach ($plugin_list as $plugin) {
$capability = '';
$instance = $plugin->getInstance();
if ($instance->does_export_files()) {
$capability .= 'F';
}
if ($instance->does_export_stream()) {
$capability .= 'S';
}
$plugin_capabilities[$plugin->id] = $capability;
}
$this->assign('plugin_capabilities', $plugin_capabilities);
}
// URLs
$this->assign('url_action', CRM_Utils_System::url('civicrm/banking/export'));
parent::run();
}
开发者ID:VangelisP,项目名称:org.project60.banking,代码行数:60,代码来源:Export.php
示例17: run
/**
* Run the page.
*
* This method is called after the page is created.
*/
public function run()
{
// get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array('labelColumn' => 'display_name'));
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$entityBlock = array('contact_id' => $contactId);
$phones = CRM_Core_BAO_Phone::getValues($entityBlock);
if (!empty($phones)) {
foreach ($phones as $key => &$value) {
$value['location_type'] = $locationTypes[$value['location_type_id']];
$value['phone_type'] = $phoneTypes[$value['phone_type_id']];
}
}
$contact = new CRM_Contact_BAO_Contact();
$contact->id = $contactId;
$contact->find(TRUE);
$privacy = array();
foreach (CRM_Contact_BAO_Contact::$_commPrefs as $name) {
if (isset($contact->{$name})) {
$privacy[$name] = $contact->{$name};
}
}
$this->assign('contactId', $contactId);
$this->assign('phone', $phones);
$this->assign('privacy', $privacy);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent
parent::run();
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:36,代码来源:Phone.php
示例18: run
/**
* Run the page.
*
* This method is called after the page is created.
*
* @return void
* @access public
*
*/
function run()
{
// get the callback, module and activity id
$action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$dao = new CRM_Core_DAO_ActivityHistory();
$dao->activity_id = $id;
$dao->activity_type = ts('SMS Sent');
if ($dao->find(TRUE)) {
$cid = $dao->entity_id;
}
$dao = new CRM_SMS_DAO_History();
$dao->id = $id;
if ($dao->find(TRUE)) {
$this->assign('fromName', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $dao->contact_id, 'display_name'));
$this->assign('toName', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'display_name'));
$this->assign('sentDate', $dao->sent_date);
$this->assign('message', $dao->message);
// get the display name and images for the contact
list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($dao->contact_id);
CRM_Utils_System::setTitle($contactImage . ' ' . $displayName);
// also add the cid params to the Menu array
CRM_Core_Menu::addParam('cid', $cid);
}
return parent::run();
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:35,代码来源:SMS.php
示例19: run
function run()
{
// Prepares variables for being sent to Smarty
//Only show countries with attached information
$countries = null;
$stats = civicrm_api3('Bic', 'stats');
foreach ($stats['values'] as $country => $count) {
$countries[] = $country;
}
// Get country names
$country_names = null;
if ($countries) {
$config = CRM_Core_Config::singleton();
$country_names = array();
$id2code = CRM_Core_PseudoConstant::countryIsoCode();
$default_country = $id2code[$config->defaultContactCountry];
$code2id = array_flip($id2code);
$id2country = CRM_Core_PseudoConstant::country(false, false);
foreach ($countries as $code) {
$country_id = $code2id[$code];
$country_name = $id2country[$country_id];
$country_names[$code] = $country_name;
}
}
// Sends variables to Smarty
$this->assign('countries', $countries);
$this->assign('country_names', $country_names);
$this->assign('default_country', $default_country);
$this->assign('show_message', true);
parent::run();
}
开发者ID:helenagarcia90,项目名称:org.project60.bic,代码行数:31,代码来源:BicList.php
示例20: run
function run()
{
$countries = CRM_Bic_Parser_Parser::getParserList();
$stats = civicrm_api3('Bic', 'stats');
$total_count = 0;
foreach ($countries as $country) {
if (isset($stats['values'][$country])) {
$total_count += $stats['values'][$country];
} else {
$stats['values'][$country] = 0;
}
}
// gather the names
$country_names = array();
$config = CRM_Core_Config::singleton();
$id2code = CRM_Core_PseudoConstant::countryIsoCode();
$default_country = $id2code[$config->defaultContactCountry];
$code2id = array_flip($id2code);
$id2country = CRM_Core_PseudoConstant::country(FALSE, FALSE);
foreach ($countries as $code) {
$country_id = $code2id[$code];
$country_name = $id2country[$country_id];
$country_names[$code] = $country_name;
}
$this->assign('countries', $countries);
$this->assign('country_names', $country_names);
$this->assign('default_country', $default_country);
$this->assign('stats', $stats['values']);
$this->assign('total_count', $total_count);
parent::run();
}
开发者ID:helenagarcia90,项目名称:org.project60.bic,代码行数:31,代码来源:Config.php
注:本文中的CRM_Core_Page类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论