本文整理汇总了PHP中CRM_Contribute_Form_Task类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_Form_Task类的具体用法?PHP CRM_Contribute_Form_Task怎么用?PHP CRM_Contribute_Form_Task使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Contribute_Form_Task类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Build all the data structures needed to build the form.
*
* @return void
*/
public function preProcess()
{
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
if ($id) {
$this->_contributionIds = array($id);
$this->_componentClause = " civicrm_contribution.id IN ( {$id} ) ";
$this->_single = TRUE;
$this->assign('totalSelectedContributions', 1);
} else {
parent::preProcess();
}
// check that all the contribution ids have pending status
$query = "\nSELECT count(*)\nFROM civicrm_contribution\nWHERE contribution_status_id != 1\nAND {$this->_componentClause}";
$count = CRM_Core_DAO::singleValueQuery($query);
if ($count != 0) {
CRM_Core_Error::statusBounce("Please select only online contributions with Completed status.");
}
// we have all the contribution ids, so now we get the contact ids
parent::setContactIDs();
$this->assign('single', $this->_single);
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey={$qfKey}";
}
$url = CRM_Utils_System::url('civicrm/contribute/search', $urlParams);
$breadCrumb = array(array('url' => $url, 'title' => ts('Search Results')));
CRM_Utils_System::appendBreadCrumb($breadCrumb);
CRM_Utils_System::setTitle(ts('Print Contribution Receipts'));
}
示例2: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
/*
* initialize the task and row fields
*/
parent::preProcess();
}
示例3: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, false);
if ($id) {
$this->_contributionIds = array($id);
$this->_componentClause = " civicrm_contribution.id IN ( {$id} ) ";
$this->_single = true;
$this->assign('totalSelectedContributions', 1);
} else {
parent::preProcess();
}
// check that all the contribution ids have pending status
$query = "\nSELECT count(*)\nFROM civicrm_contribution\nWHERE contribution_status_id != 2\nAND {$this->_componentClause}";
$count = CRM_Core_DAO::singleValueQuery($query, CRM_Core_DAO::$_nullArray);
if ($count != 0) {
CRM_Core_Error::statusBounce(ts('Please select only online contributions with Pending status.'));
}
// ensure that all contributions are generated online by pay later
$query = "\nSELECT DISTINCT( source ) as source\nFROM civicrm_contribution\nWHERE {$this->_componentClause}";
$dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
while ($dao->fetch()) {
if (strpos($dao->source, ts('Online Contribution')) === false && strpos($dao->source, ts('Online Event Registration')) === false) {
CRM_Core_Error::statusBounce("<strong>Update Pending Contribution Status</strong> can only be used for pending online contributions (made using the 'Pay Later' option). The Source for these contributions starts with 'Online ...'. Please de-select any offline contributions and try again.");
}
}
// we have all the contribution ids, so now we get the contact ids
parent::setContactIDs();
$this->assign('single', $this->_single);
}
示例4: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
parent::preProcess();
// we have all the contribution ids, so now we get the contact ids
parent::setContactIDs();
$this->assign('single', $this->_single);
}
示例5: preProcess
/**
* Build all the data structures needed to build the form.
*/
public function preProcess()
{
//check for delete
if (!CRM_Core_Permission::checkActionPermission('CiviContribute', CRM_Core_Action::DELETE)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}
parent::preProcess();
}
示例6: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
parent::preprocess();
// set print view, so that print templates are called
$this->controller->setPrint(true);
// create the selector, controller and run - store results in session
$fv = $this->get('formValues');
$selector =& new CRM_Contribute_Selector_Search($fv, $this->_action, $this->_contributionClause);
$controller =& new CRM_Core_Selector_Controller($selector, null, null, CRM_CORE_ACTION_VIEW, $this, CRM_CORE_SELECTOR_CONTROLLER_SCREEN);
$controller->setEmbedded(true);
$controller->run();
}
示例7: preProcess
/**
* Build all the data structures needed to build the form.
*/
public function preProcess()
{
// initialize the task and row fields
parent::preProcess();
//get the contact read only fields to display.
$readOnlyFields = array_merge(array('sort_name' => ts('Name')), CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_autocomplete_options', TRUE, NULL, FALSE, 'name', TRUE));
//get the read only field data.
$returnProperties = array_fill_keys(array_keys($readOnlyFields), 1);
$contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_contributionIds, 'CiviContribute', $returnProperties);
$this->assign('contactDetails', $contactDetails);
$this->assign('readOnlyFields', $readOnlyFields);
}
示例8: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false);
if ($cid) {
CRM_Contact_Form_Task_EmailCommon::preProcessSingle($this, $cid);
} else {
parent::preProcess();
// we have all the contribution ids, so now we get the contact ids
parent::setContactIDs();
}
$this->assign('single', $this->_single);
}
示例9: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
parent::preProcess();
$rows = array();
// display name and contribution details of all selected contacts
$contribIDs = implode(',', $this->_contributionIds);
$query = "\n SELECT co.total_amount as amount,\n co.receive_date as receive_date,\n co.source as source,\n ct.display_name as display_name\n FROM civicrm_contribution co\nINNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id )\n WHERE co.id IN ( {$contribIDs} )";
$dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
while ($dao->fetch()) {
$rows[] = array('display_name' => $dao->display_name, 'amount' => $dao->amount, 'source' => $dao->source, 'receive_date' => $dao->receive_date);
}
$this->assign('rows', $rows);
}
示例10: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
parent::preProcess();
require_once 'CRM/Civigiftaid/Utils/Contribution.php';
list($total, $toRemove, $notInBatch, $alreadySubmited) = CRM_Civigiftaid_Utils_Contribution::_validationRemoveContributionFromBatch($this->_contributionIds);
$this->assign('selectedContributions', $total);
$this->assign('totalToRemoveContributions', count($toRemove));
$this->assign('notInBatchContributions', count($notInBatch));
$this->assign('alreadySubmitedContributions', count($alreadySubmited));
$contributionsToRemoveRows = CRM_Civigiftaid_Utils_Contribution::getContributionDetails($toRemove);
$this->assign('contributionsToRemoveRows', $contributionsToRemoveRows);
$contributionsAlreadySubmitedRows = CRM_Civigiftaid_Utils_Contribution::getContributionDetails($alreadySubmited);
$this->assign('contributionsAlreadySubmitedRows', $contributionsAlreadySubmitedRows);
$contributionsNotInBatchRows = CRM_Civigiftaid_Utils_Contribution::getContributionDetails($notInBatch);
$this->assign('contributionsNotInBatchRows', $contributionsNotInBatchRows);
}
示例11: postProcess
function postProcess()
{
$session = CRM_Core_Session::singleton();
$userContext = $session->readUserContext();
$values = $this->exportValues();
CRM_Donrec_Form_Task_Rebook::rebook($this->_contributionIds, trim($values['contactId']), $userContext);
parent::postProcess();
// finally, redirect to original contact's contribution overview
$origin_contact_id = CRM_Donrec_Form_Task_Rebook::checkSameContact($this->_contributionIds, NULL);
if (!empty($origin_contact_id)) {
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$origin_contact_id}&selectedChild=contribute");
} else {
$url = CRM_Utils_System::url('civicrm', "");
}
CRM_Utils_System::redirect($url);
}
示例12: preProcess
/**
* Build all the data structures needed to build the form.
*
* @return void
*/
public function preProcess()
{
parent::preprocess();
// set print view, so that print templates are called
$this->controller->setPrint(1);
// get the formatted params
$queryParams = $this->get('queryParams');
$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));
}
$selector = new CRM_Contribute_Selector_Search($queryParams, $this->_action, $this->_componentClause);
$controller = new CRM_Core_Selector_Controller($selector, NULL, $sortID, CRM_Core_Action::VIEW, $this, CRM_Core_Selector_Controller::SCREEN);
$controller->setEmbedded(TRUE);
$controller->run();
}
示例13: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
/*
* initialize the task and row fields
*/
parent::preProcess();
//get the contact read only fields to display.
require_once 'CRM/Core/BAO/Preferences.php';
$readOnlyFields = array_merge(array('sort_name' => ts('Name')), CRM_Core_BAO_Preferences::valueOptions('contact_autocomplete_options', true, null, false, 'name', true));
//get the read only field data.
$returnProperties = array_fill_keys(array_keys($readOnlyFields), 1);
require_once 'CRM/Contact/BAO/Contact/Utils.php';
$contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_contributionIds, 'CiviContribute', $returnProperties);
$this->assign('contactDetails', $contactDetails);
$this->assign('readOnlyFields', $readOnlyFields);
}
示例14: preProcess
/**
* Build all the data structures needed to build the form.
*
* @return void
*/
public function preProcess()
{
$this->skipOnHold = $this->skipDeceased = FALSE;
CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
// store case id if present
$this->_caseId = CRM_Utils_Request::retrieve('caseid', 'Positive', $this, FALSE);
// retrieve contact ID if this is 'single' mode
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
$this->_activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
if ($cid) {
CRM_Contact_Form_Task_PDFLetterCommon::preProcessSingle($this, $cid);
$this->_single = TRUE;
$this->_cid = $cid;
} else {
parent::preProcess();
}
$this->assign('single', $this->_single);
}
示例15: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
parent::preProcess();
require_once 'GiftAid/Utils/Contribution.php';
list($total, $added, $alreadyAdded, $notValid) = GiftAid_Utils_Contribution::_validateContributionToBatch($this->_contributionIds);
$this->assign('selectedContributions', $total);
$this->assign('totalAddedContributions', count($added));
$this->assign('alreadyAddedContributions', count($alreadyAdded));
$this->assign('notValidContributions', count($notValid));
// get details of contribution that will be added to this batch.
$contributionsAddedRows = array();
$contributionsAddedRows = GiftAid_Utils_Contribution::getContributionDetails($added);
$this->assign('contributionsAddedRows', $contributionsAddedRows);
// get details of contribution thatare already added to this batch.
$contributionsAlreadyAddedRows = array();
$contributionsAlreadyAddedRows = GiftAid_Utils_Contribution::getContributionDetails($alreadyAdded);
$this->assign('contributionsAlreadyAddedRows', $contributionsAlreadyAddedRows);
}