当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Admin_Form::preProcess方法代码示例

本文整理汇总了PHP中CRM_Admin_Form::preProcess方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Admin_Form::preProcess方法的具体用法?PHP CRM_Admin_Form::preProcess怎么用?PHP CRM_Admin_Form::preProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Admin_Form的用法示例。


在下文中一共展示了CRM_Admin_Form::preProcess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: preProcess

 function preProcess()
 {
     parent::preProcess();
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/eventcalendarsettings');
     $session->pushUserContext($url);
 }
开发者ID:teamsinger,项目名称:com.osseed.eventcalendar,代码行数:7,代码来源:EventSettings.php

示例2: preProcess

 function preProcess()
 {
     parent::preProcess();
     CRM_Utils_System::setTitle(ts('Settings - Resource Configuration Option'));
     $this->_sid = CRM_Utils_Request::retrieve('sid', 'Positive', $this, FALSE, 0);
     $this->assign('sid', $this->_sid);
 }
开发者ID:sushantpaste,项目名称:civibooking,代码行数:7,代码来源:ResourceConfigOption.php

示例3: preProcess

 public function preProcess()
 {
     parent::preProcess();
     // set the usercontext
     $session = CRM_Core_Session::singleton();
     $session->replaceUserContext(CRM_Utils_System::url('civicrm/batch', "reset=1"));
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:7,代码来源:Batch.php

示例4: preProcess

 /**
  * For pre-processing
  *
  * @return void
  */
 public function preProcess()
 {
     parent::preProcess();
     $this->_key = CRM_Utils_Request::retrieve('key', 'String', $this, FALSE, 0);
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1&action=browse');
     $session->pushUserContext($url);
     $this->assign('id', $this->_id);
     $this->assign('key', $this->_key);
     switch ($this->_action) {
         case CRM_Core_Action::ADD:
         case CRM_Core_Action::DELETE:
         case CRM_Core_Action::ENABLE:
         case CRM_Core_Action::DISABLE:
             $info = CRM_Extension_System::singleton()->getMapper()->keyToInfo($this->_key);
             $extInfo = CRM_Admin_Page_Extensions::createExtendedInfo($info);
             $this->assign('extension', $extInfo);
             break;
         case CRM_Core_Action::UPDATE:
             if (!CRM_Extension_System::singleton()->getBrowser()->isEnabled()) {
                 CRM_Core_Error::fatal(ts('The system administrator has disabled this feature.'));
             }
             $info = CRM_Extension_System::singleton()->getBrowser()->getExtension($this->_key);
             $extInfo = CRM_Admin_Page_Extensions::createExtendedInfo($info);
             $this->assign('extension', $extInfo);
             break;
         default:
             CRM_Core_Error::fatal(ts('Unsupported action'));
     }
 }
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:35,代码来源:Extensions.php

示例5: preProcess

 /**
  * Function to pre-process
  *
  * @return None
  * @access public
  */
 public function preProcess()
 {
     parent::preProcess();
     $session =& CRM_Core_Session::singleton();
     if (!$this->_gName) {
         $this->_gName = CRM_Utils_Request::retrieve('group', 'String', $this, false, 0);
         $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name');
     }
     if ($this->_gName) {
         $this->set('gName', $this->_gName);
     } else {
         $this->_gName = $this->get('gName');
     }
     $this->_GName = ucwords(str_replace('_', ' ', $this->_gName));
     $url = "civicrm/admin/options/{$this->_gName}";
     $params = "group={$this->_gName}&reset=1";
     $session->pushUserContext(CRM_Utils_System::url($url, $params));
     $this->assign('id', $this->_id);
     require_once 'CRM/Core/OptionGroup.php';
     if ($this->_id && in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) {
         $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'domain_id', 'id');
         if (CRM_Core_Config::domainID() != $domainID) {
             CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
         }
     }
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:32,代码来源:Options.php

示例6: preProcess

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function preProcess()
 {
     parent::preProcess();
     $mapping = new CRM_Core_DAO_Mapping();
     $mapping->id = $this->_id;
     $mapping->find(TRUE);
     $this->assign('mappingName', $mapping->name);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:14,代码来源:Mapping.php

示例7: preProcess

 public function preProcess()
 {
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add');
     $this->assign('action', $this->_action);
     $this->_BAOName = 'CRM_Core_BAO_MessageTemplate';
     $this->set('BAOName', $this->_BAOName);
     parent::preProcess();
 }
开发者ID:kidaa30,项目名称:yes,代码行数:9,代码来源:MessageTemplates.php

示例8: preProcess

 public function preProcess()
 {
     parent::preProcess();
     CRM_Utils_System::setTitle(ts('Manage - Scheduled Jobs'));
     if ($this->_id) {
         $refreshURL = CRM_Utils_System::url('civicrm/admin/job', "reset=1&action=update&id={$this->_id}", FALSE, NULL, FALSE);
     } else {
         $refreshURL = CRM_Utils_System::url('civicrm/admin/job', "reset=1&action=add", FALSE, NULL, FALSE);
     }
     $this->assign('refreshURL', $refreshURL);
 }
开发者ID:PalanteJon,项目名称:com.klangsoft.flexiblejobs,代码行数:11,代码来源:Job.php

示例9: preProcess

 /**
  * Function to for pre-processing
  *
  * @return None
  * @access public
  */
 public function preProcess()
 {
     parent::preProcess();
     $this->_key = CRM_Utils_Request::retrieve('key', 'String', $this, FALSE, 0);
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1&action=browse');
     $session->pushUserContext($url);
     $this->assign('id', $this->_id);
     $this->assign('key', $this->_key);
     $ext = new CRM_Core_Extensions();
     $extension = $ext->getExtensions();
     $this->assign('extension', get_object_vars($extension[$this->_key]));
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:19,代码来源:Extensions.php

示例10: preProcess

 /**
  * Function to for pre-processing
  *
  * @return None
  * @access public
  */
 public function preProcess()
 {
     parent::preProcess();
     require_once 'CRM/Utils/Request.php';
     $this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, false, 0);
     //get optionGroup name in case of email/postal greeting or addressee, CRM-4575
     if (!empty($this->_gid)) {
         $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'name');
     }
     $session =& CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/admin/optionValue', 'reset=1&action=browse&gid=' . $this->_gid);
     $session->pushUserContext($url);
     $this->assign('id', $this->_id);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:20,代码来源:OptionValue.php

示例11: preProcess

 public function preProcess()
 {
     if (!CRM_Core_Permission::check('administer payment processors')) {
         CRM_Core_Error::statusBounce('The \'administer payment processors\' permission is required to add or edit a payment processor.');
     }
     parent::preProcess();
     CRM_Utils_System::setTitle(ts('Settings - Payment Processor'));
     // get the payment processor meta information
     if ($this->_id) {
         $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, FALSE, NULL);
         if (!$this->_ppType) {
             $this->_ppType = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor', $this->_id, 'payment_processor_type_id');
         }
         $this->set('pp', $this->_ppType);
     } else {
         $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, TRUE, NULL);
     }
     $this->assign('ppType', $this->_ppType);
     $ppTypeName = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', $this->_ppType, 'name');
     $this->assign('ppTypeName', $ppTypeName);
     $this->_ppDAO = new CRM_Financial_DAO_PaymentProcessorType();
     $this->_ppDAO->id = $this->_ppType;
     if (!$this->_ppDAO->find(TRUE)) {
         CRM_Core_Error::fatal(ts('Could not find payment processor meta information'));
     }
     if ($this->_id) {
         $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor', "reset=1&action=update&id={$this->_id}", FALSE, NULL, FALSE);
     } else {
         $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor', "reset=1&action=add", FALSE, NULL, FALSE);
     }
     //CRM-4129
     $destination = CRM_Utils_Request::retrieve('civicrmDestination', 'String', $this);
     if ($destination) {
         $destination = urlencode($destination);
         $refreshURL .= "&civicrmDestination={$destination}";
     }
     $this->assign('refreshURL', $refreshURL);
     $this->assign('is_recur', $this->_ppDAO->is_recur);
     $this->_fields = array(array('name' => 'user_name', 'label' => $this->_ppDAO->user_name_label), array('name' => 'password', 'label' => $this->_ppDAO->password_label), array('name' => 'signature', 'label' => $this->_ppDAO->signature_label), array('name' => 'subject', 'label' => $this->_ppDAO->subject_label), array('name' => 'url_site', 'label' => ts('Site URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')));
     if ($this->_ppDAO->is_recur) {
         $this->_fields[] = array('name' => 'url_recur', 'label' => ts('Recurring Payments URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'));
     }
     if (!empty($this->_ppDAO->url_button_default)) {
         $this->_fields[] = array('name' => 'url_button', 'label' => ts('Button URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'));
     }
     if (!empty($this->_ppDAO->url_api_default)) {
         $this->_fields[] = array('name' => 'url_api', 'label' => ts('API URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'));
     }
 }
开发者ID:kidaa30,项目名称:yes,代码行数:49,代码来源:PaymentProcessor.php

示例12: preProcess

 function preProcess()
 {
     parent::preProcess();
     CRM_Utils_System::setTitle(ts('Settings - Payment Processor'));
     // get the payment processor meta information
     if ($this->_id) {
         $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, false, null);
         if (!$this->_ppType) {
             $this->_ppType = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_PaymentProcessor', $this->_id, 'payment_processor_type');
         }
         $this->set('pp', $this->_ppType);
     } else {
         $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, true, null);
     }
     $this->assign('ppType', $this->_ppType);
     require_once 'CRM/Core/DAO/PaymentProcessorType.php';
     $this->_ppDAO =& new CRM_Core_DAO_PaymentProcessorType();
     $this->_ppDAO->name = $this->_ppType;
     if (!$this->_ppDAO->find(true)) {
         CRM_Core_Error::fatal(ts('Could not find payment processor meta information'));
     }
     if ($this->_id) {
         $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor', "reset=1&action=update&id={$this->_id}", false, null, false);
     } else {
         $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor', "reset=1&action=add", false, null, false);
     }
     //CRM-4129
     $destination = CRM_Utils_Request::retrieve('destination', 'String', $this);
     if ($destination) {
         $destination = urlencode($destination);
         $refreshURL .= "&destination={$destination}";
     }
     $this->assign('refreshURL', $refreshURL);
     $this->assign('is_recur', $this->_ppDAO->is_recur);
     $this->_fields = array(array('name' => 'user_name', 'label' => $this->_ppDAO->user_name_label), array('name' => 'password', 'label' => $this->_ppDAO->password_label), array('name' => 'signature', 'label' => $this->_ppDAO->signature_label), array('name' => 'subject', 'label' => $this->_ppDAO->subject_label), array('name' => 'url_site', 'label' => ts('Site URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')));
     if ($this->_ppDAO->is_recur) {
         $this->_fields[] = array('name' => 'url_recur', 'label' => ts('Recurring Payments URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'));
     }
     if (!empty($this->_ppDAO->url_button_default)) {
         $this->_fields[] = array('name' => 'url_button', 'label' => ts('Button URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'));
     }
     if (!empty($this->_ppDAO->url_api_default)) {
         $this->_fields[] = array('name' => 'url_api', 'label' => ts('API URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'));
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:45,代码来源:PaymentProcessor.php

示例13: preProcess

 /**
  * Function to pre-process
  *
  * @return None
  * @access public
  */
 public function preProcess()
 {
     parent::preProcess();
     $session =& CRM_Core_Session::singleton();
     if (!$this->_gName) {
         $this->_gName = CRM_Utils_Request::retrieve('group', 'String', $this, false, 0);
         $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name');
     }
     if ($this->_gName) {
         $this->set('gName', $this->_gName);
     } else {
         $this->_gName = $this->get('gName');
     }
     $this->_GName = ucwords(str_replace('_', ' ', $this->_gName));
     $url = "civicrm/admin/options/{$this->_gName}";
     $params = "group={$this->_gName}&reset=1";
     $session->pushUserContext(CRM_Utils_System::url($url, $params));
     $this->assign('id', $this->_id);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:25,代码来源:Options.php

示例14: preProcess

 /**
  * Function to for pre-processing
  *
  * @return None
  * @access public
  */
 public function preProcess()
 {
     parent::preProcess();
     $this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
     //get optionGroup name in case of email/postal greeting or addressee, CRM-4575
     if (!empty($this->_gid)) {
         $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'name');
     }
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/admin/optionValue', 'reset=1&action=browse&gid=' . $this->_gid);
     $session->replaceUserContext($url);
     $this->assign('id', $this->_id);
     if ($this->_id && in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) {
         $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'domain_id', 'id');
         if (CRM_Core_Config::domainID() != $domainID) {
             CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
         }
     }
 }
开发者ID:hguru,项目名称:224Civi,代码行数:25,代码来源:OptionValue.php

示例15: preProcess

 /**
  * Pre-process
  */
 public function preProcess()
 {
     parent::preProcess();
     $session = CRM_Core_Session::singleton();
     if (!$this->_gName && !empty($this->urlPath[3])) {
         $this->_gName = $this->urlPath[3];
     }
     if (!$this->_gName && !empty($_GET['gid'])) {
         $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', (int) $_GET['gid'], 'name');
     }
     if ($this->_gName) {
         $this->set('gName', $this->_gName);
     } else {
         $this->_gName = $this->get('gName');
     }
     $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name');
     $this->_gLabel = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'title');
     $url = "civicrm/admin/options/{$this->_gName}";
     $params = "reset=1";
     if ($this->_action & CRM_Core_Action::DELETE && in_array($this->_gName, array('email_greeting', 'postal_greeting', 'addressee'))) {
         // Don't allow delete if the option value belongs to addressee, postal or email greetings and is in use.
         $findValue = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'value');
         $queryParam = array(1 => array($findValue, 'Integer'));
         $columnName = $this->_gName . "_id";
         $sql = "SELECT count(id) FROM civicrm_contact WHERE " . $columnName . " = %1";
         $isInUse = CRM_Core_DAO::singleValueQuery($sql, $queryParam);
         if ($isInUse) {
             $scriptURL = "<a href='" . CRM_Utils_System::docURL2('Update Greetings and Address Data for Contacts', TRUE, NULL, NULL, NULL, "wiki") . "'>" . ts('Learn more about a script that can automatically update contact addressee and greeting options.') . "</a>";
             CRM_Core_Session::setStatus(ts('The selected %1 option has <strong>not been deleted</strong> because it is currently in use. Please update these contacts to use a different format before deleting this option. %2', array(1 => $this->_gLabel, 2 => $scriptURL)), ts('Sorry'), 'error');
             $redirect = CRM_Utils_System::url($url, $params);
             CRM_Utils_System::redirect($redirect);
         }
     }
     $session->pushUserContext(CRM_Utils_System::url($url, $params));
     $this->assign('id', $this->_id);
     if ($this->_id && in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) {
         $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'domain_id', 'id');
         if (CRM_Core_Config::domainID() != $domainID) {
             CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
         }
     }
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:45,代码来源:Options.php


注:本文中的CRM_Admin_Form::preProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。