本文整理汇总了PHP中CRM_Core_Session类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Session类的具体用法?PHP CRM_Core_Session怎么用?PHP CRM_Core_Session使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Core_Session类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: postProcess
/**
* Function to process the form
*
* @access public
*
* @return None
*/
public function postProcess()
{
$params = $this->controller->exportValues($this->_name);
if (self::updateSettingsWithDAO($params)) {
CRM_Core_Session::setStatus(ts('Training settings saved.'));
}
}
开发者ID:veda-consulting,项目名称:developer-training,代码行数:14,代码来源:Setting.php
示例2: run
function run()
{
$session = CRM_Core_Session::singleton();
$apiURL = "https://graph.facebook.com/v2.3";
$redirect_uri = rawurldecode(CRM_Utils_System::url('civicrm/civisocial/facebookcallback', NULL, TRUE));
// Retreive client_id and client_secret from settings
$is_enabled = civicrm_api3('setting', 'getvalue', array('group' => 'CiviSocial Account Credentials', 'name' => 'enable_facebook'));
if (!$is_enabled) {
die("Backend not enabled.");
}
$client_secret = civicrm_api3('setting', 'getvalue', array('group' => 'CiviSocial Account Credentials', 'name' => 'facebook_secret'));
$client_id = civicrm_api3('setting', 'getvalue', array('group' => 'CiviSocial Account Credentials', 'name' => 'facebook_app_id'));
// Facebook sends a code to the callback url, this is further used to acquire
// access token from facebook, which is needed to get all the data from facebook
if (array_key_exists('code', $_GET)) {
$facebook_code = $_GET['code'];
} else {
die("FACEBOOK FATAL: the request returned without the code. Please try loging in again.");
}
// Get the access token from facebook for the user
$access_token = "";
$access_token_response = $this->get_response($apiURL, "oauth/access_token", FALSE, array("client_id" => $client_id, "client_secret" => $client_secret, "code" => $facebook_code, "redirect_uri" => $redirect_uri));
if (array_key_exists("error", $access_token_response)) {
die($access_token_response["error"]);
$access_token = "";
} else {
$access_token = $access_token_response["access_token"];
}
$user_data_response = $this->get_response($apiURL, "me", FALSE, array("access_token" => $access_token));
$contact_id = CRM_Civisocial_BAO_CivisocialUser::handle_facebook_data($user_data_response);
$this->assign('status', $contact_id);
$session->set('userID', $contact_id);
parent::run();
}
开发者ID:rolencea,项目名称:org.civicrm.civisocial2,代码行数:34,代码来源:FacebookCallback.php
示例3: formatUnitSize
/**
* Format size.
*
*/
public static function formatUnitSize($size, $checkForPostMax = FALSE)
{
if ($size) {
$last = strtolower($size[strlen($size) - 1]);
switch ($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$size *= 1024;
case 'm':
$size *= 1024;
case 'k':
$size *= 1024;
}
if ($checkForPostMax) {
$maxImportFileSize = self::formatUnitSize(ini_get('upload_max_filesize'));
$postMaxSize = self::formatUnitSize(ini_get('post_max_size'));
if ($maxImportFileSize > $postMaxSize && $postMaxSize == $size) {
CRM_Core_Session::setStatus(ts("Note: Upload max filesize ('upload_max_filesize') should not exceed Post max size ('post_max_size') as defined in PHP.ini, please check with your system administrator."), ts("Warning"), "alert");
}
//respect php.ini upload_max_filesize
if ($size > $maxImportFileSize && $size !== $postMaxSize) {
$size = $maxImportFileSize;
CRM_Core_Session::setStatus(ts("Note: Please verify your configuration for Maximum File Size (in MB) <a href='%1'>Administrator >> System Settings >> Misc</a>. It should support 'upload_max_size' as defined in PHP.ini.Please check with your system administrator.", array(1 => CRM_Utils_System::url('civicrm/admin/setting/misc', 'reset=1'))), ts("Warning"), "alert");
}
}
return $size;
}
}
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:32,代码来源:Defaults.php
示例4: run
/**
* run this page (figure out the action needed and perform it).
*
* @return void
*/
function run()
{
if (!CRM_Core_Permission::check('administer Reports')) {
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1'));
}
$optionVal = CRM_Report_Utils_Report::getValueFromUrl();
$templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value', 'String', FALSE);
$extKey = strpos(CRM_Utils_Array::value('name', $templateInfo), '.');
$reportClass = NULL;
if ($extKey !== FALSE) {
$ext = CRM_Extension_System::singleton()->getMapper();
$reportClass = $ext->keyToClass($templateInfo['name'], 'report');
$templateInfo['name'] = $reportClass;
}
if (strstr(CRM_Utils_Array::value('name', $templateInfo), '_Form') || !is_null($reportClass)) {
CRM_Utils_System::setTitle($templateInfo['label'] . ' - Template');
$this->assign('reportTitle', $templateInfo['label']);
$session = CRM_Core_Session::singleton();
$session->set('reportDescription', $templateInfo['description']);
$wrapper = new CRM_Utils_Wrapper();
return $wrapper->run($templateInfo['name'], NULL, NULL);
}
if ($optionVal) {
CRM_Core_Session::setStatus(ts('Could not find the report template. Make sure the report template is registered and / or url is correct.'), ts('Template Not Found'), 'error');
}
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1'));
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:32,代码来源:Report.php
示例5: preProcess
/**
* Heart of the viewing process. The runner gets all the meta data for
* the contact and calls the appropriate type of page to view.
*
* @return void
* @access public
*
*/
function preProcess()
{
// Make sure case types have been configured for the component
require_once 'CRM/Core/OptionGroup.php';
$caseType = CRM_Core_OptionGroup::values('case_type');
if (empty($caseType)) {
$this->assign('notConfigured', 1);
return;
}
$session =& CRM_Core_Session::singleton();
$allCases = CRM_Utils_Request::retrieve('all', 'Positive', $session);
CRM_Utils_System::setTitle(ts('CiviCase Dashboard'));
$userID = $session->get('userID');
if (!$allCases) {
$this->assign('myCases', true);
} else {
$this->assign('myCases', false);
}
$this->assign('newClient', false);
if (CRM_Core_Permission::check('add contacts')) {
$this->assign('newClient', true);
}
require_once 'CRM/Case/BAO/Case.php';
$summary = CRM_Case_BAO_Case::getCasesSummary($allCases, $userID);
$upcoming = CRM_Case_BAO_Case::getCases($allCases, $userID, 'upcoming');
$recent = CRM_Case_BAO_Case::getCases($allCases, $userID, 'recent');
$this->assign('casesSummary', $summary);
if (!empty($upcoming)) {
$this->assign('upcomingCases', $upcoming);
}
if (!empty($recent)) {
$this->assign('recentCases', $recent);
}
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:42,代码来源:DashBoard.php
示例6: create
/**
* Takes an associative array and creates a Survey object.
*
* the function extract all the params it needs to initialize the create a
* survey object.
*
*
* @param array $params
*
* @return CRM_Survey_DAO_Survey
*/
public static function create(&$params)
{
if (empty($params)) {
return FALSE;
}
if (!empty($params['is_default'])) {
$query = "UPDATE civicrm_survey SET is_default = 0";
CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
}
if (!CRM_Utils_Array::value('id', $params)) {
if (!CRM_Utils_Array::value('created_id', $params)) {
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
}
if (!CRM_Utils_Array::value('created_date', $params)) {
$params['created_date'] = date('YmdHis');
}
}
$dao = new CRM_Campaign_DAO_Survey();
$dao->copyValues($params);
$dao->save();
if (!empty($params['custom']) && is_array($params['custom'])) {
CRM_Core_BAO_CustomValueTable::store($params['custom'], 'civicrm_survey', $dao->id);
}
return $dao;
}
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:37,代码来源:Survey.php
示例7: buildForm
function buildForm(&$form)
{
$groups =& CRM_Core_PseudoConstant::group();
$tags =& CRM_Core_PseudoConstant::tag();
if (count($groups) == 0 || count($tags) == 0) {
CRM_Core_Session::setStatus(ts("Atleast one Group and Tag must be present, for Custom Group / Tag search."));
$url = CRM_Utils_System::url('civicrm/contact/search/custom/list', 'reset=1');
CRM_Utils_System::redirect($url);
}
$inG =& $form->addElement('advmultiselect', 'includeGroups', ts('Include Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$outG =& $form->addElement('advmultiselect', 'excludeGroups', ts('Exclude Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$andOr =& $form->addElement('checkbox', 'andOr', 'Combine With (AND, Uncheck For OR)', null, array('checked' => 'checked'));
$int =& $form->addElement('advmultiselect', 'includeTags', ts('Include Tag(s)') . ' ', $tags, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$outt =& $form->addElement('advmultiselect', 'excludeTags', ts('Exclude Tag(s)') . ' ', $tags, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
//add/remove buttons for groups
$inG->setButtonAttributes('add', array('value' => ts('Add >>')));
$outG->setButtonAttributes('add', array('value' => ts('Add >>')));
$inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$outG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
//add/remove buttons for tags
$int->setButtonAttributes('add', array('value' => ts('Add >>')));
$outt->setButtonAttributes('add', array('value' => ts('Add >>')));
$int->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$outt->setButtonAttributes('remove', array('value' => ts('<< Remove')));
/**
* if you are using the standard template, this array tells the template what elements
* are part of the search criteria
*/
$form->assign('elements', array('includeGroups', 'excludeGroups', 'andOr', 'includeTags', 'excludeTags'));
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:30,代码来源:Group.php
示例8: sendEmail
/**
* send the message to all the contacts and also insert a
* contact activity in each contacts record
*
* @param array $contactIds the array of contact ids to send the email
* @param string $subject the subject of the message
* @param string $message the message contents
* @param string $emailAddress use this 'to' email address instead of the default Primary address
*
* @return array (total, added, notAdded) count of emails sent
* @access public
* @static
*/
function sendEmail(&$contactIds, &$subject, &$message, $emailAddress)
{
$session =& CRM_Core_Session::singleton();
$userID = $session->get('userID');
list($fromDisplayName, $fromEmail, $fromDoNotEmail) = CRM_Contact_BAO_Contact::getContactDetails($userID);
if (!$fromEmail) {
return array(count($contactIds), 0, count($contactIds));
}
if (!trim($fromDisplayName)) {
$fromDisplayName = $fromEmail;
}
$from = CRM_Utils_Mail::encodeAddressHeader($fromDisplayName, $fromEmail);
// create the meta level record first
$email =& new CRM_Core_BAO_EmailHistory();
$email->subject = $subject;
$email->message = $message;
$email->contact_id = $userID;
$email->sent_date = date('Ymd');
$email->save();
$sent = $notSent = 0;
foreach ($contactIds as $contactId) {
if (CRM_Core_BAO_EmailHistory::sendMessage($from, $contactId, $subject, $message, $emailAddress, $email->id)) {
$sent++;
} else {
$notSent++;
}
}
return array(count($contactIds), $sent, $notSent);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:42,代码来源:EmailHistory.php
示例9: invalidKey
public function invalidKey()
{
$message = ts('Because your session timed out, we have reset the search page.');
CRM_Core_Session::setStatus($message);
// see if we can figure out the url and redirect to the right search form
// note that this happens really early on, so we cant use any of the form or controller
// variables
$config = CRM_Core_Config::singleton();
$qString = $_GET[$config->userFrameworkURLVar];
$args = "reset=1";
$path = 'civicrm/contact/search/advanced';
if (strpos($qString, 'basic') !== FALSE) {
$path = 'civicrm/contact/search/basic';
} else {
if (strpos($qString, 'builder') !== FALSE) {
$path = 'civicrm/contact/search/builder';
} else {
if (strpos($qString, 'custom') !== FALSE && isset($_REQUEST['csid'])) {
$path = 'civicrm/contact/search/custom';
$args = "reset=1&csid={$_REQUEST['csid']}";
}
}
}
$url = CRM_Utils_System::url($path, $args);
CRM_Utils_System::redirect($url);
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:26,代码来源:Search.php
示例10: postProcess
function postProcess()
{
// define some stats
$activities_total = count($this->_activityHolderIds);
$activities_processed = 0;
$activities_detected = 0;
$activities_fixed = 0;
// filter for relevant activities
$activity_type_id = (int) CRM_Householdmerge_Logic_Configuration::getCheckHouseholdActivityTypeID();
$activity_status_ids = CRM_Householdmerge_Logic_Configuration::getFixableActivityStatusIDs();
$activity_ids = implode(',', $this->_activityHolderIds);
$filter_query = "SELECT id AS activity_id FROM civicrm_activity\n WHERE civicrm_activity.activity_type_id = {$activity_type_id} \n AND civicrm_activity.status_id IN ({$activity_status_ids})\n AND civicrm_activity.id IN ({$activity_ids});";
$filtered_activities = CRM_Core_DAO::executeQuery($filter_query);
// go through all activites and try to fix them
while ($filtered_activities->fetch()) {
$activities_processed += 1;
$problem = CRM_Householdmerge_Logic_Problem::extractProblem($filtered_activities->activity_id);
if ($problem) {
$activities_detected += 1;
if ($problem->fix()) {
$activities_fixed += 1;
}
}
}
// show stats
CRM_Core_Session::setStatus(ts('%1 of the %2 selected activities were processed, %3 of them could be fixed.', array(1 => $activities_detected, 2 => $activities_total, 3 => $activities_fixed, 'domain' => 'de.systopia.householdmerge')), ts('%1 Household Problems Fixed', array(1 => $activities_fixed, 'domain' => 'de.systopia.householdmerge')), $activities_fixed > 0 ? 'info' : 'warn');
parent::postProcess();
}
开发者ID:systopia,项目名称:de.systopia.householdmerge,代码行数:28,代码来源:Fix.php
示例11: noverwrite_civicrm_buildForm
function noverwrite_civicrm_buildForm($formName, &$form)
{
$names = array("CRM_Profile_Form_Edit", "CRM_Event_Form_Registration_Register", "CRM_Contribute_Form_Contribution_Main");
if (!in_array($formName, $names)) {
return;
}
// Don't invoke if we're using CiviMobile, since CiviMobile depends on users being able
// to edit records via profiles.
$path = CRM_Utils_Array::value('HTTP_REFERER', $_SERVER);
if ($formName == 'CRM_Profile_Form_Edit' && preg_match('#civicrm/mobile#', $path)) {
return;
}
$session = CRM_Core_Session::singleton();
if (!$session->get('userID') && !array_key_exists("cs", $_GET)) {
return;
// anonymous user, nothing to bloc
}
foreach (array('first_name', 'middle_name', 'last_name') as $f) {
if (!$form->elementExists($f)) {
continue;
}
$field = $form->getElement($f);
if ($field && $field->_attributes["value"]) {
$form->freeze($f);
}
}
// if you want to bloc it at the js level only, uncomment the next line and comment out the freeze
// CRM_Core_Resources::singleton()->addScript(file_get_contents(dirname( __FILE__ ) ."/js/noverwrite.js"));
}
开发者ID:joannechester,项目名称:noverwrite,代码行数:29,代码来源:noverwrite.php
示例12: postProcess
function postProcess()
{
$session = CRM_Core_Session::singleton();
$params = $this->exportValues();
$result = civicrm_api3('OptionValue', 'create', array('value' => $params['hour_value'], 'id' => CRM_Utils_Array::key($params['hour_type_select'], $this->_id)));
$session->pushUserContext(CRM_Utils_System::url('civicrm/hour/editoption', "&value={$params['hour_value']}"));
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:7,代码来源:EditHourOption.php
示例13: 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, 'browse');
// assign vars to templates
$this->assign('action', $action);
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0);
$this->_aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this);
// 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::DISABLE) {
require_once 'CRM/Auction/BAO/Auction.php';
CRM_Auction_BAO_Auction::setIsActive($id, 0);
} elseif ($action & CRM_Core_Action::ENABLE) {
require_once 'CRM/Auction/BAO/Auction.php';
CRM_Auction_BAO_Auction::setIsActive($id, 1);
} elseif ($action & CRM_Core_Action::DELETE) {
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1&action=browse'));
$controller = new CRM_Core_Controller_Simple('CRM_Auction_Form_Auction_Delete', 'Delete Auction', $action);
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0);
$controller->set('id', $id);
$controller->process();
return $controller->run();
}
// finally browse the auctions
$this->browse();
// parent run
parent::run();
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:42,代码来源:Item.php
示例14: postProcess
public function postProcess()
{
$values = $this->exportValues();
$options = $this->getColorOptions();
CRM_Core_Session::setStatus(ts('You picked color "%1"', array(1 => $options[$values['favorite_color']])));
parent::postProcess();
}
开发者ID:agloa,项目名称:tournament,代码行数:7,代码来源:BillingContact.php
示例15: edit
/**
* called when action is update.
*
* @param int $groupId
*
* @return null
*/
public function edit($groupId = NULL)
{
$this->assign('edit', $this->_edit);
if (!$this->_edit) {
return NULL;
}
$action = CRM_Utils_Request::retrieve('action', 'String', CRM_Core_DAO::$_nullObject, FALSE, 'browse');
if ($action == CRM_Core_Action::DELETE) {
$groupContactId = CRM_Utils_Request::retrieve('gcid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
$status = CRM_Utils_Request::retrieve('st', 'String', CRM_Core_DAO::$_nullObject, TRUE);
if (is_numeric($groupContactId) && $status) {
CRM_Contact_Page_View_GroupContact::del($groupContactId, $status, $this->_contactId);
}
$url = CRM_Utils_System::url('civicrm/user', "reset=1&id={$this->_contactId}");
CRM_Utils_System::redirect($url);
}
$controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_GroupContact', ts("Contact's Groups"), CRM_Core_Action::ADD, FALSE, FALSE, TRUE, FALSE);
$controller->setEmbedded(TRUE);
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/user', "reset=1&id={$this->_contactId}"), FALSE);
$controller->reset();
$controller->set('contactId', $this->_contactId);
$controller->set('groupId', $groupId);
$controller->set('context', 'user');
$controller->set('onlyPublicGroups', $this->_onlyPublicGroups);
$controller->process();
$controller->run();
}
开发者ID:kidaa30,项目名称:yes,代码行数:35,代码来源:GroupContact.php
示例16: normalize_civicrm_enable
/**
* Implementation of hook_civicrm_enable
*/
function normalize_civicrm_enable()
{
// jump to the setup screen after enabling extension
$session = CRM_Core_Session::singleton();
$session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/setting/reformat'));
return _normalize_civix_civicrm_enable();
}
开发者ID:progressivetech,项目名称:com.cividesk.normalize,代码行数:10,代码来源:normalize.php
示例17: getAngularModules
/**
* Get AngularJS modules and their dependencies
*
* @return array
* list of modules; same format as CRM_Utils_Hook::angularModules(&$angularModules)
* @see CRM_Utils_Hook::angularModules
*/
public function getAngularModules()
{
// load angular files only if valid permissions are granted to the user
if (!CRM_Core_Permission::check('access CiviMail') && !CRM_Core_Permission::check('create mailings') && !CRM_Core_Permission::check('schedule mailings') && !CRM_Core_Permission::check('approve mailings')) {
return array();
}
$result = array();
$result['crmMailing'] = array('ext' => 'civicrm', 'js' => array('ang/crmMailing.js', 'ang/crmMailing/*.js'), 'css' => array('ang/crmMailing.css'), 'partials' => array('ang/crmMailing'));
$result['crmMailingAB'] = array('ext' => 'civicrm', 'js' => array('ang/crmMailingAB.js', 'ang/crmMailingAB/*.js', 'ang/crmMailingAB/*/*.js'), 'css' => array('ang/crmMailingAB.css'), 'partials' => array('ang/crmMailingAB'));
$result['crmD3'] = array('ext' => 'civicrm', 'js' => array('ang/crmD3.js', 'bower_components/d3/d3.min.js'));
$config = CRM_Core_Config::singleton();
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
// Get past mailings
// CRM-16155 - Limit to a reasonable number
$civiMails = civicrm_api3('Mailing', 'get', array('is_completed' => 1, 'mailing_type' => array('IN' => array('standalone', 'winner')), 'return' => array('id', 'name', 'scheduled_date'), 'sequential' => 1, 'options' => array('limit' => 500, 'sort' => 'is_archived asc, scheduled_date desc')));
// Generic params
$params = array('options' => array('limit' => 0), 'sequential' => 1);
$groupNames = civicrm_api3('Group', 'get', $params + array('is_active' => 1, 'check_permissions' => TRUE, 'return' => array('title', 'visibility', 'group_type', 'is_hidden')));
$headerfooterList = civicrm_api3('MailingComponent', 'get', $params + array('is_active' => 1, 'return' => array('name', 'component_type', 'is_default', 'body_html', 'body_text')));
$emailAdd = civicrm_api3('Email', 'get', array('sequential' => 1, 'return' => "email", 'contact_id' => $contactID));
$mesTemplate = civicrm_api3('MessageTemplate', 'get', $params + array('sequential' => 1, 'is_active' => 1, 'return' => array("id", "msg_title"), 'workflow_id' => array('IS NULL' => "")));
$mailTokens = civicrm_api3('Mailing', 'gettokens', array('entity' => array('contact', 'mailing'), 'sequential' => 1));
$fromAddress = civicrm_api3('OptionValue', 'get', $params + array('option_group_id' => "from_email_address", 'domain_id' => CRM_Core_Config::domainID()));
CRM_Core_Resources::singleton()->addSetting(array('crmMailing' => array('civiMails' => $civiMails['values'], 'campaignEnabled' => in_array('CiviCampaign', $config->enableComponents), 'groupNames' => $groupNames['values'], 'headerfooterList' => $headerfooterList['values'], 'mesTemplate' => $mesTemplate['values'], 'emailAdd' => $emailAdd['values'], 'mailTokens' => $mailTokens['values'], 'contactid' => $contactID, 'requiredTokens' => CRM_Utils_Token::getRequiredTokens(), 'enableReplyTo' => (int) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'replyTo'), 'disableMandatoryTokensCheck' => (int) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'disable_mandatory_tokens_check'), 'fromAddress' => $fromAddress['values'], 'defaultTestEmail' => civicrm_api3('Contact', 'getvalue', array('id' => 'user_contact_id', 'return' => 'email')), 'visibility' => CRM_Utils_Array::makeNonAssociative(CRM_Core_SelectValues::groupVisibility()), 'workflowEnabled' => CRM_Mailing_Info::workflowEnabled())))->addPermissions(array('view all contacts', 'access CiviMail', 'create mailings', 'schedule mailings', 'approve mailings', 'delete in CiviMail', 'edit message templates'));
return $result;
}
开发者ID:vincent1892,项目名称:contact_report,代码行数:34,代码来源:Info.php
示例18: postProcess
static function postProcess(&$form)
{
$values = $form->exportValues();
$teamId = $values['pcp_team_contact'];
$teampcpId = CRM_Pcpteams_Utils::getPcpIdByContactAndEvent($form->get('component_page_id'), $teamId);
$userId = CRM_Pcpteams_Utils::getloggedInUserId();
// Create Team Member of relation to this Team
$cfpcpab = CRM_Pcpteams_Utils::getPcpABCustomFieldId();
$cfpcpba = CRM_Pcpteams_Utils::getPcpBACustomFieldId();
$customParams = array("custom_{$cfpcpab}" => $form->get('page_id'), "custom_{$cfpcpba}" => $teampcpId);
CRM_Pcpteams_Utils::createTeamRelationship($userId, $teamId, $customParams);
$form->_teamName = CRM_Contact_BAO_Contact::displayName($teamId);
$form->set('teamName', $form->_teamName);
$form->set('teamContactID', $teamId);
$form->set('teamPcpId', $teampcpId);
$teamAdminId = CRM_Pcpteams_Utils::getTeamAdmin($teampcpId);
// Team Join: create activity
$actParams = array('target_contact_id' => $teamId, 'assignee_contact_id' => $teamAdminId);
CRM_Pcpteams_Utils::createPcpActivity($actParams, CRM_Pcpteams_Constant::C_AT_REQ_MADE);
CRM_Core_Session::setStatus(ts('A notification has been sent to the team. Once approved, team should be visible on your page.'), ts('Team Request Sent'));
//send email once the team request has done.
list($teamAdminName, $teamAdminEmail) = CRM_Contact_BAO_Contact::getContactDetails($teamAdminId);
$contactDetails = civicrm_api('Contact', 'get', array('version' => 3, 'sequential' => 1, 'id' => $userId));
$emailParams = array('tplParams' => array('teamAdminName' => $teamAdminName, 'userFirstName' => $contactDetails['values'][0]['first_name'], 'userlastName' => $contactDetails['values'][0]['last_name'], 'teamName' => $form->_teamName, 'pageURL' => CRM_Utils_System::url('civicrm/pcp/manage', "reset=1&id={$teampcpId}", TRUE, NULL, FALSE, TRUE)), 'email' => array($teamAdminName => array('first_name' => $teamAdminName, 'last_name' => $teamAdminName, 'email-Primary' => $teamAdminEmail, 'display_name' => $teamAdminName)), 'valueName' => CRM_Pcpteams_Constant::C_MSG_TPL_JOIN_REQUEST);
$sendEmail = CRM_Pcpteams_Utils::sendMail($userId, $emailParams);
}
开发者ID:eruraindil,项目名称:uk.co.vedaconsulting.pcpteams,代码行数:26,代码来源:TeamJoin.php
示例19: run
public function run()
{
$eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, TRUE);
$fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE);
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
$quest = CRM_Utils_Request::retrieve('quest', 'String', $this);
$action = CRM_Utils_Request::retrieve('action', 'String', $this);
list($path, $mimeType) = CRM_Core_BAO_File::path($id, $eid, NULL, $quest);
if (!$path) {
CRM_Core_Error::statusBounce('Could not retrieve the file');
}
$buffer = file_get_contents($path);
if (!$buffer) {
CRM_Core_Error::statusBounce('The file is either empty or you do not have permission to retrieve the file');
}
if ($action & CRM_Core_Action::DELETE) {
if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', CRM_Core_DAO::$_nullObject)) {
CRM_Core_BAO_File::deleteFileReferences($id, $eid, $fid);
CRM_Core_Session::setStatus(ts('The attached file has been deleted.'), ts('Complete'), 'success');
$session = CRM_Core_Session::singleton();
$toUrl = $session->popUserContext();
CRM_Utils_System::redirect($toUrl);
}
} else {
CRM_Utils_System::download(CRM_Utils_File::cleanFileName(basename($path)), $mimeType, $buffer);
}
}
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:27,代码来源:File.php
示例20: postProcess
public function postProcess()
{
$session = CRM_Core_Session::singleton();
$session->setStatus('Rule ' . $this->rule->label . ' parameters updated', 'Rule parameters updated', 'success');
$redirectUrl = CRM_Utils_System::url('civicrm/civirule/form/rule', 'action=update&id=' . $this->rule->id, TRUE);
CRM_Utils_System::redirect($redirectUrl);
}
开发者ID:alejandro-ixiam,项目名称:org.civicoop.civirules,代码行数:7,代码来源:Form.php
注:本文中的CRM_Core_Session类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论