本文整理汇总了PHP中CRM_Core_Form::exportValues方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Form::exportValues方法的具体用法?PHP CRM_Core_Form::exportValues怎么用?PHP CRM_Core_Form::exportValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Form
的用法示例。
在下文中一共展示了CRM_Core_Form::exportValues方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
/**
* Processes the request.
*
* @param CRM_Core_Form $page
* CRM_Core_Form the current form-page.
* @param string $actionName
* Current action name, as one Action object can serve multiple actions.
*
* @return object|void
*/
public function perform(&$page, $actionName)
{
// save the form values and validation status to the session
$page->isFormBuilt() or $page->buildForm();
$pageName = $page->getAttribute('name');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
return $page->handle('display');
}
示例2: perform
/**
* Processes the request.
*
* @param CRM_Core_Form $page
* The current form-page.
* @param string $actionName
* Current action name, as one Action object can serve multiple actions.
*
* @return void
*/
public function perform(&$page, $actionName)
{
// save the form values and validation status to the session
$page->isFormBuilt() or $page->buildForm();
$pageName = $page->getAttribute('name');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
$data['valid'][$pageName] = $page->validate();
// Modal form and page is invalid: don't go further
if ($page->controller->isModal() && !$data['valid'][$pageName]) {
return $page->handle('display');
}
// the page is valid, process it before we jump to the next state
$page->mainProcess();
return $page->handle('jump');
}
示例3: perform
/**
* Processes the request.
* this is basically a self submit, so validate the page
* and if success, call post process
* when done processing pop to user context
*
* @param CRM_Core_Form $page
* The current form-page.
* @param string $actionName
* Current action name, as one Action object can serve multiple actions.
*
* @return object|void
*/
public function perform(&$page, $actionName)
{
$page->isFormBuilt() or $page->buildForm();
$pageName = $page->getAttribute('name');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
$data['valid'][$pageName] = $page->validate();
// Modal form and page is invalid: don't go further
if ($page->controller->isModal() && !$data['valid'][$pageName]) {
return $page->handle('display');
}
// the page is valid, process it before we jump to the next state
$page->mainProcess();
// ok so we are done now, pop stack and jump back to where we came from
// we do not reset the context because u can achieve that affect using next
// use Done when u want to pop back to the same context without a reset
$this->popUserContext();
}
示例4: perform
/**
* Processes the request.
*
* @param CRM_Core_Form $page
* CRM_Core_Form the current form-page.
* @param string $actionName
* Current action name, as one Action object can serve multiple actions.
*
* @return void
*/
public function perform(&$page, $actionName)
{
$page->isFormBuilt() or $page->buildForm();
$pageName = $page->getAttribute('name');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
$data['valid'][$pageName] = $page->validate();
// Modal form and page is invalid: don't go further
if ($page->controller->isModal() && !$data['valid'][$pageName]) {
return $page->handle('display');
}
// the page is valid, process it before we jump to the next state
$page->mainProcess();
// check if destination is set, if so goto destination
$destination = $this->_stateMachine->getDestination();
if ($destination) {
$destination = urldecode($destination);
CRM_Utils_System::redirect($destination);
} else {
return $page->handle('display');
}
}
示例5: perform
/**
* Do a state transition jump.
*
* Currently only supported types are
* Next and Back. The other actions (Cancel, Done, Submit etc) do
* not need the state machine to figure out where to go
*
* @param CRM_Core_Form $page
* The current form-page.
* @param string $actionName
* Current action name, as one Action object can serve multiple actions.
* @param string $type
* The type of transition being requested (Next or Back).
*
* @return object
*/
public function perform(&$page, $actionName, $type = 'Next')
{
// save the form values and validation status to the session
$page->isFormBuilt() or $page->buildForm();
$pageName = $page->getAttribute('name');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
$data['valid'][$pageName] = $page->validate();
// if we are going to the next state
// Modal form and page is invalid: don't go further
if ($type == 'Next' && !$data['valid'][$pageName]) {
return $page->handle('display');
}
$state =& $this->_states[$pageName];
// dont know how or why we landed here so abort and display
// current page
if (empty($state)) {
return $page->handle('display');
}
// the page is valid, process it if we are jumping to the next state
if ($type == 'Next') {
$page->mainProcess();
// we get the state again, since postProcess might have changed it
// this bug took me forever to find :) Lobo
$state =& $this->_states[$pageName];
$state->handleNextState($page);
} else {
$state->handleBackState($page);
}
}
示例6: realPerform
/**
* @param CRM_Core_Form $page
* @param $actionName
*
* @return mixed
*/
function realPerform(&$page, $actionName)
{
$pageName = $page->getAttribute('name');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
$data['valid'][$pageName] = $page->validate();
if (!$data['valid'][$pageName]) {
return $page->handle('display');
}
foreach ($this->_uploadNames as $name) {
$this->upload($page, $data, $pageName, $name);
}
$state =& $this->_stateMachine->getState($pageName);
if (empty($state)) {
return $page->handle('display');
}
// the page is valid, process it before we jump to the next state
$page->mainProcess();
// check if destination is set, if so goto destination
$destination = $this->_stateMachine->getDestination();
if ($destination) {
$destination = urldecode($destination);
CRM_Utils_System::redirect($destination);
} else {
return $state->handleNextState($page);
}
}
示例7: buildMappingForm
//.........这里部分代码省略.........
if (!$locationId && in_array($mappingName[$x][$i], $specialFields)) {
$locationId = " ";
}
$defaults["mapper[{$x}][{$i}]"] = array($mappingContactType[$x][$i], $mappingName[$x][$i], $locationId, $phoneType);
if (!$mappingName[$x][$i]) {
$noneArray[] = array($x, $i, 1);
}
if (!$locationId) {
$noneArray[] = array($x, $i, 2);
}
if (!$phoneType && !$imProvider) {
$noneArray[] = array($x, $i, 3);
}
$noneArray[] = array($x, $i, 4);
$noneArray[] = array($x, $i, 5);
$noneArray[] = array($x, $i, 6);
}
$jsSet = TRUE;
if (CRM_Utils_Array::value($i, CRM_Utils_Array::value($x, $mappingOperator))) {
$defaults["operator[{$x}][{$i}]"] = CRM_Utils_Array::value($i, $mappingOperator[$x]);
}
if (CRM_Utils_Array::value($i, CRM_Utils_Array::value($x, $mappingValue))) {
$defaults["value[{$x}][{$i}]"] = CRM_Utils_Array::value($i, $mappingValue[$x]);
}
}
}
}
//Fix for Search Builder
if ($mappingType == 'Export') {
$j = 7;
} else {
$j = 4;
}
$formValues = $form->exportValues();
if (!$jsSet) {
if (empty($formValues)) {
// Incremented length for third select box(relationship type)
for ($k = 1; $k < $j; $k++) {
$noneArray[] = array($x, $i, $k);
}
} else {
if (!empty($formValues['mapper'][$x])) {
foreach ($formValues['mapper'][$x] as $value) {
for ($k = 1; $k < $j; $k++) {
if (!isset($formValues['mapper'][$x][$i][$k]) || !$formValues['mapper'][$x][$i][$k]) {
$noneArray[] = array($x, $i, $k);
} else {
$nullArray[] = array($x, $i, $k);
}
}
}
} else {
for ($k = 1; $k < $j; $k++) {
$noneArray[] = array($x, $i, $k);
}
}
}
}
//Fix for Search Builder
if ($mappingType == 'Export') {
if (!isset($mappingId) || $i >= count(reset($mappingName))) {
if (isset($formValues['mapper']) && isset($formValues['mapper'][$x][$i][1]) && array_key_exists($formValues['mapper'][$x][$i][1], $relationshipTypes)) {
$sel->setOptions(array($sel1, $sel2, $sel5, $sel6, $sel7, $sel3, $sel4));
} else {
$sel->setOptions(array($sel1, $sel2, $sel3, $sel4, $sel5, $sel6, $sel7));
}
示例8: buildMappingForm
/**
* Build the mapping form.
*
* @param CRM_Core_Form $form
* @param string $mappingType
* (Export/Import/Search Builder).
* @param int $mappingId
* @param int $columnNo
* @param int $blockCount
* (no of blocks shown).
* @param NULL $exportMode
*
* @return void
*/
public static function buildMappingForm(&$form, $mappingType = 'Export', $mappingId = NULL, $columnNo, $blockCount = 3, $exportMode = NULL)
{
$name = "Map";
$columnCount = array('1' => $columnNo);
$form->applyFilter('saveMappingName', 'trim');
//to save the current mappings
if (!isset($mappingId)) {
$saveDetailsName = ts('Save this field mapping');
$form->add('text', 'saveMappingName', ts('Name'));
$form->add('text', 'saveMappingDesc', ts('Description'));
} else {
$form->assign('loadedMapping', $mappingId);
$params = array('id' => $mappingId);
$temp = array();
$mappingDetails = CRM_Core_BAO_Mapping::retrieve($params, $temp);
$form->assign('savedName', $mappingDetails->name);
$form->add('hidden', 'mappingId', $mappingId);
$form->addElement('checkbox', 'updateMapping', ts('Update this field mapping'), NULL);
$saveDetailsName = ts('Save as a new field mapping');
$form->add('text', 'saveMappingName', ts('Name'));
$form->add('text', 'saveMappingDesc', ts('Description'));
}
$form->addElement('checkbox', 'saveMapping', $saveDetailsName, NULL, array('onclick' => "showSaveDetails(this)"));
$form->addFormRule(array('CRM_Export_Form_Map', 'formRule'), $form->get('mappingTypeId'));
$defaults = array();
$hasLocationTypes = array();
$hasRelationTypes = array();
$fields = array();
if ($mappingType == 'Export') {
$required = TRUE;
}
$fields = CRM_Contact_BAO_Relationship::fields();
// add custom fields
$fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Relationship'));
ksort($fields);
// add component fields
$compArray = array();
foreach ($fields as $key => $value) {
//CRM-2676, replacing the conflict for same custom field name from different custom group.
$customGroupName = self::getCustomGroupName($key);
if ($customGroupName) {
$relatedMapperFields[$key] = $mapperFields[$key] = $customGroupName . ': ' . $value['title'];
} else {
$relatedMapperFields[$key] = $mapperFields[$key] = $value['title'];
}
}
$mapperKeys = array_keys($mapperFields);
$sel1 = array('' => ts('- select field -')) + $mapperFields;
if (isset($mappingId)) {
$colCnt = 0;
list($mappingName, $mappingContactType, $mappingLocation, $mappingPhoneType, $mappingImProvider, $mappingRelation, $mappingOperator, $mappingValue) = CRM_Core_BAO_Mapping::getMappingFields($mappingId);
$blkCnt = count($mappingName);
if ($blkCnt >= $blockCount) {
$blockCount = $blkCnt + 1;
}
for ($x = 1; $x < $blockCount; $x++) {
if (isset($mappingName[$x])) {
$colCnt = count($mappingName[$x]);
if ($colCnt >= $columnCount[$x]) {
$columnCount[$x] = $colCnt;
}
}
}
}
$form->_blockCount = $blockCount;
$form->_columnCount = $columnCount;
$form->set('blockCount', $form->_blockCount);
$form->set('columnCount', $form->_columnCount);
$defaults = $noneArray = $nullArray = array();
//used to warn for mismatch column count or mismatch mapping
$warning = 0;
for ($x = 1; $x < $blockCount; $x++) {
for ($i = 0; $i < $columnCount[$x]; $i++) {
$sel =& $form->addElement('hierselect', "mapper[{$x}][{$i}]", ts('Mapper for Field %1', array(1 => $i)), NULL);
$jsSet = FALSE;
if (isset($mappingId)) {
//TODO opgeslagen mappings
}
//Fix for Export
$j = 7;
$formValues = $form->exportValues();
if (!$jsSet) {
if (empty($formValues)) {
// Incremented length for third select box(relationship type)
for ($k = 1; $k < $j; $k++) {
$noneArray[] = array($x, $i, $k);
//.........这里部分代码省略.........